AUDIT: r16934 - gnucash/trunk/src/gnome-utils - Make "rename page" action work again.

Andreas Köhler andi5 at cvs.gnucash.org
Sun Feb 10 13:22:29 EST 2008


Author: andi5
Date: 2008-02-10 13:22:29 -0500 (Sun, 10 Feb 2008)
New Revision: 16934
Trac: http://svn.gnucash.org/trac/changeset/16934

Modified:
   gnucash/trunk/src/gnome-utils/gnc-main-window.c
Log:
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.

BP


Modified: gnucash/trunk/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-main-window.c	2008-02-10 01:00:47 UTC (rev 16933)
+++ gnucash/trunk/src/gnome-utils/gnc-main-window.c	2008-02-10 18:22:29 UTC (rev 16934)
@@ -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