projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add "dictionary" property to PsppireVarStore and use it.
[pspp-builds.git]
/
src
/
ui
/
gui
/
weight-cases-dialog.c
diff --git
a/src/ui/gui/weight-cases-dialog.c
b/src/ui/gui/weight-cases-dialog.c
index 1a637f3c660d0cbbb5ff0a9548ad4b567c3d9333..b3087159f941adf7d16b7d2dc1d66f7165ee38d5 100644
(file)
--- a/
src/ui/gui/weight-cases-dialog.c
+++ b/
src/ui/gui/weight-cases-dialog.c
@@
-1,43
+1,37
@@
-/*
- PSPPIRE --- A Graphical User Interface for PSPP
- Copyright (C) 2007 Free Software Foundation
+/* PSPPIRE - a graphical user interface for PSPP.
+ Copyright (C) 2007 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
-
the Free Software Foundation; either version 2
of the License, or
-
(at your option) any later version.
+
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
+
the Free Software Foundation, either version 3
of the License, or
+ (at your option) any later version.
-
This program is distributed in the hope that it will be useful,
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include "weight-cases-dialog.h"
#include "psppire-selector.h"
#include "psppire-dialog.h"
#include <config.h>
#include "weight-cases-dialog.h"
#include "psppire-selector.h"
#include "psppire-dialog.h"
-#include "
helpe
r.h"
-#include "
data-editor
.h"
+#include "
executo
r.h"
+#include "
psppire-data-window
.h"
#include "dict-display.h"
#include <language/syntax-string-source.h>
#include "dict-display.h"
#include <language/syntax-string-source.h>
-#include "
syntax-edito
r.h"
+#include "
helpe
r.h"
#include <gtk/gtk.h>
#include <gtk/gtk.h>
-#include <glade/glade.h>
#include <gettext.h>
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
#include <gettext.h>
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
-/* FIXME: These shouldn't be here */
-#include <gtksheet/gtksheet.h>
#include "psppire-var-store.h"
static void
#include "psppire-var-store.h"
static void
@@
-109,10
+103,10
@@
void
weight_cases_dialog (GObject *o, gpointer data)
{
gint response;
weight_cases_dialog (GObject *o, gpointer data)
{
gint response;
-
struct data_editor *de = data
;
+
PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data)
;
struct weight_cases_dialog wcd;
struct weight_cases_dialog wcd;
- G
ladeXML *xml = XML_NEW ("psppire.glade
");
+ G
tkBuilder *xml = builder_new ("psppire.ui
");
GtkWidget *dialog = get_widget_assert (xml, "weight-cases-dialog");
GtkWidget *source = get_widget_assert (xml, "weight-cases-treeview");
GtkWidget *dialog = get_widget_assert (xml, "weight-cases-dialog");
GtkWidget *source = get_widget_assert (xml, "weight-cases-treeview");
@@
-123,12
+117,12
@@
weight_cases_dialog (GObject *o, gpointer data)
GtkWidget *radiobutton2 = get_widget_assert (xml, "radiobutton2");
GtkWidget *status = get_widget_assert (xml, "weight-status-label");
GtkWidget *radiobutton2 = get_widget_assert (xml, "radiobutton2");
GtkWidget *status = get_widget_assert (xml, "weight-status-label");
- GtkSheet *var_sheet =
- GTK_SHEET (get_widget_assert (de->xml, "variable_sheet"));
+ PsppireVarStore *vs = NULL;
- PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet));
+ g_object_get (de->data_editor, "var-store", &vs, NULL);
+ g_object_get (vs, "dictionary", &wcd.dict, NULL);
- gtk_window_set_transient_for (GTK_WINDOW (dialog),
de->parent.window
);
+ gtk_window_set_transient_for (GTK_WINDOW (dialog),
GTK_WINDOW (de)
);
g_signal_connect (radiobutton1, "toggled", G_CALLBACK (on_toggle), entry);
g_signal_connect (selector, "selected", G_CALLBACK (on_select),
g_signal_connect (radiobutton1, "toggled", G_CALLBACK (on_toggle), entry);
g_signal_connect (selector, "selected", G_CALLBACK (on_select),
@@
-137,21
+131,22
@@
weight_cases_dialog (GObject *o, gpointer data)
g_signal_connect (selector, "de-selected", G_CALLBACK (on_deselect),
radiobutton1);
g_signal_connect (selector, "de-selected", G_CALLBACK (on_deselect),
radiobutton1);
- attach_dictionary_to_treeview (GTK_TREE_VIEW (source),
-
vs->
dict,
- GTK_SELECTION_SINGLE,
- var_is_numeric
- );
+
+
g_object_set (source, "dictionary", wcd.
dict,
+
"selection-mode",
GTK_SELECTION_SINGLE,
+ "predicate", var_is_numeric,
+
NULL
);
psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
source,
entry,
insert_source_row_into_entry,
psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
source,
entry,
insert_source_row_into_entry,
- is_currently_in_entry
+ is_currently_in_entry,
+ NULL
);
);
- wcd.dict = vs->dict;
+
wcd.entry = GTK_ENTRY (entry);
wcd.status = GTK_LABEL (status);
wcd.off = GTK_TOGGLE_BUTTON (radiobutton1);
wcd.entry = GTK_ENTRY (entry);
wcd.status = GTK_LABEL (status);
wcd.off = GTK_TOGGLE_BUTTON (radiobutton1);
@@
-177,12
+172,7
@@
weight_cases_dialog (GObject *o, gpointer data)
case PSPPIRE_RESPONSE_PASTE:
{
gchar *syntax = generate_syntax (&wcd);
case PSPPIRE_RESPONSE_PASTE:
{
gchar *syntax = generate_syntax (&wcd);
-
- struct syntax_editor *se =
- (struct syntax_editor *) window_create (WINDOW_SYNTAX, NULL);
-
- gtk_text_buffer_insert_at_cursor (se->buffer, syntax, -1);
-
+ paste_syntax_in_new_window (syntax);
g_free (syntax);
}
break;
g_free (syntax);
}
break;