projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
axes marked properly
[pspp]
/
src
/
ui
/
gui
/
val-labs-dialog.c
diff --git
a/src/ui/gui/val-labs-dialog.c
b/src/ui/gui/val-labs-dialog.c
index d1649e900bae47ccf5f8eee28e578a69e84ae2da..226021507f45796632a945e37c3ff44bccc661a0 100644
(file)
--- a/
src/ui/gui/val-labs-dialog.c
+++ b/
src/ui/gui/val-labs-dialog.c
@@
-1,5
+1,6
@@
/* PSPPIRE - a graphical user interface for PSPP.
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2005, 2009, 2010, 2011, 2012, 2015, 2016 Free Software Foundation
+ Copyright (C) 2005, 2009, 2010, 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
@@
-125,6
+126,7
@@
psppire_val_labs_dialog_init (PsppireValLabsDialog *obj)
runs after the construction properties have been set. Otherwise
PsppireDialog's "orientation" property hasn't been set and therefore we
have no box to populate. */
runs after the construction properties have been set. Otherwise
PsppireDialog's "orientation" property hasn't been set and therefore we
have no box to populate. */
+
obj->labs = val_labs_create (0);
}
obj->labs = val_labs_create (0);
}
@@
-142,10
+144,12
@@
psppire_val_labs_dialog_finalize (GObject *obj)
PsppireValLabsDialog *
psppire_val_labs_dialog_new (const struct variable *var)
{
PsppireValLabsDialog *
psppire_val_labs_dialog_new (const struct variable *var)
{
- return PSPPIRE_VAL_LABS_DIALOG (
- g_object_new (PSPPIRE_TYPE_VAL_LABS_DIALOG,
- "variable", var,
- NULL));
+ PsppireValLabsDialog *obj
+ = PSPPIRE_VAL_LABS_DIALOG (g_object_new (PSPPIRE_TYPE_VAL_LABS_DIALOG,
+ "variable", var,
+ NULL));
+
+ return obj;
}
struct val_labs *
}
struct val_labs *
@@
-160,9
+164,16
@@
psppire_val_labs_dialog_run (GtkWindow *parent_window,
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gtk_widget_show (GTK_WIDGET (dialog));
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gtk_widget_show (GTK_WIDGET (dialog));
- labs = (psppire_dialog_run (PSPPIRE_DIALOG (dialog)) == GTK_RESPONSE_OK
- ? val_labs_clone (psppire_val_labs_dialog_get_value_labels (dialog))
- : NULL);
+ gint response = psppire_dialog_run (PSPPIRE_DIALOG (dialog));
+ switch (response)
+ {
+ case GTK_RESPONSE_OK:
+ labs = val_labs_clone (psppire_val_labs_dialog_get_value_labels (dialog));
+ break;
+ default:
+ labs = NULL;
+ break;
+ }
gtk_widget_destroy (GTK_WIDGET (dialog));
gtk_widget_destroy (GTK_WIDGET (dialog));
@@
-474,6
+485,9
@@
psppire_val_labs_dialog_constructor (GType type,
type, n_properties, properties);
dialog = PSPPIRE_VAL_LABS_DIALOG (obj);
type, n_properties, properties);
dialog = PSPPIRE_VAL_LABS_DIALOG (obj);
+ g_object_set (dialog, "help-page", "VALUE-LABELS",
+ "title", _("Value Labels"), NULL);
+
content_area = GTK_CONTAINER (PSPPIRE_DIALOG (dialog));
gtk_container_add (GTK_CONTAINER (content_area),
get_widget_assert (xml, "val-labs-dialog"));
content_area = GTK_CONTAINER (PSPPIRE_DIALOG (dialog));
gtk_container_add (GTK_CONTAINER (content_area),
get_widget_assert (xml, "val-labs-dialog"));
@@
-527,7
+541,9
@@
psppire_val_labs_dialog_constructor (GType type,
g_signal_connect (dialog->add_button, "clicked",
G_CALLBACK (on_add), dialog);
g_signal_connect (dialog->add_button, "clicked",
G_CALLBACK (on_add), dialog);
- dialog->labs = NULL;
+ /* dialog->labs must not be set here, because as a member of a singleton
+ class its value persists "between" objects. */
+ /* dialog->labs = NULL; */
g_object_unref (xml);
g_object_unref (xml);
@@
-590,7
+606,6
@@
repopulate_dialog (PsppireValLabsDialog *dialog)
GTK_TREE_MODEL (list_store));
g_object_unref (list_store);
GTK_TREE_MODEL (list_store));
g_object_unref (list_store);
-
}
void
}
void