X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-oneway.c;h=35bbf01d1947a92db4bc772d6e78494747e8068a;hb=0bda70f475aad77db5636ae0bca170513353c988;hp=c817f71f152a983d8f9515b39cc2e4c15e924c96;hpb=14f4522a17db23e67a6fa17876633cc6260cb42b;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-oneway.c b/src/ui/gui/psppire-dialog-action-oneway.c index c817f71f15..35bbf01d19 100644 --- a/src/ui/gui/psppire-dialog-action-oneway.c +++ b/src/ui/gui/psppire-dialog-action-oneway.c @@ -221,12 +221,19 @@ clone_contrasts_array (GArray *src_array) static void -psppire_dialog_action_oneway_activate (GtkAction *a) +psppire_dialog_action_oneway_activate (PsppireDialogAction *a) { PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionOneway *act = PSPPIRE_DIALOG_ACTION_ONEWAY (a); - GtkBuilder *xml = builder_new ("oneway.ui"); + GHashTable *thing = psppire_dialog_action_get_hash_table (pda); + GtkBuilder *xml = g_hash_table_lookup (thing, a); + if (!xml) + { + xml = builder_new ("oneway.ui"); + g_hash_table_insert (thing, a, xml); + } + GtkWidget *contrasts_button = get_widget_assert (xml, "contrasts-button"); GtkEntry *entry = GTK_ENTRY (get_widget_assert (xml, "entry1")); @@ -266,8 +273,6 @@ psppire_dialog_action_oneway_activate (GtkAction *a) 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_oneway_parent_class)->activate) PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_oneway_parent_class)->activate (pda); } @@ -275,9 +280,7 @@ psppire_dialog_action_oneway_activate (GtkAction *a) static void psppire_dialog_action_oneway_class_init (PsppireDialogActionOnewayClass *class) { - GtkActionClass *action_class = GTK_ACTION_CLASS (class); - - action_class->activate = psppire_dialog_action_oneway_activate; + psppire_dialog_action_set_activation (class, psppire_dialog_action_oneway_activate); PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; }