mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2002-11-17 Joshua Sled <jsled@asynchronous.org>
* src/gnome/dialog-sxsincelast.c: * src/gnome/dialog-scheduledxaction.c: Use printGDate() when we need to print dates; fixes Bug#96477. * src/engine/date.[ch] (printGDate): Convenience wrapper around printDate. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7497 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
ddca426702
commit
12ccab1dce
@ -1,3 +1,12 @@
|
||||
2002-11-17 Joshua Sled <jsled@asynchronous.org>
|
||||
|
||||
* src/gnome/dialog-sxsincelast.c:
|
||||
* src/gnome/dialog-scheduledxaction.c:
|
||||
Use printGDate() when we need to print dates; fixes Bug#96477.
|
||||
|
||||
* src/engine/date.[ch] (printGDate): Convenience wrapper around
|
||||
printDate.
|
||||
|
||||
2002-11-17 Joshua Sled <jsled@asynchronous.org>
|
||||
|
||||
* src/gnome/druid-loan.c (ld_calc_current_instance_num): Do some
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <locale.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "date.h"
|
||||
#include "FreqSpec.h"
|
||||
#include "SchedXaction.h"
|
||||
#include "dialog-scheduledxaction.h"
|
||||
@ -89,12 +90,6 @@ static short module = MOD_SX;
|
||||
#define EX_CAL_NUM_MONTHS 6
|
||||
#define EX_CAL_MO_PER_COL 2
|
||||
|
||||
#ifdef HAVE_LANGINFO_D_FMT
|
||||
# define GNC_D_FMT (nl_langinfo (D_FMT))
|
||||
#else
|
||||
# define GNC_D_FMT "%Y-%m-%d"
|
||||
#endif
|
||||
|
||||
#define GNC_D_WIDTH 25
|
||||
#define GNC_D_BUF_WIDTH 26
|
||||
|
||||
@ -1439,8 +1434,8 @@ schedXact_editor_populate( SchedXactionEditorDialog *sxed )
|
||||
{
|
||||
gd = xaccSchedXactionGetLastOccurDate( sxed->sx );
|
||||
if ( g_date_valid( gd ) ) {
|
||||
gchar dateBuf[ GNC_D_BUF_WIDTH ];
|
||||
g_date_strftime( dateBuf, GNC_D_WIDTH, GNC_D_FMT, gd );
|
||||
gchar dateBuf[ MAX_DATE_LENGTH+1 ];
|
||||
printGDate( dateBuf, gd );
|
||||
gtk_label_set_text( sxed->lastOccurLabel, dateBuf );
|
||||
} else {
|
||||
gtk_label_set_text( sxed->lastOccurLabel, _( "(never)" ) );
|
||||
@ -1857,10 +1852,12 @@ putSchedXactionInDialog( gpointer data, gpointer user_data )
|
||||
if ( instList == NULL ) {
|
||||
g_string_sprintf( nextDate, "not scheduled" );
|
||||
} else {
|
||||
char tmpBuf[26];
|
||||
char tmpBuf[ MAX_DATE_LENGTH+1 ];
|
||||
char dowBuf[ 25 ]; /* <- fixme: appropriate length? */
|
||||
nextInstDate = (GDate*)instList->data;
|
||||
g_date_strftime( tmpBuf, 25, "%a, %b %e, %Y", nextInstDate );
|
||||
g_string_sprintf( nextDate, "%s", tmpBuf );
|
||||
printGDate( tmpBuf, nextInstDate );
|
||||
g_date_strftime( dowBuf, 25, "%A", nextInstDate );
|
||||
g_string_sprintf( nextDate, "%s (%s)", tmpBuf, dowBuf );
|
||||
}
|
||||
|
||||
/* Add markings to GncDenseCal */
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include <gnome.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include "date.h"
|
||||
#include "Account.h"
|
||||
#include "Group.h"
|
||||
#include "Query.h"
|
||||
@ -124,15 +125,6 @@
|
||||
|
||||
#define COERCE_VOID_TO_GBOOLEAN(x) ((gboolean)(*#x))
|
||||
|
||||
#ifdef HAVE_LANGINFO_D_FMT
|
||||
# define GNC_D_FMT (nl_langinfo (D_FMT))
|
||||
#else
|
||||
# define GNC_D_FMT "%Y-%m-%d"
|
||||
#endif
|
||||
|
||||
#define GNC_D_WIDTH 25
|
||||
#define GNC_D_BUF_WIDTH 26
|
||||
|
||||
#define IGNORE_TEXT "Ignored"
|
||||
#define POSTPONE_TEXT "Postponed"
|
||||
#define READY_TEXT "Ready to create"
|
||||
@ -152,8 +144,6 @@ typedef enum {
|
||||
|
||||
/**
|
||||
* The states a to-be-created SX can be in...
|
||||
*
|
||||
|
||||
* TO_CREATE : The SX is ready to be created, depending on variable-binding
|
||||
* requirements.
|
||||
* IGNORE : Drop the SX on the floor forever.
|
||||
@ -1139,8 +1129,8 @@ sxsld_process_to_create_instance( sxSinceLastData *sxsld,
|
||||
}
|
||||
/* add to the postponed list. */
|
||||
{
|
||||
char tmpBuf[50];
|
||||
g_date_strftime( tmpBuf, 49, "%c", tci->date );
|
||||
char tmpBuf[ MAX_DATE_LENGTH+1 ];
|
||||
printGDate( tmpBuf, tci->date );
|
||||
DEBUG( "Adding defer instance on %s for %s",
|
||||
tmpBuf,
|
||||
xaccSchedXactionGetName( tci->parentTCT->sx ) );
|
||||
@ -1236,8 +1226,8 @@ sxsld_process_to_create_page( sxSinceLastData *sxsld )
|
||||
andequal_numerics_set,
|
||||
&allVarsBound );
|
||||
if ( !allVarsBound ) {
|
||||
char tmpBuf[GNC_D_BUF_WIDTH];
|
||||
g_date_strftime( tmpBuf, GNC_D_WIDTH, GNC_D_FMT, tci->date );
|
||||
char tmpBuf[ MAX_DATE_LENGTH+1 ];
|
||||
printGDate( tmpBuf, tci->date );
|
||||
/* FIXME: this should be better-presented to the user. */
|
||||
DEBUG( "SX %s on date %s still has unbound variables.",
|
||||
xaccSchedXactionGetName(tci->parentTCT->sx), tmpBuf );
|
||||
@ -1789,8 +1779,9 @@ add_to_create_list_to_gui( GList *toCreateList, sxSinceLastData *sxsld )
|
||||
tci->varBindings );
|
||||
}
|
||||
|
||||
rowText[0] = g_new0( char, GNC_D_WIDTH );
|
||||
g_date_strftime( rowText[0], GNC_D_WIDTH, GNC_D_FMT, tci->date );
|
||||
rowText[0] = g_new0( char, MAX_DATE_LENGTH+1 );
|
||||
printGDate( rowText[0], tci->date );
|
||||
|
||||
|
||||
switch ( tci->state ) {
|
||||
case TO_CREATE:
|
||||
@ -1873,9 +1864,8 @@ add_reminders_to_gui( GList *reminderList, sxSinceLastData *sxsld )
|
||||
instances = instances->next ) {
|
||||
rit = (reminderInstanceTuple*)instances->data;
|
||||
|
||||
rowText[0] = g_new0( gchar, GNC_D_WIDTH );
|
||||
g_date_strftime( rowText[0],
|
||||
GNC_D_WIDTH, GNC_D_FMT, rit->occurDate );
|
||||
rowText[0] = g_new0( gchar, MAX_DATE_LENGTH+1 );
|
||||
printGDate( rowText[0], rit->occurDate );
|
||||
rowText[1] = "";
|
||||
rowText[2] = g_new0( gchar, 5 ); /* FIXME: appropriate size? */
|
||||
sprintf( rowText[2], "%d",
|
||||
@ -1917,7 +1907,7 @@ add_dead_list_to_gui(GList *removeList, sxSinceLastData *sxsld)
|
||||
SX_OBSOLETE_CLIST ));
|
||||
|
||||
tmp_str = g_string_new(NULL);
|
||||
rowtext[2] = g_new0(gchar, GNC_D_BUF_WIDTH );
|
||||
//rowtext[2] = g_new0(gchar, MAX_DATE_LENGTH+1 );
|
||||
|
||||
gtk_clist_freeze( cl );
|
||||
gtk_clist_clear( cl );
|
||||
@ -1935,7 +1925,7 @@ add_dead_list_to_gui(GList *removeList, sxSinceLastData *sxsld)
|
||||
xaccFreqSpecGetFreqStr( fs, tmp_str );
|
||||
rowtext[1] = tmp_str->str;
|
||||
|
||||
strcpy( rowtext[2], _( OBSOLETE_TEXT ) );
|
||||
rowtext[2] = g_strdup( _(OBSOLETE_TEXT) );
|
||||
|
||||
gtk_clist_insert( cl, row, rowtext );
|
||||
gtk_clist_set_row_data( cl, row, tdt );
|
||||
@ -3431,11 +3421,11 @@ create_bad_reminders_msg( gpointer data, gpointer ud )
|
||||
{
|
||||
GString *msg;
|
||||
reminderInstanceTuple *rit;
|
||||
static char tmpBuf[GNC_D_BUF_WIDTH];
|
||||
static char tmpBuf[ MAX_DATE_LENGTH+1 ];
|
||||
|
||||
rit = (reminderInstanceTuple*)data;
|
||||
msg = (GString*)ud;
|
||||
g_date_strftime( tmpBuf, GNC_D_WIDTH, GNC_D_FMT, rit->occurDate );
|
||||
printGDate( tmpBuf, rit->occurDate );
|
||||
g_string_sprintfa( msg, tmpBuf );
|
||||
g_string_sprintfa( msg, "\n" );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user