X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-count.c;h=f6937b9b6d1c9d7e61ee3b1d04bd247e7a746dae;hb=0bda70f475aad77db5636ae0bca170513353c988;hp=edb44a065c816edfea660089c28febdba7d98cb2;hpb=2a71889bf86463fb752bcbab248da47b25b4fd9a;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-count.c b/src/ui/gui/psppire-dialog-action-count.c index edb44a065c..f6937b9b6d 100644 --- a/src/ui/gui/psppire-dialog-action-count.c +++ b/src/ui/gui/psppire-dialog-action-count.c @@ -145,12 +145,19 @@ refresh (PsppireDialogAction *rd_) } static void -psppire_dialog_action_count_activate (GtkAction *a) +psppire_dialog_action_count_activate (PsppireDialogAction *a) { PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionCount *act = PSPPIRE_DIALOG_ACTION_COUNT (a); - GtkBuilder *xml = builder_new ("count.ui"); + GHashTable *thing = psppire_dialog_action_get_hash_table (pda); + GtkBuilder *xml = g_hash_table_lookup (thing, a); + if (!xml) + { + xml = builder_new ("count.ui"); + g_hash_table_insert (thing, a, xml); + } + GtkWidget *selector = get_widget_assert (xml, "count-selector1"); GtkWidget *button = get_widget_assert (xml, "button1"); @@ -168,12 +175,9 @@ psppire_dialog_action_count_activate (GtkAction *a) g_signal_connect_swapped (button, "clicked", G_CALLBACK (values_dialog), act); - psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - g_object_unref (xml); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_count_parent_class)->activate) PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_count_parent_class)->activate (pda); }