2001-10-22 Joshua Sled <jsled@asynchronous.org>

* src/gnome/Makefile.am: Removed obsolete dialog-nextrun.{c,h}

	* src/gnome/window-main.c (gnc_main_window_create_menus): Added
	both Scheduled Transaction-related items to "Scheduled
	Transactions" sub-menu of "Tools".
	(gnc_main_window_about_cb): Added self to GUI About dlg.

	* src/gnome/dialog-scheduledxaction.c: Renamed '_'-led functions.

	* src/gnome/dialog-sxsincelast.c: Changed from a loose
	confederation of multiple dialogs to the strong central authority
	of a GnomeDruid-based since-last-run UI.  Renamed '_'-led
	functions.

	* src/gnome/glade/sched-xact.glade: Fixed a non-unique-name
	problem between the GnomeNumberEntry "end_nentry" and it's
	GtkEntry "end_nentry".  Added Druid-based Since-Last-Run dialog.

	* src/gnome/dialog-scheduledxaction.c (schedXact_editor_populate),
	(editor_ok_button_clicked): Added support for now-uniquely-named
	"end_gnome_nentry".

	* src/engine/SchedXaction.c
	(xaccSchedXactionCreateSequenceState): Added.
	(xaccSchedXactionIncrSequenceState): Added.
	(xaccSchedXactionDestroySequenceState): Added.
	Added support for opaque state data when generating a sequence of
	SX instances to support number-of-occurance-terminated SXes.

	* src/backend/file/gnc-freqspec-xml-v2.c (dom_tree_to_freqSpec):
	Added missing instance of GNCSession propogation.

	* src/backend/file/io-gncxml-v2.c
	(write_template_transaction_data): Added correct determination for
	writing out the template-transaction section [before: only if
	transactions existed in accounts; now: if any accounts exist] to
	prevent read errors from SXes with valid-and-referenced Accounts,
	but no Transactions in them.

	* src/gnome-utils/gnc-frequency.c (gnc_frequency_setup): Better
	error text when UIFreqType isn't recognized or appropriate.

	* src/gnome/dialog-scheduledxaction.c (editor_ok_button_clicked):
	Correctly sets SXes to have no occurance data if that's the case.
	Better option variable naming, usage.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5710 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldfeatures/g2-gog-integ
Joshua Sled 25 years ago
parent d9ed89be9a
commit ced5ea0167

@ -1,3 +1,51 @@
2001-10-22 Joshua Sled <jsled@asynchronous.org>
* src/gnome/Makefile.am: Removed obsolete dialog-nextrun.{c,h}
* src/gnome/window-main.c (gnc_main_window_create_menus): Added
both Scheduled Transaction-related items to "Scheduled
Transactions" sub-menu of "Tools".
(gnc_main_window_about_cb): Added self to GUI About dlg.
* src/gnome/dialog-scheduledxaction.c: Renamed '_'-led functions.
* src/gnome/dialog-sxsincelast.c: Changed from a loose
confederation of multiple dialogs to the strong central authority
of a GnomeDruid-based since-last-run UI. Renamed '_'-led
functions.
* src/gnome/glade/sched-xact.glade: Fixed a non-unique-name
problem between the GnomeNumberEntry "end_nentry" and it's
GtkEntry "end_nentry". Added Druid-based Since-Last-Run dialog.
* src/gnome/dialog-scheduledxaction.c (schedXact_editor_populate),
(editor_ok_button_clicked): Added support for now-uniquely-named
"end_gnome_nentry".
* src/engine/SchedXaction.c
(xaccSchedXactionCreateSequenceState): Added.
(xaccSchedXactionIncrSequenceState): Added.
(xaccSchedXactionDestroySequenceState): Added.
Added support for opaque state data when generating a sequence of
SX instances to support number-of-occurance-terminated SXes.
* src/backend/file/gnc-freqspec-xml-v2.c (dom_tree_to_freqSpec):
Added missing instance of GNCSession propogation.
* src/backend/file/io-gncxml-v2.c
(write_template_transaction_data): Added correct determination for
writing out the template-transaction section [before: only if
transactions existed in accounts; now: if any accounts exist] to
prevent read errors from SXes with valid-and-referenced Accounts,
but no Transactions in them.
* src/gnome-utils/gnc-frequency.c (gnc_frequency_setup): Better
error text when UIFreqType isn't recognized or appropriate.
* src/gnome/dialog-scheduledxaction.c (editor_ok_button_clicked):
Correctly sets SXes to have no occurance data if that's the case.
Better option variable naming, usage.
2001-10-16 Dave Peticolas <dave@krondo.com>
* src/engine/test-core/test-engine-stuff.c: work on test
@ -1304,6 +1352,7 @@
directory.
* src/engine/io-gncbin-r.c: remove #if 0'ed code.
2001-07-30 Joshua Sled <jsled@asynchronous.org>
* src/gnome/glade/sched-xact.glade: Added seperate reminders

