r23260 - gnucash/trunk/src - Gnc-Prefs: Convert gnc user warnings

Geert Janssens gjanssens at code.gnucash.org
Mon Oct 7 10:27:36 EDT 2013


Author: gjanssens
Date: 2013-10-07 10:27:34 -0400 (Mon, 07 Oct 2013)
New Revision: 23260
Trac: http://svn.gnucash.org/trac/changeset/23260

Added:
   gnucash/trunk/src/gnome-utils/gschemas/org.gnucash.warnings.gschema.xml.in
   gnucash/trunk/src/gnome-utils/make-gnc-warnings-c.xsl
   gnucash/trunk/src/gnome-utils/make-gnc-warnings-h.xsl
Removed:
   gnucash/trunk/src/gnome/gschemas/org.gnucash.warnings.gschema.xml.in
Modified:
   gnucash/trunk/src/business/business-ledger/Makefile.am
   gnucash/trunk/src/business/business-ledger/gncEntryLedger.c
   gnucash/trunk/src/business/business-ledger/gncEntryLedgerControl.c
   gnucash/trunk/src/core-utils/gnc-prefs.h
   gnucash/trunk/src/gnome-utils/Makefile.am
   gnucash/trunk/src/gnome-utils/dialog-reset-warnings.c
   gnucash/trunk/src/gnome-utils/dialog-utils.c
   gnucash/trunk/src/gnome-utils/dialog-utils.h
   gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.c
   gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.c
   gnucash/trunk/src/gnome-utils/gschemas/Makefile.am
   gnucash/trunk/src/gnome/dialog-commodities.c
   gnucash/trunk/src/gnome/dialog-price-edit-db.c
   gnucash/trunk/src/gnome/gnc-plugin-page-register.c
   gnucash/trunk/src/gnome/gnc-plugin-page-register2.c
   gnucash/trunk/src/gnome/gnc-split-reg.c
   gnucash/trunk/src/gnome/gnc-split-reg2.c
   gnucash/trunk/src/gnome/gschemas/Makefile.am
   gnucash/trunk/src/register/ledger-core/Makefile.am
   gnucash/trunk/src/register/ledger-core/split-register-control.c
   gnucash/trunk/src/register/ledger-core/split-register-model.c
   gnucash/trunk/src/register/ledger-core/split-register.c
Log:
Gnc-Prefs: Convert gnc user warnings

This is a little more involved that a simple
find/replace of gconf->gsettings functions.

Gsettings doesn't allow introspection on the schema
like gconf does. So we need another way to extract
the warnings' summaries and long descriptions to
show the user. To fix this, a new set of source
files is auto-generated based on the gsettings schema
source file for the warnings: gnc-warnings.[ch]

gnc-warnings.c: contains an array of warning
description structs and the implementation of
an accessor function. The array is to be assumed
read only

gnc-warnings.h: defines each warning using #define
and exposes the accessor function to the rest of the
source tree.

The two source files are constructed using an xsl
transformation on the gsettings schema source file.
This is done using the tool xsltproc, which should
already be available on each platform GnuCash supports
because it gets installed together with libxml2,
which is already a required dependency for GnuCash.

Modified: gnucash/trunk/src/business/business-ledger/Makefile.am
===================================================================
--- gnucash/trunk/src/business/business-ledger/Makefile.am	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/business/business-ledger/Makefile.am	2013-10-07 14:27:34 UTC (rev 23260)
@@ -30,6 +30,7 @@
 
 AM_CPPFLAGS = \
   -I${top_srcdir}/src \
+  -I${top_builddir}/src \
   -I${top_srcdir}/src/engine \
   -I${top_srcdir}/src/core-utils \
   -I${top_srcdir}/src/gnc-module \

Modified: gnucash/trunk/src/business/business-ledger/gncEntryLedger.c
===================================================================
--- gnucash/trunk/src/business/business-ledger/gncEntryLedger.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/business/business-ledger/gncEntryLedger.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -37,6 +37,7 @@
 
 #include "gnc-component-manager.h"
 #include "gnc-ui.h"
+#include "gnome-utils/gnc-warnings.h"
 
 #include "gncEntry.h"
 #include "gncEntryLedger.h"
@@ -45,6 +46,7 @@
 #include "gncEntryLedgerModel.h"
 #include "gncEntryLedgerControl.h"
 
+
 /** Static Functions ***************************************************/
 
 static void
@@ -910,7 +912,7 @@
                                GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                                _("_Record"), GTK_RESPONSE_ACCEPT,
                                NULL);
-        response = gnc_dialog_run(GTK_DIALOG(dialog), "invoice_entry_duplicated");
+        response = gnc_dialog_run(GTK_DIALOG(dialog), GNC_PREF_WARN_INV_ENTRY_DUP);
         gtk_widget_destroy(dialog);
 
         if (response != GTK_RESPONSE_ACCEPT)

Modified: gnucash/trunk/src/business/business-ledger/gncEntryLedgerControl.c
===================================================================
--- gnucash/trunk/src/business/business-ledger/gncEntryLedgerControl.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/business/business-ledger/gncEntryLedgerControl.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -37,6 +37,7 @@
 #include "gnc-ui.h"
 #include "gnc-ui-util.h"
 #include "gnc-gui-query.h"
+#include "gnome-utils/gnc-warnings.h"
 #include "table-allgui.h"
 #include "pricecell.h"
 #include "dialog-tax-table.h"
@@ -45,6 +46,7 @@
 #include "gncEntryLedgerP.h"
 #include "gncEntryLedgerControl.h"
 
+
 static gboolean
 gnc_entry_ledger_save (GncEntryLedger *ledger, gboolean do_commit)
 {
@@ -889,7 +891,7 @@
                                        GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                                        _("_Record"), GTK_RESPONSE_ACCEPT,
                                        NULL);
-                response = gnc_dialog_run(GTK_DIALOG(dialog), "invoice_entry_changed");
+                response = gnc_dialog_run(GTK_DIALOG(dialog), GNC_PREF_WARN_INV_ENTRY_MOD);
                 gtk_widget_destroy(dialog);
                 break;
             }

Modified: gnucash/trunk/src/core-utils/gnc-prefs.h
===================================================================
--- gnucash/trunk/src/core-utils/gnc-prefs.h	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/core-utils/gnc-prefs.h	2013-10-07 14:27:34 UTC (rev 23260)
@@ -52,8 +52,8 @@
 #define GNC_PREFS_GROUP_GENERAL_REGISTER  "general.register"
 #define GNC_PREFS_GROUP_GENERAL_REPORT    "general.report"
 #define GNC_PREFS_GROUP_WARNINGS          "general.warnings"
-#define GNC_PREFS_GROUP_WARNINGS_TEMP     "general.warnings.temporary"
-#define GNC_PREFS_GROUP_WARNINGS_PERM     "general.warnings.permanent"
+#define GNC_PREFS_GROUP_WARNINGS_TEMP     "warnings.temporary"
+#define GNC_PREFS_GROUP_WARNINGS_PERM     "warnings.permanent"
 
 /* Preference names used across multiple modules */
 #define GNC_PREF_SAVE_GEOMETRY       "save_window_geometry"

Modified: gnucash/trunk/src/gnome/dialog-commodities.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-commodities.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome/dialog-commodities.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -38,6 +38,7 @@
 #include "gnc-ui-util.h"
 #include "gnc-gnome-utils.h"
 #include "gnc-session.h"
+#include "gnome-utils/gnc-warnings.h"
 
 
 #define DIALOG_COMMODITIES_CM_CLASS "dialog-commodities"
@@ -169,13 +170,13 @@
         message = _("This commodity has price quotes. Are "
                     "you sure you want to delete the selected "
                     "commodity and its price quotes?");
