r23053 - gnucash/trunk/src - Bug #672595: After creation of a new book, make sure to set it to dirty so that a cancelled save_as dialog leaves the book dirty.

Christian Stimming cstim at code.gnucash.org
Sun Jun 16 04:30:09 EDT 2013


Author: cstim
Date: 2013-06-16 04:30:09 -0400 (Sun, 16 Jun 2013)
New Revision: 23053
Trac: http://svn.gnucash.org/trac/changeset/23053

Modified:
   gnucash/trunk/src/gnome/assistant-hierarchy.c
   gnucash/trunk/src/gnome/dialog-new-user.c
   gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c
Log:
Bug #672595: After creation of a new book, make sure to set it to dirty so that a cancelled save_as dialog leaves the book dirty.

The missing part was the line in assistant-hierarchy.c, but I've added
it to the two other calls to file_access_for_save_as() to be on the safe
side on those two other book creation places as well.

Modified: gnucash/trunk/src/gnome/assistant-hierarchy.c
===================================================================
--- gnucash/trunk/src/gnome/assistant-hierarchy.c	2013-06-14 21:43:17 UTC (rev 23052)
+++ gnucash/trunk/src/gnome/assistant-hierarchy.c	2013-06-16 08:30:09 UTC (rev 23053)
@@ -1164,6 +1164,7 @@
     GncPluginPage *page;
     page = gnc_plugin_page_account_tree_new();
     gnc_main_window_open_page(NULL, page);
+    qof_book_mark_session_dirty(gnc_get_current_book());
     gnc_ui_file_access_for_save_as();
 }
 

Modified: gnucash/trunk/src/gnome/dialog-new-user.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-new-user.c	2013-06-14 21:43:17 UTC (rev 23052)
+++ gnucash/trunk/src/gnome/dialog-new-user.c	2013-06-16 08:30:09 UTC (rev 23053)
@@ -37,6 +37,7 @@
 #include "gnc-main-window.h"
 #include "gnc-plugin-page-account-tree.h"
 #include "gnc-session.h"
+#include "app-utils/gnc-ui-util.h" // for gnc_get_current_book
 
 #define GCONF_SECTION "dialogs/new_user"
 #define FIRST_STARTUP "first_startup"
@@ -72,6 +73,7 @@
 
     page = gnc_plugin_page_account_tree_new();
     gnc_main_window_open_page(NULL, page);
+    qof_book_mark_session_dirty(gnc_get_current_book());
     gnc_ui_file_access_for_save_as();
 }
 

Modified: gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c	2013-06-14 21:43:17 UTC (rev 23052)
+++ gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c	2013-06-16 08:30:09 UTC (rev 23053)
@@ -1333,7 +1333,10 @@
 
     /* If We did not have an account tree, lets save it */
     if (!wind->acct_tree_found)
+    {
+        qof_book_mark_session_dirty(gnc_get_current_book());
         gnc_ui_file_access_for_save_as();
+    }
 
     gnc_close_gui_component_by_data( ASSISTANT_QIF_IMPORT_CM_CLASS, wind );
 }



More information about the gnucash-changes mailing list