@ -136,8 +136,9 @@ typedef struct
static void
fspd_init( fsParseData *fspd )
{
fspd->fs = NULL;
fspd->list = NULL;
fspd->fs = NULL;
fspd->list = NULL;
fspd->session = NULL;
fspd->interval
= fspd->offset
= fspd->day
@ -594,6 +595,7 @@ dom_tree_to_freqSpec(xmlNodePtr node, GNCSession *session)
fsParseData fspd;
fspd_init( &fspd );
fspd.session = session;
fspd.fs = xaccFreqSpecMalloc(session);
successful = dom_tree_generic_parse( node, fs_dom_handlers, &fspd );

@ -720,22 +720,12 @@ static void
write_template_transaction_data( FILE *out, GNCBook *book )
{
AccountGroup *ag;
GList *gl;
gboolean hasTemplateTransactionData = FALSE;
ag = gnc_book_get_template_group(book);
gl = xaccGroupGetSubAccounts( ag );
while ( !hasTemplateTransactionData && (gl != NULL) )
{
hasTemplateTransactionData |=
(xaccAccountGetSplitList( (Account*)gl->data ) != NULL);
gl = gl->next;
}
if ( hasTemplateTransactionData )
if ( xaccGroupGetNumSubAccounts(ag) > 0 )
{
fprintf( out, "<%s>\n", TEMPLATE_TRANSACTION_TAG );
write_account_group( out, gnc_book_get_template_group(book) );
write_account_group( out, ag );
xaccGroupForEachTransaction( ag, xml_add_trn_data, (gpointer)out );
fprintf( out, "</%s>\n", TEMPLATE_TRANSACTION_TAG );
}

@ -19,7 +19,7 @@ X would like "don't even tell me you instantiated it, just fscking do
##################################################
### To-Do
### '.' = to-do, 'X' = done
### '.' = to-do, 'X' = done, '?' = jsled verify
##################################################
@ -33,7 +33,7 @@ X create a template register
. this is going to be: a tabbed notebook in which the tabs contain
the number of transactions the GL they hold contain.
. Hook into 'book data changed' save-on-exit decision
? Hook into 'book data changed' save-on-exit decision
. add a big calendar [gnome-pim? evo?] to SXaction List/overview
@ -42,6 +42,7 @@ X create a template register
scanning code.
. need "since-last-run" UI for instanatiation.
X Change from dialogs to druid
X/O create transactions
X numeric
X formula
@ -59,6 +60,9 @@ X create a template register
pop up the 'new scheduled transactions' dialog [option, time-of-day]
. Should deal with "nothing-to-do" better [not even show up in the worst
[read: no auto-notify/to-create/reminders] case].
. this is different between the auto-invoked since-last-run dialog [show
nothing] and the menu-invoked since-last-run [show a dialog to the user
stating there's nothing to do].
. Double-clicking on auto-create list should jump to transaction
. register of first split?
. double-clicking a reminder should [probably] move it up to the to-create
@ -78,13 +82,13 @@ X create a template register
not-yet-created transactions.
. The ability to turn a non-recurring transaction into a recurring one...
. inactive cells
. date
. recn
X date
. recn?
. deal better with formulas in template transactions [real FormulaCell]
. recognize purely numeric template transactions and balance at
template-creation time.
. balance transaction via symbolic math?
. balance transaction via variable cancellation?
. GNCFrequency
. initial-settings synchronization [start date, optionmenus]
@ -107,23 +111,23 @@ X create a template register
. Configuration options...
. Overall
. Size of template register window
X Size of template register window
. color of future register entries
. conrad's desires
. policy
. create for N days in advance
. show for N days in advance, create when come-due
. defaults
. create/show for 'N' days in advance
. remind me 'M' days in advance
. just create
. notify when created
. Per-SX
. just create/notify
. create/show
. lead-time
. reminder
. lead-time
X policy
X create for N days in advance
X show for N days in advance, create when come-due
X defaults
X create/show for 'N' days in advance
X remind me 'M' days in advance
X just create
X notify when created
X Per-SX
X just create/notify
X create/show
X lead-time
X reminder
X lead-time
@ -144,8 +148,8 @@ X create a template register
### Bugs
##################################################
. General
. Date l10n.
X General
X Date l10n.
. GNCFreqency
. transitioning to a new tab doesn't correctly setup the agreement between
@ -157,7 +161,7 @@ X create a template register
. Scheduled Transaction Editor
. Can't click-out of the register
. auto-shrink on window create [the register is too wide, leading to too
X auto-shrink on window create [the register is too wide, leading to too
much whitespace on the two top panels -- sometimes].
. Size/space issues.
. Un-selecting "End Date" leaves calendar widget sensitive
@ -167,10 +171,11 @@ X create a template register
. Scheduled Transaction List
. Since-last-run
. any [horizontal] window size change height-grows the top/auto-create GL.
. correct "Back" button behavior in new Druid paradigm
X any [horizontal] window size change height-grows the top/auto-create GL.
X always goes one date past the instantiation date.
. tab-order on variable-entry window isn't always correct.
X credit and debit seem reversed at instantiation time...
? credit and debit seem reversed at instantiation time...
. this is fixed, but is the fix correct?
##################################################
@ -306,24 +311,3 @@ conrad wants to use this to remind him to pay his bills. He runs GnuCash
continuously, and thus wants an option to "pop-up on day change [at time
HH:MM]". He's interested in seeing future transactions as well as what's
being created ATM.
-----
<Wilddev> There are 2 reasons to create scheduled transactions
<Wilddev> as a reminder you have to pay this bill by this day or I'll remind you until you do something, either skip me or mark me as paid, if the first I do nothing other than remind you, if the second I enter a transaction in the register
<Wilddev> and second
<Wilddev> as an actual transaction that goes into the register on a future date, ie I know that this money leaves my account in 2 days, so I want it to go in automatically on that day. If I leave gnucash running all the time, it'll wait until that day then enter the transaction
<Wilddev> as you can see the purpose of each is quite different
<jsled> Wilddev: Indeed...
<jsled> For the first, you're saying that reminders should start some number of days before the transaction is usually due/paid... and that there are two acknowledgements of that... 'remind me later' or 'here's the amount/create'.
<jsled> For the second, you're looking at ad-hoc once-scheduled transactions... which should go away immediately afterwards.
<Wilddev> yes, tho it would be nice to have when you actually get reminded configurable :)
<jsled> Wilddev: On a per-scheduled-transaction basis, I think.
<Wilddev> yup
<jsled> Okay... so this brings up something that isn't presently in the scheme at all: reminders.
<jsled> I think it's as simple as a "[ ] Remind me __ days in advance" element in the SXEditor, and the appropriate logic in the since-last-run code...
<Wilddev> how often is the last run code 'run'?
<jsled> Wilddev: On startup, or when the timer [a-la conrad's requirement] goes off.
<Wilddev> yes that would work
<jsled> So the "since-last-run" dialog has three panes: 1) auto-created, notification requested. 2) To-create. 3) To-create-soon + reminders.
<Wilddev> that sounds good

@ -430,7 +430,7 @@ xaccSchedXactionSetAdvanceReminder( SchedXaction *sx, gint reminderDays )
/* FIXME: there is a bug in this, I think */
GDate
xaccSchedXactionGetNextInstance( SchedXaction *sx )
xaccSchedXactionGetNextInstance( SchedXaction *sx, void *stateData )
{
GDate last_occur, next_occur, tmpDate;
@ -453,18 +453,6 @@ xaccSchedXactionGetNextInstance( SchedXaction *sx )
}
}
#if 0
if ( g_date_valid( &last_occur ) ) {
g_date_set_time( &tmpDate, time(NULL) );
last_occur =
( g_date_compare( &last_occur,
&tmpDate ) > 0 ?
last_occur : tmpDate );
} else {
g_date_set_time( &last_occur, time(NULL) );
}
#endif /* 0 */
if ( g_date_valid( &sx->start_date )
&& ! g_date_valid( &sx->last_date ) ) {
/* Think about this for a second, and you realize
@ -478,13 +466,54 @@ xaccSchedXactionGetNextInstance( SchedXaction *sx )
}
xaccFreqSpecGetNextInstance( sx->freq, &last_occur, &next_occur );
/* out-of-bounds check */
if ( xaccSchedXactionHasEndDate( sx ) ) {
GDate *end_date = xaccSchedXactionGetEndDate( sx );
if ( g_date_compare( &next_occur, end_date ) > 0 ) {
PINFO( "next_occur past end date" );
g_date_clear( &next_occur, 1 );
}
} else if ( xaccSchedXactionHasOccurDef( sx ) && stateData ) {
/* FIXME: does this work? */
gint remaining;
remaining = xaccSchedXactionGetRemOccur( sx );
if ( remaining == 0 ) {
PINFO( "no more occurances remain" );
g_date_clear( &next_occur, 1 );
}
}
return next_occur;
}
GDate xaccSchedXactionGetInstanceAfter( SchedXaction *sx, GDate *date )
GDate
xaccSchedXactionGetInstanceAfter( SchedXaction *sx,
GDate *date,
void *stateData )
{
GDate next_occur;
xaccFreqSpecGetNextInstance( sx->freq, date, &next_occur );
if ( xaccSchedXactionHasEndDate( sx ) ) {
GDate *end_date;
end_date = xaccSchedXactionGetEndDate( sx );
if ( g_date_compare( &next_occur, end_date ) > 0 ) {
PINFO( "next_occur past end_date" );
g_date_clear( &next_occur, 1 );
}
} else if ( xaccSchedXactionHasOccurDef( sx ) && stateData ) {
/* gint remaining = xaccSchedXactionGetRemOccur( sx ); */
gint *remaining = (gint*)stateData;
DEBUG( "stateData [remaining]: %d", *remaining );
if ( (*remaining - 1) < 0 ) {
PINFO( "next_occur is outside "
"reminaing-instances window." );
g_date_clear( &next_occur, 1 );
}
}
return next_occur;
}
@ -610,3 +639,39 @@ xaccSchedXactionSetTemplateTrans(SchedXaction *sx, GList *t_t_list,
xaccTransCommitEdit(new_trans);
}
}
void*
xaccSchedXactionCreateSequenceState( SchedXaction *sx )
{
void *toRet = NULL;
if ( xaccSchedXactionHasOccurDef( sx ) ) {
toRet = g_new0( gint, 1 );
*(gint*)toRet = xaccSchedXactionGetRemOccur( sx );
DEBUG( "Returning state data [remaining]: %d", *(gint*)toRet );
} else {
DEBUG( "Returning null state data" );
}
return toRet;
}
void
xaccSchedXactionIncrSequenceState( SchedXaction *sx,
void *stateData )
{
if ( xaccSchedXactionHasOccurDef( sx ) ) {
gint *remaining;
remaining = (gint*)stateData;
*remaining = *remaining - 1;
}
}
void
xaccSchedXactionDestroySequenceState( SchedXaction *sx,
void *stateData )
{
if ( xaccSchedXactionHasOccurDef( sx ) ) {
g_free( (gint*)stateData );
}
}

