[Gnucash-changes] Migrate the business preferences over to the new preferences dialog.

David Hampton hampton at cvs.gnucash.org
Fri Jul 22 22:37:44 EDT 2005


Log Message:
-----------
Migrate the business preferences over to the new preferences dialog.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash/src/business/business-gnome:
        businessmod-gnome.c
        dialog-invoice.c
        gnc-plugin-business.c
        gnc-plugin-business.h
    gnucash/src/business/business-gnome/glade:
        Makefile.am
    gnucash/src/business/business-gnome/schemas:
        apps_gnucash_dialog_business_common.schemas
    gnucash/src/business/business-ledger:
        Makefile.am
        gncEntryLedger.c
        gncEntryLedger.h
        gncEntryLedgerLoad.c
        gncEntryLedgerP.h
    gnucash/src/business/business-utils:
        business-prefs.scm

Added Files:
-----------
    gnucash/src/business/business-gnome/glade:
        businessprefs.glade

Revision Data
-------------
Index: businessmod-gnome.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-gnome/businessmod-gnome.c,v
retrieving revision 1.13.4.4
retrieving revision 1.13.4.5
diff -Lsrc/business/business-gnome/businessmod-gnome.c -Lsrc/business/business-gnome/businessmod-gnome.c -u -r1.13.4.4 -r1.13.4.5
--- src/business/business-gnome/businessmod-gnome.c
+++ src/business/business-gnome/businessmod-gnome.c
@@ -45,6 +45,10 @@
 #include "gnc-plugin-manager.h"
 #include "gnc-plugin-business.h"
 
+#include "gnc-hooks.h"
+#include "dialog-invoice.h"
+#include "dialog-preferences.h"
+
 /* version of the gnc module system interface we require */
 int libgncmod_business_gnome_LTX_gnc_module_system_interface = 0;
 
@@ -111,7 +115,10 @@
 				   gnc_plugin_business_new ());
 
     gnc_hook_add_dangler(HOOK_UI_POST_STARTUP,
-			 (GFunc)gnc_invoice_remind_bills_due, NULL);
+			 (GFunc)gnc_invoice_remind_bills_due_cb, NULL);
+
+    gnc_preferences_add_page("businessprefs.glade", "business_prefs",
+			     "Business");
   }
 
   return TRUE;
Index: gnc-plugin-business.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-gnome/Attic/gnc-plugin-business.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -Lsrc/business/business-gnome/gnc-plugin-business.h -Lsrc/business/business-gnome/gnc-plugin-business.h -u -r1.1.2.3 -r1.1.2.4
--- src/business/business-gnome/gnc-plugin-business.h
+++ src/business/business-gnome/gnc-plugin-business.h
@@ -63,5 +63,6 @@
 
 GncMainWindow *gnc_plugin_business_get_window (void);
 void gnc_invoice_remind_bills_due (void);
+void gnc_invoice_remind_bills_due_cb (void);
 
 #endif /* __GNC_PLUGIN_BUSINESS_H */
Index: gnc-plugin-business.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-gnome/Attic/gnc-plugin-business.c,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -Lsrc/business/business-gnome/gnc-plugin-business.c -Lsrc/business/business-gnome/gnc-plugin-business.c -u -r1.1.2.14 -r1.1.2.15
--- src/business/business-gnome/gnc-plugin-business.c
+++ src/business/business-gnome/gnc-plugin-business.c
@@ -369,24 +369,6 @@
   return last_window;
 }
 
-
-void
-gnc_invoice_remind_bills_due (void)
-{
-  GNCBook *book;
-  gint days;
-
-//if (!gnc_gconf_get_bool(GCONF_SECTION_BILL, "notify_when_due", NULL))
-  if (!gnc_lookup_boolean_option("Business", "Notify Bills Due?", FALSE))
-    return;
-
-  book = qof_session_get_book(qof_session_get_current_session());
-//days = gnc_gconf_get_int(GCONF_SECTION_BILL, "days_in_advance", NULL);
-  days = gnc_lookup_number_option("Business", "Bills Due Days", 7.0);
-
-  gnc_invoice_show_bills_due(book, days);
-}
-
 /************************************************************
  *                    Command Callbacks                     *
  ************************************************************/