-        warning = "delete_commodity2";
+        warning = GNC_PREF_WARN_PRICE_COMM_DEL_QUOTES;
     }
     else
     {
         message = _("Are you sure you want to delete the "
                     "selected commodity?");
-        warning = "delete_commodity";
+        warning = GNC_PREF_WARN_PRICE_COMM_DEL;
     }
 
     dialog = gtk_message_dialog_new(GTK_WINDOW(cd->dialog),

Modified: gnucash/trunk/src/gnome/dialog-price-edit-db.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-price-edit-db.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome/dialog-price-edit-db.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -45,6 +45,7 @@
 #include "gnc-tree-view-price.h"
 #include "gnc-ui.h"
 #include "gnc-ui-util.h"
+#include "gnome-utils/gnc-warnings.h"
 #include "guile-util.h"
 #include "engine-helpers-guile.h"
 #include "swig-runtime.h"
@@ -198,7 +199,7 @@
                                GTK_STOCK_DELETE, GTK_RESPONSE_YES,
                                (gchar *)NULL);
         gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_YES);
-        response = gnc_dialog_run(GTK_DIALOG(dialog), "pricedb_remove_multiple");
+        response = gnc_dialog_run(GTK_DIALOG(dialog), GNC_PREF_WARN_PRICE_QUOTES_DEL);
         gtk_widget_destroy(dialog);
     }
     else

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-register.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-register.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-register.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -70,6 +70,7 @@
 #include "gnc-window.h"
 #include "gnc-main-window.h"
 #include "gnc-session.h"
+#include "gnome-utils/gnc-warnings.h"
 #include "gnucash-sheet.h"
 #include "dialog-lot-viewer.h"
 #include "Scrub.h"
@@ -2706,7 +2707,8 @@
                             "%s", message);
                     gtk_dialog_add_button(GTK_DIALOG(dialog), _("_Print checks"),
                                           GTK_RESPONSE_YES);
-                    response = gnc_dialog_run(GTK_DIALOG(dialog), "print_multi_acct_checks");
+                    response = gnc_dialog_run(GTK_DIALOG(dialog),
+                                              GNC_PREF_WARN_CHECKPRINTING_MULTI_ACCT);
                     gtk_widget_destroy(dialog);
                     if (response != GTK_RESPONSE_YES)
                     {

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-register2.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-register2.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-register2.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -81,6 +81,7 @@
 #include "gnc-window.h"
 #include "gnc-main-window.h"
 #include "gnc-session.h"
+#include "gnome-utils/gnc-warnings.h"
 #include "dialog-lot-viewer.h"
 #include "Scrub.h"
 #include "qof.h"
@@ -2618,7 +2619,8 @@
                             "%s", message);
                     gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Print checks"),
                                           GTK_RESPONSE_YES);
-                    response = gnc_dialog_run (GTK_DIALOG (dialog), "print_multi_acct_checks");
+                    response = gnc_dialog_run (GTK_DIALOG (dialog),
+                                               GNC_PREF_WARN_CHECKPRINTING_MULTI_ACCT);
                     gtk_widget_destroy (dialog);
                     if (response != GTK_RESPONSE_YES)
                     {

Modified: gnucash/trunk/src/gnome/gnc-split-reg.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-split-reg.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome/gnc-split-reg.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -49,6 +49,7 @@
 #include "gnc-pricedb.h"
 #include "gnc-ui-util.h"
 #include "gnc-ui.h"
+#include "gnome-utils/gnc-warnings.h"
 #include "gnucash-sheet.h"
 #include "table-allgui.h"
 
@@ -967,11 +968,11 @@
     {
         gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
                 "%s", recn_warn);
-        warning = "register_remove_all_splits2";
+        warning = GNC_PREF_WARN_REG_SPLIT_DEL_ALL_RECD;
     }
     else
     {
-        warning = "register_remove_all_splits";
+        warning = GNC_PREF_WARN_REG_SPLIT_DEL_ALL;
     }
 
     gtk_dialog_add_button(GTK_DIALOG(dialog),
@@ -1101,11 +1102,11 @@
         {
             gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
                     "%s", recn_warn);
-            warning = "register_delete_split2";
+            warning = GNC_PREF_WARN_REG_SPLIT_DEL_RECD;
         }
         else
         {
-            warning = "register_delete_split";
+            warning = GNC_PREF_WARN_REG_SPLIT_DEL;
         }
 
         gtk_dialog_add_button(GTK_DIALOG(dialog),
@@ -1142,11 +1143,11 @@
         {
             gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
                     "%s", recn_warn);
-            warning = "register_delete_trans2";
+            warning = GNC_PREF_WARN_REG_TRANS_DEL_RECD;
         }
         else
         {
-            warning = "register_delete_trans";
+            warning = GNC_PREF_WARN_REG_TRANS_DEL;
         }
         gtk_dialog_add_button(GTK_DIALOG(dialog),
                               GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
@@ -1988,7 +1989,7 @@
                                     "%s", read_only);
     gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
             "%s", args->string);
-    gnc_dialog_run(GTK_DIALOG(dialog), "register_read_only");
+    gnc_dialog_run(GTK_DIALOG(dialog), GNC_PREF_WARN_REG_IS_READ_ONLY);
     gtk_widget_destroy(dialog);
     g_free(args);
     return FALSE;

Modified: gnucash/trunk/src/gnome/gnc-split-reg2.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-split-reg2.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome/gnc-split-reg2.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -38,6 +38,7 @@
 
 #include "gnc-euro.h"
 #include "gnc-gconf-utils.h"
+#include "gnome-utils/gnc-warnings.h"
 #include "dialog-utils.h"
 
 #define STATE_SECTION_PREFIX "window/pages/register2/"
@@ -1037,14 +1038,14 @@
     gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
                                               "%s", message);
 
-    gnc_dialog_run (GTK_DIALOG (dialog), "accounts_payable_receivable");
+    gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_IS_ACCT_PAY_REC);
     gtk_widget_destroy (dialog);
     g_free (args);
     return FALSE;
 }
 
 
-/* This Register is an Account Payable / Recievable one */
+/* This Register is an Account Payable / Receivable one */
 static void
 gnc_split_reg2_determine_account_pr (GNCSplitReg2 *gsr)
 {
@@ -1082,7 +1083,7 @@
                                     "%s", read_only);
     gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
             "%s", args->string);
-    gnc_dialog_run (GTK_DIALOG (dialog), "register_read_only");
+    gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_IS_READ_ONLY);
     gtk_widget_destroy (dialog);
     g_free (args);
     return FALSE;

Modified: gnucash/trunk/src/gnome/gschemas/Makefile.am
===================================================================
--- gnucash/trunk/src/gnome/gschemas/Makefile.am	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome/gschemas/Makefile.am	2013-10-07 14:27:34 UTC (rev 23260)
@@ -9,7 +9,6 @@
   org.gnucash.dialogs.sxs.gschema.xml.in \
   org.gnucash.dialogs.totd.gschema.xml.in \
   org.gnucash.gschema.xml.in \
-  org.gnucash.warnings.gschema.xml.in \
   org.gnucash.window.pages.account.tree.gschema.xml.in \
   org.gnucash.window.pages.gschema.xml.in \
   org.gnucash.window.pages.register.gschema.xml.in