@ -97,6 +97,9 @@ int xaccSchedXactionHasEndDate( SchedXaction *sx );
* Returns invalid date when there is no end-date specified.
**/
GDate* xaccSchedXactionGetEndDate( SchedXaction *sx );
/**
* Set to an invalid GDate to turn off 'end-date' definition.
**/
void xaccSchedXactionSetEndDate( SchedXaction *sx, GDate* newEnd );
GDate* xaccSchedXactionGetLastOccurDate( SchedXaction *sx );
@ -108,6 +111,9 @@ void xaccSchedXactionSetLastOccurDate( SchedXaction *sx, GDate* newLastOccur );
**/
gboolean xaccSchedXactionHasOccurDef( SchedXaction *sx );
gint xaccSchedXactionGetNumOccur( SchedXaction *sx );
/**
* Set to '0' to turn off number-of-occurances definition.
**/
void xaccSchedXactionSetNumOccur( SchedXaction *sx, gint numNum );
gint xaccSchedXactionGetRemOccur( SchedXaction *sx );
void xaccSchedXactionSetRemOccur( SchedXaction *sx, gint numRemain );
@ -166,13 +172,35 @@ void xaccSchedXactionSetSlot( SchedXaction *sx,
const GUID *xaccSchedXactionGetGUID( SchedXaction *sx );
void xaccSchedXactionSetGUID( SchedXaction *sx, GUID g );
/**
* Next-Instance state data.
*
* If you're looking at to-create [but not-yet-created] scheduled
* transactions, you'll want to use this to keep track of any
* SX-type-specific information that relates to the sequence and when it
* should end. This is an opaque structure to the caller; it should be
* created and freed with the following functions, and passed into the
* GetNextInstance and GetInstanceAfter functions.
*
* The necessity for this arose in dealing with SXes with some number of
* remaining occurances, and thinking about how to keep track of this when
* looking at reminders... and generally thinking about not wanting the
* caller to know every possible thing that needs to be kept track of in a
* forward-looking sequence of SXes.
**/
void *xaccSchedXactionCreateSequenceState( SchedXaction *sx );
void xaccSchedXactionIncrSequenceState( SchedXaction *sx, void *stateData );
void xaccSchedXactionDestroySequenceState( SchedXaction *sx, void *stateData );
/**
* Returns the next occurance of a scheduled transaction. If the
* transaction hasn't occured, then it's based off the start date.
* Otherwise, it's based off the last-occurance date.
**/
GDate xaccSchedXactionGetNextInstance( SchedXaction *sx );
GDate xaccSchedXactionGetInstanceAfter( SchedXaction *sx, GDate *date );
GDate xaccSchedXactionGetNextInstance( SchedXaction *sx, void *stateData );
GDate xaccSchedXactionGetInstanceAfter( SchedXaction *sx,
GDate *date,
void *stateData );
/*
* Set the schedxaction's template transaction. t_t_list is a glist

@ -323,9 +323,11 @@ gnc_frequency_setup( GNCFrequency *gf, FreqSpec *fs, GDate *startDate )
{
GDate theDate;
tmpTm = g_new0( struct tm, 1 );
/* set the date */
/* set the date */
if ( xaccFreqSpecGetOnce( fs, &theDate ) < 0 ) {
PERR( "Inappropriate FreqSpec type\n" );
PERR( "Inappropriate FreqSpec type "
"[gnc-frequency: %d vs. FreqSpec: %d]\n",
uift, xaccFreqSpecGetUIType( fs ) );
return;
}
g_date_to_struct_tm( &theDate, tmpTm );
@ -337,7 +339,9 @@ gnc_frequency_setup( GNCFrequency *gf, FreqSpec *fs, GDate *startDate )
{
int dailyMult = -1;
if ( xaccFreqSpecGetDaily( fs, &dailyMult ) < 0 ) {
PERR( "Inappropriate FreqSpec type\n" );
PERR( "Inappropriate FreqSpec type "
"[gnc-frequency: %d vs. FreqSpec: %d]\n",
uift, xaccFreqSpecGetUIType( fs ) );
return;
}
o = glade_xml_get_widget( gf->gxml, "daily_spin" );
@ -358,7 +362,9 @@ gnc_frequency_setup( GNCFrequency *gf, FreqSpec *fs, GDate *startDate )
}
subFS = (FreqSpec*)fsList->data;
if ( xaccFreqSpecGetWeekly( subFS, &weekMult, &dayOfWeek ) < 0 ) {
PERR( "Invalid FreqSpec type" );
PERR( "Inappropriate FreqSpec type "
"[gnc-frequency: %d vs. FreqSpec: %d]\n",
uift, xaccFreqSpecGetUIType( fs ) );
return;
}
o = glade_xml_get_widget( gf->gxml, "dailymf_spin" );
@ -380,7 +386,9 @@ gnc_frequency_setup( GNCFrequency *gf, FreqSpec *fs, GDate *startDate )
return;
}
if ( xaccFreqSpecGetWeekly( subFS, &weeklyMult, &dayOfWeek ) < 0 ) {
PERR( "Inappropriate FreqSpec type\n" );
PERR( "Inappropriate FreqSpec type "
"[gnc-frequency: %d, FreqSpec: %d]\n",
uift, xaccFreqSpecGetUIType( fs ) );
return;
}
} else {
@ -391,7 +399,9 @@ gnc_frequency_setup( GNCFrequency *gf, FreqSpec *fs, GDate *startDate )
return;
}
if ( xaccFreqSpecGetWeekly( subFS, &otherWeeklyMult, &dayOfWeek ) < 0 ) {
PERR( "Inappropriate FreqSpec type\n" );
PERR( "Inappropriate FreqSpec type "
"[gnc-frequency: %d, FreqSpec: %d]\n",
uift, xaccFreqSpecGetUIType( fs ) );
return;
}
if ( weeklyMult != otherWeeklyMult ) {
@ -425,7 +435,9 @@ gnc_frequency_setup( GNCFrequency *gf, FreqSpec *fs, GDate *startDate )
subFS = (FreqSpec*)(g_list_nth( list, 0 )->data);
if ( xaccFreqSpecGetMonthly( subFS, &monthlyMult,
&firstDayOfMonth, &monthOffset ) < 0 ) {
PERR( "Inappropriate FreqSpec type\n" );
PERR( "Inappropriate FreqSpec type "
"[gnc-frequency: %d, FreqSpec: %d]\n",
uift, xaccFreqSpecGetUIType( fs ) );
return;
}
gtk_spin_button_set_value( GTK_SPIN_BUTTON(o), monthlyMult );
@ -448,7 +460,9 @@ gnc_frequency_setup( GNCFrequency *gf, FreqSpec *fs, GDate *startDate )
int monthlyMult, dayOfMonth, monthOffset;
if ( xaccFreqSpecGetMonthly( fs, &monthlyMult,
&dayOfMonth, &monthOffset ) < 0 ) {
PERR( "Inappropriate FreqSpec type" );
PERR( "Inappropriate FreqSpec type "
"[gnc-frequency: %d, FreqSpec: %d]\n",
uift, xaccFreqSpecGetUIType( fs ) );
return;
}
o = glade_xml_get_widget( gf->gxml, "monthly_spin" );
@ -464,7 +478,9 @@ gnc_frequency_setup( GNCFrequency *gf, FreqSpec *fs, GDate *startDate )
if ( xaccFreqSpecGetMonthly( fs, &monthlyMult,
&dayOfMonth, &monthOffset ) < 0 ) {
PERR( "Inappropriate FreqSpec type" );
PERR( "Inappropriate FreqSpec type "
"[gnc-frequency: %d, FreqSpec: %d]\n",
uift, xaccFreqSpecGetUIType( fs ) );
return;
}
if ( monthlyMult != 3 ) {
@ -482,7 +498,9 @@ gnc_frequency_setup( GNCFrequency *gf, FreqSpec *fs, GDate *startDate )
if ( xaccFreqSpecGetMonthly( fs, &monthlyMult,
&dayOfMonth, &monthOffset ) < 0 ) {
PERR( "Inappropriate FreqSpec type" );
PERR( "Inappropriate FreqSpec type "
"[gnc-frequency: %d, FreqSpec: %d]\n",
uift, xaccFreqSpecGetUIType( fs ) );
return;
}
if ( monthlyMult != 4 ) {
@ -500,7 +518,9 @@ gnc_frequency_setup( GNCFrequency *gf, FreqSpec *fs, GDate *startDate )
if ( xaccFreqSpecGetMonthly( fs, &monthlyMult,
&dayOfMonth, &monthOffset ) < 0 ) {
PERR( "Inappropriate FreqSpec type" );
PERR( "Inappropriate FreqSpec type "
"[gnc-frequency: %d, FreqSpec: %d]\n",
uift, xaccFreqSpecGetUIType( fs ) );
return;
}
if ( monthlyMult != 6 ) {
@ -518,7 +538,9 @@ gnc_frequency_setup( GNCFrequency *gf, FreqSpec *fs, GDate *startDate )
if ( xaccFreqSpecGetMonthly( fs, &monthlyMult,
&dayOfMonth, &monthOffset ) < 0 ) {
PERR( "Inappropriate FreqSpec type" );
PERR( "Inappropriate FreqSpec type "
"[gnc-frequency: %d, FreqSpec: %d]\n",
uift, xaccFreqSpecGetUIType( fs ) );
return;
}
if ( (monthlyMult % 12) != 0) {
@ -539,7 +561,8 @@ gnc_frequency_setup( GNCFrequency *gf, FreqSpec *fs, GDate *startDate )
}
break;
default:
PERR( "unknown ui freq type [%d, %s]\n", __LINE__, __FILE__ );
PERR( "unknown ui freq type %d [%d, %s]\n",
uift, __LINE__, __FILE__ );
break;
}
update_appropriate_cal( gf );
@ -1118,6 +1141,7 @@ start_date_changed( GnomeDateEdit *gde, gpointer d )
o = NULL;
switch (uift) {
case UIFREQ_ONCE: /* FALLTHROUGH */
case UIFREQ_DAILY: /* FALLTHROUGH */
case UIFREQ_DAILY_MF: /* FALLTHROUGH */
case UIFREQ_WEEKLY: /* FALLTHROUGH */

@ -38,7 +38,6 @@ libgncgnome_la_SOURCES = \
window-reconcile.c \
window-register.c \
window-report.c \
dialog-nextrun.c \
dialog-sxsincelast.c
gnomeappdir = ${datadir}/gnome/apps/Applications
@ -80,7 +79,6 @@ noinst_HEADERS = \
window-reconcile.h \
window-register.h \
window-report.h \
dialog-nextrun.h \
dialog-sxsincelast.h
EXTRA_DIST = \

@ -1,572 +0,0 @@
/********************************************************************\
* dialog-nextrun.c - "since last run" dialog. *
* Copyright (c) 2001 Joshua Sled <jsled@asynchronous.org> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License*
* along with this program; if not, contact: *
* *
* Free Software Foundation Voice: +1-617-542-5942 *
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
* Boston, MA 02111-1307, USA gnu@gnu.org *
\********************************************************************/
#include "config.h"
#include <gnome.h>
#include "Group.h"
#include "SchedXaction.h"
#include "Transaction.h"
#include "dialog-nextrun.h"
#include "dialog-utils.h"
#include "gnc-book.h"
#include "gnc-component-manager.h"
#include "gnc-engine-util.h"
#include "gnc-exp-parser.h"
#include "gnc-numeric.h"
#include "gnc-ui-util.h"
#include "split-register.h"
#define DIALOG_NEXTRUN_CM_CLASS "dialog-nextrun"
static short module = MOD_SX;
typedef struct _toCreateTransaction {
SchedXaction *sx;
GDate *date;
gint clistRow;
} toCreateTransaction;
typedef struct _sxSinceLastData {
GtkWidget *nextrunDlg;
GladeXML *gxml;
GList /* <toCreateTransaction*> */ *transList;
} sxSinceLastData;
static void nextrun_init( sxSinceLastData *sxsld );
static void nextrun_close_handler( gpointer ud );
static void nr_ok_clicked( GtkButton *b, gpointer ud );
static void nr_next_clicked( GtkButton *b, gpointer ud );
static void nr_prev_xaction_clicked( GtkButton *b, gpointer ud );
static void nr_next_xaction_clicked( GtkButton *b, gpointer ud );
static void nextrun_destroy( GtkObject *o, gpointer ud );
static void slr_create_transactions( SchedXaction *sx, GDate *gd );
/* int parse_vars_from_formula( const char *formula, GHashTable *varHash ); */
void
gnc_ui_nextrun_guile_wrapper( char *foo )
{
gnc_ui_nextrun_dialog_create();
}
void
gnc_ui_nextrun_dialog_create(void)
{
sxSinceLastData *sxsld = g_new0( sxSinceLastData, 1 );
sxsld->gxml = gnc_glade_xml_new( "sched-xact.glade", "Since-Last-Run Instantiation" );
sxsld->nextrunDlg = glade_xml_get_widget( sxsld->gxml, "Since-Last-Run Instantiation" );
nextrun_init( sxsld );
}
static void
nextrun_init( sxSinceLastData *sxsld )
{
GtkWidget *o;
int i;
struct widgetNameSignalHandlerTuple {
char *name;
char *signal;
void (*handlerFn)();
} widgets[] = {
{ "ok", "clicked", nr_ok_clicked },
{ "next", "clicked", nr_next_clicked },
{ "prev_xaction", "clicked", nr_prev_xaction_clicked },
{ "next_xaction", "clicked", nr_next_xaction_clicked },
{ NULL, NULL, NULL }
};
gnc_register_gui_component( DIALOG_NEXTRUN_CM_CLASS,
NULL,
nextrun_close_handler,
sxsld->nextrunDlg );
gtk_signal_connect( GTK_OBJECT(sxsld->nextrunDlg), "destroy",
GTK_SIGNAL_FUNC( nextrun_destroy ), sxsld );
for ( i=0; widgets[i].name != NULL ; i++ ) {
o = glade_xml_get_widget( sxsld->gxml, widgets[i].name );
gtk_signal_connect( GTK_OBJECT(o), widgets[i].signal,
GTK_SIGNAL_FUNC(widgets[i].handlerFn),
sxsld );
}
o = glade_xml_get_widget( sxsld->gxml, "next" );
gtk_signal_connect( GTK_OBJECT(o), "clicked",
GTK_SIGNAL_FUNC(nr_next_clicked),
sxsld );
o = glade_xml_get_widget( sxsld->gxml, "prev_xaction" );
gtk_signal_connect( GTK_OBJECT(o), "clicked",
GTK_SIGNAL_FUNC(nr_prev_xaction_clicked),
sxsld );
o = glade_xml_get_widget( sxsld->gxml, "next_xaction" );
gtk_signal_connect( GTK_OBJECT(o), "clicked",
GTK_SIGNAL_FUNC(nr_next_xaction_clicked),
sxsld );
gtk_widget_show_all( sxsld->nextrunDlg );
}
static void
nextrun_close_handler( gpointer ud )
{
gnome_dialog_close( GNOME_DIALOG( ((sxSinceLastData*)ud)->nextrunDlg ) );
}
static void
nr_ok_clicked( GtkButton *b, gpointer ud )
{
sxSinceLastData *sxsld;
GList *tctList;
toCreateTransaction *tct;
sxsld = (sxSinceLastData*)ud;
tctList = sxsld->transList;
if ( tctList == NULL ) {
PERR( "no transactions to create\n" );
}
do {
tct = (toCreateTransaction*)tctList->data;
slr_create_transactions( tct->sx, tct->date );
} while ( (tctList = tctList->next) );
nextrun_close_handler( ud );
}
static void
free_elts( gpointer data, gpointer user_data )
{
g_free( data );
}
static void
nr_next_clicked( GtkButton *b, gpointer ud )
{
sxSinceLastData *sxsld;
GtkWidget *dlg;
GtkWidget *o;
GtkCList *cl;
time_t gdeDate;
GList *sxList;
GNCBook *book;
SchedXaction *sx;
GDate gd, *endDate;
gchar buf[1024];
gint row;
char *rowText[2];
toCreateTransaction *tct;
sxsld = (sxSinceLastData*)ud;
o = glade_xml_get_widget( sxsld->gxml, "next_date" );
gdeDate = gnome_date_edit_get_date( GNOME_DATE_EDIT(o) );
DEBUG( "Okay... I should run with a date of: %s", ctime(&gdeDate) );
/* destroy the previous transactions
destroy all the toCreateTransactions */
if ( sxsld->transList != NULL ) {
g_list_foreach( sxsld->transList, free_elts, NULL );
g_list_free( sxsld->transList );
sxsld->transList = NULL;
}
book = gnc_get_current_book ();
sxList = gnc_book_get_schedxactions( book );
if ( sxList == NULL ) {
PERR( "No scheduled transactions to play with\n" );
return;
}
/* FIXME: This is actually a non-changeable date. */
endDate = g_date_new();
g_date_set_time( endDate, gdeDate );
o = glade_xml_get_widget( sxsld->gxml, "replace_with_register" );
cl = GTK_CLIST(o);
gtk_clist_clear( cl );
g_date_clear( &gd, 1 );
row = 0;
do {
sx = (SchedXaction*)sxList->data;
/* this is really "last-run-date", right? */
g_date_set_time( &gd, time(NULL) );
gd = xaccSchedXactionGetNextInstance( sx );
while ( g_date_compare( &gd, endDate ) <= 0
&& g_date_valid( &gd ) ) {
g_date_strftime( buf, 1023, "%a, %b %e, %Y", &gd );
/* add to clist [ahem... register... ahem] */
rowText[0] = xaccSchedXactionGetName( sx );
rowText[1] = malloc( sizeof(char) * 256 ); /* FIXME */
g_date_strftime( rowText[1], 255, "%a, %b %e, %Y", &gd );
tct = g_new0( toCreateTransaction, 1 );
tct->sx = sx;
tct->date = g_date_new();
*tct->date = gd;
tct->clistRow = row;
sxsld->transList = g_list_append( sxsld->transList, tct );
gtk_clist_insert( cl, row, rowText );
row += 1;
gd = xaccSchedXactionGetInstanceAfter( sx, &gd );
}
} while ( (sxList = sxList->next) );
g_date_free( endDate );
}
static void
nextrun_destroy( GtkObject *o, gpointer ud )
{
DEBUG( "nuttin' doin...\n" );
}
static void
nr_prev_xaction_clicked( GtkButton *b, gpointer ud )
{
}
static void
nr_next_xaction_clicked( GtkButton *b, gpointer ud )
{
}
static gboolean
create_each_transaction( Transaction *t, void *d )
{
Transaction *newT;
GDate *gd;
GList *sList;
GList *osList;
Split *split;
kvp_frame *split_kvpf;
kvp_value *kvp_val;
gboolean errFlag;
errFlag = FALSE;
DEBUG( "I'm seeing Transaction \"%s\"\n",
xaccTransGetDescription( t ) );
gd = (GDate*)d;
newT = xaccMallocTransaction(gnc_get_current_session ());
xaccTransBeginEdit( newT );
/* the action and description/memo are in the template */
gnc_copy_trans_onto_trans( t, newT, FALSE, FALSE );
/* the date is new [gd] */
xaccTransSetDate( newT,
g_date_day( gd ),
g_date_month( gd ),
g_date_year( gd ) );
/* the accounts and amounts are in the kvp_frames of the splits. */
osList = xaccTransGetSplitList( t );
sList = xaccTransGetSplitList( newT );
if ( (osList == NULL) || (sList == NULL) ) {
PERR( "\tseen transaction w/o splits. :(\n" );
return FALSE;
}
do {
split = (Split*)sList->data;
/* FIXME: Ick. This assumes that the split lists will be
ordered identically. :( I think it's fair to say they
will, but I'd rather not have to count on it. --jsled */
split_kvpf = xaccSplitGetSlots( (Split*)osList->data );
DEBUG( "\tProcessing Split \"%s\"\n",
xaccSplitGetMemo( split ) );
DEBUG( "\tkvp_frame: %s\n",
kvp_frame_to_string( split_kvpf ) );
/* from-transaction of splits */
{
GUID *acct_guid;
Account *acct;
/* contains the guid of the split's actual account. */
kvp_val = kvp_frame_get_slot_path( split_kvpf,
GNC_SX_ID,
GNC_SX_ACCOUNT,
NULL);
if ( kvp_val == NULL ) {
PERR( "Null kvp_val for account\n" );
}
acct_guid = kvp_value_get_guid( kvp_val );
acct = xaccAccountLookup( acct_guid,
gnc_get_current_session () );
DEBUG( "Got account with name \"%s\"\n",
xaccAccountGetName( acct ) );
/* xaccSplitSetAccount( split, acct ); */
xaccAccountInsertSplit( acct, split );
}
/* credit/debit formulas */
{
char *str;
gnc_numeric credit_num;
gnc_numeric debit_num;
gnc_numeric final;
int gncn_error;
kvp_val = kvp_frame_get_slot_path(split_kvpf,
GNC_SX_ID,
GNC_SX_CREDIT_FORMULA,
NULL);
str = kvp_value_get_string( kvp_val );
credit_num = gnc_numeric_create( 0, 1 );
if ( str != NULL ) {
printf( "---------------\n" );
printf( "Parsing formula:\n" );
/* parse_vars_from_formula( str, NULL ); */
printf( "---------------\n" );
xaccParseAmount( str, TRUE, &credit_num, NULL );
/* string_to_gnc_numeric( str, &credit_num ); */
printf( "gnc_numeric::credit: \"%s\" -> \"%s\"\n",
str, gnc_numeric_to_string( credit_num ) );
}
kvp_val = kvp_frame_get_slot_path( split_kvpf,
GNC_SX_ID,
GNC_SX_DEBIT_FORMULA,
NULL);
str = kvp_value_get_string( kvp_val );
debit_num = gnc_numeric_create( 0, 1 );
if ( str != NULL ) {
printf( "---------------\n" );
printf( "Parsing formula:\n" );
/* parse_vars_from_formula( str, NULL ); */
printf( "---------------\n" );
xaccParseAmount( str, TRUE, &debit_num, NULL );
/* string_to_gnc_numeric( str, &debit_num ); */
printf( "gnc_numeric::debit: \"%s\" -> \"%s\"\n",
str, gnc_numeric_to_string( debit_num ) );
}
final = gnc_numeric_sub_fixed( credit_num, debit_num );
gncn_error = gnc_numeric_check( final );
if ( gncn_error != GNC_ERROR_OK ) {
printf( "Error %d in final gnc_numeric value\n", gncn_error );
errFlag = TRUE;
break;
}
DEBUG( "gnc_numeric::final: \"%s\"\n",
gnc_numeric_to_string( final ) );
xaccSplitSetValue( split, final );
}
#if 0
kvp_val = kvp_frame_get_slot_path( split_kvpf,
GNC_SX_ID,
GNC_SX_SHARES,
NULL);
kvp_val = kvp_frame_get_slot_path( split_kvpf,
GNC_SX_ID,
GNC_SX_AMNT,
NULL);
#endif /* 0 */
} while ( (sList = sList->next) && (osList = osList->next) );
if ( errFlag ) {
PERR( "Some error in new transaction creation...\n" );
xaccTransRollbackEdit( newT );
} else {
xaccTransCommitEdit( newT );
}
return TRUE;
}
static void
slr_create_transactions( SchedXaction *sx, GDate *gd )
{
AccountGroup *ag;
Account *acct;
char *id;
/* get template account group */
ag = gnc_book_get_template_group( gnc_get_current_book () );
id = guid_to_string( xaccSchedXactionGetGUID(sx) );
acct = xaccGetAccountFromName( ag, id );
DEBUG( "Got account \"%s\"\n",
xaccAccountGetName( acct ) );
g_free( id );
xaccAccountForEachTransaction( acct,
create_each_transaction,
gd );
}
#if 0
/**
* Parses in-fix mathematical formulas using the standard operators
* [+-/%*], and '(', ')' grouping.
*
* Any strings are placed in the GHashTable as variables. The value of
* each key in the hash-table is a struct of the form:
* { const char *varStr;
* gint idx;
* gint len; };
*
**/
int
parse_vars_from_formula( const char *formula, GHashTable *varHash )
{
gnc_numeric num_foo;
char *foo;
GList *list;
gnc_exp_parser_init();
if ( ! gnc_exp_parser_parse( formula, &num_foo, &foo ) ) {
PERR( "Error parsing at \"%s\": %s\n",
foo, gnc_exp_parser_error_string() );
}
PINFO( "Successful parse...\n" );
list = gnc_exp_parser_get_variable_names();
if ( list == NULL ) {
PINFO( "NULL variable list\n" );
} else {
do {
PINFO( "Variable \"%s\"\n",
list->data );
} while ( (list = list->next) );
}
gnc_exp_parser_shutdown();
}
#endif /* 0 */
#if 0
GScanner *varScanner;
GTokenType tok;
varScanner = g_scanner_new( NULL );
g_scanner_set_scope( varScanner, 0 );
g_scanner_freeze_symbol_table( varScanner );
g_scanner_scope_add_symbol( varScanner, 0, "(", (gpointer)"left-paren" );
g_scanner_scope_add_symbol( varScanner, 0, ")", (gpointer)"right-paren" );
g_scanner_scope_add_symbol( varScanner, 0, "+", (gpointer)"plus" );
g_scanner_scope_add_symbol( varScanner, 0, "-", (gpointer)"minus" );
g_scanner_scope_add_symbol( varScanner, 0, "/", (gpointer)"div" );
g_scanner_scope_add_symbol( varScanner, 0, "*", (gpointer)"mult" );
g_scanner_thaw_symbol_table( varScanner );
g_scanner_input_text( varScanner, formula, strlen( formula ) );
do {
tok = g_scanner_get_next_token( varScanner );
printf( "tok: " );
switch ( varScanner->token ) {
case G_TOKEN_EOF:
printf( "EOF" ); break;
case G_TOKEN_LEFT_PAREN:
printf( "(" ); break;
case G_TOKEN_RIGHT_PAREN:
printf( ")" ); break;
case G_TOKEN_LEFT_CURLY:
printf( "{" ); break;
case G_TOKEN_RIGHT_CURLY:
printf( "}" ); break;
case G_TOKEN_LEFT_BRACE:
printf( "[" ); break;
case G_TOKEN_RIGHT_BRACE:
printf( "]" ); break;
case G_TOKEN_EQUAL_SIGN:
printf( "=" ); break;
case G_TOKEN_COMMA:
printf( "," ); break;
case G_TOKEN_NONE:
printf( "NONE" ); break;
case G_TOKEN_ERROR:
printf( "ERROR(%d)", varScanner->value.v_error ); break;
case G_TOKEN_CHAR:
printf( "CHAR(%c)", varScanner->value.v_char ); break;
case G_TOKEN_BINARY:
printf( "BINARY" ); break;
case G_TOKEN_OCTAL:
printf( "OCTAL(%ul)", varScanner->value.v_octal ); break;
case G_TOKEN_INT:
printf( "INT(%ul)", varScanner->value.v_int ); break;
case G_TOKEN_HEX:
printf( "HEX(%ul)", varScanner->value.v_hex ); break;
case G_TOKEN_FLOAT:
printf( "FLOAT(%f)", varScanner->value.v_float ); break;
case G_TOKEN_STRING:
printf( "STRING(%s)", varScanner->value.v_string ); break;
case G_TOKEN_SYMBOL:
printf( "SYMBOL(%s)", (gchar*)varScanner->value.v_symbol ); break;
case G_TOKEN_IDENTIFIER:
printf( "IDENT(%s)", varScanner->value.v_identifier ); break;
case G_TOKEN_IDENTIFIER_NULL:
printf( "NULL_IDENT" ); break;
case G_TOKEN_COMMENT_SINGLE:
case G_TOKEN_COMMENT_MULTI:
printf( "COMMENT(%s)", varScanner->value.v_comment ); break;
case G_TOKEN_LAST:
printf( "END" ); break;
default:
printf( "UNK" ); break;
};
printf( "\n" );
} while ( (varScanner->token != G_TOKEN_LAST) &&
(varScanner->token != G_TOKEN_EOF) &&
(varScanner->token != G_TOKEN_NONE) );
return 1;
/*
"0.33 * ( base + ld ) + (0.25 * internet)":
tok: FLOAT(0.330000)
tok: UNK
tok: )
tok: IDENT(base)
tok: UNK
tok: IDENT(ld)
tok: (
tok: UNK
tok: )
tok: FLOAT(0.250000)
tok: UNK
tok: IDENT(internet)
tok: (
tok: EOF
*/
#endif /* 0 */

@ -58,6 +58,7 @@ static short module = MOD_SX;
#define ADVANCE_DAYS_SPIN "advance_days"
#define REMIND_OPT "remind_opt"
#define REMIND_DAYS_SPIN "remind_days"
#define END_GNOME_NUMENTRY "end_gnome_nentry"
#define END_OPTION 0
#define NUM_OCCUR_OPTION 1
@ -142,8 +143,8 @@ static void sxed_reg_xferCB( GtkWidget *w, gpointer d );
static void gnc_sxed_reg_check_close(SchedXactionEditorDialog *sxed);
static gboolean _editor_component_sx_equality( gpointer find_data,
gpointer user_data );
static gboolean editor_component_sx_equality( gpointer find_data,
gpointer user_data );
/** Implementations *****************************************************/
@ -162,6 +163,8 @@ sxed_close_handler ( gpointer user_data )
{
SchedXactionEditorDialog *sxed = user_data;
DEBUG( "sxed_close_handler" );
gnc_sxed_reg_check_close( sxed );
gnc_ledger_display_close( sxed->ledger );
@ -203,7 +206,7 @@ void
editor_ok_button_clicked( GtkButton *b, SchedXactionEditorDialog *sxed )
{
GNCBook *book;
GtkWidget *o, *o2, *o3;
GtkWidget *w, *optEndDate, *optNoEnd, *optNumOccur;
GList *sxList;
FreqSpec *fs;
gint row;
@ -213,28 +216,29 @@ editor_ok_button_clicked( GtkButton *b, SchedXactionEditorDialog *sxed )
gdate = g_date_new();
/* read out data back into SchedXaction object. */
o = glade_xml_get_widget( sxed->gxml, "sxe_name" );
xaccSchedXactionSetName( sxed->sx, gtk_entry_get_text( GTK_ENTRY(o) ) );
w = glade_xml_get_widget( sxed->gxml, "sxe_name" );
xaccSchedXactionSetName( sxed->sx, gtk_entry_get_text( GTK_ENTRY(w) ) );
o = glade_xml_get_widget( sxed->gxml, "rb_enddate" );
o2 = glade_xml_get_widget( sxed->gxml, "rb_noend" );
o3 = glade_xml_get_widget( sxed->gxml, "rb_num_occur" );
if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(o)) ) {
optEndDate = glade_xml_get_widget( sxed->gxml, "rb_enddate" );
optNoEnd = glade_xml_get_widget( sxed->gxml, "rb_noend" );
optNumOccur = glade_xml_get_widget( sxed->gxml, "rb_num_occur" );
if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(optEndDate)) ) {
/* get the end date data */
o = glade_xml_get_widget( sxed->gxml, "sxe_end_date" );
g_date_set_time( gdate, gnome_date_edit_get_date( GNOME_DATE_EDIT(o) ) );
w = glade_xml_get_widget( sxed->gxml, "sxe_end_date" );
g_date_set_time( gdate, gnome_date_edit_get_date( GNOME_DATE_EDIT(w) ) );
xaccSchedXactionSetEndDate( sxed->sx, gdate );
/* set the num occurances data */
xaccSchedXactionSetNumOccur( sxed->sx, -1 );
} else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(o3) ) ) {
xaccSchedXactionSetNumOccur( sxed->sx, 0 );
} else if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(optNumOccur) ) ) {
gint num;
/* get the occurances data */
o = glade_xml_get_widget( sxed->gxml, "end_nentry" );
xaccSchedXactionSetNumOccur( sxed->sx,
(gint)gnome_number_entry_get_number( GNOME_NUMBER_ENTRY(o) ) );
w = glade_xml_get_widget( sxed->gxml, END_GNOME_NUMENTRY );
num = (gint)gnome_number_entry_get_number( GNOME_NUMBER_ENTRY(w) );
xaccSchedXactionSetNumOccur( sxed->sx, num );
g_date_clear( gdate, 1 );
xaccSchedXactionSetEndDate( sxed->sx, gdate );
} else if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(o2) ) ) {
xaccSchedXactionSetNumOccur( sxed->sx, -1 );
} else if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(optNoEnd) ) ) {
xaccSchedXactionSetNumOccur( sxed->sx, 0 );
g_date_clear( gdate, 1 );
xaccSchedXactionSetEndDate( sxed->sx, gdate );
} else {
@ -244,10 +248,10 @@ editor_ok_button_clicked( GtkButton *b, SchedXactionEditorDialog *sxed )
{
gboolean autocreateState, notifyState;
o = glade_xml_get_widget( sxed->gxml, "autocreate_opt" );
autocreateState = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(o) );
o = glade_xml_get_widget( sxed->gxml, "notify_opt" );
notifyState = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(o) );
w = glade_xml_get_widget( sxed->gxml, "autocreate_opt" );
autocreateState = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(w) );
w = glade_xml_get_widget( sxed->gxml, "notify_opt" );
notifyState = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(w) );
/* "Notify" only makes sense if AutoCreate is actived;
enforce that here. */
@ -260,20 +264,20 @@ editor_ok_button_clicked( GtkButton *b, SchedXactionEditorDialog *sxed )
int daysInAdvance;
daysInAdvance = 0;
o = glade_xml_get_widget( sxed->gxml, "advance_opt" );
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(o) ) ) {
o = glade_xml_get_widget( sxed->gxml, "advance_days" );
w = glade_xml_get_widget( sxed->gxml, "advance_opt" );
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(w) ) ) {
w = glade_xml_get_widget( sxed->gxml, "advance_days" );
daysInAdvance =
gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(o) );
gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(w) );
}
xaccSchedXactionSetAdvanceCreation( sxed->sx, daysInAdvance );
daysInAdvance = 0;
o = glade_xml_get_widget( sxed->gxml, "remind_opt" );
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(o) ) ) {
o = glade_xml_get_widget( sxed->gxml, "remind_days" );
w = glade_xml_get_widget( sxed->gxml, "remind_opt" );
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(w) ) ) {
w = glade_xml_get_widget( sxed->gxml, "remind_days" );
daysInAdvance =
gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(o) );
gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(w) );
}
xaccSchedXactionSetAdvanceReminder( sxed->sx, daysInAdvance );
}
@ -326,6 +330,8 @@ advance_toggle( GtkButton *o, SchedXactionEditorDialog *sxed )
}
gtk_widget_set_sensitive( spin,
gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(o) ) );
/* FIXME: this doesn't do what we want... :( */
gtk_editable_set_editable( GTK_EDITABLE(spin), TRUE );
}
/* Local destruction of dialog */
@ -519,7 +525,7 @@ gnc_ui_scheduled_xaction_editor_dialog_create( SchedXactionDialog *sxd,
};
alreadyExists = gnc_find_gui_components( DIALOG_SCHEDXACTION_EDITOR_CM_CLASS,
_editor_component_sx_equality,
editor_component_sx_equality,
sx );
if ( alreadyExists ) {
sxed = (SchedXactionEditorDialog*)alreadyExists->data;
@ -593,9 +599,9 @@ void
schedXact_editor_init( SchedXactionEditorDialog *sxed )
{
GtkWidget *w;
w = glade_xml_get_widget( sxed->gxml,
"end_nentry" );
w = glade_xml_get_widget( sxed->gxml, END_GNOME_NUMENTRY );
gtk_widget_set_sensitive( w, FALSE );
/* Allow grow, allow shrink, auto-shrink */
gtk_window_set_policy (GTK_WINDOW(sxed->dialog), TRUE, TRUE, FALSE);
}
@ -892,16 +898,10 @@ schedXact_editor_create_ledger( SchedXactionEditorDialog *sxed )
gnucash_register_attach_popup( sxed->reg, popup, sxed );
toolbar = schedXaction_editor_create_reg_tool_bar( sxed );
gtk_container_set_border_width( GTK_CONTAINER(toolbar), 2 );
//gtk_container_set_border_width( GTK_CONTAINER(toolbar), 2 );
gtk_container_add( GTK_CONTAINER(vbox), toolbar );
gtk_container_add( GTK_CONTAINER(vbox), regWidget );
/* FIXME: This doesn't actually do what we want. */
gtk_box_set_child_packing( GTK_BOX(vbox), regWidget,
TRUE, TRUE, 2,
GTK_PACK_END /* it already has a
* position... */ );
gtk_box_pack_start( GTK_BOX(vbox), toolbar, FALSE, FALSE, 2 );
gtk_box_pack_end( GTK_BOX(vbox), regWidget, TRUE, TRUE, 2 );
#if 0
gtk_signal_connect( GTK_OBJECT(sxed->dialog), "activate_cursor",
@ -963,7 +963,7 @@ schedXact_editor_populate( SchedXactionEditorDialog *sxed )
} else if ( xaccSchedXactionGetNumOccur( sxed->sx ) != -1 ) {
w = glade_xml_get_widget( sxed->gxml, "rb_num_occur" );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(w), TRUE );
w = glade_xml_get_widget( sxed->gxml, "end_nentry" );
w = glade_xml_get_widget( sxed->gxml, END_GNOME_NUMENTRY );
w = gnome_number_entry_gtk_entry( GNOME_NUMBER_ENTRY(w) );
tmpgStr = g_string_sized_new(5);
g_string_sprintf( tmpgStr, "%d", xaccSchedXactionGetNumOccur( sxed->sx ) );
@ -1059,7 +1059,7 @@ set_endgroup_toggle_states( SchedXactionEditorDialog *sxed, EndType type )
dateCtl = glade_xml_get_widget( sxed->gxml, "sxe_end_date" );
gtk_widget_set_sensitive( GTK_WIDGET(dateCtl), (type == END_DATE) );
occurCtl = glade_xml_get_widget( sxed->gxml, "end_nentry" );
occurCtl = glade_xml_get_widget( sxed->gxml, END_GNOME_NUMENTRY );
gtk_widget_set_sensitive( GTK_WIDGET(occurCtl), (type == END_OCCUR) );
}
@ -1080,29 +1080,24 @@ static
void
edit_button_clicked( GtkButton *b, gpointer d )
{
GList *sel;
GtkCList *cl;
int row;
SchedXactionDialog *sxd;
SchedXaction *sx;
GList *sel;
GtkCList *cl;
int row;
SchedXactionDialog *sxd;
SchedXaction *sx;
SchedXactionEditorDialog *sxed;
sxd = (SchedXactionDialog*)d;
cl = GTK_CLIST(glade_xml_get_widget( sxd->gxml, "sched_xact_list" ));
sel = cl->selection;
if ( !sel ) {
return;
}
do {
for( sel = cl->selection; sel; sel = g_list_next(sel) ) {
row = (int)sel->data;
/* get the clist row for this listitem */
/* get the object UD */
sx = (SchedXaction*)gtk_clist_get_row_data( cl, row );
sxed = gnc_ui_scheduled_xaction_editor_dialog_create( sxd, sx, 0 );
} while ( (sel = g_list_next(sel)) );
}
}
static
@ -1229,7 +1224,7 @@ putSchedXactionInClist( gpointer data, gpointer user_data )
xaccFreqSpecGetFreqStr( xaccSchedXactionGetFreqSpec(sx), freqStr );
gd = xaccSchedXactionGetNextInstance( sx );
gd = xaccSchedXactionGetNextInstance( sx, NULL );
if ( ! g_date_valid( &gd ) ) {
g_string_sprintf( nextDate, "not scheduled" );
@ -1622,8 +1617,8 @@ gnc_sxed_reg_check_close(SchedXactionEditorDialog *sxed)
}
static gboolean
_editor_component_sx_equality( gpointer find_data,
gpointer user_data )
editor_component_sx_equality( gpointer find_data,
gpointer user_data )
{
return ( (SchedXaction*)find_data
== ((SchedXactionEditorDialog*)user_data)->sx );

File diff suppressed because it is too large Load Diff

@ -92,8 +92,8 @@
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
@ -519,7 +519,7 @@
<widget>
<class>GnomeNumberEntry</class>
<name>numberentry1</name>
<name>end_gnome_nentry</name>
<max_saved>10</max_saved>
<child>
<padding>0</padding>
@ -563,8 +563,8 @@
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
@ -4512,4 +4512,527 @@ Anually
</widget>
</widget>
<widget>
<class>GtkWindow</class>
<name>Since Last Run Druid</name>
<title>Since Last Run</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<widget>
<class>GnomeDruid</class>
<name>sincelast_druid</name>
<widget>
<class>GnomeDruidPageStandard</class>
<name>reminders_page</name>
<title>Transaction Reminders</title>
<title_color>255,255,255</title_color>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDruidPageStandard:vbox</child_name>
<name>druid-vbox5</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label847862</name>
<label>The listed Scheduled Transactions are to-be created soon.
Select any which you would like to create now, and click
&quot;Next&quot; to create them.</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>11</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow15</name>
<border_width>3</border_width>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkCList</class>
<name>reminder_clist</name>
<can_focus>True</can_focus>
<columns>3</columns>
<column_widths>147,198,80</column_widths>
<selection_mode>GTK_SELECTION_EXTENDED</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label847863</name>
<label>Name</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label847864</name>
<label>Next Date</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label847865</name>
<label>Days</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDruidPageStandard</class>
<name>auto_create_notify_page</name>
<title>Auto-Created Transactions Notification</title>
<title_color>255,255,255</title_color>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDruidPageStandard:vbox</child_name>
<name>ac_vbox</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>Placeholder</class>
</widget>
<widget>
<class>Placeholder</class>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDruidPageStandard</class>
<name>to_create_page</name>
<title>To-Create Transaction Preparation</title>
<title_color>255,255,255</title_color>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDruidPageStandard:vbox</child_name>
<name>druid-vbox7</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHPaned</class>
<name>to_create_hpaned</name>
<handle_size>10</handle_size>
<gutter_size>10</gutter_size>
<position>400</position>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow16</name>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<shrink>True</shrink>
<resize>False</resize>
</child>
<widget>
<class>GtkCList</class>
<name>to_create_clist</name>
<can_focus>True</can_focus>
<columns>3</columns>
<column_widths>80,123,80</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label847866</name>
<label>Name</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label847867</name>
<label>Date</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label847868</name>
<label>Ready?</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkFrame</class>
<name>frame81</name>
<border_width>1</border_width>
<label>Variables</label>
<label_xalign>0.1</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<shrink>True</shrink>
<resize>True</resize>
</child>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow17</name>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<widget>
<class>GtkViewport</class>
<name>viewport2</name>
<border_width>2</border_width>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkTable</class>
<name>variables_table</name>
<rows>2</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>2</row_spacing>
<column_spacing>2</column_spacing>
<widget>
<class>GtkLabel</class>
<name>label847869</name>
<label>Value</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label847870</name>
<label>Variable</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
</widget>
</widget>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDruidPageStandard</class>
<name>created_page</name>
<title>Created Transaction Review</title>
<title_color>255,255,255</title_color>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDruidPageStandard:vbox</child_name>
<name>created_vbox</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>Placeholder</class>
</widget>
<widget>
<class>Placeholder</class>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDruidPageStandard</class>
<name>obsolete_page</name>
<title>Obsolete Scheduled Transactions</title>
<title_color>255,255,255</title_color>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDruidPageStandard:vbox</child_name>
<name>druid-vbox9</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label847871</name>
<label>The following scheduled transactions have expired.
Select those you wish to delete.</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>11</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow18</name>
<border_width>3</border_width>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkCList</class>
<name>sx_obsolete_clist</name>
<can_focus>True</can_focus>
<columns>3</columns>
<column_widths>80,80,80</column_widths>
<selection_mode>GTK_SELECTION_EXTENDED</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label847872</name>
<label>Name</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label847873</name>
<label>Frequency</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label847874</name>
<label>Ended On</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkHButtonBox</class>
<name>hbuttonbox8</name>
<layout_style>GTK_BUTTONBOX_SPREAD</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkButton</class>
<name>select_all_button</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Select All</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
<name>unselect_all_button</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Unselect All</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDruidPageFinish</class>
<name>finish_page</name>
<title>All Done</title>
<text>Thanks for playing our game...</text>
<background_color>25,25,112</background_color>
<logo_background_color>255,255,255</logo_background_color>
<textbox_color>255,255,255</textbox_color>
<text_color>0,0,0</text_color>
<title_color>255,255,255</title_color>
</widget>
</widget>
</widget>
</GTK-Interface>

@ -507,7 +507,8 @@ gnc_main_window_about_cb (GtkWidget *widget, gpointer data)
{
GtkWidget *about;
const gchar *message = _("The GnuCash personal finance manager.\n"
"The GNU way to manage your money!");
"The GNU way to manage your money!\n"
"http://www.gnucash.org/");
const gchar *copyright = "(C) 1998-2001 Linas Vepstas";
const gchar *authors[] = {
"Rob Browning <rlb@cs.utexas.edu>",
@ -517,6 +518,7 @@ gnc_main_window_about_cb (GtkWidget *widget, gpointer data)
"Dave Peticolas <dave@krondo.com>",
"Christian Stimming <stimming@tuhh.de>",
"Linas Vepstas <linas@linas.org>",
"Joshua Sled <jsled@asynchronous.org>",
NULL
};
@ -627,6 +629,25 @@ gnc_main_window_create_menus(GNCMDIInfo * maininfo)
},
GNOMEUIINFO_END
};
static GnomeUIInfo gnc_sched_xaction_tools_submenu_template[] =
{
{ GNOME_APP_UI_ITEM,
N_("List and Editor"),
N_("The list of Scheduled Transactions"),
gnc_main_window_sched_xaction_cb, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL
},
{ GNOME_APP_UI_ITEM,
N_("Since Last Run..."),
N_("Create Scheduled Transactions since the last time run."),
gnc_main_window_sched_xaction_slr_cb, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL
},
GNOMEUIINFO_END
};
static GnomeUIInfo gnc_tools_menu_template[] =
{
@ -669,20 +690,8 @@ gnc_main_window_create_menus(GNCMDIInfo * maininfo)
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL
},
{ GNOME_APP_UI_ITEM,
N_("Scheduled Transactions List"),
N_("A list of Scheduled Transactions"),
gnc_main_window_sched_xaction_cb, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL
},
{ GNOME_APP_UI_ITEM,
N_("Scheduled Transactions Since-Last-Run..."),
N_("Create Scheduled Transactions since the last-time-run."),
gnc_main_window_sched_xaction_slr_cb, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL
},
GNOMEUIINFO_SUBTREE( N_("Scheduled Transactions"),
gnc_sched_xaction_tools_submenu_template ),
GNOMEUIINFO_END
};

