r16990 - gnucash/branches/2.2/src/gnome-utils - [r16934] Make "rename page" action work again.

Andreas Köhler andi5 at cvs.gnucash.org
Sat Mar 1 09:50:34 EST 2008


Author: andi5
Date: 2008-03-01 09:50:33 -0500 (Sat, 01 Mar 2008)
New Revision: 16990
Trac: http://svn.gnucash.org/trac/changeset/16990

Modified:
   gnucash/branches/2.2/src/gnome-utils/gnc-main-window.c
Log:
[r16934] Make "rename page" action work again.

In r15774 the structure of main window notebook tab labels changed, but
in gnc_main_window_cmd_actions_rename_page() the GtkLabel lookup was
still hard-coded and has not been adjusted.  Use
main_window_find_tab_items() instead.


Modified: gnucash/branches/2.2/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/branches/2.2/src/gnome-utils/gnc-main-window.c	2008-03-01 14:50:24 UTC (rev 16989)
+++ gnucash/branches/2.2/src/gnome-utils/gnc-main-window.c	2008-03-01 14:50:33 UTC (rev 16990)
@@ -3238,8 +3238,7 @@
 {
   GncMainWindowPrivate *priv;
   GncPluginPage *page;
-  GtkWidget *tab_hbox, *widget, *label = NULL, *entry = NULL;
-  GList *children, *tmp;
+  GtkWidget *label, *entry;
 
   ENTER(" ");
   priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
@@ -3248,22 +3247,9 @@
     LEAVE("No current page");
     return;
   }
-  
-  tab_hbox = gtk_notebook_get_tab_label(GTK_NOTEBOOK(priv->notebook),
-                                       page->notebook_page);
-  children = gtk_container_get_children(GTK_CONTAINER(tab_hbox));
-  for (tmp = children; tmp; tmp = g_list_next(tmp)) {
-    widget = tmp->data;
-    if (GTK_IS_LABEL(widget)) {
-      label = widget;
-    } else if (GTK_IS_ENTRY(widget)) {
-      entry = widget;
-    }
-  }
-  g_list_free(children);
 
-  if (!label || !entry) {
-    LEAVE("Missing label or entry.");
+  if (!main_window_find_tab_items(window, page, &label, &entry)) {
+    LEAVE("can't find required widgets");
     return;
   }
 



More information about the gnucash-changes mailing list