Deleted: gnucash/trunk/src/gnome/gschemas/org.gnucash.warnings.gschema.xml.in
===================================================================
--- gnucash/trunk/src/gnome/gschemas/org.gnucash.warnings.gschema.xml.in	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome/gschemas/org.gnucash.warnings.gschema.xml.in	2013-10-07 14:27:34 UTC (rev 23260)
@@ -1,89 +0,0 @@
-<schemalist gettext-domain="GETTEXT_PACKAGE">
-  <schema id="org.gnucash.warnings" path="/apps/gnucash/general/warnings/permanent/">
-    <key name="change_reconciled_split" type="i">
-      <default>0</default>
-      <summary>Change contents of reconciled split</summary>
-      <description>This dialog is presented before allowing you to change the contents of a reconciled split.  Allowing these changes can make it hard to perform future reconciliations.</description>
-    </key>
-    <key name="mark_split_unreconciled" type="i">
-      <default>0</default>
-      <summary>Mark transaction split as unreconciled</summary>
-      <description>This dialog is presented before allowing you to mark a transaction split as unreconciled.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</description>
-    </key>
-    <key name="register_read_only" type="i">
-      <default>0</default>
-      <summary>Read only register</summary>
-      <description>This dialog is presented when a read-only register is opened.</description>
-    </key>
-    <key name="register_delete_trans" type="i">
-      <default>0</default>
-      <summary>Delete a transaction</summary>
-      <description>This dialog is presented before allowing you to delete a transaction.</description>
-    </key>
-    <key name="register_delete_trans2" type="i">
-      <default>0</default>
-      <summary>Delete a transaction</summary>
-      <description>This dialog is presented before allowing you to delete a transaction that contains reconciled splits.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</description>
-    </key>
-    <key name="register_delete_split" type="i">
-      <default>0</default>
-      <summary>Remove a split from a transaction</summary>
-      <description>This dialog is presented before allowing you to remove a split from a transaction.</description>
-    </key>
-    <key name="register_delete_split2" type="i">
-      <default>0</default>
-      <summary>Remove a reconciled split from a transaction</summary>
-      <description>This dialog is presented before allowing you to remove a reconciled split from a transaction.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</description>
-    </key>
-    <key name="register_remove_all_splits" type="i">
-      <default>0</default>
-      <summary>Remove all the splits from a transaction</summary>
-      <description>This dialog is presented before allowing you to remove all splits from a transaction.</description>
-    </key>
-    <key name="register_remove_all_splits2" type="i">
-      <default>0</default>
-      <summary>Remove all the splits from a transaction</summary>
-      <description>This dialog is presented before allowing you to remove all splits (including some reconciled splits) from a transaction.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</description>
-    </key>
-    <key name="transaction_changed" type="i">
-      <default>0</default>
-      <summary>Commit changes to a transaction</summary>
-      <description>This dialog is presented when you attempt to move out of a modified transaction.  The changed data must be either saved or discarded.</description>
-    </key>
-    <key name="transaction_duplicated" type="i">
-      <default>0</default>
-      <summary>Duplicating a changed transaction</summary>
-      <description>This dialog is presented when you attempt to duplicate a modified transaction.  The changed data must be saved or the duplication canceled.</description>
-    </key>
-    <key name="invoice_entry_changed" type="i">
-      <default>0</default>
-      <summary>Commit changes to a invoice_entry</summary>
-      <description>This dialog is presented when you attempt to move out of a modified invoice entry.  The changed data must be either saved or discarded.</description>
-    </key>
-    <key name="invoice_entry_duplicated" type="i">
-      <default>0</default>
-      <summary>Duplicating a changed invoice_entry</summary>
-      <description>This dialog is presented when you attempt to duplicate a modified invoice entry.  The changed data must be saved or the duplication canceled.</description>
-    </key>
-    <key name="delete_commodity" type="i">
-      <default>0</default>
-      <summary>Delete a commodity</summary>
-      <description>This dialog is presented before allowing you to delete a commodity.</description>
-    </key>
-    <key name="delete_commodity2" type="i">
-      <default>0</default>
-      <summary>Delete a commodity and prices</summary>
-      <description>This dialog is presented before allowing you to delete a commodity that has price quotes attached.  Deleting the commodity will delete the quotes as well.</description>
-    </key>
-    <key name="pricedb_remove_multiple" type="i">
-      <default>0</default>
-      <summary>Delete multiple price quotes</summary>
-      <description>This dialog is presented before allowing you to delete multiple price quotes at one time.</description>
-    </key>
-    <key name="print_multi_acct_checks" type="i">
-      <default>0</default>
-      <summary>Print checks from multiple accounts</summary>
-      <description>This dialog is presented if you try to print checks from multiple accounts at the same time.</description>
-    </key>
-  </schema>
-</schemalist>

Modified: gnucash/trunk/src/gnome-utils/Makefile.am
===================================================================
--- gnucash/trunk/src/gnome-utils/Makefile.am	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome-utils/Makefile.am	2013-10-07 14:27:34 UTC (rev 23260)
@@ -99,6 +99,7 @@
   gnc-tree-view-split-reg.c \
   gnc-tree-view-sx-list.c \
   gnc-tree-view.c \
+  gnc-warnings.c \
   gnc-window.c \
   gncmod-gnome-utils.c \
   misc-gnome-utils.c \
@@ -210,6 +211,14 @@
   ${LIBXML2_LIBS} \
   ${GTK_MAC_LIBS}
 
+BUILT_SOURCES = gnc-warnings.c gnc-warnings.h
+
+gnc-warnings.c: gschemas/org.gnucash.warnings.gschema.xml.in make-gnc-warnings-c.xsl
+	xsltproc -o $@ $(srcdir)/make-gnc-warnings-c.xsl $<
+
+gnc-warnings.h: gschemas/org.gnucash.warnings.gschema.xml.in make-gnc-warnings-h.xsl
+	xsltproc -o $@ $(srcdir)/make-gnc-warnings-h.xsl $<
+
 if HAVE_X11_XLIB_H
   libgncmod_gnome_utils_la_LIBADD += -lX11
 endif
@@ -229,6 +238,8 @@
 
 EXTRA_DIST = \
   gnome-utils.i \
+  make-gnc-warnings-c.xsl \
+  make-gnc-warnings-h.xsl \
   ${gncmod_DATA} \
   ${gncscm_DATA}
 

Modified: gnucash/trunk/src/gnome-utils/dialog-reset-warnings.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-reset-warnings.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome-utils/dialog-reset-warnings.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -27,9 +27,10 @@
 #include <gtk/gtk.h>
 
 #include "dialog-utils.h"
-#include "gnc-gconf-utils.h"
 #include "gnc-engine.h"
+#include "gnc-prefs.h"
 #include "gnc-ui.h"
+#include "gnome-utils/gnc-warnings.h"
 #include "gnc-component-manager.h"
 #include "dialog-reset-warnings.h"
 
@@ -38,7 +39,6 @@
 
 #define GNC_PREFS_GROUP                 "dialogs.reset_warnings"
 #define DIALOG_RESET_WARNINGS_CM_CLASS  "reset-warnings"
-#define GCONF_ENTRY_LIST                "gconf_entries"
 #define TIPS_STRING                     "tips"
 
 typedef struct
@@ -56,12 +56,9 @@
 void gnc_reset_warnings_select_all_cb (GtkButton *button, gpointer user_data);
 void gnc_reset_warnings_unselect_all_cb (GtkButton *button, gpointer user_data);
 void gnc_reset_warnings_response_cb (GtkDialog *dialog, gint response, gpointer user_data);
-static GSList *gnc_reset_warnings_add_section (RWDialog *rw_dialog,
-        const gchar *section, GtkWidget *box);
-static void gnc_reset_warnings_release_entries (GSList *entries);
+static void gnc_reset_warnings_add_section (RWDialog *rw_dialog,
+                                            const gchar *section, GtkWidget *box);
 static void gnc_reset_warnings_update_widgets (RWDialog *rw_dialog);
