Update frequency specification in SX from transaction dialog before moving one day back. Replace deprecated gdk_draw_pixmap.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13668 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2006-03-18 21:21:39 +00:00
parent c856521bd3
commit 279293cae8
3 changed files with 24 additions and 18 deletions

View File

@ -1,7 +1,12 @@
2006-03-18 Andreas Köhler <andi5.py@gmx.net>
* src/gnome-utils/gnc-dense-cal.c: Replace gdk_draw_pixmap with
gdk_draw_drawable.
* src/gnome/dialog-sx-from-trans.c: Let glib subtract days from a
GDate, because G_DATE_BAD_DAY (0) is a bad day.
GDate, because G_DATE_BAD_DAY (0) is a bad day. Clear the date
before setting day and update frequency specification before
moving one day back.
* src/gnome-utils/gnc-embedded-window.c:
* src/gnome/dialog-sxsincelast.c:

View File

@ -757,12 +757,12 @@ gnc_dense_cal_expose( GtkWidget *widget,
dcal = GNC_DENSE_CAL (widget);
gc = widget->style->fg_gc[ GTK_WIDGET_STATE(widget) ];
gdk_draw_pixmap( widget->window,
gc,
dcal->drawbuf,
0, 0, 0, 0,
widget->allocation.width,
widget->allocation.height );
gdk_draw_drawable(GDK_DRAWABLE(widget->window),
gc,
GDK_DRAWABLE(dcal->drawbuf),
0, 0, 0, 0,
widget->allocation.width,
widget->allocation.height);
return FALSE;
}
@ -977,14 +977,14 @@ gnc_dense_cal_draw_to_buffer( GncDenseCal *dcal )
break;
}
idx = (dcal->month - 1 + i) % 12;
gdk_draw_pixmap( dcal->drawbuf,
widget->style->fg_gc[widget->state],
dcal->monthLabels[idx],
0, 0,
dcal->leftPadding
+ dcal->monthPositions[i].x,
dcal->monthPositions[i].y,
dcal->label_width, dcal->label_height );
gdk_draw_drawable(GDK_DRAWABLE(dcal->drawbuf),
widget->style->fg_gc[widget->state],
GDK_DRAWABLE(dcal->monthLabels[idx]),
0, 0,
dcal->leftPadding
+ dcal->monthPositions[i].x,
dcal->monthPositions[i].y,
dcal->label_width, dcal->label_height);
}
}

View File

@ -713,26 +713,27 @@ sxftd_update_example_cal( SXFromTransInfo *sxfti )
gchar *name;
GString *info;
i = 0;
fs = xaccFreqSpecMalloc( gnc_get_current_book() );
get = sxftd_get_end_info( sxfti );
tmp_tt = gnc_date_edit_get_date( sxfti->startDateGDE );
tmpTm = g_new0( struct tm, 1 );
*tmpTm = *localtime( &tmp_tt );
g_date_clear(&date, 1);
g_date_set_day( &date, tmpTm->tm_mday );
g_date_set_month( &date, tmpTm->tm_mon+1 );
g_date_set_year( &date, tmpTm->tm_year+1900 );
g_free( tmpTm );
sxftd_update_fs( sxfti, &date, fs );
/* go one day before what's in the box so we can get the correct start
* date. */
g_date_subtract_days(&date, 1);
sxftd_update_fs( sxfti, &date, fs );
xaccFreqSpecGetNextInstance( fs, &date, &date );
startDate = date;
i = 0;
while ( (i < (SXFTD_EXCAL_NUM_MONTHS * 31))
&& g_date_valid( &date )
/* Do checking against end restriction. */