From: John Darrington Date: Fri, 2 Jun 2017 06:43:04 +0000 (+0200) Subject: Fix bug where the Examine subdialogs appeared multiple times. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7540139200790d83e22d42bca2559a3058b7564d;hp=e56d6454f9e8663e4108f77c8f07b85a73b8bb9d;p=pspp Fix bug where the Examine subdialogs appeared multiple times. --- diff --git a/src/ui/gui/psppire-dialog-action-examine.c b/src/ui/gui/psppire-dialog-action-examine.c index 8a643820ea..0bce847e24 100644 --- a/src/ui/gui/psppire-dialog-action-examine.c +++ b/src/ui/gui/psppire-dialog-action-examine.c @@ -209,10 +209,16 @@ psppire_dialog_action_examine_activate (PsppireDialogAction *a) { xml = builder_new ("examine.ui"); g_hash_table_insert (thing, a, xml); - } - GtkWidget *stats_button = get_widget_assert (xml, "stats-button"); - GtkWidget *opts_button = get_widget_assert (xml, "opts-button"); + GtkWidget *stats_button = get_widget_assert (xml, "stats-button"); + GtkWidget *opts_button = get_widget_assert (xml, "opts-button"); + + g_signal_connect_swapped (stats_button, "clicked", + G_CALLBACK (run_stats_dialog), act); + + g_signal_connect_swapped (opts_button, "clicked", + G_CALLBACK (run_opts_dialog), act); + } GtkWidget *dep_sel = get_widget_assert (xml, "psppire-selector1"); GtkWidget *dep_sel2 = get_widget_assert (xml, "psppire-selector2"); @@ -236,6 +242,7 @@ psppire_dialog_action_examine_activate (PsppireDialogAction *a) list = g_list_append (list, dep_sel3); list = g_list_append (list, get_widget_assert (xml, "frame3")); gtk_container_set_focus_chain (GTK_CONTAINER (table), list); + g_list_free (list); act->stats_dialog = get_widget_assert (xml, "statistics-dialog"); @@ -253,13 +260,6 @@ psppire_dialog_action_examine_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, (void *) dialog_state_valid); psppire_dialog_action_set_refresh (pda, dialog_refresh); - g_signal_connect_swapped (stats_button, "clicked", - G_CALLBACK (run_stats_dialog), act); - - g_signal_connect_swapped (opts_button, "clicked", - G_CALLBACK (run_opts_dialog), act); - - g_list_free (list); } static void