X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-correlation.c;h=81b694a7aa147489fa7b0eec989f810f2d94d80e;hb=81ddd8ec0219b4808fc5392d4da0eebd45efa7ac;hp=c86dd51165644eab89608afa302eb2a3e4817316;hpb=3e4bee90c58e9ebf4ac024ab918824b92b71059a;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-correlation.c b/src/ui/gui/psppire-dialog-action-correlation.c index c86dd51165..81b694a7aa 100644 --- a/src/ui/gui/psppire-dialog-action-correlation.c +++ b/src/ui/gui/psppire-dialog-action-correlation.c @@ -78,8 +78,10 @@ dialog_state_valid (gpointer user_data) } static void -refresh (PsppireDialogActionCorrelation *rd) +refresh (PsppireDialogAction *rd_) { + PsppireDialogActionCorrelation *rd = + PSPPIRE_DIALOG_ACTION_CORRELATION (rd_); GtkTreeModel *liststore = gtk_tree_view_get_model (GTK_TREE_VIEW (rd->variables)); gtk_list_store_clear (GTK_LIST_STORE (liststore)); @@ -90,14 +92,21 @@ refresh (PsppireDialogActionCorrelation *rd) } static void -psppire_dialog_action_correlation_activate (GtkAction *a) +psppire_dialog_action_correlation_activate (PsppireDialogAction *a) { PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionCorrelation *act = PSPPIRE_DIALOG_ACTION_CORRELATION (a); - GtkBuilder *xml = builder_new ("correlation.ui"); - pda->dialog = get_widget_assert (xml, "correlation-dialog"); - pda->source = get_widget_assert (xml, "dict-view"); + GHashTable *thing = psppire_dialog_action_get_hash_table (pda); + GtkBuilder *xml = g_hash_table_lookup (thing, a); + if (!xml) + { + xml = builder_new ("correlation.ui"); + g_hash_table_insert (thing, a, xml); + } + + pda->dialog = get_widget_assert (xml, "correlation-dialog"); + pda->source = get_widget_assert (xml, "dict-view"); act->variables = get_widget_assert (xml, "psppire-var-view1"); act->significant = get_widget_assert (xml, "button-flag-significants"); @@ -106,8 +115,6 @@ psppire_dialog_action_correlation_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_correlation_parent_class)->activate) PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_correlation_parent_class)->activate (pda); } @@ -115,9 +122,8 @@ psppire_dialog_action_correlation_activate (GtkAction *a) static void psppire_dialog_action_correlation_class_init (PsppireDialogActionCorrelationClass *class) { - GtkActionClass *action_class = GTK_ACTION_CLASS (class); + psppire_dialog_action_set_activation (class, psppire_dialog_action_correlation_activate); - action_class->activate = psppire_dialog_action_correlation_activate; PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; }