X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-1sks.c;h=f0654c6b714f0c8a400ad18b8a9fe6a0d6bd22b1;hb=8ccde6b2cb998a1acb9d8074b25088d839cf658f;hp=055d3e9f0cfc8179ffbf08e8c3ed5c2b6b5c97fc;hpb=2a71889bf86463fb752bcbab248da47b25b4fd9a;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-1sks.c b/src/ui/gui/psppire-dialog-action-1sks.c index 055d3e9f0c..f0654c6b71 100644 --- a/src/ui/gui/psppire-dialog-action-1sks.c +++ b/src/ui/gui/psppire-dialog-action-1sks.c @@ -43,32 +43,32 @@ append_fragment (GString *string, const gchar *dist, PsppireVarView *vv) { g_string_append (string, "\n\t/KOLMOGOROV-SMIRNOV"); - g_string_append (string, " ( "); + g_string_append (string, " ("); g_string_append (string, dist); - g_string_append (string, " ) = "); + g_string_append (string, ") = "); psppire_var_view_append_names (vv, 0, string); } static char * -generate_syntax (PsppireDialogAction *act) +generate_syntax (const PsppireDialogAction *act) { PsppireDialogAction1sks *rd = PSPPIRE_DIALOG_ACTION_1SKS (act); gchar *text; GString *string = g_string_new ("NPAR TEST"); - if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->cb[CB_NORMAL]))) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->cb[CB_NORMAL]))) append_fragment (string, "NORMAL", PSPPIRE_VAR_VIEW (rd->variables)); - if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->cb[CB_UNIFORM]))) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->cb[CB_UNIFORM]))) append_fragment (string, "UNIFORM", PSPPIRE_VAR_VIEW (rd->variables)); - if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->cb[CB_POISSON]))) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->cb[CB_POISSON]))) append_fragment (string, "POISSON", PSPPIRE_VAR_VIEW (rd->variables)); - if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->cb[CB_EXPONENTIAL]))) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->cb[CB_EXPONENTIAL]))) append_fragment (string, "EXPONENTIAL", PSPPIRE_VAR_VIEW (rd->variables)); g_string_append (string, ".\n"); @@ -94,10 +94,10 @@ dialog_state_valid (gpointer data) for (i = 0; i < 4; ++i) { - if ( TRUE == gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (fd->cb[i]))) + if (TRUE == gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (fd->cb[i]))) break; } - if ( i >= 4) + if (i >= 4) return FALSE; return TRUE; @@ -116,13 +116,14 @@ refresh (PsppireDialogAction *rd_) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fd->cb[i]), FALSE); } -static void -psppire_dialog_action_1sks_activate (GtkAction *a) +static GtkBuilder * +psppire_dialog_action_1sks_activate (PsppireDialogAction *a, GVariant *param) { PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogAction1sks *act = PSPPIRE_DIALOG_ACTION_1SKS (a); GtkBuilder *xml = builder_new ("ks-one-sample.ui"); + pda->dialog = get_widget_assert (xml, "ks-one-sample-dialog"); pda->source = get_widget_assert (xml, "dict-view"); @@ -135,17 +136,13 @@ psppire_dialog_action_1sks_activate (GtkAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - - g_object_unref (xml); - - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_1sks_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_1sks_parent_class)->activate (pda); + return xml; } static void psppire_dialog_action_1sks_class_init (PsppireDialogAction1sksClass *class) { - psppire_dialog_action_set_activation (class, psppire_dialog_action_1sks_activate); + PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_1sks_activate; PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; }