projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
simplify weighting
[pspp]
/
src
/
ui
/
gui
/
psppire-dialog-action-chisquare.c
diff --git
a/src/ui/gui/psppire-dialog-action-chisquare.c
b/src/ui/gui/psppire-dialog-action-chisquare.c
index 36c68c064e42d68f0c996eafb7f3ff07530a0c57..4fd09d0a44726986b3f555d3a66386271a035345 100644
(file)
--- a/
src/ui/gui/psppire-dialog-action-chisquare.c
+++ b/
src/ui/gui/psppire-dialog-action-chisquare.c
@@
-1,5
+1,5
@@
/* PSPPIRE - a graphical user interface for PSPP.
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2010, 2011, 2012, 2013 Free Software Foundation
+ Copyright (C) 2010, 2011, 2012, 2013
, 2014
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
@@
-19,6
+19,8
@@
#include "psppire-dialog-action-chisquare.h"
#include "psppire-dialog-action-chisquare.h"
+#include <float.h>
+
#include "psppire-var-view.h"
#include "psppire-dialog.h"
#include "psppire-var-view.h"
#include "psppire-dialog.h"
@@
-35,7
+37,7
@@
G_DEFINE_TYPE (PsppireDialogActionChisquare, psppire_dialog_action_chisquare, PS
static char *
static char *
-generate_syntax (PsppireDialogAction *act)
+generate_syntax (
const
PsppireDialogAction *act)
{
PsppireDialogActionChisquare *scd = PSPPIRE_DIALOG_ACTION_CHISQUARE (act);
{
PsppireDialogActionChisquare *scd = PSPPIRE_DIALOG_ACTION_CHISQUARE (act);
@@
-46,11
+48,11
@@
generate_syntax (PsppireDialogAction *act)
psppire_var_view_append_names_str (PSPPIRE_VAR_VIEW (scd->var_view), 0, &dss);
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,
+
+ ds_put_cstr (&dss,
gtk_entry_get_text (GTK_ENTRY (scd->value_lower)));
ds_put_cstr (&dss, ", ");
gtk_entry_get_text (GTK_ENTRY (scd->value_lower)));
ds_put_cstr (&dss, ", ");
@@
-61,7
+63,7
@@
generate_syntax (PsppireDialogAction *act)
ds_put_cstr (&dss, ")");
}
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;
{
GtkListStore *ls = scd->expected_list;
GtkTreeIter iter;
@@
-70,7
+72,7
@@
generate_syntax (PsppireDialogAction *act)
ds_put_cstr (&dss, "\n\t");
ds_put_cstr (&dss, "/EXPECTED = ");
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;
for (ok = gtk_tree_model_get_iter_first (GTK_TREE_MODEL(ls),
&iter);
ok;
@@
-80,7
+82,7
@@
generate_syntax (PsppireDialogAction *act)
gtk_tree_model_get (GTK_TREE_MODEL (ls), &iter, 0, &v, -1);
gtk_tree_model_get (GTK_TREE_MODEL (ls), &iter, 0, &v, -1);
- ds_put_c_format (&dss, " %
g"
, v);
+ ds_put_c_format (&dss, " %
.*g", DBL_DIG + 1
, v);
}
}
}
}
@@
-103,7
+105,7
@@
dialog_state_valid (gpointer a)
GtkTreeModel *vars =
gtk_tree_view_get_model (GTK_TREE_VIEW (act->var_view));
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;
return FALSE;
return TRUE;
@@
-126,8
+128,8
@@
refresh (PsppireDialogAction *rd_)
gtk_entry_set_text (GTK_ENTRY (csd->value_upper), "");
}
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);
{
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionChisquare *act = PSPPIRE_DIALOG_ACTION_CHISQUARE (a);
@@
-157,19
+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);
psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
psppire_dialog_action_set_refresh (pda, refresh);
- g_object_unref (xml);
-
- 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);
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);
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),
expected_value_entry);
psppire_acr_set_entry (PSPPIRE_ACR (values_acr),
@@
-177,17
+177,13
@@
psppire_dialog_action_chisquare_activate (GtkAction *a)
psppire_acr_set_model(PSPPIRE_ACR (values_acr), act->expected_list);
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)
{
}
static void
psppire_dialog_action_chisquare_class_init (PsppireDialogActionChisquareClass *class)
{
- GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
- action_class->activate = 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;
}
PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
}