X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-sort.c;h=c911d437f7489b17aa8cec3430a24cc6b1bb7783;hb=6d82ab433f298bcf1f0e6615c801d47b9738701a;hp=363ef08b03d48a70f9e80ff0085e593b7b2907ca;hpb=90d86f274e3f497ae75739170f0e2e45ffcaa19c;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-sort.c b/src/ui/gui/psppire-dialog-action-sort.c index 363ef08b03..c911d437f7 100644 --- a/src/ui/gui/psppire-dialog-action-sort.c +++ b/src/ui/gui/psppire-dialog-action-sort.c @@ -95,11 +95,18 @@ psppire_dialog_action_sort_activate (GtkAction *a) PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionSort *act = PSPPIRE_DIALOG_ACTION_SORT (a); - GtkBuilder *xml = builder_new ("sort.ui"); - pda->dialog = get_widget_assert (xml, "sort-cases-dialog"); - pda->source = get_widget_assert (xml, "sort-cases-treeview1"); + GHashTable *thing = psppire_dialog_action_get_hash_table (pda); + GtkBuilder *xml = g_hash_table_lookup (thing, a); + if (!xml) + { + xml = builder_new ("sort.ui"); + g_hash_table_insert (thing, a, xml); + } + + pda->dialog = get_widget_assert (xml, "sort-cases-dialog"); + pda->source = get_widget_assert (xml, "sort-cases-treeview1"); - act->variables = get_widget_assert (xml, "sort-cases-treeview2"); + act->variables = get_widget_assert (xml, "sort-cases-treeview2"); act->ascending = get_widget_assert (xml, "sort-cases-radiobutton0"); psppire_dialog_action_set_refresh (pda, reset); @@ -109,17 +116,13 @@ psppire_dialog_action_sort_activate (GtkAction *a) if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_sort_parent_class)->activate) PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_sort_parent_class)->activate (pda); - - g_object_unref (xml); } static void psppire_dialog_action_sort_class_init (PsppireDialogActionSortClass *class) { - GtkActionClass *action_class = GTK_ACTION_CLASS (class); - PsppireDialogActionClass *pdac = PSPPIRE_DIALOG_ACTION_CLASS (class); - - action_class->activate = psppire_dialog_action_sort_activate; + PsppireDialogActionClass *pdac = PSPPIRE_DIALOG_ACTION_CLASS (class); + psppire_dialog_action_set_activation (class, psppire_dialog_action_sort_activate); pdac->generate_syntax = generate_syntax; }