X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-k-related.c;h=16f0f721c3703a3544fd4566a7758caab45bf0cc;hb=fc6620099bbc53762095569d5356b67a81a85402;hp=9f1b588c5fa24dfbea60ada0cca17185f1d26ba2;hpb=69f29abce63bbc3c02da10bc2d6ecf5c061a8238;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-k-related.c b/src/ui/gui/psppire-dialog-action-k-related.c index 9f1b588c5f..16f0f721c3 100644 --- a/src/ui/gui/psppire-dialog-action-k-related.c +++ b/src/ui/gui/psppire-dialog-action-k-related.c @@ -110,7 +110,14 @@ psppire_dialog_action_k_related_activate (GtkAction *a) PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionKRelated *act = PSPPIRE_DIALOG_ACTION_K_RELATED (a); - GtkBuilder *xml = builder_new ("k-related.ui"); + GHashTable *thing = psppire_dialog_action_get_pointer (pda); + GtkBuilder *xml = g_hash_table_lookup (thing, a); + if (!xml) + { + xml = builder_new ("k-related.ui"); + g_hash_table_insert (thing, a, xml); + } + pda->dialog = get_widget_assert (xml, "k-related-dialog"); pda->source = get_widget_assert (xml, "dict-view"); @@ -126,8 +133,6 @@ psppire_dialog_action_k_related_activate (GtkAction *a) "predicate", var_is_numeric, NULL); - g_object_unref (xml); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_k_related_parent_class)->activate) PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_k_related_parent_class)->activate (pda); } @@ -135,9 +140,7 @@ psppire_dialog_action_k_related_activate (GtkAction *a) static void psppire_dialog_action_k_related_class_init (PsppireDialogActionKRelatedClass *class) { - GtkActionClass *action_class = GTK_ACTION_CLASS (class); - - action_class->activate = psppire_dialog_action_k_related_activate; + psppire_dialog_action_set_activation (class, psppire_dialog_action_k_related_activate); PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; }