X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-weight.c;h=280d3c3c483ef4d28755f654c40dd7452ad1af5f;hb=32ea29485bdd610b7d05dd806c5f06f68da0f0fe;hp=ec604ec97c2a32e5784e97e484cc366dd8f937ec;hpb=6e097c89af440da90b43ce90864394c4d0c843d5;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-weight.c b/src/ui/gui/psppire-dialog-action-weight.c index ec604ec97c..280d3c3c48 100644 --- a/src/ui/gui/psppire-dialog-action-weight.c +++ b/src/ui/gui/psppire-dialog-action-weight.c @@ -119,49 +119,43 @@ on_toggle (GtkToggleButton *off, gpointer data) } -static void -psppire_dialog_action_weight_activate (PsppireDialogAction *pda) +static GtkBuilder * +psppire_dialog_action_weight_activate (PsppireDialogAction *pda, GVariant *param) { PsppireDialogActionWeight *act = PSPPIRE_DIALOG_ACTION_WEIGHT (pda); - GHashTable *thing = psppire_dialog_action_get_hash_table (pda); - GtkBuilder *xml = g_hash_table_lookup (thing, pda); - if (!xml) - { - xml = builder_new ("weight.ui"); - g_hash_table_insert (thing, pda, xml); + GtkBuilder *xml = builder_new ( "weight.ui"); - pda->dialog = get_widget_assert (xml, "weight-cases-dialog"); - pda->source = get_widget_assert (xml, "weight-cases-treeview"); + pda->dialog = get_widget_assert (xml, "weight-cases-dialog"); + pda->source = get_widget_assert (xml, "weight-cases-treeview"); - act->entry = get_widget_assert (xml, "weight-cases-entry"); - act->off = get_widget_assert (xml,"weight-cases-radiobutton1"); - act->on = get_widget_assert (xml, "radiobutton2"); - act->status = get_widget_assert (xml, "weight-status-label"); - GtkWidget *selector = get_widget_assert (xml, "weight-cases-selector"); + act->entry = get_widget_assert (xml, "weight-cases-entry"); + act->off = get_widget_assert (xml,"weight-cases-radiobutton1"); + act->on = get_widget_assert (xml, "radiobutton2"); + act->status = get_widget_assert (xml, "weight-status-label"); + GtkWidget *selector = get_widget_assert (xml, "weight-cases-selector"); - g_signal_connect (selector, "selected", G_CALLBACK (on_select), act); - g_signal_connect (selector, "de-selected", G_CALLBACK (on_deselect), act); - g_signal_connect (act->off, "toggled", G_CALLBACK (on_toggle), act); + g_signal_connect (selector, "selected", G_CALLBACK (on_select), act); + g_signal_connect (selector, "de-selected", G_CALLBACK (on_deselect), act); + g_signal_connect (act->off, "toggled", G_CALLBACK (on_toggle), act); - g_object_set (pda->source, - "selection-mode", GTK_SELECTION_SINGLE, - "predicate", var_is_numeric, - NULL); + g_object_set (pda->source, + "selection-mode", GTK_SELECTION_SINGLE, + "predicate", var_is_numeric, + NULL); - psppire_selector_set_filter_func (PSPPIRE_SELECTOR (selector), - is_currently_in_entry); - } + psppire_selector_set_filter_func (PSPPIRE_SELECTOR (selector), + is_currently_in_entry); psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - + return xml; } static void psppire_dialog_action_weight_class_init (PsppireDialogActionWeightClass *class) { - psppire_dialog_action_set_activation (class, psppire_dialog_action_weight_activate); + PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_weight_activate; PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; }