-static void gnc_reset_warnings_gconf_changed (GConfClient *client, guint cnxn_id,
-        GConfEntry *entry, gpointer user_data);
 
 
 /****************************************************
@@ -140,7 +137,8 @@
 gnc_reset_warnings_apply_one (GtkWidget *widget,
                               GtkDialog *dialog)
 {
-    const char *name;
+    const gchar *pref = NULL;
+    const gchar *prefs_group = NULL;
 
     ENTER("widget %p, dialog %p", widget, dialog);
 
@@ -150,8 +148,10 @@
         return;
     }
 
-    name = gtk_widget_get_name(widget);
-    gnc_gconf_unset(NULL, name, NULL);
+    pref = gtk_widget_get_name(widget);
+    prefs_group = g_object_get_data (G_OBJECT (widget), "prefs-group");
+    if (prefs_group)
+        gnc_prefs_reset (prefs_group, pref);
     gtk_widget_destroy(widget);
     LEAVE(" ");
 }
@@ -174,25 +174,6 @@
 }
 
 
-static void
-gnc_reset_warnings_revert_changes (RWDialog *rw_dialog)
-{
-    GSList *entries, *tmp;
-    GConfEntry *entry;
-
-    ENTER("rw_dialog %p", rw_dialog);
-
-    entries = g_object_get_data(G_OBJECT(rw_dialog->dialog), GCONF_ENTRY_LIST);
-    for (tmp = entries; tmp; tmp = g_slist_next(tmp))
-    {
-        entry = tmp->data;
-        gnc_gconf_set_int (NULL, entry->key,
-                           gconf_value_get_int(entry->value), NULL);
-    }
-    LEAVE(" ");
-}
-
-
 /***************************/
 /*    Dialog Callbacks     */
 /***************************/
@@ -212,8 +193,6 @@
         break;
 
     case GTK_RESPONSE_OK:
