X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Ft-test-options.c;h=1b28eefdb631865cd6a7df23dd7b29275437690d;hb=a9e5621ea36156f1855bfa701f9fae07a648c844;hp=89fe3434d54ec5827711f11da59cc99c45f32c0e;hpb=ab3ae49b850af736519c2bb9f08152ed9a994982;p=pspp diff --git a/src/ui/gui/t-test-options.c b/src/ui/gui/t-test-options.c index 89fe3434d5..1b28eefdb6 100644 --- a/src/ui/gui/t-test-options.c +++ b/src/ui/gui/t-test-options.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007 Free Software Foundation + Copyright (C) 2007, 2012, 2015 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,10 +21,12 @@ #include "psppire-dialog.h" #include +#include "builder-wrapper.h" #include "helper.h" #include "t-test-options.h" #include "widget-io.h" +#include "psppire-scanf.h" #include #define _(msgid) gettext (msgid) @@ -60,8 +62,12 @@ tt_options_dialog_create (GtkWindow *parent) tto->xml = builder_new ("t-test.ui"); tto->confidence = - widget_scanf (_("Confidence Interval: %2d %%"), - &tto->conf_percent); + psppire_scanf_new (_("Con_fidence Interval: %2d %%"), &tto->conf_percent); + + g_object_set (tto->confidence, + "use-underline", TRUE, + "mnemonic-widget", psppire_scanf_get_child (PSPPIRE_SCANF (tto->confidence), 0), + NULL); tto->dialog = get_widget_assert (tto->xml, "options-dialog"); @@ -86,6 +92,8 @@ tt_options_dialog_create (GtkWindow *parent) void tt_options_dialog_destroy (struct tt_options_dialog *tto) { + if (tto == NULL) + return; gtk_container_remove (GTK_CONTAINER (tto->box), tto->confidence); g_object_unref (tto->xml); g_free (tto); @@ -121,14 +129,20 @@ tt_options_dialog_run (struct tt_options_dialog *tto) void tt_options_dialog_append_syntax (const struct tt_options_dialog *tto, GString *str) { - g_string_append (str, "\t/MISSING="); + struct string dss; + ds_init_empty (&dss); + + ds_put_cstr (&dss, "\t/MISSING="); - if ( tto->excl == EXCL_ANALYSIS ) - g_string_append (str, "ANALYSIS"); + if (tto->excl == EXCL_ANALYSIS) + ds_put_cstr (&dss, "ANALYSIS"); else - g_string_append (str, "LISTWISE"); + ds_put_cstr (&dss, "LISTWISE"); + + ds_put_c_format (&dss, "\n\t/CRITERIA=CI(%g)", + tto->confidence_interval/100.0); + g_string_append (str, ds_cstr (&dss)); - g_string_append_printf (str, "\n\t/CRITERIA=CIN(%g)", - tto->confidence_interval/100.0); + ds_destroy (&dss); }