mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-12-01 04:59:29 -06:00
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 git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16934 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
440ef0516a
commit
ac20287d9a
@ -3238,8 +3238,7 @@ gnc_main_window_cmd_actions_rename_page (GtkAction *action, GncMainWindow *windo
|
|||||||
{
|
{
|
||||||
GncMainWindowPrivate *priv;
|
GncMainWindowPrivate *priv;
|
||||||
GncPluginPage *page;
|
GncPluginPage *page;
|
||||||
GtkWidget *tab_hbox, *widget, *label = NULL, *entry = NULL;
|
GtkWidget *label, *entry;
|
||||||
GList *children, *tmp;
|
|
||||||
|
|
||||||
ENTER(" ");
|
ENTER(" ");
|
||||||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
||||||
@ -3248,22 +3247,9 @@ gnc_main_window_cmd_actions_rename_page (GtkAction *action, GncMainWindow *windo
|
|||||||
LEAVE("No current page");
|
LEAVE("No current page");
|
||||||
return;
|
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) {
|
if (!main_window_find_tab_items(window, page, &label, &entry)) {
|
||||||
LEAVE("Missing label or entry.");
|
LEAVE("can't find required widgets");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user