-        gnc_gconf_remove_notification(G_OBJECT(rw_dialog->dialog), GCONF_WARNINGS,
-                                      DIALOG_RESET_WARNINGS_CM_CLASS);
         gnc_reset_warnings_apply_changes(rw_dialog);
         gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(rw_dialog->dialog));
         gnc_unregister_gui_component_by_data(DIALOG_RESET_WARNINGS_CM_CLASS,
@@ -222,9 +201,6 @@
         break;
 
     default:
-        gnc_gconf_remove_notification(G_OBJECT(rw_dialog->dialog), GCONF_WARNINGS,
-                                      DIALOG_RESET_WARNINGS_CM_CLASS);
-        gnc_reset_warnings_revert_changes(rw_dialog);
         gnc_unregister_gui_component_by_data(DIALOG_RESET_WARNINGS_CM_CLASS,
                                              rw_dialog);
         gtk_widget_destroy(GTK_WIDGET(rw_dialog->dialog));
@@ -271,44 +247,29 @@
 
 
 /***********************************************************************
- *  This call back function adds an entry to the correct dialog box.
+ *  This call back function adds a warning to the correct dialog box.
  *
  *  @internal
  *  @param rw_dialog, the data structure
- *  @param gconf entry.
+ *  @param prefs_group the preference group that holds the warning status.
+ *  @param warning a record with details for one warning.
  *  @param box, the required dialog box to update.
  ***********************************************************************/
 static void
-gnc_reset_warnings_add_one (RWDialog *rw_dialog, GConfEntry *entry, GtkWidget *box)
+gnc_reset_warnings_add_one (RWDialog *rw_dialog, const gchar *prefs_group,
+                            const GncWarningSpec *warning, GtkWidget *box)
 {
-    const gchar *name, *schema_name, *desc, *long_desc = NULL;
     GtkWidget *checkbox;
-    GConfSchema *schema = NULL;
 
-    ENTER("rw_dialog %p, entry %p, box %p", rw_dialog, entry, box);
+    ENTER("rw_dialog %p, warning %p, box %p", rw_dialog, warning, box);
 
-    name = strrchr(entry->key, '/') + 1;
-    schema_name = gconf_entry_get_schema_name(entry);
-    if (schema_name)
-        schema = gnc_gconf_get_schema(NULL, schema_name, NULL);
-    if (schema)
-    {
-        DEBUG("found schema %p", schema);
-        desc = gconf_schema_get_short_desc(schema);
-        DEBUG("description %s", desc);
-        long_desc = gconf_schema_get_long_desc(schema);
-        checkbox = gtk_check_button_new_with_label(desc ? desc : name);
-        if (long_desc)
-            gtk_widget_set_tooltip_text(checkbox, long_desc);
-        gconf_schema_free(schema);
-    }
-    else
-    {
-        DEBUG("no schema");
-        checkbox = gtk_check_button_new_with_label(name);
-    }
+    checkbox = gtk_check_button_new_with_label(warning->warn_desc ? warning->warn_desc : warning->warn_name);
+    if (warning->warn_long_desc)
+        gtk_widget_set_tooltip_text(checkbox, warning->warn_long_desc);
 
-    gtk_widget_set_name(checkbox, entry->key);
+    gtk_widget_set_name(checkbox, warning->warn_name);
+    g_object_set_data_full (G_OBJECT (checkbox), "prefs-group", g_strdup(prefs_group),
+                            (GDestroyNotify) g_free);
     g_signal_connect_swapped(G_OBJECT(checkbox), "toggled",
                              (GCallback)gnc_reset_warnings_update_widgets, rw_dialog);
     gtk_box_pack_start(GTK_BOX(box), checkbox, TRUE, TRUE, 0);
@@ -317,129 +278,35 @@
 
 
 /********************************************************************
- *  This call back function adds the gconf section
+ *  Add all warnings found in the given preference group
  *  to the dialog box.
  *
  *  @internal
  *  @param The reset warnings data structure
- *  @param The section in gconf.
+ *  @param The preference group.
  *  @param The required dialog box to update.
  ********************************************************************/
-static GSList *
-gnc_reset_warnings_add_section (RWDialog *rw_dialog, const gchar *section, GtkWidget *box)
+static void
+gnc_reset_warnings_add_section (RWDialog *rw_dialog, const gchar *prefs_group, GtkWidget *box)
 {
-    GSList *entries, *tmp;
-    GConfEntry *entry;
+    const GncWarningSpec *warning = gnc_get_warnings();
+    gint i = 0;
 
-    ENTER("rw_dialog %p, section %s, box %p", rw_dialog, section, box);
+    ENTER("rw_dialog %p, section %s, box %p", rw_dialog, prefs_group, box);
 
-    entries = gnc_gconf_client_all_entries(section);
-    for (tmp = entries; tmp; tmp = g_slist_next(tmp))
+    for (i = 0; warning[i].warn_name; i++)
     {
-        entry = tmp->data;
-        if (gconf_value_get_int(entry->value) != 0)
+        if (gnc_prefs_get_int(prefs_group, warning[i].warn_name) != 0)
         {
-            gnc_reset_warnings_add_one(rw_dialog, entry, box);
+            gnc_reset_warnings_add_one(rw_dialog, prefs_group, &warning[i], box);
         }
     }
 
     LEAVE(" ");
-    return entries;
 }
 
 
-/****************************************
- * Reset Functions for closure
- ****************************************/
-static void
-gnc_reset_warnings_release_entries (GSList *entries)
-{
-    GSList *tmp;
-
-    ENTER(" ");
-    for (tmp = entries; tmp; tmp = g_slist_next(tmp))
-    {
-        gconf_entry_free(tmp->data);
-    }
-    g_slist_free(entries);
-    LEAVE(" ");
-}
-
-
-static void
-gnc_reset_warnings_find_remove (GtkWidget *widget,
-                                const gchar *name)
-{
-    ENTER("widget %p, name %s", widget, name);
-
-    if (strcmp(gtk_widget_get_name(widget), name) == 0)
-    {
-        DEBUG("destroying widget %s", name);
-        gtk_widget_destroy(widget);
-    }
-    LEAVE(" ");
-}
-
-
 /***********************************************************************
- *  This call back function is triggered when warning gconf entries
- *  are changed.
- *
- *  @internal
- *  @param The gconf client unused.
- *  @param The gconf client connection id.
- *  @param The gconf entry.
- *  @param The user_data points to the dialog.
- ***********************************************************************/
-static void
-gnc_reset_warnings_gconf_changed (GConfClient *client,
-                                  guint cnxn_id,
-                                  GConfEntry *entry,
-                                  gpointer user_data)
-{
-    RWDialog *rw_dialog = g_object_get_data(G_OBJECT(user_data), "dialog-structure");
-
-    GtkWidget *box;
-    GList     *list;
-
-    ENTER("rw_dialog %p, entry %p, user_data %p", rw_dialog, entry, user_data);
-
-    g_return_if_fail(GTK_IS_DIALOG(rw_dialog->dialog));
-
-    DEBUG("entry key '%s', value as %p, value as int %d", entry->key, entry->value, gconf_value_get_int(entry->value));
-
-    /* Which box is affected */
-    if (strstr(entry->key, "permanent") != 0)
-    {
-        box = rw_dialog->perm_vbox;
-    }
-    else
-    {
-        box = rw_dialog->temp_vbox;
-    }
-
-    if (gconf_value_get_int(entry->value) != 0)
-    {
-        gnc_reset_warnings_add_one (rw_dialog, entry, box);
-        DEBUG("added checkbox for %s", entry->key);
-    }
-    else
-    {
-        /* Don't know if we were invoked by the dialog removing the
-         * warning, or if the remove happened somewhere else like
-         * gconf-editor.  Can't hurt to run the widgets and try to remove
-         * it.  Worst case we can't find it because its already been
-         * deleted. */
-        list = gtk_container_get_children(GTK_CONTAINER(box));
-        g_list_foreach(list, (GFunc)gnc_reset_warnings_find_remove, entry->key);
-        g_list_free(list);
-    }
-    gnc_reset_warnings_update_widgets(rw_dialog);
-    LEAVE(" ");
-}
-
-
-/***********************************************************************
  *  Raise the rw dialog to the top of the window stack.  This
  *  function is called if the user attempts to create a second rw
  *  dialog.
@@ -498,8 +365,6 @@
     GtkWidget  *dialog;
     GtkBuilder *builder;
 
-    GSList *perm_list, *temp_list;
-
     rw_dialog = g_new0 (RWDialog, 1);
 
     ENTER("");
@@ -526,32 +391,24 @@
     DEBUG("permanent");
     rw_dialog->perm_vbox_label = GTK_WIDGET(gtk_builder_get_object (builder, "perm_vbox_and_label"));
     rw_dialog->perm_vbox = GTK_WIDGET(gtk_builder_get_object (builder, "perm_vbox"));
-    perm_list = gnc_reset_warnings_add_section(rw_dialog, GCONF_WARNINGS_PERM, rw_dialog->perm_vbox);
+    gnc_reset_warnings_add_section(rw_dialog, GNC_PREFS_GROUP_WARNINGS_PERM, rw_dialog->perm_vbox);
 
     DEBUG("temporary");
     rw_dialog->temp_vbox_label = GTK_WIDGET(gtk_builder_get_object (builder, "temp_vbox_and_label"));
     rw_dialog->temp_vbox = GTK_WIDGET(gtk_builder_get_object (builder, "temp_vbox"));
-    temp_list = gnc_reset_warnings_add_section(rw_dialog, GCONF_WARNINGS_TEMP, rw_dialog->temp_vbox);
+    gnc_reset_warnings_add_section(rw_dialog, GNC_PREFS_GROUP_WARNINGS_TEMP, rw_dialog->temp_vbox);
 
     rw_dialog->buttonbox = GTK_WIDGET(gtk_builder_get_object (builder, "hbuttonbox"));
 
     rw_dialog->nolabel = GTK_WIDGET(gtk_builder_get_object (builder, "no_warnings"));
     rw_dialog->applybutton = GTK_WIDGET(gtk_builder_get_object (builder, "applybutton"));
 
-    g_object_set_data_full(G_OBJECT(rw_dialog->dialog), GCONF_ENTRY_LIST,
-                           g_slist_concat (perm_list, temp_list),
-                           (GDestroyNotify)gnc_reset_warnings_release_entries);
-
-    /* Populate the dialog boxes with the gconf entries */
+    /* Enable the proper response buttons */
     gnc_reset_warnings_update_widgets(rw_dialog);
 
-    /* Record the pointer to the rw data structure and claen up after */
+    /* Record the pointer to the rw data structure and clean up after */
     g_object_set_data_full(G_OBJECT(rw_dialog->dialog), "dialog-structure", rw_dialog, g_free);
 
-    gnc_gconf_add_notification(G_OBJECT(rw_dialog->dialog), GCONF_WARNINGS,
-                               gnc_reset_warnings_gconf_changed,
-                               DIALOG_RESET_WARNINGS_CM_CLASS);
-
     gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(rw_dialog->dialog));
 
     gnc_register_gui_component (DIALOG_RESET_WARNINGS_CM_CLASS,

Modified: gnucash/trunk/src/gnome-utils/dialog-utils.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-utils.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome-utils/dialog-utils.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -39,7 +39,6 @@
 #include "gnc-engine.h"
 #include "gnc-euro.h"
 #include "gnc-ui-util.h"
-#include "gnc-gconf-utils.h"
 #include "gnc-prefs.h"
 #include "guile-util.h"
 #include "gnc-main-window.h"
@@ -510,7 +509,7 @@
 }
 
 gint
-gnc_dialog_run (GtkDialog *dialog, const gchar *gconf_key)
+gnc_dialog_run (GtkDialog *dialog, const gchar *pref_name)
 {
     GtkWidget *perm, *temp;
     gboolean ask = TRUE;
@@ -518,10 +517,10 @@
 
     /* Does the user want to see this question? If not, return the
      * previous answer. */
-    response = gnc_gconf_get_int(GCONF_WARNINGS_PERM, gconf_key, NULL);
+    response = gnc_prefs_get_int(GNC_PREFS_GROUP_WARNINGS_PERM, pref_name);
     if (response != 0)
         return response;
-    response = gnc_gconf_get_int(GCONF_WARNINGS_TEMP, gconf_key, NULL);
+    response = gnc_prefs_get_int(GNC_PREFS_GROUP_WARNINGS_TEMP, pref_name);
     if (response != 0)
         return response;
 
@@ -564,11 +563,11 @@
         /* Save the answer? */
         if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(perm)))
         {
-            gnc_gconf_set_int(GCONF_WARNINGS_PERM, gconf_key, response, NULL);
+            gnc_prefs_set_int(GNC_PREFS_GROUP_WARNINGS_PERM, pref_name, response);
         }
         else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(temp)))
         {
-            gnc_gconf_set_int(GCONF_WARNINGS_TEMP, gconf_key, response, NULL);
+            gnc_prefs_set_int(GNC_PREFS_GROUP_WARNINGS_TEMP, pref_name, response);
         }
     }
     return response;

Modified: gnucash/trunk/src/gnome-utils/dialog-utils.h
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-utils.h	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome-utils/dialog-utils.h	2013-10-07 14:27:34 UTC (rev 23260)
@@ -97,7 +97,7 @@
 /** Note: This dialog is modal!  (It calls gtk_dialog_run() which is modal.)
  */
 gint
