projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename psppire_dialog_action_get_pointer -> psppire_dialog_action_get_hash_table
[pspp]
/
src
/
ui
/
gui
/
psppire-dialog-action-binomial.c
diff --git
a/src/ui/gui/psppire-dialog-action-binomial.c
b/src/ui/gui/psppire-dialog-action-binomial.c
index 2641684c1ca762d85818cff1cc435ee54854bd06..2efcc6c4b017b8110948ff9d199832d8e11521bd 100644
(file)
--- a/
src/ui/gui/psppire-dialog-action-binomial.c
+++ b/
src/ui/gui/psppire-dialog-action-binomial.c
@@
-1,5
+1,5
@@
/* PSPPIRE - a graphical user interface for PSPP.
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2012 Free Software Foundation
+ Copyright (C) 2012
, 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
@@
-20,6
+20,8
@@
#include "psppire-dialog-action-binomial.h"
#include "psppire-value-entry.h"
#include "psppire-dialog-action-binomial.h"
#include "psppire-value-entry.h"
+#include <float.h>
+
#include "dialog-common.h"
#include "helper.h"
#include <ui/syntax-gen.h>
#include "dialog-common.h"
#include "helper.h"
#include <ui/syntax-gen.h>
@@
-100,7
+102,13
@@
psppire_dialog_action_binomial_activate (GtkAction *a)
PsppireDialogActionBinomial *act = PSPPIRE_DIALOG_ACTION_BINOMIAL (a);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionBinomial *act = PSPPIRE_DIALOG_ACTION_BINOMIAL (a);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
- GtkBuilder *xml = builder_new ("binomial.ui");
+ GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("binomial.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
pda->dialog = get_widget_assert (xml, "binomial-dialog");
pda->source = get_widget_assert (xml, "dict-view");
pda->dialog = get_widget_assert (xml, "binomial-dialog");
pda->source = get_widget_assert (xml, "dict-view");
@@
-112,9
+120,6
@@
psppire_dialog_action_binomial_activate (GtkAction *a)
act->cutpoint_entry = get_widget_assert (xml, "cutpoint-entry");
act->cutpoint_button = get_widget_assert (xml, "radiobutton4");
act->cutpoint_entry = get_widget_assert (xml, "cutpoint-entry");
act->cutpoint_button = get_widget_assert (xml, "radiobutton4");
- g_object_unref (xml);
-
-
g_signal_connect (act->cutpoint_button, "toggled", G_CALLBACK (set_sensitivity_from_toggle),
act->cutpoint_entry);
g_signal_connect (act->cutpoint_button, "toggled", G_CALLBACK (set_sensitivity_from_toggle),
act->cutpoint_entry);
@@
-141,7
+146,7
@@
generate_syntax (PsppireDialogAction *a)
ds_init_cstr (&str, "NPAR TEST\n\t/BINOMIAL");
if ( get_proportion (scd, &prop))
ds_init_cstr (&str, "NPAR TEST\n\t/BINOMIAL");
if ( get_proportion (scd, &prop))
- ds_put_c_format (&str, "(%
g)"
, prop);
+ ds_put_c_format (&str, "(%
.*g)", DBL_DIG + 1
, prop);
ds_put_cstr (&str, " =");
ds_put_cstr (&str, " =");
@@
-165,9
+170,7
@@
generate_syntax (PsppireDialogAction *a)
static void
psppire_dialog_action_binomial_class_init (PsppireDialogActionBinomialClass *class)
{
static void
psppire_dialog_action_binomial_class_init (PsppireDialogActionBinomialClass *class)
{
- GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
- action_class->activate = psppire_dialog_action_binomial_activate;
+ psppire_dialog_action_set_activation (class, psppire_dialog_action_binomial_activate);
PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
}
PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
}