From 5f7dd05d39cbc66154fcdc38570870d5506dddb7 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 9 Nov 2011 21:51:11 +0100 Subject: [PATCH] wizard: remove the old tabs from notebook before reloading rhbz#751833 --- src/gui-wizard-gtk/wizard.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c index 569fce3..fae0dca 100644 --- a/src/gui-wizard-gtk/wizard.c +++ b/src/gui-wizard-gtk/wizard.c @@ -1008,6 +1008,20 @@ static void save_items_from_notepad() } } +static void remove_tabs_from_notebook(GtkNotebook *notebook) +{ + gint n_pages = gtk_notebook_get_n_pages(notebook); + int ii; + + for (ii = 0; ii < n_pages; ii++) + { + /* removing a page changes the indices, so we always need to remove + * page 0 + */ + gtk_notebook_remove_page(notebook, 0); //we need to always the page 0 + } +} + static void append_item_to_ls_details(gpointer name, gpointer value, gpointer data) { problem_item *item = (problem_item*)value; @@ -1208,6 +1222,7 @@ static void update_event_checkboxes(GList **events_gui_data, void update_gui_state_from_problem_data(void) { update_window_title(); + remove_tabs_from_notebook(g_notebook); const char *reason = get_problem_item_content_or_NULL(g_cd, FILENAME_REASON); const char *not_reportable = get_problem_item_content_or_NULL(g_cd, -- 1.7.8.rc1