-gnc_dialog_run(GtkDialog *dialog, const gchar *gconf_key);
+gnc_dialog_run(GtkDialog *dialog, const gchar *pref_key);
 
 /* If this is a new book, this function can be used to display book options
  * dialog so user can specify options, before any transactions can be

Modified: gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -39,6 +39,7 @@
 #include "gnc-ui.h"
 #include "gnc-prefs.h"
 #include "gnc-gdate-utils.h"
+#include "gnome-utils/gnc-warnings.h"
 #include "dialog-utils.h"
 #include "dialog-dup-trans.h"
 #include "dialog-account.h"
@@ -146,7 +147,7 @@
                 "%s", message);
         gtk_dialog_add_button (GTK_DIALOG (dialog),
                               _("_Record"), GTK_RESPONSE_ACCEPT);
-        response = gnc_dialog_run (GTK_DIALOG (dialog), "transaction_being_edited");
+        response = gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_TRANS_MOD);
         gtk_widget_destroy (dialog);
 
         if (response != GTK_RESPONSE_ACCEPT)
@@ -870,11 +871,11 @@
     {
         gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
                 "%s", recn_warn);
-        warning = "register_remove_all_splits2";
+        warning = GNC_PREF_WARN_REG_SPLIT_DEL_ALL_RECD;
     }
     else
     {
-        warning = "register_remove_all_splits";
+        warning = GNC_PREF_WARN_REG_SPLIT_DEL_ALL;
     }
 
     gtk_dialog_add_button (GTK_DIALOG (dialog),
@@ -1007,11 +1008,11 @@
         {
             gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
                     "%s", recn_warn);
-            warning = "register_delete_split2";
+            warning = GNC_PREF_WARN_REG_SPLIT_DEL_RECD;
         }
         else
         {
-            warning = "register_delete_split";
+            warning = GNC_PREF_WARN_REG_SPLIT_DEL;
         }
 
         gtk_dialog_add_button (GTK_DIALOG (dialog),
@@ -1048,11 +1049,11 @@
         {
             gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
                     "%s", recn_warn);
-            warning = "register_delete_trans2";
+            warning = GNC_PREF_WARN_REG_TRANS_DEL_RECD;
         }
         else
         {
-            warning = "register_delete_trans";
+            warning = GNC_PREF_WARN_REG_TRANS_DEL;
         }
         gtk_dialog_add_button (GTK_DIALOG (dialog),
                               GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
@@ -1820,7 +1821,7 @@
             "%s", message);
     gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Unreconcile"),
                           GTK_RESPONSE_YES);
-    response = gnc_dialog_run (GTK_DIALOG (dialog), "mark_split_unreconciled");
+    response = gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_RECD_SPLIT_UNREC);
     gtk_widget_destroy (dialog);
 
     if (response == GTK_RESPONSE_YES)
@@ -1928,7 +1929,7 @@
                 "%s", message);
         gtk_dialog_add_button (GTK_DIALOG (dialog), _("Chan_ge Split"),
                               GTK_RESPONSE_YES);
-        response = gnc_dialog_run (GTK_DIALOG (dialog), "change_reconciled_split");
+        response = gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_RECD_SPLIT_MOD);
         gtk_widget_destroy (dialog);
 
         if (response != GTK_RESPONSE_YES)

Modified: gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -38,6 +38,7 @@
 #include "gnc-tree-control-split-reg.h"
 #include "gnc-tree-util-split-reg.h"
 #include "gnc-ui.h"
+#include "gnome-utils/gnc-warnings.h"
 #include "dialog-utils.h"
 #include "gnc-prefs.h"
 #include "Transaction.h"
@@ -2453,7 +2454,7 @@
                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                             _("_Record Changes"), GTK_RESPONSE_ACCEPT, NULL);
 
-    response = gnc_dialog_run (GTK_DIALOG (dialog), "transaction_changed");
+    response = gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_TRANS_MOD);
     gtk_widget_destroy (dialog);
 
     switch (response)

Modified: gnucash/trunk/src/gnome-utils/gschemas/Makefile.am
===================================================================
--- gnucash/trunk/src/gnome-utils/gschemas/Makefile.am	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/gnome-utils/gschemas/Makefile.am	2013-10-07 14:27:34 UTC (rev 23260)
@@ -1,7 +1,8 @@
 @INTLTOOL_XML_NOMERGE_RULE@
 
 gschema_in_files = \
-  org.gnucash.history.gschema.xml.in
+  org.gnucash.history.gschema.xml.in \
+  org.gnucash.warnings.gschema.xml.in
 
 gsettings_SCHEMAS = $(gschema_in_files:.gschema.xml.in=.gschema.xml)
 

Added: gnucash/trunk/src/gnome-utils/gschemas/org.gnucash.warnings.gschema.xml.in
===================================================================
--- gnucash/trunk/src/gnome-utils/gschemas/org.gnucash.warnings.gschema.xml.in	                        (rev 0)
+++ gnucash/trunk/src/gnome-utils/gschemas/org.gnucash.warnings.gschema.xml.in	2013-10-07 14:27:34 UTC (rev 23260)
@@ -0,0 +1,191 @@
+<schemalist gettext-domain="GETTEXT_PACKAGE">
+  <schema id="org.gnucash.warnings" path="/apps/gnucash/warnings/">
+    <child name="permanent" schema="org.gnucash.warnings.permanent"/>
+    <child name="temporary" schema="org.gnucash.warnings.temporary"/>
+  </schema>
+  <schema id="org.gnucash.warnings.permanent" path="/apps/gnucash/warnings/permanent/">
+    <key name="checkprinting_multi_acct" type="i">
+      <default>0</default>
+      <summary>Print checks from multiple accounts</summary>
+      <description>This dialog is presented if you try to print checks from multiple accounts at the same time.</description>
+    </key>
+    <key name="inv_entry_mod" type="i">
+      <default>0</default>
+      <summary>Commit changes to a invoice_entry</summary>
+      <description>This dialog is presented when you attempt to move out of a modified invoice entry.  The changed data must be either saved or discarded.</description>
+    </key>
+    <key name="inv_entry_dup" type="i">
+      <default>0</default>
+      <summary>Duplicating a changed invoice_entry</summary>
+      <description>This dialog is presented when you attempt to duplicate a modified invoice entry.  The changed data must be saved or the duplication canceled.</description>
+    </key>
+    <key name="price_comm_del" type="i">
+      <default>0</default>
+      <summary>Delete a commodity</summary>
+      <description>This dialog is presented before allowing you to delete a commodity.</description>
+    </key>
+    <key name="price_comm_del_quotes" type="i">
+      <default>0</default>
+      <summary>Delete a commodity with price quotes</summary>
+      <description>This dialog is presented before allowing you to delete a commodity that has price quotes attached.  Deleting the commodity will delete the quotes as well.</description>
+    </key>
+    <key name="price_quotes_del" type="i">
+      <default>0</default>
+      <summary>Delete multiple price quotes</summary>
+      <description>This dialog is presented before allowing you to delete multiple price quotes at one time.</description>
+    </key>
+    <key name="reg_is_acct_pay_rec" type="i">
+      <default>0</default>
+      <summary>Edit account payable/accounts receivable register</summary>
+      <description>This dialog is presented before allowing you to edit an accounts payable/accounts receivable account. These account types are reserved for the business features and should rarely be manipulated manually.</description>
+    </key>
+    <key name="reg_is_read_only" type="i">
+      <default>0</default>
+      <summary>Read only register</summary>
+      <description>This dialog is presented when a read-only register is opened.</description>
+    </key>
+    <key name="reg_recd_split_mod" type="i">
+      <default>0</default>
+      <summary>Change contents of reconciled split</summary>
+      <description>This dialog is presented before allowing you to change the contents of a reconciled split.  Allowing these changes can make it hard to perform future reconciliations.</description>
+    </key>
+    <key name="reg_recd_split_unrec" type="i">
+      <default>0</default>
+      <summary>Mark transaction split as unreconciled</summary>
+      <description>This dialog is presented before allowing you to mark a transaction split as unreconciled.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</description>
+    </key>
+    <key name="reg_split_del" type="i">
+      <default>0</default>
+      <summary>Remove a split from a transaction</summary>
+      <description>This dialog is presented before allowing you to remove a split from a transaction.</description>
+    </key>
+    <key name="reg_split_del_recd" type="i">
+      <default>0</default>
+      <summary>Remove a reconciled split from a transaction</summary>
+      <description>This dialog is presented before allowing you to remove a reconciled split from a transaction.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</description>
+    </key>
+    <key name="reg_split_del_all" type="i">
+      <default>0</default>
+      <summary>Remove all the splits from a transaction</summary>
+      <description>This dialog is presented before allowing you to remove all splits from a transaction.</description>
+    </key>
+    <key name="reg_split_del_all_recd" type="i">
+      <default>0</default>
+      <summary>Remove all the splits from a transaction</summary>
+      <description>This dialog is presented before allowing you to remove all splits (including some reconciled splits) from a transaction.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</description>
+    </key>
+    <key name="reg_trans_del" type="i">
+      <default>0</default>
+      <summary>Delete a transaction</summary>
+      <description>This dialog is presented before allowing you to delete a transaction.</description>
+    </key>
+    <key name="reg_trans_del_recd" type="i">
+      <default>0</default>
+      <summary>Delete a transaction with reconciled splits</summary>
+      <description>This dialog is presented before allowing you to delete a transaction that contains reconciled splits.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</description>
+    </key>
+    <key name="reg_trans_dup" type="i">
+      <default>0</default>
+      <summary>Duplicating a changed transaction</summary>
+      <description>This dialog is presented when you attempt to duplicate a modified transaction.  The changed data must be saved or the duplication canceled.</description>
+    </key>
+    <key name="reg_trans_mod" type="i">
+      <default>0</default>
+      <summary>Commit changes to a transaction</summary>
+      <description>This dialog is presented when you attempt to move out of a modified transaction.  The changed data must be either saved or discarded.</description>
+    </key>
+  </schema>
+  
+  <schema id="org.gnucash.warnings.temporary" path="/apps/gnucash/warnings/temporary/">
+    <key name="checkprinting_multi_acct" type="i">
+      <default>0</default>
+      <summary>Print checks from multiple accounts</summary>
+      <description>This dialog is presented if you try to print checks from multiple accounts at the same time.</description>
+    </key>
+    <key name="inv_entry_mod" type="i">
+      <default>0</default>
+      <summary>Commit changes to a invoice_entry</summary>
+      <description>This dialog is presented when you attempt to move out of a modified invoice entry.  The changed data must be either saved or discarded.</description>
+    </key>
+    <key name="inv_entry_dup" type="i">
+      <default>0</default>
+      <summary>Duplicating a changed invoice_entry</summary>
+      <description>This dialog is presented when you attempt to duplicate a modified invoice entry.  The changed data must be saved or the duplication canceled.</description>
+    </key>
+    <key name="price_comm_del" type="i">
+      <default>0</default>
+      <summary>Delete a commodity</summary>
+      <description>This dialog is presented before allowing you to delete a commodity.</description>
+    </key>
+    <key name="price_comm_del_quotes" type="i">
+      <default>0</default>
+      <summary>Delete a commodity with price quotes</summary>
+      <description>This dialog is presented before allowing you to delete a commodity that has price quotes attached.  Deleting the commodity will delete the quotes as well.</description>
+    </key>
+    <key name="price_quotes_del" type="i">
+      <default>0</default>
+      <summary>Delete multiple price quotes</summary>
+      <description>This dialog is presented before allowing you to delete multiple price quotes at one time.</description>
+    </key>
+    <key name="reg_is_acct_pay_rec" type="i">
+      <default>0</default>
+      <summary>Edit account payable/accounts receivable register</summary>
+      <description>This dialog is presented before allowing you to edit an accounts payable/accounts receivable account. These account types are reserved for the business features and should rarely be manipulated manually.</description>
+    </key>
+    <key name="reg_is_read_only" type="i">
+      <default>0</default>
+      <summary>Read only register</summary>
+      <description>This dialog is presented when a read-only register is opened.</description>
+    </key>
+    <key name="reg_recd_split_mod" type="i">
+      <default>0</default>
+      <summary>Change contents of reconciled split</summary>
+      <description>This dialog is presented before allowing you to change the contents of a reconciled split.  Allowing these changes can make it hard to perform future reconciliations.</description>
+    </key>
+    <key name="reg_recd_split_unrec" type="i">
+      <default>0</default>
+      <summary>Mark transaction split as unreconciled</summary>
+      <description>This dialog is presented before allowing you to mark a transaction split as unreconciled.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</description>
+    </key>
+    <key name="reg_split_del" type="i">
+      <default>0</default>
+      <summary>Remove a split from a transaction</summary>
+      <description>This dialog is presented before allowing you to remove a split from a transaction.</description>
+    </key>
+    <key name="reg_split_del_recd" type="i">
+      <default>0</default>
+      <summary>Remove a reconciled split from a transaction</summary>
+      <description>This dialog is presented before allowing you to remove a reconciled split from a transaction.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</description>
+    </key>
+    <key name="reg_split_del_all" type="i">
+      <default>0</default>
+      <summary>Remove all the splits from a transaction</summary>
+      <description>This dialog is presented before allowing you to remove all splits from a transaction.</description>
+    </key>
+    <key name="reg_split_del_all_recd" type="i">
+      <default>0</default>
+      <summary>Remove all the splits from a transaction</summary>
+      <description>This dialog is presented before allowing you to remove all splits (including some reconciled splits) from a transaction.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</description>
+    </key>
+    <key name="reg_trans_del" type="i">
+      <default>0</default>
+      <summary>Delete a transaction</summary>
+      <description>This dialog is presented before allowing you to delete a transaction.</description>
+    </key>
+    <key name="reg_trans_del_recd" type="i">
+      <default>0</default>
+      <summary>Delete a transaction with reconciled splits</summary>
+      <description>This dialog is presented before allowing you to delete a transaction that contains reconciled splits.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</description>
+    </key>
+    <key name="reg_trans_dup" type="i">
+      <default>0</default>
+      <summary>Duplicating a changed transaction</summary>
+      <description>This dialog is presented when you attempt to duplicate a modified transaction.  The changed data must be saved or the duplication canceled.</description>
+    </key>
+    <key name="reg_trans_mod" type="i">
+      <default>0</default>
+      <summary>Commit changes to a transaction</summary>
+      <description>This dialog is presented when you attempt to move out of a modified transaction.  The changed data must be either saved or discarded.</description>
+    </key>
+  </schema>
+</schemalist>

Added: gnucash/trunk/src/gnome-utils/make-gnc-warnings-c.xsl
===================================================================
--- gnucash/trunk/src/gnome-utils/make-gnc-warnings-c.xsl	                        (rev 0)
+++ gnucash/trunk/src/gnome-utils/make-gnc-warnings-c.xsl	2013-10-07 14:27:34 UTC (rev 23260)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="text" encoding="UTF8"/>
+
+<xsl:template match="/">
+/********************************************************************\
+ * gnc-warnings.c -- overview of warning messages that can be       *
+ *                  displayed to the user always or once.           *
+ *                                                                  *
+ * ATTENTION: this file is autogenerated based on the gsettings     *
+ *            schema file org.gnucash.warnings.gschema.xml.in       *
+ *                                                                  *
+ * If you need any modifications in this file, please update the    *
+ * schema source file (or the xsl translation file depending on the *
+ * kind of change required) instead.                                *
+ *                                                                  *
+ * Copyright (C) 2013 Geert Janssens <geert at kobaltwit.be>           *
+ *                                                                  *
+ * 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       *
+ * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
+ * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
+ *                                                                  *
+\********************************************************************/
+
+
+#include <gnc-warnings.h>
+
+static GncWarningSpec warning_spec [] =
+{<xsl:for-each select="//schema[@id='org.gnucash.warnings.permanent']/key">
+  { GNC_PREF_WARN_<xsl:value-of select="translate(@name,$smallcase,$uppercase)"/>,
+    "<xsl:value-of select="summary"/>",
+    "<xsl:value-of select="description"/>",
+  },</xsl:for-each>
+  { NULL }
+};
+
+const GncWarningSpec *gnc_get_warnings (void)
+{
+    return warning_spec;
+}
+</xsl:template>
+<xsl:variable name="smallcase" select="'-abcdefghijklmnopqrstuvwxyz'" />
+<xsl:variable name="uppercase" select="'_ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
+
+</xsl:stylesheet> 
\ No newline at end of file

