[Gnucash-changes] Use the new dialog that remembers whether or not it should suppress

David Hampton hampton at cvs.gnucash.org
Wed Jul 20 17:21:24 EDT 2005


Log Message:
-----------
Use the new dialog that remembers whether or not it should suppress
further instances.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash/src/register/ledger-core:
        split-register-control.c
        split-register-model.c
    gnucash/src/gnome/schemas:
        Makefile.am

Added Files:
-----------
    gnucash/src/gnome/schemas:
        apps_gnucash_warnings.schemas

Revision Data
-------------
Index: split-register-control.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/register/ledger-core/split-register-control.c,v
retrieving revision 1.43.2.5
retrieving revision 1.43.2.6
diff -Lsrc/register/ledger-core/split-register-control.c -Lsrc/register/ledger-core/split-register-control.c -u -r1.43.2.5 -r1.43.2.6
--- src/register/ledger-core/split-register-control.c
+++ src/register/ledger-core/split-register-control.c
@@ -1537,23 +1537,21 @@
 gnc_split_register_recn_cell_confirm (char old_flag, gpointer data)
 {
   SplitRegister *reg = data;
+  gint response;
+  const gchar *message =
+    _("<b>Mark split as unreconciled?</b>\n\n"
+      "You are about to mark a reconciled split as unreconciled.  Doing "
+      "so might make future reconciliation difficult!  Continue "
+      "with this change?\n");
 
-  if (old_flag == YREC)
-  {
-    const char *message = _("Do you really want to mark this transaction "
-                            "not reconciled?\nDoing so might make future "
-                            "reconciliation difficult!");
-    gboolean confirm;
+  if (old_flag != YREC)
+    return TRUE;
 
-    confirm = gnc_lookup_boolean_option ("Register",
-                                         "Confirm before changing reconciled",
-                                         TRUE);
-    if (!confirm)
-      return TRUE;
+  /* Does the user want to be warned? */
+  response = gnc_warning_remember_dialog(gnc_split_register_get_parent(reg),
+					 "mark_split_unreconciled",
+					 "_Unreconcile", GTK_STOCK_CANCEL,
+					 message);
 
-    return gnc_verify_dialog (gnc_split_register_get_parent (reg),
-                              TRUE, message);
-  }
-
-  return TRUE;
+  return (response == GTK_RESPONSE_YES);
 }
Index: split-register-model.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/register/ledger-core/split-register-model.c,v
retrieving revision 1.50.2.4
retrieving revision 1.50.2.5
diff -Lsrc/register/ledger-core/split-register-model.c -Lsrc/register/ledger-core/split-register-model.c -u -r1.50.2.4 -r1.50.2.5
--- src/register/ledger-core/split-register-model.c
+++ src/register/ledger-core/split-register-model.c
@@ -1830,22 +1830,23 @@
 
   if (recn == YREC)
   {
-    gboolean confirm;
-    const gchar *message = _("You are about to change a reconciled split.\n"
-			     "Are you sure you want to do that?");
-
-    confirm = gnc_lookup_boolean_option ("Register",
-                                         "Confirm before changing reconciled",
-                                         TRUE);
-    if (!confirm)
-      return TRUE;
+    gint response;
+    const gchar *message =
+      _("<b>Change reconciled split?</b>\n\n"
+	"You are about to change a reconciled split.  Doing so might make "
+	"future reconciliation difficult!  Continue with this change?\n");
+  
+    /* Does the user want to be warned? */
+    response = gnc_warning_remember_dialog(gnc_split_register_get_parent(reg),
+					   "change_reconciled_split",
+					   "Change _Split", GTK_STOCK_CANCEL,
+					   message);
 
-    confirm = gnc_verify_dialog (gnc_split_register_get_parent (reg),
-				 FALSE, message);
+    if (response != GTK_RESPONSE_YES)
+      return FALSE;
 
-    info->change_confirmed = confirm;
-
-    return confirm;
+    info->change_confirmed = TRUE;
+    return TRUE;
   }
 
   return TRUE;
--- /dev/null
+++ src/gnome/schemas/apps_gnucash_warnings.schemas
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<gconfschemafile>
+  <schemalist>
+
+    <schema>
+      <key>/schemas/apps/gnucash/general/warnings/change_reconciled_split</key>
+      <applyto>/apps/gnucash/general/warnings/permanent/change_reconciled_split</applyto>
+      <applyto>/apps/gnucash/general/warnings/temporary/change_reconciled_split</applyto>
+      <owner>gnucash</owner>
+      <type>int</type>
+      <default>0</default>
+      <locale name="C">
+        <short>Change contents of reconciled split.</short>
+        <long>
+	  This dialog is presented before allowing you to change the
+	  contents of a reconciled split.  Allowing these chagnes can
+	  make it hard to perform future reconciliations.
+	</long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/gnucash/general/warnings/mark_split_unreconciled</key>
+      <applyto>/apps/gnucash/general/warnings/permanent/mark_split_unreconciled</applyto>
+      <applyto>/apps/gnucash/general/warnings/temporary/mark_split_unreconciled</applyto>
+      <owner>gnucash</owner>
+      <type>int</type>
+      <default>0</default>
+      <locale name="C">
+        <short>Mark transaction split as unreconciled.</short>
+        <long>
+	  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.
+	</long>
+      </locale>
+    </schema>
+
+  </schemalist>
+</gconfschemafile>
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/schemas/Attic/Makefile.am,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -Lsrc/gnome/schemas/Makefile.am -Lsrc/gnome/schemas/Makefile.am -u -r1.1.2.7 -r1.1.2.8
--- src/gnome/schemas/Makefile.am
+++ src/gnome/schemas/Makefile.am
@@ -5,6 +5,7 @@
   apps_gnucash_dialog_prices.schemas \
   apps_gnucash_dialog_totd.schemas \
   apps_gnucash_general.schemas \
+  apps_gnucash_warnings.schemas \
   apps_gnucash_window_pages_register.schemas
 
 install-data-local:


More information about the gnucash-changes mailing list