projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
psppire-data-sheet: Implement primary selection.
[pspp]
/
src
/
ui
/
gui
/
t-test-options.c
diff --git
a/src/ui/gui/t-test-options.c
b/src/ui/gui/t-test-options.c
index ed8ac042daaf7e3e420eb739dcfd0e32a6ef24a1..467d4321ff00a416721cb9cecd17c3b935ff7599 100644
(file)
--- 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.
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007 Free Software Foundation
+ Copyright (C) 2007
, 2012
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
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 <gl/xalloc.h>
#include "psppire-dialog.h"
#include <gl/xalloc.h>
+#include "builder-wrapper.h"
#include "helper.h"
#include "t-test-options.h"
#include "widget-io.h"
#include "helper.h"
#include "t-test-options.h"
#include "widget-io.h"
+#include "psppire-scanf.h"
#include <gettext.h>
#define _(msgid) gettext (msgid)
#include <gettext.h>
#define _(msgid) gettext (msgid)
@@
-49,27
+51,34
@@
struct tt_options_dialog
gdouble confidence_interval;
gboolean non_default_options;
enum exclude_mode excl;
gdouble confidence_interval;
gboolean non_default_options;
enum exclude_mode excl;
+ GtkBuilder *xml;
};
struct tt_options_dialog *
};
struct tt_options_dialog *
-tt_options_dialog_create (Gtk
Builder *xml, Gtk
Window *parent)
+tt_options_dialog_create (GtkWindow *parent)
{
struct tt_options_dialog *tto = xmalloc (sizeof (*tto));
{
struct tt_options_dialog *tto = xmalloc (sizeof (*tto));
+ tto->xml = builder_new ("t-test.ui");
+
tto->confidence =
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 (xml, "options-dialog");
+ tto->dialog = get_widget_assert (
tto->
xml, "options-dialog");
- tto->box = get_widget_assert (xml, "vbox1");
+ tto->box = get_widget_assert (
tto->
xml, "vbox1");
- tto->analysis = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "radiobutton1"));
- tto->listwise = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "radiobutton2"));
+ tto->analysis = GTK_TOGGLE_BUTTON (get_widget_assert (
tto->
xml, "radiobutton1"));
+ tto->listwise = GTK_TOGGLE_BUTTON (get_widget_assert (
tto->
xml, "radiobutton2"));
gtk_widget_show (tto->confidence);
gtk_widget_show (tto->confidence);
-
gtk
_box_pack_start_defaults (GTK_BOX (tto->box), tto->confidence);
+
psppire
_box_pack_start_defaults (GTK_BOX (tto->box), tto->confidence);
gtk_window_set_transient_for (GTK_WINDOW (tto->dialog), parent);
gtk_window_set_transient_for (GTK_WINDOW (tto->dialog), parent);
@@
-84,6
+93,7
@@
void
tt_options_dialog_destroy (struct tt_options_dialog *tto)
{
gtk_container_remove (GTK_CONTAINER (tto->box), tto->confidence);
tt_options_dialog_destroy (struct tt_options_dialog *tto)
{
gtk_container_remove (GTK_CONTAINER (tto->box), tto->confidence);
+ g_object_unref (tto->xml);
g_free (tto);
}
g_free (tto);
}
@@
-115,16
+125,22
@@
tt_options_dialog_run (struct tt_options_dialog *tto)
}
void
}
void
-tt_options_dialog_append_syntax (struct tt_options_dialog *tto, GString *str)
+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
else
- g_string_append (str, "LISTWISE");
+ ds_put_cstr (&dss, "LISTWISE");
+
+ ds_put_c_format (&dss, "\n\t/CRITERIA=CIN(%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);
}
}