Index: dialog-invoice.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-gnome/dialog-invoice.c,v
retrieving revision 1.81.4.19
retrieving revision 1.81.4.20
diff -Lsrc/business/business-gnome/dialog-invoice.c -Lsrc/business/business-gnome/dialog-invoice.c -u -r1.81.4.19 -r1.81.4.20
--- src/business/business-gnome/dialog-invoice.c
+++ src/business/business-gnome/dialog-invoice.c
@@ -72,9 +72,6 @@
 #define DIALOG_NEW_INVOICE_CM_CLASS "dialog-new-invoice"
 #define DIALOG_VIEW_INVOICE_CM_CLASS "dialog-view-invoice"
 
-#define GCONF_SECTION_INVOICE "dialogs/business/invoice"
-#define GCONF_SECTION_BILL    "dialogs/business/bill"
-#define GCONF_SECTION_VOUCHER "dialogs/business/voucher"
 #define GCONF_SECTION_SEARCH  "dialogs/business/invoice_search"
 
 void gnc_invoice_window_ok_cb (GtkWidget *widget, gpointer data);
@@ -619,7 +616,7 @@
   memo = NULL;
 
   /* Get the default for the accumulate option */
-  accumulate = gnc_lookup_boolean_option("Business", "Accumulate splits on Post?", TRUE);
+  accumulate = gnc_gconf_get_bool(GCONF_SECTION_INVOICE, "accumulate_splits", NULL);
 
   if (!gnc_dialog_dates_acct_question_parented (iw_get_window(iw), message, ddue_label,
 				       post_label, acct_label, question_label, TRUE,
@@ -1667,6 +1664,7 @@
   GncEntryLedger *entry_ledger = NULL;
   GncOwnerType owner_type;
   GncEntryLedgerType ledger_type;
+  const gchar *gconf_section = NULL;
 
   invoice = gncInvoiceLookup(iw->book,&iw->invoice_guid);
 
@@ -1760,12 +1758,15 @@
     switch (owner_type) {
     case GNC_OWNER_CUSTOMER:
       ledger_type = GNCENTRY_INVOICE_VIEWER;
+      gconf_section = GCONF_SECTION_INVOICE;
       break;
     case GNC_OWNER_VENDOR:
       ledger_type = GNCENTRY_BILL_VIEWER;
+      gconf_section = GCONF_SECTION_BILL;
       break;
     case GNC_OWNER_EMPLOYEE:
       ledger_type = GNCENTRY_EXPVOUCHER_VIEWER;
+      gconf_section = GCONF_SECTION_BILL;
       break;
     default:
       g_warning ("Invalid owner type");
@@ -1780,6 +1781,9 @@
   /* Set the entry_ledger's invoice */
   gnc_entry_ledger_set_default_invoice (entry_ledger, invoice);
 
+  /* Set the gconf section */
+  gnc_entry_ledger_set_gconf_section (entry_ledger, gconf_section);
+
   /* Setup initial values */
   iw->component_id =
     gnc_register_gui_component (DIALOG_VIEW_INVOICE_CM_CLASS,
@@ -1799,8 +1803,10 @@
     GtkWidget *regWidget, *frame, *window;
     guint num_rows;
 
-    num_rows = (guint) gnc_lookup_number_option ("Business",
-                                                 "Number of Rows", 10.0);
+    num_rows = gnc_gconf_get_float(GCONF_SECTION_INVOICE,
+				   KEY_NUMBER_OF_ROWS, NULL);
+    if (num_rows == 0)
+      num_rows = 10;
     gnucash_register_set_initial_rows( num_rows );
 
     /* Watch the order of operations, here... */
@@ -2266,3 +2272,25 @@
 				      TRUE, FALSE,
 				      buttons, NULL);
 }
+
+void
+gnc_invoice_remind_bills_due (void)
+{
+  GNCBook *book;
+  gint days;
+
+  book = qof_session_get_book(qof_session_get_current_session());
+  days = gnc_gconf_get_float(GCONF_SECTION_BILL, "days_in_advance", NULL);
+
+  gnc_invoice_show_bills_due(book, days);
+}
+
+void
+gnc_invoice_remind_bills_due_cb (void)
+{
+  if (!gnc_gconf_get_bool(GCONF_SECTION_BILL, "notify_when_due", NULL))
+    return;
+
+  gnc_invoice_remind_bills_due();
+}
+
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-gnome/glade/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -Lsrc/business/business-gnome/glade/Makefile.am -Lsrc/business/business-gnome/glade/Makefile.am -u -r1.2 -r1.2.4.1
--- src/business/business-gnome/glade/Makefile.am
+++ src/business/business-gnome/glade/Makefile.am
@@ -1,6 +1,7 @@
 gladedir = $(GNC_GLADE_DIR)
 glade_DATA = \
   billterms.glade \
+  businessprefs.glade \
   customer.glade \
   date-close.glade \
   employee.glade \
--- /dev/null
+++ src/business/business-gnome/glade/businessprefs.glade
@@ -0,0 +1,343 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="window1">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">window1</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="business_prefs">
+      <property name="border_width">6</property>
+      <property name="visible">True</property>
+      <property name="n_rows">8</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="label53">
+	  <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="label54">
+	  <property name="visible">True</property>
+	  <property name="label" translatable="yes">&lt;b&gt;Invoices&lt;/b&gt;</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">2</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="GtkCheckButton" id="gconf/dialogs/business/bill/tax_included">
+	  <property name="visible">True</property>
+	  <property name="tooltip" translatable="yes">Whether tax is included by default in entries on Bills. This setting is inherited by new customers and vendors.</property>
+	  <property name="can_focus">True</property>
+	  <property name="label" translatable="yes">Ta_x Included</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">1</property>
+	  <property name="top_attach">7</property>
+	  <property name="bottom_attach">8</property>
+	  <property name="x_padding">12</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkSpinButton" id="gconf/dialogs/business/bill/days_in_advance">
+	  <property name="visible">True</property>
+	  <property name="tooltip" translatable="yes">How many days in the future to warn about Bills coming due.</property>
+	  <property name="can_focus">True</property>
+	  <property name="climb_rate">1</property>
+	  <property name="digits">0</property>
+	  <property name="numeric">True</property>
+	  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+	  <property name="snap_to_ticks">False</property>
+	  <property name="wrap">False</property>
+	  <property name="adjustment">7 1 180 1 10 10</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">3</property>
+	  <property name="right_attach">4</property>
+	  <property name="top_attach">6</property>
+	  <property name="bottom_attach">7</property>
+	  <property name="x_options"></property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkLabel" id="label15">
+	  <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/business/bill/days_in_advance</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">2</property>
+	  <property name="right_attach">3</property>
+	  <property name="top_attach">6</property>
+	  <property name="bottom_attach">7</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkCheckButton" id="gconf/dialogs/business/bill/notify_when_due">
+	  <property name="visible">True</property>
+	  <property name="tooltip" translatable="yes">Whether to display the list of Bills Due at startup.</property>
+	  <property name="can_focus">True</property>
+	  <property name="label" translatable="yes">_Notify When Due</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">2</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="GtkLabel" id="label51">
+	  <property name="visible">True</property>
+	  <property name="label" translatable="yes">&lt;b&gt;Bills&lt;/b&gt;</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">2</property>
+	  <property name="top_attach">5</property>
+	  <property name="bottom_attach">6</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkLabel" id="label50">
+	  <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">4</property>
+	  <property name="bottom_attach">5</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkCheckButton" id="gconf/dialogs/business/invoice/tax_included">
+	  <property name="visible">True</property>
+	  <property name="tooltip" translatable="yes">Whether tax is included by default in entries on Invoices. This setting is inherited by new customers and vendors.</property>
+	  <property name="can_focus">True</property>
+	  <property name="label" translatable="yes">_Tax Included</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">2</property>
+	  <property name="top_attach">3</property>
+	  <property name="bottom_attach">4</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/business/invoice/accumulate_splits">
+	  <property name="visible">True</property>
+	  <property name="tooltip" translatable="yes">Whether multiple entries in an invoice which transfer to the same account should be accumulated into a single split by default. This setting can be changed in the Post dialog.</property>
+	  <property name="can_focus">True</property>
+	  <property name="label" translatable="yes">_Accumulate splits on Post</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">2</property>
+	  <property name="top_attach">2</property>
+	  <property name="bottom_attach">3</property>
+	  <property name="x_padding">12</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkLabel" id="label14">
+	  <property name="visible">True</property>
+	  <property name="label" translatable="yes">Number of _Rows:</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>
+	</widget>
+	<packing>
+	  <property name="left_attach">2</property>
+	  <property name="right_attach">3</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="GtkSpinButton" id="gconf/dialogs/business/invoice/number_of_rows">
+	  <property name="visible">True</property>
+	  <property name="tooltip" translatable="yes">Default number of register rows to display in Invoices.</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">1 0 100 1 10 10</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">3</property>
+	  <property name="right_attach">4</property>
+	  <property name="top_attach">2</property>
+	  <property name="bottom_attach">3</property>
+	  <property name="x_options"></property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkCheckButton" id="gconf/dialogs/business/invoice/use_new_window">
+	  <property name="visible">True</property>
+	  <property name="can_focus">True</property>
+	  <property name="label" translatable="yes">_Open in new window</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">2</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>
+    </widget>
+  </child>
+</widget>
+
+</glade-interface>
Index: apps_gnucash_dialog_business_common.schemas
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-gnome/schemas/Attic/apps_gnucash_dialog_business_common.schemas,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -Lsrc/business/business-gnome/schemas/apps_gnucash_dialog_business_common.schemas -Lsrc/business/business-gnome/schemas/apps_gnucash_dialog_business_common.schemas -u -r1.1.2.2 -r1.1.2.3
--- src/business/business-gnome/schemas/apps_gnucash_dialog_business_common.schemas
+++ src/business/business-gnome/schemas/apps_gnucash_dialog_business_common.schemas
@@ -63,5 +63,90 @@
       </locale>
     </schema>
 
+    <schema>
+      <key>/schemas/apps/gnucash/dialogs/business/invoice/accumulate_splits</key>
+      <applyto>/apps/gnucash/dialogs/business/invoice/accumulate_splits</applyto>
+      <owner>gnucash</owner>
+      <type>bool</type>
+      <default>TRUE</default>
+      <locale name="C">
+        <short>Accumulate Create a new window for each new invoice.</short>
+        <long>
+	  If this field is TRUE then multiple entries in an invoice
+	  that transfer to the same account will be accumulated into a
+	  single split.  This field can be overridden per invoice in
+	  the Posting dialog.
+	</long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/gnucash/dialogs/business/tax_included</key>
+      <applyto>/apps/gnucash/dialogs/business/bill/tax_included</applyto>
+      <applyto>/apps/gnucash/dialogs/business/invoice/tax_included</applyto>
+      <owner>gnucash</owner>
+      <type>bool</type>
+      <default>TRUE</default>
+      <locale name="C">
+        <short>Is tax included ion this type of business entry?</short>
+        <long>
+	  If set to TRUE then tax is included by default in entries of
+	  this type.  This setting is inherited by new customers and
+	  vendors.
+	</long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/gnucash/dialogs/business/invoice/number_of_rows</key>
+      <applyto>/apps/gnucash/dialogs/business/invoice/number_of_rows</applyto>
+      <owner>gnucash</owner>
+      <type>float</type>
+      <default>10.0</default>
+      <locale name="C">
+        <short>The number of rows in an invoice.</short>
+        <long>
+	  This field sets the number of rows to show in an invoice.
+	  It does not actually affect the display of the contents of
+	  the window.  It is only used to set the size of the window
+	  when first opened.
+	</long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/gnucash/dialogs/business/bill/notify_when_due</key>
+      <applyto>/apps/gnucash/dialogs/business/bill/notify_when_due</applyto>
+      <owner>gnucash</owner>
+      <type>bool</type>
+      <default>TRUE</default>
+      <locale name="C">
+        <short>Show bills due reminder at startup.</short>
+        <long>
+	  If TRUE, at startup Gnucash will check to see whether any
+	  bills will become due soon.  If so, it will present the user
+	  with a reminder dialog.  The definition of "soon" is
+	  controlled by the "Days in Advance" setting.  If FALSE,
+	  gnucash does not check for due bills.
+	</long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/gnucash/dialogs/business/bill/days_in_advance</key>
+      <applyto>/apps/gnucash/dialogs/business/bill/days_in_advance</applyto>
+      <owner>gnucash</owner>
+      <type>float</type>
+      <default>7.0</default>
+      <locale name="C">
+        <short>Show bills due within this many days.</short>
+        <long>
+	  This field defines the number of days in advance that
+	  Gnucash will check for due bills.  Its value is only used if
+	  the "Notify when due" setting is TRUE.
+	</long>
+      </locale>
+    </schema>
+
   </schemalist>
 </gconfschemafile>
Index: gncEntryLedgerP.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-ledger/gncEntryLedgerP.h,v
retrieving revision 1.16.4.1
retrieving revision 1.16.4.2
diff -Lsrc/business/business-ledger/gncEntryLedgerP.h -Lsrc/business/business-ledger/gncEntryLedgerP.h -u -r1.16.4.1 -r1.16.4.2
--- src/business/business-ledger/gncEntryLedgerP.h
+++ src/business/business-ledger/gncEntryLedgerP.h
@@ -52,6 +52,8 @@
   GncEntryLedgerType type;
 
   gboolean	is_invoice;	/* is this an invoice (or a bill)? */
+
+  const gchar * gconf_section;
 };
 
 GncEntry * gnc_entry_ledger_get_entry (GncEntryLedger *ledger,
Index: gncEntryLedger.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-ledger/gncEntryLedger.c,v
retrieving revision 1.41.4.4
retrieving revision 1.41.4.5
diff -Lsrc/business/business-ledger/gncEntryLedger.c -Lsrc/business/business-ledger/gncEntryLedger.c -u -r1.41.4.4 -r1.41.4.5
--- src/business/business-ledger/gncEntryLedger.c
+++ src/business/business-ledger/gncEntryLedger.c
@@ -277,6 +277,7 @@
   ledger->type = type;
   ledger->book = book;
   ledger->traverse_to_new = TRUE;
+  ledger->gconf_section = NULL;
 
   /* Orders and Invoices are "invoices" for lookups */
   switch (type) {
@@ -841,3 +842,12 @@
 
   return ledger->query;
 }
+
+void
+gnc_entry_ledger_set_gconf_section (GncEntryLedger *ledger, const gchar *string)
+{
+  if (!ledger)
+    return;
+
+  ledger->gconf_section = string;
+}
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-ledger/Makefile.am,v
retrieving revision 1.6.4.2
retrieving revision 1.6.4.3
diff -Lsrc/business/business-ledger/Makefile.am -Lsrc/business/business-ledger/Makefile.am -u -r1.6.4.2 -r1.6.4.3
--- src/business/business-ledger/Makefile.am
+++ src/business/business-ledger/Makefile.am
@@ -19,6 +19,7 @@
 
 libgnc_business_ledger_la_LDFLAGS = -module
 libgnc_business_ledger_la_LIBADD = \
+  ${top_builddir}/src/core-utils/libcore-utils.la \
   ${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \
   ${top_builddir}/src/app-utils/libgncmod-app-utils.la \
   ${top_builddir}/src/register/register-core/libgncmod-register-core.la \
@@ -32,6 +33,7 @@
   -I${top_srcdir}/src/business/dialog-tax-table \
   -I${top_srcdir}/src \
   -I${top_srcdir}/src/engine \
+  -I${top_srcdir}/src/core-utils \
   -I${top_srcdir}/src/gnc-module \
   -I${top_srcdir}/src/app-utils \
   -I${top_srcdir}/src/gnome-utils \
Index: gncEntryLedgerLoad.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-ledger/gncEntryLedgerLoad.c,v
retrieving revision 1.28.4.3
retrieving revision 1.28.4.4
diff -Lsrc/business/business-ledger/gncEntryLedgerLoad.c -Lsrc/business/business-ledger/gncEntryLedgerLoad.c -u -r1.28.4.3 -r1.28.4.4
--- src/business/business-ledger/gncEntryLedgerLoad.c
+++ src/business/business-ledger/gncEntryLedgerLoad.c
@@ -33,6 +33,7 @@
 #include "combocell.h"
 #include "global-options.h"
 #include "gnc-component-manager.h"
+#include "gnc-gconf-utils.h"
 #include "gnc-ui-util.h"
 #include "messages.h"
 #include "recncell.h"
@@ -408,10 +409,11 @@
 	  taxincluded = FALSE;
 	  break;
 	case GNC_TAXINCLUDED_USEGLOBAL:
-	  taxincluded = gnc_lookup_boolean_option ("Business",
-						   (ledger->is_invoice ?
-						    "Invoice Tax Included?" :
-						    "Bill Tax Included?"), FALSE);
+	  if (ledger->gconf_section) {
+	    taxincluded = gnc_gconf_get_bool(ledger->gconf_section, "tax_included", NULL);
+	  } else {
+	    taxincluded = FALSE;
+	  }
 	  break;
 	}
 
Index: gncEntryLedger.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-ledger/gncEntryLedger.h,v
retrieving revision 1.22.4.4
retrieving revision 1.22.4.5
diff -Lsrc/business/business-ledger/gncEntryLedger.h -Lsrc/business/business-ledger/gncEntryLedger.h -u -r1.22.4.4 -r1.22.4.5
--- src/business/business-ledger/gncEntryLedger.h
+++ src/business/business-ledger/gncEntryLedger.h
@@ -130,4 +130,6 @@
 
 QueryNew * gnc_entry_ledger_get_query (GncEntryLedger *ledger);
 
+void gnc_entry_ledger_set_gconf_section (GncEntryLedger *ledger, const gchar *string);
+
 #endif /* GNC_ENTRY_LEDGER_H */
Index: business-prefs.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-utils/business-prefs.scm,v
retrieving revision 1.2.4.4
retrieving revision 1.2.4.5
diff -Lsrc/business/business-utils/business-prefs.scm -Lsrc/business/business-utils/business-prefs.scm -u -r1.2.4.4 -r1.2.4.5
--- src/business/business-utils/business-prefs.scm
+++ src/business/business-utils/business-prefs.scm
@@ -19,64 +19,6 @@
 ;; 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
 ;; Boston, MA  02111-1307,  USA       gnu at gnu.org
 
-(gnc:register-configuration-option
- (gnc:make-number-range-option
-  gnc:*business-label* (N_ "Number of Rows")
-  "a" (N_ "Default number of register rows to display in Invoices.")
-   10.0 ;; default
-    1.0 ;; lower bound
-  200.0 ;; upper bound
-    0.0 ;; number of decimals
-    1.0 ;; step size
-  ))
-
-(gnc:register-configuration-option
- (gnc:make-simple-boolean-option
-  gnc:*business-label* (N_ "Accumulate splits on Post?")
-  "f0" (N_ (string-append
-	   "Whether multiple entries in an invoice which transfer to "
-	   "the same account should be accumulated into a single split by default."
-	   "This setting can be changed in the Post dialog."))
-  #t))
-
-(gnc:register-configuration-option
- (gnc:make-simple-boolean-option
-  gnc:*business-label* (N_ "Invoice Tax Included?")
-  "f1" (N_ (string-append
-	   "Whether tax is included by default in entries on Invoices. "
-	   "This setting is inherited by new customers and vendors"))
-  #f))
-
-(gnc:register-configuration-option
- (gnc:make-simple-boolean-option
-  gnc:*business-label* (N_ "Bill Tax Included?")
-  "f2" (N_ (string-append
-	   "Whether tax is included by default in entries on Bills. "
-	   "This setting is inherited by new customers and vendors"))
-  #f))
-
-(gnc:register-configuration-option
- (gnc:make-complex-boolean-option
-  gnc:*business-label* (N_ "Notify Bills Due?")
-  "g" (N_ "Whether to display the list of Bills Due at startup.")
-  #t #f
-  (lambda (x) (gnc:set-option-selectable-by-name gnc:*business-label*
-						 "Bills Due Days"
-						 x))
-  ))
-
-(gnc:register-configuration-option
- (gnc:make-number-range-option
-  gnc:*business-label* (N_ "Bills Due Days")
-  "h" (N_ "How many days in the future to warn about Bills coming due.")
-    7.0 ;; default
-    1.0 ;; lower bound
-  180.0 ;; upper bound
-    0.0 ;; number of decimals
-    1.0 ;; step size
-  ))
-
-
 (define (book-options-generator options)
   (define (reg-option new-option)
     (gnc:register-option options new-option))


More information about the gnucash-changes mailing list