projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup
[pspp]
/
src
/
ui
/
gui
/
missing-val-dialog.c
diff --git
a/src/ui/gui/missing-val-dialog.c
b/src/ui/gui/missing-val-dialog.c
index 83ec504edde789941812d75c392df4ec445c8f9e..3ee221d7613a45ccac3a39ba763fefd421fcc8c5 100644
(file)
--- a/
src/ui/gui/missing-val-dialog.c
+++ b/
src/ui/gui/missing-val-dialog.c
@@
-1,5
+1,6
@@
/* PSPPIRE - a graphical user interface for PSPP.
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2005, 2006, 2009, 2011, 2012, 2015, 2016 Free Software Foundation
+ Copyright (C) 2005, 2006, 2009, 2011, 2012, 2015, 2016,
+ 2020 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
@@
-195,12
+196,13
@@
err_dialog (const gchar *msg, GtkWindow *window)
static gboolean
try_missing_value(const PsppireMissingValDialog *dialog, const gchar *text, union value *vp)
{
static gboolean
try_missing_value(const PsppireMissingValDialog *dialog, const gchar *text, union value *vp)
{
- const int var_width = fmt_var_width (
&
dialog->format);
+ const int var_width = fmt_var_width (dialog->format);
char *error_txt = NULL;
value_init(vp, var_width);
error_txt = data_in (ss_cstr(text), "UTF-8", dialog->format.type,
char *error_txt = NULL;
value_init(vp, var_width);
error_txt = data_in (ss_cstr(text), "UTF-8", dialog->format.type,
- vp, var_width, dialog->encoding);
+ settings_get_fmt_settings (), vp, var_width,
+ dialog->encoding);
if (error_txt)
{
err_dialog (error_txt, GTK_WINDOW (dialog));
if (error_txt)
{
err_dialog (error_txt, GTK_WINDOW (dialog));
@@
-231,21
+233,21
@@
static gboolean
missing_val_dialog_acceptable (gpointer data)
{
PsppireMissingValDialog *dialog = data;
missing_val_dialog_acceptable (gpointer data)
{
PsppireMissingValDialog *dialog = data;
- int var_width = fmt_var_width (
&
dialog->format);
+ int var_width = fmt_var_width (dialog->format);
- if (
gtk_toggle_button_get_active (dialog->button_discrete))
+ if (gtk_toggle_button_get_active (dialog->button_discrete))
{
gint nvals = 0;
gint i;
mv_clear(&dialog->mvl);
{
gint nvals = 0;
gint i;
mv_clear(&dialog->mvl);
- for(i = 0 ; i < 3 ; ++i
)
+ for(i = 0 ; i < 3 ; ++i)
{
gchar *text =
g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->mv[i])));
union value v;
{
gchar *text =
g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->mv[i])));
union value v;
- if (
!text || strlen (g_strstrip (text)) == 0
)
+ if (
!text || strlen (g_strstrip (text)) == 0
)
{
g_free (text);
continue;
{
g_free (text);
continue;
@@
-262,7
+264,7
@@
missing_val_dialog_acceptable (gpointer data)
g_free (text);
value_destroy (&v, var_width);
}
g_free (text);
value_destroy (&v, var_width);
}
- if (
nvals == 0
)
+ if (
nvals == 0
)
{
err_dialog (_("At least one value must be specified"),
GTK_WINDOW (dialog));
{
err_dialog (_("At least one value must be specified"),
GTK_WINDOW (dialog));
@@
-308,7
+310,7
@@
missing_val_dialog_acceptable (gpointer data)
discrete_text = g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->discrete)));
discrete_text = g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->discrete)));
- if (
discrete_text && strlen (g_strstrip (discrete_text)) > 0
)
+ if (
discrete_text && strlen (g_strstrip (discrete_text)) > 0
)
{
union value discrete_val;
if (!try_missing_value (dialog, discrete_text, &discrete_val))
{
union value discrete_val;
if (!try_missing_value (dialog, discrete_text, &discrete_val))
@@
-337,7
+339,7
@@
discrete (GtkToggleButton *button, gpointer data)
gint i;
PsppireMissingValDialog *dialog = data;
gint i;
PsppireMissingValDialog *dialog = data;
- for (i = 0 ; i < 3 ; ++i
)
+ for (i = 0 ; i < 3 ; ++i)
{
gtk_widget_set_sensitive (dialog->mv[i],
gtk_toggle_button_get_active (button));
{
gtk_widget_set_sensitive (dialog->mv[i],
gtk_toggle_button_get_active (button));
@@
-374,6
+376,9
@@
psppire_missing_val_dialog_constructor (GType type,
type, n_properties, properties);
dialog = PSPPIRE_MISSING_VAL_DIALOG (obj);
type, n_properties, properties);
dialog = PSPPIRE_MISSING_VAL_DIALOG (obj);
+ g_object_set (dialog, "help-page", "Missing-Observations",
+ "title", _("Missing Values"), NULL);
+
content_area = GTK_CONTAINER (PSPPIRE_DIALOG (dialog));
xml = builder_new ("missing-val-dialog.ui");
gtk_container_add (GTK_CONTAINER (content_area),
content_area = GTK_CONTAINER (PSPPIRE_DIALOG (dialog));
xml = builder_new ("missing-val-dialog.ui");
gtk_container_add (GTK_CONTAINER (content_area),
@@
-430,7
+435,7
@@
psppire_missing_val_dialog_set_variable (PsppireMissingValDialog *dialog,
else
mv_copy (&dialog->mvl, vmv);
dialog->encoding = g_strdup (var_get_encoding (var));
else
mv_copy (&dialog->mvl, vmv);
dialog->encoding = g_strdup (var_get_encoding (var));
- dialog->format =
*
var_get_print_format (var);
+ dialog->format = var_get_print_format (var);
}
else
{
}
else
{
@@
-447,20
+452,20
@@
psppire_missing_val_dialog_set_variable (PsppireMissingValDialog *dialog,
gtk_widget_set_sensitive (dialog->high, FALSE);
gtk_widget_set_sensitive (dialog->discrete, FALSE);
gtk_widget_set_sensitive (dialog->high, FALSE);
gtk_widget_set_sensitive (dialog->discrete, FALSE);
- var_type = val_type_from_width (fmt_var_width (
&
dialog->format));
+ var_type = val_type_from_width (fmt_var_width (dialog->format));
gtk_widget_set_sensitive (GTK_WIDGET (dialog->button_range),
var_type == VAL_NUMERIC);
if (var == NULL)
return;
gtk_widget_set_sensitive (GTK_WIDGET (dialog->button_range),
var_type == VAL_NUMERIC);
if (var == NULL)
return;
- for (i = 0 ; i < 3 ; ++i
)
+ for (i = 0 ; i < 3 ; ++i)
{
gtk_entry_set_text (GTK_ENTRY (dialog->mv[i]), "");
gtk_widget_set_sensitive (dialog->mv[i], FALSE);
}
{
gtk_entry_set_text (GTK_ENTRY (dialog->mv[i]), "");
gtk_widget_set_sensitive (dialog->mv[i], FALSE);
}
- if (
mv_has_range (&dialog->mvl))
+ if (mv_has_range (&dialog->mvl))
{
union value low, high;
gchar *low_text;
{
union value low, high;
gchar *low_text;
@@
-468,19
+473,19
@@
psppire_missing_val_dialog_set_variable (PsppireMissingValDialog *dialog,
mv_get_range (&dialog->mvl, &low.f, &high.f);
mv_get_range (&dialog->mvl, &low.f, &high.f);
- low_text = value_to_text__ (low,
&
dialog->format, dialog->encoding);
- high_text = value_to_text__ (high,
&
dialog->format, dialog->encoding);
+ low_text = value_to_text__ (low, dialog->format, dialog->encoding);
+ high_text = value_to_text__ (high, dialog->format, dialog->encoding);
gtk_entry_set_text (GTK_ENTRY (dialog->low), low_text);
gtk_entry_set_text (GTK_ENTRY (dialog->high), high_text);
g_free (low_text);
g_free (high_text);
gtk_entry_set_text (GTK_ENTRY (dialog->low), low_text);
gtk_entry_set_text (GTK_ENTRY (dialog->high), high_text);
g_free (low_text);
g_free (high_text);
- if (
mv_has_value (&dialog->mvl))
+ if (mv_has_value (&dialog->mvl))
{
gchar *text;
text = value_to_text__ (*mv_get_value (&dialog->mvl, 0),
{
gchar *text;
text = value_to_text__ (*mv_get_value (&dialog->mvl, 0),
-
&
dialog->format, dialog->encoding);
+ dialog->format, dialog->encoding);
gtk_entry_set_text (GTK_ENTRY (dialog->discrete), text);
g_free (text);
}
gtk_entry_set_text (GTK_ENTRY (dialog->discrete), text);
g_free (text);
}
@@
-491,18
+496,18
@@
psppire_missing_val_dialog_set_variable (PsppireMissingValDialog *dialog,
gtk_widget_set_sensitive (dialog->discrete, TRUE);
}
gtk_widget_set_sensitive (dialog->discrete, TRUE);
}
- else if (
mv_has_value (&dialog->mvl))
+ else if (mv_has_value (&dialog->mvl))
{
const int n = mv_n_values (&dialog->mvl);
{
const int n = mv_n_values (&dialog->mvl);
- for (i = 0 ; i < 3 ; ++i
)
+ for (i = 0 ; i < 3 ; ++i)
{
{
- if (
i < n)
+ if (i < n)
{
gchar *text ;
text = value_to_text__ (*mv_get_value (&dialog->mvl, i),
{
gchar *text ;
text = value_to_text__ (*mv_get_value (&dialog->mvl, i),
-
&
dialog->format, dialog->encoding);
+ dialog->format, dialog->encoding);
gtk_entry_set_text (GTK_ENTRY (dialog->mv[i]), text);
g_free (text);
}
gtk_entry_set_text (GTK_ENTRY (dialog->mv[i]), text);
g_free (text);
}
@@
-510,7
+515,7
@@
psppire_missing_val_dialog_set_variable (PsppireMissingValDialog *dialog,
}
gtk_toggle_button_set_active (dialog->button_discrete, TRUE);
}
}
gtk_toggle_button_set_active (dialog->button_discrete, TRUE);
}
- else if (
mv_is_empty (&dialog->mvl))
+ else if (mv_is_empty (&dialog->mvl))
{
gtk_toggle_button_set_active (dialog->button_none, TRUE);
}
{
gtk_toggle_button_set_active (dialog->button_none, TRUE);
}