Added: gnucash/trunk/src/gnome-utils/make-gnc-warnings-h.xsl
===================================================================
--- gnucash/trunk/src/gnome-utils/make-gnc-warnings-h.xsl	                        (rev 0)
+++ gnucash/trunk/src/gnome-utils/make-gnc-warnings-h.xsl	2013-10-07 14:27:34 UTC (rev 23260)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="text" encoding="UTF8"/>
+
+<xsl:template match="/">
+/********************************************************************\
+ * gnc-warnings.h -- overview of warning messages that can be       *
+ *                  displayed to the user always or once.           *
+ *                                                                  *
+ * ATTENTION: this file is autogenerated based on the gsettings     *
+ *            schema file org.gnucash.warnings.gschema.xml.in       *
+ *                                                                  *
+ * If you need any modifications in this file, please update the    *
+ * schema source file (or the xsl translation file depending on the *
+ * kind of change required) instead.                                *
+ *                                                                  *
+ * Copyright (C) 2013 Geert Janssens <geert at kobaltwit.be>           *
+ *                                                                  *
+ * 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       *
+ * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
+ * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
+ *                                                                  *
+\********************************************************************/
+
+#ifndef GNC_WARNINGS_H
+#define GNC_WARNINGS_H
+
+#include <glib.h>
+
+<xsl:for-each select="//schema[@id='org.gnucash.warnings.permanent']/key">
+#define GNC_PREF_WARN_<xsl:value-of select="translate(@name,$smallcase,$uppercase)"/> "<xsl:value-of select="@name"/>"</xsl:for-each>
+
+enum {<xsl:for-each select="//schema[@id='org.gnucash.warnings.permanent']/key">
+    WARN_<xsl:value-of select="translate(@name,$smallcase,$uppercase)"/>,</xsl:for-each>
+};
+
+typedef struct GncWarningSpec
+{
+  const gchar *warn_name;
+  const gchar *warn_desc;
+  const gchar *warn_long_desc;
+} GncWarningSpec;
+
+const GncWarningSpec *gnc_get_warnings (void);
+
+#endif /* GNC_WARNINGS_H */
+</xsl:template>
+<xsl:variable name="smallcase" select="'-abcdefghijklmnopqrstuvwxyz'" />
+<xsl:variable name="uppercase" select="'_ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
+
+</xsl:stylesheet> 
\ No newline at end of file

