r18909 - gnucash/trunk/src/gnome-utils - Bug #536108 - After cancelling "save as", user is not prompted 2nd time

Geert Janssens gjanssens at code.gnucash.org
Mon Mar 15 05:01:51 EDT 2010


Author: gjanssens
Date: 2010-03-15 05:01:50 -0400 (Mon, 15 Mar 2010)
New Revision: 18909
Trac: http://svn.gnucash.org/trac/changeset/18909

Modified:
   gnucash/trunk/src/gnome-utils/gnc-file.c
Log:
Bug #536108 - After cancelling "save as", user is not prompted 2nd time

Modified: gnucash/trunk/src/gnome-utils/gnc-file.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-file.c	2010-03-14 21:10:26 UTC (rev 18908)
+++ gnucash/trunk/src/gnome-utils/gnc-file.c	2010-03-15 09:01:50 UTC (rev 18909)
@@ -874,7 +874,7 @@
 }
 
 /* Routine that pops up a file chooser dialog
- * 
+ *
  * Note: this dialog is used when dbi is not enabled
  *       so the paths used in here are always file
  *       paths, never db uris.
@@ -1178,6 +1178,26 @@
         return;
     }
 
+    /* oops ... file already exists ... ask user what to do... */
+    if (qof_session_save_may_clobber_data (new_session))
+    {
+        const char *format = _("The file %s already exists. "
+                               "Are you sure you want to overwrite it?");
+
+        /* if user says cancel, we should break out */
+        if (!gnc_verify_dialog (NULL, FALSE, format, newfile))
+        {
+            xaccLogDisable();
+            qof_session_destroy (new_session);
+            xaccLogEnable();
+            g_free (newfile);
+            save_in_progress--;
+            return;
+        }
+
+        /* Whoa-ok. Blow away the previous file. */
+    }
+
     /* XXX Would logging make sense for databases as well (mysql/postgres) ?
      * Currently the logpath is relative to the data file path.
      * Databases don't have a file path, so no logging will be
@@ -1212,23 +1232,6 @@
 
     /* --------------- END CORE SESSION CODE -------------- */
 
-    /* oops ... file already exists ... ask user what to do... */
-    if (qof_session_save_may_clobber_data (new_session))
-    {
-        const char *format = _("The file %s already exists. "
-                               "Are you sure you want to overwrite it?");
-
-        /* if user says cancel, we should break out */
-        if (!gnc_verify_dialog (NULL, FALSE, format, newfile))
-        {
-            g_free (newfile);
-            save_in_progress--;
-            return;
-        }
-
-        /* Whoa-ok. Blow away the previous file. */
-    }
-
     gnc_file_save ();
     save_in_progress--;
 



More information about the gnucash-changes mailing list