r16084 - gnucash/branches/2.0 - Remember the current session when an option dialog boxes is opened,

Derek Atkins warlord at cvs.gnucash.org
Mon May 14 10:38:13 EDT 2007


Author: warlord
Date: 2007-05-14 10:38:12 -0400 (Mon, 14 May 2007)
New Revision: 16084
Trac: http://svn.gnucash.org/trac/changeset/16084

Modified:
   gnucash/branches/2.0/
   gnucash/branches/2.0/ChangeLog
   gnucash/branches/2.0/src/gnome-utils/dialog-options.c
Log:
Remember the current session when an option dialog boxes is opened,
and close it when the session is closed.  Fixes #394074.

Merge from r15976



Property changes on: gnucash/branches/2.0
___________________________________________________________________
Name: svk:merge
   - 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/2.0:697
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/2.0:14722
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:13282
   + 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/2.0:697
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/2.0:14723
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:13282

Modified: gnucash/branches/2.0/ChangeLog
===================================================================
--- gnucash/branches/2.0/ChangeLog	2007-05-14 14:38:04 UTC (rev 16083)
+++ gnucash/branches/2.0/ChangeLog	2007-05-14 14:38:12 UTC (rev 16084)
@@ -6,6 +6,9 @@
 	  there is small interval in the middle where any call to get the
 	  current book will get bogus results.  Fixes #414783.
 
+	* Remember the current session when an option dialog boxes is opened,
+	  and close it when the session is closed.  Fixes #394074.
+
 2007-04-21  David Hampton  <hampton at employees.org>
 
 	* Disable the close callback while updating reports.  Fixes #416986.

Modified: gnucash/branches/2.0/src/gnome-utils/dialog-options.c
===================================================================
--- gnucash/branches/2.0/src/gnome-utils/dialog-options.c	2007-05-14 14:38:04 UTC (rev 16083)
+++ gnucash/branches/2.0/src/gnome-utils/dialog-options.c	2007-05-14 14:38:12 UTC (rev 16084)
@@ -43,12 +43,14 @@
 #include "gnc-account-sel.h"
 #include "gnc-tree-view-account.h"
 #include "gnc-commodity-edit.h"
+#include "gnc-component-manager.h"
 #include "gnc-general-select.h"
 #include "gnc-currency-edit.h"
 #include "gnc-date-edit.h"
 #include "gnc-engine.h"
 #include "gnc-gconf-utils.h"
 #include "gnc-gui-query.h"
+#include "gnc-session.h"
 #include "gnc-ui.h"
 #include "guile-util.h"
 #include "option-util.h"
@@ -63,6 +65,8 @@
 /* This static indicates the debugging module that this .o belongs to.  */
 static QofLogModule log_module = GNC_MOD_GUI;
 
+#define DIALOG_OPTIONS_CM_CLASS "dialog-options"
+
 /*
  * Point where preferences switch control method from a set of
  * notebook tabs to a list.
@@ -1396,6 +1400,13 @@
 #endif
 }
 
+static void
+component_close_handler (gpointer data)
+{
+  GNCOptionWin *window = data;
+  gtk_dialog_response(GTK_DIALOG(window->dialog), GTK_RESPONSE_CANCEL);
+}
+
 /* gnc_options_dialog_new:
  *
  *   - Opens the preferences glade file
@@ -1410,6 +1421,7 @@
   GNCOptionWin * retval;
   GladeXML *xml;
   GtkWidget * hbox;
+  gint component_id;
 
   retval = g_new0(GNCOptionWin, 1);
   xml = gnc_glade_xml_new ("preferences.glade", "GnuCash Options");
@@ -1429,6 +1441,11 @@
   gtk_widget_show(retval->notebook);
   gtk_box_pack_start(GTK_BOX(hbox), retval->notebook, TRUE, TRUE, 5);
 
+  component_id = gnc_register_gui_component (DIALOG_OPTIONS_CM_CLASS,
+                                             NULL, component_close_handler,
+                                             retval);
+  gnc_gui_component_set_session (component_id, gnc_get_current_session());
+
   return retval;
 }
 



More information about the gnucash-changes mailing list