Modified: gnucash/trunk/src/register/ledger-core/Makefile.am
===================================================================
--- gnucash/trunk/src/register/ledger-core/Makefile.am	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/register/ledger-core/Makefile.am	2013-10-07 14:27:34 UTC (rev 23260)
@@ -41,6 +41,7 @@
 
 AM_CPPFLAGS = \
   -I${top_srcdir}/src \
+  -I${top_builddir}/src \
   -I${top_srcdir}/src/engine \
   -I${top_srcdir}/src/gnc-module \
   -I${top_srcdir}/src/core-utils \

Modified: gnucash/trunk/src/register/ledger-core/split-register-control.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register-control.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/register/ledger-core/split-register-control.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -30,6 +30,7 @@
 #include "gnc-component-manager.h"
 #include "gnc-prefs.h"
 #include "gnc-ui.h"
+#include "gnome-utils/gnc-warnings.h"
 #include "pricecell.h"
 #include "datecell.h"
 #include "dialog-transfer.h"
@@ -1546,7 +1547,7 @@
                            GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                            _("_Record Changes"), GTK_RESPONSE_ACCEPT,
                            NULL);
-    response = gnc_dialog_run(GTK_DIALOG(dialog), "transaction_changed");
+    response = gnc_dialog_run(GTK_DIALOG(dialog), GNC_PREF_WARN_REG_TRANS_MOD);
     gtk_widget_destroy(dialog);
 
     switch (response)
@@ -1845,7 +1846,7 @@
             "%s", message);
     gtk_dialog_add_button(GTK_DIALOG(dialog), _("_Unreconcile"),
                           GTK_RESPONSE_YES);
-    response = gnc_dialog_run(GTK_DIALOG(dialog), "mark_split_unreconciled");
+    response = gnc_dialog_run(GTK_DIALOG(dialog), GNC_PREF_WARN_REG_RECD_SPLIT_UNREC);
     gtk_widget_destroy(dialog);
     return (response == GTK_RESPONSE_YES);
 }

Modified: gnucash/trunk/src/register/ledger-core/split-register-model.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register-model.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/register/ledger-core/split-register-model.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -30,6 +30,7 @@
 #include "gnc-engine.h"
 #include "gnc-prefs.h"
 #include "gnc-ui.h"
+#include "gnome-utils/gnc-warnings.h"
 #include "pricecell.h"
 #include "recncell.h"
 #include "split-register.h"
@@ -2062,7 +2063,7 @@
                 "%s", message);
         gtk_dialog_add_button(GTK_DIALOG(dialog), _("Chan_ge Split"),
                               GTK_RESPONSE_YES);
-        response = gnc_dialog_run(GTK_DIALOG(dialog), "change_reconciled_split");
+        response = gnc_dialog_run(GTK_DIALOG(dialog), GNC_PREF_WARN_REG_RECD_SPLIT_MOD);
         gtk_widget_destroy(dialog);
         if (response != GTK_RESPONSE_YES)
             return FALSE;

Modified: gnucash/trunk/src/register/ledger-core/split-register.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register.c	2013-10-07 14:27:02 UTC (rev 23259)
+++ gnucash/trunk/src/register/ledger-core/split-register.c	2013-10-07 14:27:34 UTC (rev 23260)
@@ -37,6 +37,7 @@
 #include "gnc-ledger-display.h"
 #include "gnc-prefs.h"
 #include "gnc-ui.h"
+#include "gnome-utils/gnc-warnings.h"
 #include "guile-util.h"
 #include "numcell.h"
 #include "pricecell.h"
@@ -463,7 +464,7 @@
                 "%s", message);
         gtk_dialog_add_button(GTK_DIALOG(dialog),
                               _("_Record"), GTK_RESPONSE_ACCEPT);
-        response = gnc_dialog_run(GTK_DIALOG(dialog), "transaction_duplicated");
+        response = gnc_dialog_run(GTK_DIALOG(dialog), GNC_PREF_WARN_REG_TRANS_DUP);
         gtk_widget_destroy(dialog);
 
         if (response != GTK_RESPONSE_ACCEPT)



More information about the gnucash-changes mailing list