X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-oneway.c;h=d82ce27c313f8f3f3a7b0a8e88d68e4c0d5580fc;hb=c115ee191738e0c382d151f10e96e255acc74d83;hp=6e66862c4b60754d4eab567a134dfb4fd846f58f;hpb=2a71889bf86463fb752bcbab248da47b25b4fd9a;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-oneway.c b/src/ui/gui/psppire-dialog-action-oneway.c index 6e66862c4b..d82ce27c31 100644 --- a/src/ui/gui/psppire-dialog-action-oneway.c +++ b/src/ui/gui/psppire-dialog-action-oneway.c @@ -47,7 +47,7 @@ G_DEFINE_TYPE (PsppireDialogActionOneway, psppire_dialog_action_oneway, PSPPIRE_ static char * -generate_syntax (PsppireDialogAction *act) +generate_syntax (const PsppireDialogAction *act) { PsppireDialogActionOneway *ow = PSPPIRE_DIALOG_ACTION_ONEWAY (act); gchar *text; @@ -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,10 +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); } static void