[Gnucash-changes] Convert scheduled transactions over to the new
preferences dialog and
David Hampton
hampton at cvs.gnucash.org
Tue Aug 2 23:05:23 EDT 2005
Log Message:
-----------
Convert scheduled transactions over to the new preferences dialog and
gconf storage. Fix register menu problems when in embedded windows.
Use C side hooks to set up the "since last run" dialog.
Tags:
----
gnucash-gnome2-dev
Modified Files:
--------------
gnucash:
ChangeLog
gnucash/src/app-utils:
prefs.scm
gnucash/src/gnome:
dialog-scheduledxaction.c
dialog-scheduledxaction.h
dialog-sx-from-trans.c
dialog-sxsincelast.c
dialog-sxsincelast.h
gw-gnc-spec.scm
top-level.c
gnucash/src/gnome/glade:
sched-xact.glade
gnucash/src/gnome/ui:
gnc-plugin-page-sxregister-ui.xml
gnc-sxed-window-ui.xml
gnucash/src/scm:
main.scm
Added Files:
-----------
gnucash/src/gnome/schemas:
apps_gnucash_dialog_scheduled_transctions.schemas
Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1487.2.260
retrieving revision 1.1487.2.261
diff -LChangeLog -LChangeLog -u -r1.1487.2.260 -r1.1487.2.261
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,39 @@
+2005-08-02 David Hampton <hampton at employees.org>
+
+ * src/app-utils/prefs.scm:
+ * src/gnome/dialog-scheduledxaction.[ch]:
+ * src/gnome/dialog-sx-from-trans.c:
+ * src/gnome/dialog-sxsincelast.[ch]:
+ * src/gnome/gw-gnc-spec.scm:
+ * src/gnome/top-level.c:
+ * src/gnome/glade/sched-xact.glade:
+ * src/gnome/schemas/apps_gnucash_dialog_scheduled_transctions.schemas:
+ * src/gnome/ui/gnc-plugin-page-sxregister-ui.xml:
+ * src/gnome/ui/gnc-sxed-window-ui.xml:
+ * src/scm/main.scm: Convert scheduled transactions over to the new
+ preferences dialog and gconf storage. Fix register menu problems
+ when in embedded windows. Use C side hooks to set up the "since
+ last run" dialog.
+
+ * src/gnome/gnc-plugin-page-register.c: Properly set the window
+ field in the gnc_split_register data structure when installing the
+ page into a GncEmbeddedWindow.
+
+ * src/core-utils/gnc-gobject-utils.c: Enhance object tracking to
+ catch the deletion of an object that hasn't been removed from the
+ tracking list.
+
+ * src/gnome-utils/gnc-embedded-window.c:
+ * src/gnome-utils/gnc-main-window.c:
+ * src/gnome-utils/gnc-window.[ch]: Add method for retrieving the
+ GtkWindow associated with a GncWindow.
+
+ * src/gnome-utils/dialog-preferences.c:
+ * src/gnome-utils/preferences.glade: Clean up xml data structures
+ when the dialog is destroyed. Connect signals in all add-in
+ preference pages. Don't show the dialog until completely built
+ and moved to the remembered position.
+
2005-07-30 David Hampton <hampton at employees.org>
* Lots 'o files: Remove unnecessary includes.
Index: dialog-sx-from-trans.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/dialog-sx-from-trans.c,v
retrieving revision 1.26.4.4
retrieving revision 1.26.4.5
diff -Lsrc/gnome/dialog-sx-from-trans.c -Lsrc/gnome/dialog-sx-from-trans.c -u -r1.26.4.4 -r1.26.4.5
--- src/gnome/dialog-sx-from-trans.c
+++ src/gnome/dialog-sx-from-trans.c
@@ -38,6 +38,7 @@
#include "gnc-book.h"
#include "gnc-date-edit.h"
#include "gnc-engine-util.h"
+#include "gnc-gconf-utils.h"
#include "gnc-ui.h"
#include "gnc-ui-util.h"
#include "gnc-dense-cal.h"
@@ -59,8 +60,6 @@
#define SXFTD_EX_CAL_FRAME "ex_cal_frame"
#define SXFTD_END_DATE_BOX "end_date_hbox"
-#define SX_OPT_STR "Scheduled Transactions"
-
#define SXFTD_ERRNO_UNBALANCED_XACTION 3
#define SXFTD_ERRNO_OPEN_XACTION -3
@@ -515,27 +514,19 @@
gint daysInAdvance;
autoCreateState =
- gnc_lookup_boolean_option( SX_OPT_STR,
- "Auto-Create new Scheduled "
- "Transactions by default", FALSE );
+ gnc_gconf_get_bool( SXED_GCONF_SECTION, KEY_CREATE_AUTO, NULL );
notifyState =
- gnc_lookup_boolean_option( SX_OPT_STR,
- "Notify on new, auto-created "
- "Scheduled Transactions", FALSE );
+ gnc_gconf_get_bool( SXED_GCONF_SECTION, KEY_NOTIFY, NULL );
xaccSchedXactionSetAutoCreate( sx,
autoCreateState,
(autoCreateState & notifyState) );
daysInAdvance =
- (int)gnc_lookup_number_option( SX_OPT_STR,
- "Default number of days in "
- "advance to create", 0 );
+ gnc_gconf_get_float( SXED_GCONF_SECTION, KEY_CREATE_DAYS, NULL );
xaccSchedXactionSetAdvanceCreation( sx, daysInAdvance );
daysInAdvance =
- (int)gnc_lookup_number_option( SX_OPT_STR,
- "Default number of days in "
- "advance to remind", 0 );
+ gnc_gconf_get_float( SXED_GCONF_SECTION, KEY_NOTIFY_DAYS, NULL );
xaccSchedXactionSetAdvanceReminder( sx, daysInAdvance );
}
Index: dialog-sxsincelast.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/dialog-sxsincelast.h,v
retrieving revision 1.4
retrieving revision 1.4.4.1
diff -Lsrc/gnome/dialog-sxsincelast.h -Lsrc/gnome/dialog-sxsincelast.h -u -r1.4 -r1.4.4.1
--- src/gnome/dialog-sxsincelast.h
+++ src/gnome/dialog-sxsincelast.h
@@ -38,7 +38,7 @@
* dialog stating there's nothing to do.]
**/
gint gnc_ui_sxsincelast_dialog_create( void );
-void gnc_ui_sxsincelast_guile_wrapper( char* );
+void gnc_sx_sxsincelast_book_opened (void);
/**
* Returns the varaibles from the Splits of the given SchedXaction as the
Index: dialog-sxsincelast.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/dialog-sxsincelast.c,v
retrieving revision 1.65.4.11
retrieving revision 1.65.4.12
diff -Lsrc/gnome/dialog-sxsincelast.c -Lsrc/gnome/dialog-sxsincelast.c -u -r1.65.4.11 -r1.65.4.12
--- src/gnome/dialog-sxsincelast.c
+++ src/gnome/dialog-sxsincelast.c
@@ -70,6 +70,7 @@
#include "gnc-engine-util.h"
#include "gnc-exp-parser.h"
#include "gnc-embedded-window.h"
+#include "gnc-gconf-utils.h"
#include "gnc-main-window.h"
#include "gnc-numeric.h"
#include "gnc-plugin-page.h"
@@ -416,9 +417,13 @@
* Used to wrap for the book-open hook, where the book filename is given.
**/
void
-gnc_ui_sxsincelast_guile_wrapper( char *bookfile )
+gnc_sx_sxsincelast_book_opened (void)
{
gint ret;
+
+ if (!gnc_gconf_get_bool(GCONF_SECTION, "show_at_file_open", NULL))
+ return;
+
ret = gnc_ui_sxsincelast_dialog_create();
if ( ret < 0 ) {
gnc_info_dialog
@@ -433,6 +438,7 @@
}
}
+
static gboolean
show_handler (const char *class, gint component_id,
gpointer user_data, gpointer iter_data)
Index: dialog-scheduledxaction.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/dialog-scheduledxaction.h,v
retrieving revision 1.6
retrieving revision 1.6.4.1
diff -Lsrc/gnome/dialog-scheduledxaction.h -Lsrc/gnome/dialog-scheduledxaction.h -u -r1.6 -r1.6.4.1
--- src/gnome/dialog-scheduledxaction.h
+++ src/gnome/dialog-scheduledxaction.h
@@ -30,6 +30,12 @@
#define DIALOG_SCHEDXACTION_CM_CLASS "dialog-scheduledtransactions"
#define DIALOG_SCHEDXACTION_EDITOR_CM_CLASS "dialog-scheduledtransaction-editor"
+#define SXED_GCONF_SECTION "dialogs/scheduled_trans/transaction_editor"
+#define KEY_CREATE_AUTO "create_auto"
+#define KEY_CREATE_DAYS "create_days"
+#define KEY_NOTIFY "notify"
+#define KEY_NOTIFY_DAYS "notify_days"
+
struct _SchedXactionDialog;
struct _SchedXactionEditorDialog;
@@ -50,4 +56,10 @@
void gnc_ui_scheduled_xaction_editor_dialog_destroy( SchedXactionEditorDialog *sxd );
+/**
+ * Sets up a book opened hook. The function called may open a "since
+ * last run" dialog based upon the user's preferences.
+ **/
+void gnc_ui_sx_initialize (void);
+
#endif
Index: top-level.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/top-level.c,v
retrieving revision 1.140.4.26
retrieving revision 1.140.4.27
diff -Lsrc/gnome/top-level.c -Lsrc/gnome/top-level.c -u -r1.140.4.26 -r1.140.4.27
--- src/gnome/top-level.c
+++ src/gnome/top-level.c
@@ -36,6 +36,7 @@
#include "dialog-account.h"
#include "dialog-commodity.h"
#include "dialog-options.h"
+#include "dialog-scheduledxaction.h"
#include "dialog-transfer.h"
#include "dialog-totd.h"
#include "dialog-utils.h"
@@ -309,6 +310,7 @@
gnc_options_dialog_set_global_help_cb (gnc_global_options_help_cb, NULL);
gnc_totd_dialog(NULL, TRUE);
+ gnc_ui_sx_initialize();
main_window = gnc_main_window_new ();
gtk_widget_show (GTK_WIDGET (main_window));
Index: dialog-scheduledxaction.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/dialog-scheduledxaction.c,v
retrieving revision 1.71.2.15
retrieving revision 1.71.2.16
diff -Lsrc/gnome/dialog-scheduledxaction.c -Lsrc/gnome/dialog-scheduledxaction.c -u -r1.71.2.15 -r1.71.2.16
--- src/gnome/dialog-scheduledxaction.c
+++ src/gnome/dialog-scheduledxaction.c
@@ -31,6 +31,7 @@
#include "SchedXaction.h"
#include "SX-book.h"
#include "SX-book-p.h"
+#include "dialog-preferences.h"
#include "dialog-scheduledxaction.h"
#include "dialog-utils.h"
#include "gnc-book.h"
@@ -41,7 +42,9 @@
#include "gnc-embedded-window.h"
#include "gnc-engine-util.h"
#include "gnc-frequency.h"
+#include "gnc-gconf-utils.h"
#include "gnc-gui-query.h"
+#include "gnc-hooks.h"
#include "gnc-ledger-display.h"
#include "gnc-plugin-page.h"
#include "gnc-plugin-page-register.h"
@@ -68,9 +71,7 @@
#define SX_LIST "sched_xact_list"
#define SX_LIST_UPCOMING_FRAME "upcoming_cal_frame"
#define SX_EDITOR_GLADE_NAME "Scheduled Transaction Editor"
-#define SX_OPT_STR "Scheduled Transactions"
-#define SXED_GCONF_SECTION "dialogs/scheduled_trans/transaction_editor"
#define SXED_WIN_PREFIX "sx_editor_win"
#define SXED_NAME_ENTRY "sxe_name"
#define SXED_LAST_OCCUR_LABEL "last_occur_label"
@@ -84,6 +85,8 @@
#define END_ENTRY "end_nentry"
#define REMAIN_ENTRY "remain_nentry"
+#define SX_GLADE_FILE "sched-xact.glade"
+
#define END_NEVER_OPTION 0
#define END_DATE_OPTION 1
#define NUM_OCCUR_OPTION 2
@@ -238,7 +241,9 @@
/* Toplevel */
{ "EditAction", NULL, N_("_Edit"), NULL, NULL, NULL },
{ "ViewAction", NULL, N_("_View"), NULL, NULL, NULL },
+ { "ViewAction", NULL, N_("_View"), NULL, NULL, NULL },
{ "ActionsAction", NULL, N_("_Actions"), NULL, NULL, NULL },
+ { "TransactionAction", NULL, N_("_Transaction"), NULL, NULL, NULL },
/* Edit menu */
{ "EditCutAction", GTK_STOCK_CUT, N_("Cu_t"), "<control>x",
@@ -1206,7 +1211,7 @@
sxd = g_new0( SchedXactionDialog, 1 );
- sxd->gxml = gnc_glade_xml_new( "sched-xact.glade", SX_LIST_GLADE_NAME );
+ sxd->gxml = gnc_glade_xml_new( SX_GLADE_FILE, SX_LIST_GLADE_NAME );
sxd->dialog = glade_xml_get_widget( sxd->gxml, SX_LIST_GLADE_NAME );
sxd->sxData = g_hash_table_new( NULL, NULL );
@@ -1420,7 +1425,7 @@
}
sxed = g_new0( SchedXactionEditorDialog, 1 );
- sxed->gxml = gnc_glade_xml_new( "sched-xact.glade",
+ sxed->gxml = gnc_glade_xml_new( SX_GLADE_FILE,
SX_EDITOR_GLADE_NAME );
sxed->dialog = glade_xml_get_widget( sxed->gxml, SX_EDITOR_GLADE_NAME );
@@ -1585,8 +1590,8 @@
gnc_plugin_page_register_set_ui_description (sxed->plugin_page,
"gnc-plugin-page-sxregister-ui.xml");
gnc_plugin_page_register_set_options (sxed->plugin_page,
- SX_OPT_STR,
- "Template Register Lines",
+ SXED_GCONF_SECTION,
+ KEY_NUMBER_OF_ROWS,
NUM_LEDGER_LINES_DEFAULT,
(CAP_JUMP | CAP_SCHEDULE) );
gnc_embedded_window_open_page (sxed->embed_window, sxed->plugin_page);
@@ -1666,13 +1671,9 @@
/* Do auto-create/notify setup */
if ( sxed->newsxP ) {
autoCreateState =
- gnc_lookup_boolean_option( SX_OPT_STR,
- "Auto-Create new Scheduled "
- "Transactions by default", FALSE );
+ gnc_gconf_get_bool( SXED_GCONF_SECTION, KEY_CREATE_AUTO, NULL );
notifyState =
- gnc_lookup_boolean_option( SX_OPT_STR,
- "Notify on new, auto-created "
- "Scheduled Transactions", FALSE );
+ gnc_gconf_get_bool( SXED_GCONF_SECTION, KEY_NOTIFY, NULL );
} else {
xaccSchedXactionGetAutoCreate( sxed->sx,
&autoCreateState,
@@ -1688,9 +1689,7 @@
/* Do days-in-advance-to-create widget[s] setup. */
if ( sxed->newsxP ) {
daysInAdvance =
- (int)gnc_lookup_number_option( SX_OPT_STR,
- "Default number of days in "
- "advance to create", 0 );
+ gnc_gconf_get_float( SXED_GCONF_SECTION, KEY_CREATE_DAYS, NULL );
} else {
daysInAdvance =
xaccSchedXactionGetAdvanceCreation( sxed->sx );
@@ -1704,9 +1703,7 @@
/* Do days-in-advance-to-remind widget[s] setup. */
if ( sxed->newsxP ) {
daysInAdvance =
- (int)gnc_lookup_number_option( SX_OPT_STR,
- "Default number of days in "
- "advance to remind", 0 );
+ gnc_gconf_get_float( SXED_GCONF_SECTION, KEY_NOTIFY_DAYS, NULL );
} else {
daysInAdvance =
xaccSchedXactionGetAdvanceReminder( sxed->sx );
@@ -2458,3 +2455,45 @@
gnc_sxed_cmd_edit_paste (GtkAction *action, SchedXactionEditorDialog *sxed)
{
}
+
+
+void on_sx_check_toggled (GtkWidget *togglebutton, gpointer user_data);
+
+void
+on_sx_check_toggled (GtkWidget *togglebutton,
+ gpointer user_data)
+{
+ GtkWidget *widget;
+ gboolean create, notify;
+
+ /* The gnc_glade_lookup_widget() function works because all of these
+ * widgets come from the same glade file. */
+ widget = gnc_glade_lookup_widget(togglebutton,
+ "gconf/dialogs/scheduled_trans/transaction_editor/create_auto");
+ create = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+ widget = gnc_glade_lookup_widget(togglebutton,
+ "gconf/dialogs/scheduled_trans/transaction_editor/notify");
+ gtk_widget_set_sensitive(widget, create);
+ notify = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+
+ widget = gnc_glade_lookup_widget(togglebutton, "create_days_label");
+ gtk_widget_set_sensitive(widget, create);
+ widget = gnc_glade_lookup_widget(togglebutton, "create_days_hbox");
+ gtk_widget_set_sensitive(widget, create);
+
+ widget = gnc_glade_lookup_widget(togglebutton, "notify_days_label");
+ gtk_widget_set_sensitive(widget, create && notify);
+ widget = gnc_glade_lookup_widget(togglebutton, "notify_days_hbox");
+ gtk_widget_set_sensitive(widget, create && notify);
+}
+
+
+void
+gnc_ui_sx_initialize (void)
+{
+ gnc_hook_add_dangler(HOOK_BOOK_OPENED,
+ (GFunc)gnc_sx_sxsincelast_book_opened, NULL);
+ gnc_preferences_add_page (SX_GLADE_FILE,
+ "sx_prefs",
+ "Scheduled Transactions");
+}
Index: gw-gnc-spec.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/gw-gnc-spec.scm,v
retrieving revision 1.14.4.16
retrieving revision 1.14.4.17
diff -Lsrc/gnome/gw-gnc-spec.scm -Lsrc/gnome/gw-gnc-spec.scm -u -r1.14.4.16 -r1.14.4.17
--- src/gnome/gw-gnc-spec.scm
+++ src/gnome/gw-gnc-spec.scm
@@ -233,16 +233,4 @@
order to destroy the dialog. The dialog will not be destroyed
by the user closing the window.")
- (gw:wrap-function
- ws
- 'gnc:sx-editor
- '<gw:void>
- "gnc_ui_scheduled_xaction_dialog_create" '()
- "Open the Scheduled Transaction Editor" )
-
- (gw:wrap-function
- ws
- 'gnc:sx-since-last-run-wrapper
- '<gw:void>
- "gnc_ui_sxsincelast_guile_wrapper" '(((<gw:mchars> caller-owned) bookfile))
- "Wrapper to open the since-last-run dialog from a book-open hook." ))
+)
Index: gnc-sxed-window-ui.xml
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/ui/Attic/gnc-sxed-window-ui.xml,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -Lsrc/gnome/ui/gnc-sxed-window-ui.xml -Lsrc/gnome/ui/gnc-sxed-window-ui.xml -u -r1.1.2.1 -r1.1.2.2
--- src/gnome/ui/gnc-sxed-window-ui.xml
+++ src/gnome/ui/gnc-sxed-window-ui.xml
@@ -11,6 +11,9 @@
<placeholder name="ViewPlaceholder"/>
</menu>
+ <menu name="Transaction" action="TransactionAction">
+ </menu>
+
<menu name="Actions" action="ActionsAction">
<placeholder name="ActionsPlaceholder"/>
</menu>
Index: gnc-plugin-page-sxregister-ui.xml
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/ui/Attic/gnc-plugin-page-sxregister-ui.xml,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -Lsrc/gnome/ui/gnc-plugin-page-sxregister-ui.xml -Lsrc/gnome/ui/gnc-plugin-page-sxregister-ui.xml -u -r1.1.2.2 -r1.1.2.3
--- src/gnome/ui/gnc-plugin-page-sxregister-ui.xml
+++ src/gnome/ui/gnc-plugin-page-sxregister-ui.xml
@@ -1,15 +1,13 @@
<ui>
<menubar>
- <menu name="Edit" action="EditAction">
- <placeholder name="EditSelectedPlaceholder">
- <separator name="EditSep22"/>
- <menuitem name="EditCutTransaction" action="EditCutTransactionAction"/>
- <menuitem name="EditCopyTransaction" action="EditCopyTransactionAction"/>
- <menuitem name="EditPasteTransaction" action="EditPasteTransactionAction"/>
- <menuitem name="EditVoidTransaction" action="EditVoidTransactionAction"/>
- <menuitem name="EditUnvoidTransaction" action="EditUnvoidTransactionAction"/>
- <menuitem name="EditReverseTransaction" action="EditReverseTransactionAction"/>
- </placeholder>
+ <menu name="Transaction" action="TransactionAction">
+ <menuitem name="CutTransaction" action="CutTransactionAction"/>
+ <menuitem name="CopyTransaction" action="CopyTransactionAction"/>
+ <menuitem name="PasteTransaction" action="PasteTransactionAction"/>
+ <separator name="TransactionSep2"/>
+ <menuitem name="VoidTransaction" action="VoidTransactionAction"/>
+ <menuitem name="UnvoidTransaction" action="UnvoidTransactionAction"/>
+ <menuitem name="ReverseTransaction" action="ReverseTransactionAction"/>
</menu>
<menu name="View" action="ViewAction">
Index: prefs.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/app-utils/prefs.scm,v
retrieving revision 1.28.4.11
retrieving revision 1.28.4.12
diff -Lsrc/app-utils/prefs.scm -Lsrc/app-utils/prefs.scm -u -r1.28.4.11 -r1.28.4.12
--- src/app-utils/prefs.scm
+++ src/app-utils/prefs.scm
@@ -282,66 +282,6 @@
;; "www.gnucash.org"))
-;; Scheduled|Recurring Transactions
-
-(gnc:register-configuration-option
- (gnc:make-simple-boolean-option
- (N_ "Scheduled Transactions")
- (N_ "Run on GnuCash start")
- "a" (N_ "Should the Since-Last-Run window appear on GnuCash startup?")
- #t ))
-
-(gnc:register-configuration-option
- (gnc:make-simple-boolean-option
- (N_ "Scheduled Transactions")
- (N_ "Auto-Create new Scheduled Transactions by default")
- "b" (N_ "Should new Scheduled Transactions have the 'Auto Create' flag set by default?")
- #f ))
-
-(gnc:register-configuration-option
- (gnc:make-simple-boolean-option
- (N_ "Scheduled Transactions")
- (N_ "Notify on new, auto-created Scheduled Transactions")
- "c" (N_ "Should new Scheduled Transactions with the 'AutoCreate' flag set also be set to notify?")
- #t ))
-
-(gnc:register-configuration-option
- (gnc:make-number-range-option
- (N_ "Scheduled Transactions")
- (N_ "Default number of days in advance to create")
- "d" (N_ "Default number of days in advance to create new Scheduled Transactions.")
- 0 ; default
- 0 ; min
- 99999 ; max
- 0 ; num decimals
- 1 ; step size
- ))
-
-(gnc:register-configuration-option
- (gnc:make-number-range-option
- (N_ "Scheduled Transactions")
- (N_ "Default number of days in advance to remind")
- "e" (N_ "Default number of days in advance to remind on new Scheduled Transactions.")
- 0 ; default
- 0 ; min
- 99999 ; max
- 0 ; num-decimals
- 1 ; step size
- ))
-
-(gnc:register-configuration-option
- (gnc:make-number-range-option
- (N_ "Scheduled Transactions")
- (N_ "Template Register Lines")
- "f" (N_ "How many lines in the template register?")
- 6 ; default
- 1 ; min
- 50 ; max
- 0 ; num-decimals
- 1 ; step size
- ))
-
-
;;; Advanced Options
(gnc:register-configuration-option
Index: sched-xact.glade
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/glade/sched-xact.glade,v
retrieving revision 1.42.2.11
retrieving revision 1.42.2.12
diff -Lsrc/gnome/glade/sched-xact.glade -Lsrc/gnome/glade/sched-xact.glade -u -r1.42.2.11 -r1.42.2.12
--- src/gnome/glade/sched-xact.glade
+++ src/gnome/glade/sched-xact.glade
@@ -8671,4 +8671,451 @@
</child>
</widget>
+<widget class="GtkWindow" id="Preferences">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Preferences</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+
+ <child>
+ <widget class="GtkTable" id="sx_prefs">
+ <property name="visible">True</property>
+ <property name="n_rows">12</property>
+ <property name="n_columns">4</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">0</property>
+ <property name="column_spacing">12</property>
+
+ <child>
+ <widget class="GtkLabel" id="label847981">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Since Last Run Dialog</b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label847982">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label847983">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Transaction Editor Defaults</b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="gconf/dialogs/scheduled_trans/since_last_run/show_at_file_open">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Show the "since last run" window when a file is opened.</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Run when data file opened</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">4</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_padding">12</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="gconf/dialogs/scheduled_trans/transaction_editor/create_auto">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Set the 'auto-create' flag on newly created scheduled transactions.</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Auto-create new transactions</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_sx_check_toggled" last_modification_time="Tue, 02 Aug 2005 03:22:36 GMT"/>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">4</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_padding">12</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="gconf/dialogs/scheduled_trans/transaction_editor/notify">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Set the 'notify' flag on newly created scheduled transactions.</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Notify before transactions are created </property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_sx_check_toggled" last_modification_time="Tue, 02 Aug 2005 03:22:26 GMT"/>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">4</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="x_padding">12</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment25">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">30</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="create_days_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Days in advance:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">gconf/dialogs/scheduled_trans/transaction_editor/create_days</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment26">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">30</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="notify_days_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Da_ys in advance:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">gconf/dialogs/scheduled_trans/transaction_editor/notify_days</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">7</property>
+ <property name="bottom_attach">8</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label847988">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Register _Lines</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">gconf/dialogs/scheduled_trans/transaction_editor/number_of_lines</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">8</property>
+ <property name="bottom_attach">9</property>
+ <property name="x_padding">12</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox182">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkSpinButton" id="gconf/dialogs/scheduled_trans/transaction_editor/number_of_lines">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Make the template register large enough to show this many lines.</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">6 1 50 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label847989">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">lines</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">8</property>
+ <property name="bottom_attach">9</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="notify_days_hbox">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkSpinButton" id="gconf/dialogs/scheduled_trans/transaction_editor/notify_days">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Begin notifications this many days before the transaction is created.</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">0 0 365 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label847986">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">days</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">7</property>
+ <property name="bottom_attach">8</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="create_days_hbox">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkSpinButton" id="gconf/dialogs/scheduled_trans/transaction_editor/create_days">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Create the transaction this many days before its effective date.</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">0 0 365 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label847985">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">days</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
</glade-interface>
--- /dev/null
+++ src/gnome/schemas/apps_gnucash_dialog_scheduled_transctions.schemas
@@ -0,0 +1,104 @@
+<?xml version="1.0"?>
+<gconfschemafile>
+ <schemalist>
+
+ <schema>
+ <key>/schemas/apps/gnucash/dialogs/scheduled_trans/since_last_run/show_at_file_open</key>
+ <applyto>/apps/gnucash/dialogs/scheduled_trans/since_last_run/show_at_file_open</applyto>
+
+aa <applyto>/apps/gnucash/dialogs/scheduled_trans/transaction_editor/window_position</applyto>
+aa <applyto>/apps/gnucash/dialogs/scheduled_trans/transaction_list/window_position</applyto>
+
+ <owner>gnucash</owner>
+ <type>bool</type>
+ <default>TRUE</default>
+ <locale name="C">
+ <short>Show "since last run" dialog when a file is opened.</short>
+ <long>
+ Whether or not to show scheduled transactions "since last
+ run" dialog when a data file is opened. This includes the
+ initial data file open when GnuCash starts. A value of TRUE
+ says to show the dialog; FALSE says not to show the dialog.
+ </long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/gnucash/dialogs/scheduled_trans/transaction_editor/create_auto</key>
+ <applyto>/apps/gnucash/dialogs/scheduled_trans/transaction_editor/create_auto</applyto>
+ <owner>gnucash</owner>
+ <type>bool</type>
+ <default>FALSE</default>
+ <locale name="C">
+ <short>Set the "auto create" flag by default</short>
+ <long>
+ If set to TRUE then any newly created scheduled transactions
+ will have its 'auto create' flag set by default. The user
+ can change this pre-transaction flag during transaction
+ creation, or at any later time by editing the transaction.
+ </long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/gnucash/dialogs/scheduled_trans/transaction_editor/create_days</key>
+ <applyto>/apps/gnucash/dialogs/scheduled_trans/transaction_editor/create_days</applyto>
+ <owner>gnucash</owner>
+ <type>float</type>
+ <default>0</default>
+ <locale name="C">
+ <short>How many days in advance to notify the user.</short>
+ <long>How many days in advance to notify the user.</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/gnucash/dialogs/scheduled_trans/transaction_editor/notify</key>
+ <applyto>/apps/gnucash/dialogs/scheduled_trans/transaction_editor/notify</applyto>
+ <owner>gnucash</owner>
+ <type>bool</type>
+ <default>TRUE</default>
+ <locale name="C">
+ <short>Set the "notify" flag by default</short>
+ <long>
+ If set to TRUE then any newly created scheduled transactions
+ will have its 'notify' flag set by default. The user can
+ change this pre-transaction flag during transaction
+ creation, or at any later time by editing the transaction.
+ This setting only has meaning of the create_auto setting is
+ TRUE.
+ </long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/gnucash/dialogs/scheduled_trans/transaction_editor/notify_days</key>
+ <applyto>/apps/gnucash/dialogs/scheduled_trans/transaction_editor/notify_days</applyto>
+ <owner>gnucash</owner>
+ <type>float</type>
+ <default>0</default>
+ <locale name="C">
+ <short>How many days in advance to notify the user.</short>
+ <long>How many days in advance to notify the user.</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/gnucash/dialogs/scheduled_trans/transaction_editor/number_of_rows</key>
+ <applyto>/apps/gnucash/dialogs/scheduled_trans/transaction_editor/number_of_rows</applyto>
+ <owner>gnucash</owner>
+ <type>float</type>
+ <default>6.0</default>
+ <locale name="C">
+ <short>The number of rows in an scheduled transaction.</short>
+ <long>
+ This field sets the number of rows to show in a scheduled
+ transaction. It does not actually affect the display of the
+ contents of the window. It is only used to set the size of
+ the dialog when first opened.
+ </long>
+ </locale>
+ </schema>
+
+ </schemalist>
+</gconfschemafile>
Index: main.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/scm/main.scm,v
retrieving revision 1.109.2.23
retrieving revision 1.109.2.24
diff -Lsrc/scm/main.scm -Lsrc/scm/main.scm -u -r1.109.2.23 -r1.109.2.24
--- src/scm/main.scm
+++ src/scm/main.scm
@@ -459,15 +459,6 @@
(set-current-module original-module))
- (gnc:hook-add-dangler gnc:*book-opened-hook*
- (lambda (session)
- (if ((gnc:option-getter
- (gnc:lookup-global-option
- "Scheduled Transactions"
- "Run on GnuCash start" )))
- (gnc:sx-since-last-run-wrapper
- (gnc:session-get-url session)))))
-
;; Load the system configs
(gnc:update-splash-screen (_ "Loading configs..."))
(if (not (gnc:load-system-config-if-needed))
More information about the gnucash-changes
mailing list