gnucash unstable: Pass a NULL parent to gnc_options_dialog_new_modal in assistant-hierarchy.
John Ralls
jralls at code.gnucash.org
Sat Oct 28 13:00:12 EDT 2017
Updated via https://github.com/Gnucash/gnucash/commit/b92a41b6 (commit)
from https://github.com/Gnucash/gnucash/commit/d22b098d (commit)
commit b92a41b60863ff237e5f71c554dda189e55564f8
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Oct 28 09:56:58 2017 -0700
Pass a NULL parent to gnc_options_dialog_new_modal in assistant-hierarchy.
In this case the dialog isn't a dialog, it's a notebook page, so it
doesn't need to have a parent at creation.
diff --git a/gnucash/gnome/assistant-hierarchy.c b/gnucash/gnome/assistant-hierarchy.c
index dae9afb..66258b1 100644
--- a/gnucash/gnome/assistant-hierarchy.c
+++ b/gnucash/gnome/assistant-hierarchy.c
@@ -1174,9 +1174,9 @@ book_options_dialog_close_cb(GNCOptionWin * optionwin,
}
static void
-assistant_insert_book_options_page (hierarchy_data *data, GtkWindow* parent)
+assistant_insert_book_options_page (hierarchy_data *data)
{
- GtkWidget *options;
+ GtkWidget *options, *parent;
GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_set_homogeneous (GTK_BOX (vbox), FALSE);
@@ -1185,9 +1185,9 @@ assistant_insert_book_options_page (hierarchy_data *data, GtkWindow* parent)
gnc_option_db_load, data->options);
gnc_option_db_clean (data->options);
+ /* The options dialog gets added to the notebook so it doesn't need a parent.*/
data->optionwin = gnc_options_dialog_new_modal (TRUE, _("New Book Options"),
- DIALOG_BOOK_OPTIONS_CM_CLASS,
- parent);
+ DIALOG_BOOK_OPTIONS_CM_CLASS, NULL);
gnc_options_dialog_build_contents_full (data->optionwin, data->options, FALSE);
gnc_options_dialog_set_close_cb (data->optionwin,
@@ -1196,6 +1196,7 @@ assistant_insert_book_options_page (hierarchy_data *data, GtkWindow* parent)
gnc_options_dialog_set_new_book_option_values (data->options);
options = gnc_options_dialog_notebook (data->optionwin);
+ parent = gtk_widget_get_parent (options);
g_object_ref (options);
gtk_container_remove (GTK_CONTAINER(parent), options);
@@ -1278,7 +1279,7 @@ gnc_create_hierarchy_assistant (gboolean use_defaults, GncHierarchyAssistantFini
/* Book options page - only on new books */
if (data->new_book)
- assistant_insert_book_options_page (data, GTK_WINDOW (tree_view));
+ assistant_insert_book_options_page (data);
/* Final Accounts Page */
data->final_account_tree_container = GTK_WIDGET(gtk_builder_get_object (builder, "final_account_tree_box"));
Summary of changes:
gnucash/gnome/assistant-hierarchy.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
More information about the gnucash-changes
mailing list