@ -40,10 +40,15 @@
#include "gnucash-header.h"
#include "gnucash-item-edit.h"
/* +DEBUG Just for the time being, until we get this
* gnome-druid/gnucash-sheet problem sorted out. --jsled */
#include "gnc-engine-util.h"
static short module = MOD_SX;
/* -DEBUG */
#define DEFAULT_REGISTER_HEIGHT 400
#define DEFAULT_REGISTER_WIDTH 630
static guint gnucash_register_initial_rows = 15;
static void gnucash_sheet_start_editing_at_cursor (GnucashSheet *sheet);
@ -683,6 +688,10 @@ gnucash_sheet_size_request (GtkWidget *widget, GtkRequisition *requisition)
requisition->width = compute_optimal_width (sheet);
requisition->height = compute_optimal_height (sheet);
/* temporary -- jsled
DEBUG( "size_request: returning %d x %d\n",
requisition->width, requisition->height );
*/
}
const char *
@ -1013,11 +1022,30 @@ gnucash_sheet_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
if (GTK_WIDGET_CLASS(sheet_parent_class)->size_allocate)
(*GTK_WIDGET_CLASS (sheet_parent_class)->size_allocate)
(widget, allocation);
/* temporary -- jsled
DEBUG( "allocation: x: %d, y: %d, w: %d, h: %d, "
"sheet_width: %d, sheet_height: %d\n",
allocation->x, allocation->y,
allocation->width, allocation->height,
sheet->window_height, sheet->window_width );
*/
if (allocation->height == sheet->window_height &&
allocation->width == sheet->window_width)
return;
/* Deal with a bug in gnome-druid.c which causes the ledger to resize
* in 8x4 increments ad infinitum... :(
*
* THIS IS BAD AND LAME. THE RIGHT THING TO DO IS FIGURE OUT WHO'S
* DOING THE BAD THING AND FIX THEM.
* -- jsled
*/
if ( (allocation->height - GNOME_PAD_SMALL - sheet->window_height) == 0
&& (allocation->width - 2 * GNOME_PAD_SMALL - sheet->window_width) == 0 )
return;
/* END LAMENESS */
if (allocation->width != sheet->window_width)
gnucash_sheet_styles_set_dimensions (sheet, allocation->width);

Loading…
Cancel
Save