X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-chisquare.c;h=4fd09d0a44726986b3f555d3a66386271a035345;hb=refs%2Fheads%2Fctables7;hp=00b6d22a4f46ac89608cd17002f463f89a2c37a6;hpb=ed208cf009043f0bf319a4e919c279d5b1401f36;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-chisquare.c b/src/ui/gui/psppire-dialog-action-chisquare.c index 00b6d22a4f..4fd09d0a44 100644 --- a/src/ui/gui/psppire-dialog-action-chisquare.c +++ b/src/ui/gui/psppire-dialog-action-chisquare.c @@ -37,7 +37,7 @@ G_DEFINE_TYPE (PsppireDialogActionChisquare, psppire_dialog_action_chisquare, PS static char * -generate_syntax (PsppireDialogAction *act) +generate_syntax (const PsppireDialogAction *act) { PsppireDialogActionChisquare *scd = PSPPIRE_DIALOG_ACTION_CHISQUARE (act); @@ -48,11 +48,11 @@ generate_syntax (PsppireDialogAction *act) psppire_var_view_append_names_str (PSPPIRE_VAR_VIEW (scd->var_view), 0, &dss); - if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (scd->range_button))) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (scd->range_button))) { ds_put_cstr (&dss, "("); - - ds_put_cstr (&dss, + + ds_put_cstr (&dss, gtk_entry_get_text (GTK_ENTRY (scd->value_lower))); ds_put_cstr (&dss, ", "); @@ -63,7 +63,7 @@ generate_syntax (PsppireDialogAction *act) ds_put_cstr (&dss, ")"); } - if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (scd->values_button))) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (scd->values_button))) { GtkListStore *ls = scd->expected_list; GtkTreeIter iter; @@ -72,7 +72,7 @@ generate_syntax (PsppireDialogAction *act) ds_put_cstr (&dss, "\n\t"); ds_put_cstr (&dss, "/EXPECTED = "); - + for (ok = gtk_tree_model_get_iter_first (GTK_TREE_MODEL(ls), &iter); ok; @@ -105,7 +105,7 @@ dialog_state_valid (gpointer a) GtkTreeModel *vars = gtk_tree_view_get_model (GTK_TREE_VIEW (act->var_view)); - if ( !gtk_tree_model_get_iter_first (vars, ¬used) ) + if (!gtk_tree_model_get_iter_first (vars, ¬used)) return FALSE; return TRUE; @@ -128,19 +128,13 @@ refresh (PsppireDialogAction *rd_) gtk_entry_set_text (GTK_ENTRY (csd->value_upper), ""); } -static void -psppire_dialog_action_chisquare_activate (GtkAction *a) +static GtkBuilder * +psppire_dialog_action_chisquare_activate (PsppireDialogAction *a, GVariant *param) { PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionChisquare *act = PSPPIRE_DIALOG_ACTION_CHISQUARE (a); - GHashTable *thing = psppire_dialog_action_get_hash_table (pda); - GtkBuilder *xml = g_hash_table_lookup (thing, a); - if (!xml) - { - xml = builder_new ("chi-square.ui"); - g_hash_table_insert (thing, a, xml); - } + GtkBuilder *xml = builder_new ("chi-square.ui"); GtkWidget *range_table = get_widget_assert (xml, "range-table"); GtkWidget *values_acr = get_widget_assert (xml, "psppire-acr1"); @@ -165,17 +159,17 @@ psppire_dialog_action_chisquare_activate (GtkAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - g_signal_connect (act->range_button, "toggled", - G_CALLBACK (set_sensitivity_from_toggle), + g_signal_connect (act->range_button, "toggled", + G_CALLBACK (set_sensitivity_from_toggle), range_table); - g_signal_connect (act->values_button, "toggled", - G_CALLBACK (set_sensitivity_from_toggle), + g_signal_connect (act->values_button, "toggled", + G_CALLBACK (set_sensitivity_from_toggle), values_acr); - g_signal_connect (act->values_button, "toggled", - G_CALLBACK (set_sensitivity_from_toggle), + g_signal_connect (act->values_button, "toggled", + G_CALLBACK (set_sensitivity_from_toggle), expected_value_entry); psppire_acr_set_entry (PSPPIRE_ACR (values_acr), @@ -183,15 +177,13 @@ psppire_dialog_action_chisquare_activate (GtkAction *a) psppire_acr_set_model(PSPPIRE_ACR (values_acr), act->expected_list); - - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_chisquare_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_chisquare_parent_class)->activate (pda); + return xml; } static void psppire_dialog_action_chisquare_class_init (PsppireDialogActionChisquareClass *class) { - psppire_dialog_action_set_activation (class, psppire_dialog_action_chisquare_activate); + PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_chisquare_activate; PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; }