X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-count.c;h=84e4bda76bc5d14b2bfa16133a0499eef093b5ec;hb=ed208cf009043f0bf319a4e919c279d5b1401f36;hp=a439e1a764e6aa729ffda067cc683b3be24d0883;hpb=731134f6eec60db6615fbb2a0e36323588422df3;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-count.c b/src/ui/gui/psppire-dialog-action-count.c index a439e1a764..84e4bda76b 100644 --- a/src/ui/gui/psppire-dialog-action-count.c +++ b/src/ui/gui/psppire-dialog-action-count.c @@ -150,7 +150,14 @@ psppire_dialog_action_count_activate (GtkAction *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); } @@ -181,9 +185,7 @@ psppire_dialog_action_count_activate (GtkAction *a) static void psppire_dialog_action_count_class_init (PsppireDialogActionCountClass *class) { - GtkActionClass *action_class = GTK_ACTION_CLASS (class); - - action_class->activate = psppire_dialog_action_count_activate; + psppire_dialog_action_set_activation (class,psppire_dialog_action_count_activate); PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; }