X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-histogram.c;h=e6a6fe733e82381cb1c9f14147afc539500f9e6c;hb=f1ae4ee2876bee191b1bf79672d4bf834750c227;hp=3cf1fe77bc9ae4933ea884295c5368ed926ad724;hpb=2d82411f69f2a87a04ed22de78717bacf7d342de;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-histogram.c b/src/ui/gui/psppire-dialog-action-histogram.c index 3cf1fe77bc..e6a6fe733e 100644 --- a/src/ui/gui/psppire-dialog-action-histogram.c +++ b/src/ui/gui/psppire-dialog-action-histogram.c @@ -42,7 +42,7 @@ dialog_state_valid (gpointer data) const gchar *var_name = gtk_entry_get_text (GTK_ENTRY (rd->variable)); const struct variable *var = psppire_dict_lookup_var (PSPPIRE_DIALOG_ACTION (rd)->dict, var_name); - if ( var == NULL) + if (var == NULL) return FALSE; @@ -58,19 +58,13 @@ refresh (PsppireDialogAction *rd_) gtk_entry_set_text (GTK_ENTRY (rd->variable), ""); } -static void -psppire_dialog_action_histogram_activate (GtkAction *a) +static GtkBuilder * +psppire_dialog_action_histogram_activate (PsppireDialogAction *a, GVariant *param) { PsppireDialogActionHistogram *act = PSPPIRE_DIALOG_ACTION_HISTOGRAM (a); PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); - GHashTable *thing = psppire_dialog_action_get_hash_table (pda); - GtkBuilder *xml = g_hash_table_lookup (thing, a); - if (!xml) - { - xml = builder_new ("histogram.ui"); - g_hash_table_insert (thing, a, xml); - } + GtkBuilder *xml = builder_new ("histogram.ui"); pda->dialog = get_widget_assert (xml, "histogram-dialog"); pda->source = get_widget_assert (xml, "dict-view"); @@ -83,14 +77,13 @@ psppire_dialog_action_histogram_activate (GtkAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_histogram_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_histogram_parent_class)->activate (pda); + return xml; } static char * -generate_syntax (PsppireDialogAction *a) +generate_syntax (const PsppireDialogAction *a) { PsppireDialogActionHistogram *rd = PSPPIRE_DIALOG_ACTION_HISTOGRAM (a); gchar *text; @@ -117,7 +110,7 @@ generate_syntax (PsppireDialogAction *a) static void psppire_dialog_action_histogram_class_init (PsppireDialogActionHistogramClass *class) { - psppire_dialog_action_set_activation (class, psppire_dialog_action_histogram_activate); + PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_histogram_activate; PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; }