X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-chisquare.c;h=3a45e4a714b6217e14bf022e1eb2b35a61d97530;hb=109eccf01c32b5784f464de2d424fd7a9905123f;hp=5ee3e879913ec8e1debd3b15578e9369eabc008d;hpb=14f4522a17db23e67a6fa17876633cc6260cb42b;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-chisquare.c b/src/ui/gui/psppire-dialog-action-chisquare.c index 5ee3e87991..3a45e4a714 100644 --- a/src/ui/gui/psppire-dialog-action-chisquare.c +++ b/src/ui/gui/psppire-dialog-action-chisquare.c @@ -37,7 +37,7 @@ G_DEFINE_TYPE (PsppireDialogActionChisquare, psppire_dialog_action_chisquare, PS static char * -generate_syntax (PsppireDialogAction *act) +generate_syntax (const PsppireDialogAction *act) { PsppireDialogActionChisquare *scd = PSPPIRE_DIALOG_ACTION_CHISQUARE (act); @@ -129,12 +129,18 @@ refresh (PsppireDialogAction *rd_) } static void -psppire_dialog_action_chisquare_activate (GtkAction *a) +psppire_dialog_action_chisquare_activate (PsppireDialogAction *a) { PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionChisquare *act = PSPPIRE_DIALOG_ACTION_CHISQUARE (a); - GtkBuilder *xml = builder_new ("chi-square.ui"); + GHashTable *thing = psppire_dialog_action_get_hash_table (pda); + GtkBuilder *xml = g_hash_table_lookup (thing, a); + if (!xml) + { + xml = builder_new ("chi-square.ui"); + g_hash_table_insert (thing, a, xml); + } GtkWidget *range_table = get_widget_assert (xml, "range-table"); GtkWidget *values_acr = get_widget_assert (xml, "psppire-acr1"); @@ -159,8 +165,6 @@ psppire_dialog_action_chisquare_activate (GtkAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - g_object_unref (xml); - g_signal_connect (act->range_button, "toggled", G_CALLBACK (set_sensitivity_from_toggle), range_table); @@ -180,16 +184,12 @@ psppire_dialog_action_chisquare_activate (GtkAction *a) psppire_acr_set_model(PSPPIRE_ACR (values_acr), act->expected_list); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_chisquare_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_chisquare_parent_class)->activate (pda); } static void psppire_dialog_action_chisquare_class_init (PsppireDialogActionChisquareClass *class) { - GtkActionClass *action_class = GTK_ACTION_CLASS (class); - - action_class->activate = psppire_dialog_action_chisquare_activate; + psppire_dialog_action_set_activation (class, psppire_dialog_action_chisquare_activate); PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; }