[Gnucash-changes] r13644 - gnucash/trunk - Don't create a new window for a page if there's already an open blank

David Hampton hampton at cvs.gnucash.org
Wed Mar 15 21:42:52 EST 2006


Author: hampton
Date: 2006-03-15 21:42:51 -0500 (Wed, 15 Mar 2006)
New Revision: 13644
Trac: http://svn.gnucash.org/trac/changeset/13644

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/gnome-utils/gnc-main-window.c
Log:
Don't create a new window for a page if there's already an open blank
window.  Fixes 334672.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-03-15 20:59:52 UTC (rev 13643)
+++ gnucash/trunk/ChangeLog	2006-03-16 02:42:51 UTC (rev 13644)
@@ -1,3 +1,8 @@
+2006-03-15  David Hampton  <hampton at employees.org>
+
+	* src/gnome-utils/gnc-main-window.c: Don't create a new window for
+	a page if there's already an open blank window.  Fixes 334672.
+
 2006-03-15  Andreas Köhler  <andi5.py at gmx.net>
 
 	* src/gnome/window-reconcile.c: Add a call to gnc_tm_set_day_end

Modified: gnucash/trunk/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-main-window.c	2006-03-15 20:59:52 UTC (rev 13643)
+++ gnucash/trunk/src/gnome-utils/gnc-main-window.c	2006-03-16 02:42:51 UTC (rev 13644)
@@ -1949,6 +1949,7 @@
 	const gchar *icon;
 	GtkWidget *image;
 	gboolean immutable = FALSE;
+	GList *tmp;
 
 	if (window)
 	  g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
@@ -1960,8 +1961,18 @@
 	  return;
 	}
 
+	/* Does the page want to be in a new window? */
 	if (gnc_plugin_page_get_use_new_window(page)) {
-	  window = gnc_main_window_new ();
+	  /* See if there's a blank window. If so, use that. */
+	  for (tmp = active_windows; tmp; tmp = g_list_next(tmp)) {
+	    window = GNC_MAIN_WINDOW(tmp->data);
+	    priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
+	    if (priv->installed_pages == NULL) {
+	      break;
+	    }
+	  }
+	  if (tmp == NULL)
+	    window = gnc_main_window_new ();
 	  gtk_widget_show(GTK_WIDGET(window));
 	} else if ((window == NULL) && active_windows) {
 	  window = active_windows->data;



More information about the gnucash-changes mailing list