From: John Darrington Date: Sun, 4 Jan 2009 08:30:30 +0000 (+0900) Subject: Merge commit 'HEAD'; commit 'master/master' X-Git-Tag: v0.7.3~296^2~8^2~1 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6bcae693f035491ae0625f301f3e630c1335555;p=pspp-builds.git Merge commit 'HEAD'; commit 'master/master' Conflicts: src/ui/gui/crosstabs-dialog.c src/ui/gui/goto-case-dialog.c src/ui/gui/helper.c src/ui/gui/regression-dialog.c --- b6bcae693f035491ae0625f301f3e630c1335555 diff --cc src/ui/gui/comments-dialog.c index 34c9957d,34c9957d,f425fac2..49d143cb --- a/src/ui/gui/comments-dialog.c +++ b/src/ui/gui/comments-dialog.c @@@@ -96,10 -96,10 -94,10 +95,10 @@@@ comments_dialog (GObject *o, gpointer d { GtkTextIter iter; gint response ; - struct data_editor *de = data; + PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data); struct comment_dialog cd; -- GladeXML *xml = XML_NEW ("psppire.glade"); ++ GtkBuilder *xml = builder_new ("psppire.ui"); GtkWidget *dialog = get_widget_assert (xml, "comments-dialog"); GtkWidget *textview = get_widget_assert (xml, "comments-textview1"); diff --cc src/ui/gui/crosstabs-dialog.c index 9654a27c,9654a27c,2c50b461..188c4aaa --- a/src/ui/gui/crosstabs-dialog.c +++ b/src/ui/gui/crosstabs-dialog.c @@@@ -23,13 -23,13 -23,13 +23,13 @@@@ #include #include -#include +#include #include #include -- #include ++ #include "helper.h" #include #include -#include +#include #include "gettext.h" #define _(msgid) gettext (msgid) @@@@ -385,15 -385,15 -385,13 +385,14 @@@@ voi crosstabs_dialog (GObject *o, gpointer data) { gint response; - struct data_editor *de = data; - struct crosstabs_dialog cd; -- GladeXML *xml = XML_NEW ("crosstabs.glade"); -- ++ GtkBuilder *xml = builder_new ("crosstabs.ui"); PsppireVarStore *vs = NULL; + PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data); + + GtkWidget *dialog = get_widget_assert (xml, "crosstabs-dialog"); GtkWidget *source = get_widget_assert (xml, "dict-treeview"); GtkWidget *dest_rows = get_widget_assert (xml, "rows"); diff --cc src/ui/gui/find-dialog.c index ad9bf842,ad9bf842,985e73fb..130b25cf --- a/src/ui/gui/find-dialog.c +++ b/src/ui/gui/find-dialog.c @@@@ -52,10 -52,10 -51,10 +51,10 @@@@ which match particular strings * struct find_dialog { -- GladeXML *xml; ++ GtkBuilder *xml; PsppireDict *dict; struct datasheet *data; - struct data_editor *de; + PsppireDataWindow *de; GtkWidget *variable_entry; GtkWidget *value_entry; GtkWidget *value_labels_checkbox; diff --cc src/ui/gui/goto-case-dialog.c index 57db5865,57db5865,a22b5cb0..9a523943 --- a/src/ui/gui/goto-case-dialog.c +++ b/src/ui/gui/goto-case-dialog.c @@@@ -24,7 -24,7 -24,7 +24,7 @@@@ static void -- refresh (const PsppireDataWindow *de, GladeXML *xml) -refresh (const struct data_editor *de, GtkBuilder *xml) +++refresh (const PsppireDataWindow *de, GtkBuilder *xml) { PsppireDataStore *ds = NULL; casenumber case_count ; @@@@ -43,8 -43,8 -43,8 +43,8 @@@@ voi goto_case_dialog (GObject *o, gpointer data) { gint response; -- GladeXML *xml = XML_NEW ("psppire.glade"); ++ GtkBuilder *xml = builder_new ("psppire.ui"); - struct data_editor *de = data; + PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data); GtkWidget *dialog = get_widget_assert (xml, "goto-case-dialog"); diff --cc src/ui/gui/helper.c index 12003e2a,12003e2a,fc9105d7..1d4ae027 --- a/src/ui/gui/helper.c +++ b/src/ui/gui/helper.c @@@@ -299,14 -299,14 -319,4 +321,12 @@@@ clone_list_store (const GtkListStore *s } -- -- +void +paste_syntax_in_new_window (const gchar *syntax) +{ + GtkWidget *se = psppire_syntax_window_new (); + gtk_text_buffer_insert_at_cursor (PSPPIRE_SYNTAX_WINDOW (se)->buffer, syntax, -1); + + gtk_widget_show (se); +} diff --cc src/ui/gui/oneway-anova-dialog.c index 45e88807,45e88807,59b65b4a..d41b2760 --- a/src/ui/gui/oneway-anova-dialog.c +++ b/src/ui/gui/oneway-anova-dialog.c @@@@ -166,9 -166,9 -166,9 +166,9 @@@@ oneway_anova_dialog (GObject *o, gpoint ow.dict = vs->dict; ow.dialog = -- GTK_WINDOW (get_widget_assert (xml, "oneway-anova-dialog")); ++ GTK_WINDOW (get_widget_assert (builder, "oneway-anova-dialog")); - gtk_window_set_transient_for (ow.dialog, de->parent.window); + gtk_window_set_transient_for (ow.dialog, GTK_WINDOW (de)); attach_dictionary_to_treeview (GTK_TREE_VIEW (dict_view), vs->dict, diff --cc src/ui/gui/psppire-syntax-window.c index 421ae2ca,421ae2ca,00000000..4241949e mode 100644,100644,000000..100644 --- a/src/ui/gui/psppire-syntax-window.c +++ b/src/ui/gui/psppire-syntax-window.c @@@@ -1,630 -1,630 -1,0 +1,627 @@@@ +/* PSPPIRE - a graphical user interface for PSPP. + Copyright (C) 2008 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 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. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include +#include +#include +#include "helper.h" + +#include +#include + +#include "psppire-syntax-window.h" + +#include "psppire-data-window.h" +#include "psppire-window-register.h" +#include "about.h" +#include "psppire-syntax-window.h" +#include "syntax-editor-source.h" +#include + +#include +#define _(msgid) gettext (msgid) +#define N_(msgid) msgid + +static void psppire_syntax_window_base_finalize (PsppireSyntaxWindowClass *, gpointer); +static void psppire_syntax_window_base_init (PsppireSyntaxWindowClass *class); +static void psppire_syntax_window_class_init (PsppireSyntaxWindowClass *class); +static void psppire_syntax_window_init (PsppireSyntaxWindow *syntax_editor); + +GType +psppire_syntax_window_get_type (void) +{ + static GType psppire_syntax_window_type = 0; + + if (!psppire_syntax_window_type) + { + static const GTypeInfo psppire_syntax_window_info = + { + sizeof (PsppireSyntaxWindowClass), + (GBaseInitFunc) psppire_syntax_window_base_init, + (GBaseFinalizeFunc) psppire_syntax_window_base_finalize, + (GClassInitFunc)psppire_syntax_window_class_init, + (GClassFinalizeFunc) NULL, + NULL, + sizeof (PsppireSyntaxWindow), + 0, + (GInstanceInitFunc) psppire_syntax_window_init, + }; + + psppire_syntax_window_type = + g_type_register_static (PSPPIRE_WINDOW_TYPE, "PsppireSyntaxWindow", + &psppire_syntax_window_info, 0); + } + + return psppire_syntax_window_type; +} + +static GObjectClass *parent_class ; + +static void +psppire_syntax_window_finalize (GObject *object) +{ + if (G_OBJECT_CLASS (parent_class)->finalize) + (*G_OBJECT_CLASS (parent_class)->finalize) (object); +} + + +static void +psppire_syntax_window_class_init (PsppireSyntaxWindowClass *class) +{ + parent_class = g_type_class_peek_parent (class); +} + + +static void +psppire_syntax_window_base_init (PsppireSyntaxWindowClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->finalize = psppire_syntax_window_finalize; +} + + + +static void +psppire_syntax_window_base_finalize (PsppireSyntaxWindowClass *class, + gpointer class_data) +{ +} + + +static void +editor_execute_syntax (const PsppireSyntaxWindow *sw, GtkTextIter start, + GtkTextIter stop) +{ + PsppireWindow *win = PSPPIRE_WINDOW (sw); + const gchar *name = psppire_window_get_filename (win); + execute_syntax (create_syntax_editor_source (sw->buffer, start, stop, name)); +} + + +/* Parse and execute all the text in the buffer */ +static void +on_run_all (GtkMenuItem *menuitem, gpointer user_data) +{ + GtkTextIter begin, end; + PsppireSyntaxWindow *se = PSPPIRE_SYNTAX_WINDOW (user_data); + + gtk_text_buffer_get_iter_at_offset (se->buffer, &begin, 0); + gtk_text_buffer_get_iter_at_offset (se->buffer, &end, -1); + + editor_execute_syntax (se, begin, end); +} + +/* Parse and execute the currently selected text */ +static void +on_run_selection (GtkMenuItem *menuitem, gpointer user_data) +{ + GtkTextIter begin, end; + PsppireSyntaxWindow *se = PSPPIRE_SYNTAX_WINDOW (user_data); + + if ( gtk_text_buffer_get_selection_bounds (se->buffer, &begin, &end) ) + editor_execute_syntax (se, begin, end); +} + + +/* Parse and execute the from the current line, to the end of the + buffer */ +static void +on_run_to_end (GtkMenuItem *menuitem, gpointer user_data) +{ + GtkTextIter begin, end; + GtkTextIter here; + gint line; + + PsppireSyntaxWindow *se = PSPPIRE_SYNTAX_WINDOW (user_data); + + /* Get the current line */ + gtk_text_buffer_get_iter_at_mark (se->buffer, + &here, + gtk_text_buffer_get_insert (se->buffer) + ); + + line = gtk_text_iter_get_line (&here) ; + + /* Now set begin and end to the start of this line, and end of buffer + respectively */ + gtk_text_buffer_get_iter_at_line (se->buffer, &begin, line); + gtk_text_buffer_get_iter_at_line (se->buffer, &end, -1); + + editor_execute_syntax (se, begin, end); +} + + + +/* Parse and execute the current line */ +static void +on_run_current_line (GtkMenuItem *menuitem, gpointer user_data) +{ + GtkTextIter begin, end; + GtkTextIter here; + gint line; + + PsppireSyntaxWindow *se = PSPPIRE_SYNTAX_WINDOW (user_data); + + /* Get the current line */ + gtk_text_buffer_get_iter_at_mark (se->buffer, + &here, + gtk_text_buffer_get_insert (se->buffer) + ); + + line = gtk_text_iter_get_line (&here) ; + + /* Now set begin and end to the start of this line, and start of + following line respectively */ + gtk_text_buffer_get_iter_at_line (se->buffer, &begin, line); + gtk_text_buffer_get_iter_at_line (se->buffer, &end, line + 1); + + editor_execute_syntax (se, begin, end); +} + + + +/* Append ".sps" to FILENAME if necessary. + The returned result must be freed when no longer required. + */ +static gchar * +append_suffix (const gchar *filename) +{ + if ( ! g_str_has_suffix (filename, ".sps" ) && + ! g_str_has_suffix (filename, ".SPS" ) ) + { + return g_strdup_printf ("%s.sps", filename); + } + + return strdup (filename); +} + +/* + Save BUFFER to the file called FILENAME. + If successful, clears the buffer's modified flag +*/ +static gboolean +save_editor_to_file (PsppireSyntaxWindow *se, + const gchar *filename, + GError **err) +{ + GtkTextBuffer *buffer = se->buffer; + gboolean result ; + GtkTextIter start, stop; + gchar *text; + + gchar *suffixedname; + gchar *glibfilename; + g_assert (filename); + + suffixedname = append_suffix (filename); + + glibfilename = g_filename_from_utf8 (suffixedname, -1, 0, 0, err); + + g_free ( suffixedname); + + if ( ! glibfilename ) + return FALSE; + + gtk_text_buffer_get_iter_at_line (buffer, &start, 0); + gtk_text_buffer_get_iter_at_offset (buffer, &stop, -1); + + text = gtk_text_buffer_get_text (buffer, &start, &stop, FALSE); + + result = g_file_set_contents (glibfilename, text, -1, err); + + if ( result ) + { + psppire_window_set_filename (PSPPIRE_WINDOW (se), filename); + gtk_text_buffer_set_modified (buffer, FALSE); + } + + return result; +} + +/* If the buffer's modified flag is set, then save it, and close the window. + Otherwise just close the window. +*/ +static void +save_if_modified (PsppireSyntaxWindow *se) +{ + + if ( TRUE == gtk_text_buffer_get_modified (se->buffer)) + { + gint response; + GtkWidget *dialog; + + const gchar *filename = psppire_window_get_filename (PSPPIRE_WINDOW (se)); + + g_return_if_fail (filename != NULL); + + dialog = + gtk_message_dialog_new (GTK_WINDOW (se), + GTK_DIALOG_MODAL, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_NONE, + _("Save contents of syntax editor to %s?"), + filename); + + gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_YES, + GTK_RESPONSE_ACCEPT); + gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_NO, + GTK_RESPONSE_REJECT); + gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL); + + + response = gtk_dialog_run (GTK_DIALOG (dialog)); + + gtk_widget_destroy (dialog); + + if ( response == GTK_RESPONSE_ACCEPT ) + { + GError *err = NULL; + + if ( ! save_editor_to_file (se, filename, &err) ) + { + msg (ME, err->message); + g_error_free (err); + } + } + + if ( response == GTK_RESPONSE_CANCEL ) + return ; + } + + gtk_widget_destroy (GTK_WIDGET (se)); +} + +/* Callback for the File->SaveAs menuitem */ +static void +on_syntax_save_as (GtkMenuItem *menuitem, gpointer user_data) +{ + GtkFileFilter *filter; + gint response; + + PsppireSyntaxWindow *se = PSPPIRE_SYNTAX_WINDOW (user_data); + + GtkWidget *dialog = + gtk_file_chooser_dialog_new (_("Save Syntax"), + GTK_WINDOW (se), + GTK_FILE_CHOOSER_ACTION_SAVE, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, + NULL); + + filter = gtk_file_filter_new (); + gtk_file_filter_set_name (filter, _("Syntax Files (*.sps) ")); + gtk_file_filter_add_pattern (filter, "*.sps"); + gtk_file_filter_add_pattern (filter, "*.SPS"); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + + filter = gtk_file_filter_new (); + gtk_file_filter_set_name (filter, _("All Files")); + gtk_file_filter_add_pattern (filter, "*"); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + + gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), + TRUE); + response = gtk_dialog_run (GTK_DIALOG (dialog)); + + if ( response == GTK_RESPONSE_ACCEPT ) + { + GError *err = NULL; + char *filename = + gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog) ); + + if ( ! save_editor_to_file (se, filename, &err) ) + { + msg ( ME, err->message ); + g_error_free (err); + } + + free (filename); + } + + gtk_widget_destroy (dialog); +} + + +/* Callback for the File->Save menuitem */ +static void +on_syntax_save (GtkMenuItem *menuitem, gpointer user_data) +{ + PsppireSyntaxWindow *se = PSPPIRE_SYNTAX_WINDOW (user_data); + const gchar *filename = psppire_window_get_filename (PSPPIRE_WINDOW (se)); + + + if ( filename == NULL ) + on_syntax_save_as (menuitem, se); + else + { + GError *err = NULL; + save_editor_to_file (se, filename, &err); + if ( err ) + { + msg (ME, err->message); + g_error_free (err); + } + } +} + + +/* Callback for the File->Quit menuitem */ +static gboolean +on_quit (GtkMenuItem *menuitem, gpointer user_data) +{ + PsppireSyntaxWindow *se = PSPPIRE_SYNTAX_WINDOW (user_data); + save_if_modified (se); + return FALSE; +} + + +/* Callback for the "delete" action (clicking the x on the top right + hand corner of the window) */ +static gboolean +on_delete (GtkWidget *w, GdkEvent *event, gpointer user_data) +{ + PsppireSyntaxWindow *se = PSPPIRE_SYNTAX_WINDOW (user_data); + + save_if_modified (se); + return TRUE; +} + + +void +create_syntax_window (void) +{ + GtkWidget *w = psppire_syntax_window_new (); + gtk_widget_show (w); +} + +/* Callback for the File->Open->Syntax menuitem */ +void +open_syntax_window (GtkMenuItem *menuitem, gpointer parent) +{ + GtkFileFilter *filter; + gint response; + + GtkWidget *dialog = + gtk_file_chooser_dialog_new (_("Open Syntax"), + GTK_WINDOW (parent), + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + NULL); + + filter = gtk_file_filter_new (); + gtk_file_filter_set_name (filter, _("Syntax Files (*.sps) ")); + gtk_file_filter_add_pattern (filter, "*.sps"); + gtk_file_filter_add_pattern (filter, "*.SPS"); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + + filter = gtk_file_filter_new (); + gtk_file_filter_set_name (filter, _("All Files")); + gtk_file_filter_add_pattern (filter, "*"); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + + response = gtk_dialog_run (GTK_DIALOG (dialog)); + + if (response == GTK_RESPONSE_ACCEPT) + { + const char *file_name = gtk_file_chooser_get_filename + (GTK_FILE_CHOOSER (dialog)); + + GtkWidget *se = psppire_syntax_window_new (); + + if ( psppire_syntax_window_load_from_file (PSPPIRE_SYNTAX_WINDOW (se), file_name, NULL) ) +#if RECENT_LISTS_AVAILABLE + { + GtkRecentManager *manager = gtk_recent_manager_get_default(); + gchar *uri = g_filename_to_uri (file_name, NULL, NULL); + + gtk_recent_manager_remove_item (manager, uri, NULL); + if ( ! gtk_recent_manager_add_item (manager, uri)) + g_warning ("Could not add item %s to recent list\n",uri); + + g_free (uri); + } +#else + ; +#endif + gtk_widget_show (se); + } + + gtk_widget_destroy (dialog); +} + + + +extern struct source_stream *the_source_stream ; + +static void +psppire_syntax_window_init (PsppireSyntaxWindow *window) +{ + GladeXML *xml = XML_NEW ("syntax-editor.glade"); + GtkWidget *box = gtk_vbox_new (FALSE, 0); + + GtkWidget *menubar = get_widget_assert (xml, "menubar2"); + GtkWidget *sw = get_widget_assert (xml, "scrolledwindow8"); + GtkWidget *sb = get_widget_assert (xml, "statusbar2"); + + GtkWidget *text_view = get_widget_assert (xml, "syntax_text_view"); + window->buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)); + window->lexer = lex_create (the_source_stream); + + connect_help (xml); + + gtk_container_add (GTK_CONTAINER (window), box); + + g_object_ref (menubar); -- gtk_widget_unparent (menubar); + + g_object_ref (sw); -- gtk_widget_unparent (sw); + + g_object_ref (sb); -- gtk_widget_unparent (sb); + + + gtk_box_pack_start (GTK_BOX (box), menubar, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (box), sw, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (box), sb, FALSE, TRUE, 0); + + gtk_widget_show_all (box); + + g_signal_connect (get_widget_assert (xml,"file_new_syntax"), + "activate", + G_CALLBACK (create_syntax_window), + NULL); + + g_signal_connect (get_widget_assert (xml,"file_open_syntax"), + "activate", + G_CALLBACK (open_syntax_window), + window); + +#if 0 + g_signal_connect (get_widget_assert (xml,"file_new_data"), + "activate", + G_CALLBACK (create_data_window), + window); +#endif + + g_signal_connect (get_widget_assert (xml,"help_about"), + "activate", + G_CALLBACK (about_new), + window); + + g_signal_connect (get_widget_assert (xml,"help_reference"), + "activate", + G_CALLBACK (reference_manual), + NULL); + + g_signal_connect (get_widget_assert (xml, "file_save"), + "activate", + G_CALLBACK (on_syntax_save), + window); + + g_signal_connect (get_widget_assert (xml, "file_save_as"), + "activate", + G_CALLBACK (on_syntax_save_as), + window); + + g_signal_connect (get_widget_assert (xml,"file_quit"), + "activate", + G_CALLBACK (on_quit), + window); + + g_signal_connect (get_widget_assert (xml,"run_all"), + "activate", + G_CALLBACK (on_run_all), + window); + + + g_signal_connect (get_widget_assert (xml,"run_selection"), + "activate", + G_CALLBACK (on_run_selection), + window); + + g_signal_connect (get_widget_assert (xml,"run_current_line"), + "activate", + G_CALLBACK (on_run_current_line), + window); + + g_signal_connect (get_widget_assert (xml,"run_to_end"), + "activate", + G_CALLBACK (on_run_to_end), + window); + + g_signal_connect (get_widget_assert (xml,"windows_minimise_all"), + "activate", + G_CALLBACK (psppire_window_minimise_all), NULL); + + PSPPIRE_WINDOW (window)->menu = GTK_MENU_SHELL (get_widget_assert (xml,"windows_menu")); + + g_object_unref (xml); + + g_signal_connect (window, "delete-event", + G_CALLBACK (on_delete), window); +} + + +GtkWidget* +psppire_syntax_window_new (void) +{ + return GTK_WIDGET (g_object_new (psppire_syntax_window_get_type (), + "usage", PSPPIRE_WINDOW_USAGE_SYNTAX, + NULL)); +} + + +/* + Loads the buffer from the file called FILENAME +*/ +gboolean +psppire_syntax_window_load_from_file (PsppireSyntaxWindow *se, + const gchar *filename, + GError **err) +{ + gchar *text; + GtkTextIter iter; + + gchar *glibfilename = g_filename_from_utf8 (filename, -1, 0, 0, err); + + if ( ! glibfilename ) + return FALSE; + + /* FIXME: What if it's a very big file ? */ + if ( ! g_file_get_contents (glibfilename, &text, NULL, err) ) + { + g_free (glibfilename); + return FALSE; + } + g_free (glibfilename); + + gtk_text_buffer_get_iter_at_line (se->buffer, &iter, 0); + + gtk_text_buffer_insert (se->buffer, &iter, text, -1); + + psppire_window_set_filename (PSPPIRE_WINDOW (se), filename); + + gtk_text_buffer_set_modified (se->buffer, FALSE); + + return TRUE; +} + diff --cc src/ui/gui/recode-dialog.c index 642dae02,642dae02,9d1ad79d..859737f6 --- a/src/ui/gui/recode-dialog.c +++ b/src/ui/gui/recode-dialog.c @@@@ -963,40 -963,40 -962,40 +962,40 @@@@ recode_dialog (PsppireDataWindow *de, g /* Set up the Old & New Values subdialog */ { -- rd.string_button = get_widget_assert (xml, "checkbutton1"); -- rd.width_entry = get_widget_assert (xml, "spinbutton1"); ++ rd.string_button = get_widget_assert (builder, "checkbutton1"); ++ rd.width_entry = get_widget_assert (builder, "spinbutton1"); -- rd.convert_button = get_widget_assert (xml, "checkbutton2"); ++ rd.convert_button = get_widget_assert (builder, "checkbutton2"); -- rd.ov_range_lower_entry = get_widget_assert (xml, "entry5"); -- rd.ov_range_upper_entry = get_widget_assert (xml, "entry3"); -- rd.ov_low_up_entry = get_widget_assert (xml, "entry6"); -- rd.ov_high_down_entry = get_widget_assert (xml, "entry7"); ++ rd.ov_range_lower_entry = get_widget_assert (builder, "entry5"); ++ rd.ov_range_upper_entry = get_widget_assert (builder, "entry3"); ++ rd.ov_low_up_entry = get_widget_assert (builder, "entry6"); ++ rd.ov_high_down_entry = get_widget_assert (builder, "entry7"); -- rd.new_value_entry = get_widget_assert (xml, "entry1"); -- rd.ov_value_entry = get_widget_assert (xml, "entry2"); ++ rd.new_value_entry = get_widget_assert (builder, "entry1"); ++ rd.ov_value_entry = get_widget_assert (builder, "entry2"); -- rd.toggle[BUTTON_NEW_VALUE] = get_widget_assert (xml, "radiobutton1"); -- rd.toggle[BUTTON_NEW_SYSMIS] = get_widget_assert (xml, "radiobutton2"); -- rd.toggle[BUTTON_NEW_COPY] = get_widget_assert (xml, "radiobutton3"); -- rd.toggle[BUTTON_OLD_VALUE] = get_widget_assert (xml, "radiobutton4"); -- rd.toggle[BUTTON_OLD_SYSMIS] = get_widget_assert (xml, "radiobutton6"); -- rd.toggle[BUTTON_OLD_MISSING]= get_widget_assert (xml, "radiobutton7"); -- rd.toggle[BUTTON_OLD_RANGE] = get_widget_assert (xml, "radiobutton8"); -- rd.toggle[BUTTON_OLD_LOW_UP] = get_widget_assert (xml, "radiobutton10"); -- rd.toggle[BUTTON_OLD_HIGH_DOWN] = get_widget_assert (xml, "radiobutton5"); -- rd.toggle[BUTTON_OLD_ELSE] = get_widget_assert (xml, "radiobutton11"); ++ rd.toggle[BUTTON_NEW_VALUE] = get_widget_assert (builder, "radiobutton1"); ++ rd.toggle[BUTTON_NEW_SYSMIS] = get_widget_assert (builder, "radiobutton2"); ++ rd.toggle[BUTTON_NEW_COPY] = get_widget_assert (builder, "radiobutton3"); ++ rd.toggle[BUTTON_OLD_VALUE] = get_widget_assert (builder, "radiobutton4"); ++ rd.toggle[BUTTON_OLD_SYSMIS] = get_widget_assert (builder, "radiobutton6"); ++ rd.toggle[BUTTON_OLD_MISSING]= get_widget_assert (builder, "radiobutton7"); ++ rd.toggle[BUTTON_OLD_RANGE] = get_widget_assert (builder, "radiobutton8"); ++ rd.toggle[BUTTON_OLD_LOW_UP] = get_widget_assert (builder, "radiobutton10"); ++ rd.toggle[BUTTON_OLD_HIGH_DOWN] = get_widget_assert (builder, "radiobutton5"); ++ rd.toggle[BUTTON_OLD_ELSE] = get_widget_assert (builder, "radiobutton11"); -- rd.new_copy_label = get_widget_assert (xml, "label3"); -- rd.strings_box = get_widget_assert (xml, "table3"); ++ rd.new_copy_label = get_widget_assert (builder, "label3"); ++ rd.strings_box = get_widget_assert (builder, "table3"); rd.old_and_new_dialog = -- PSPPIRE_DIALOG (get_widget_assert (xml, "old-new-values-dialog")); ++ PSPPIRE_DIALOG (get_widget_assert (builder, "old-new-values-dialog")); gtk_window_set_transient_for (GTK_WINDOW (rd.old_and_new_dialog), - de->parent.window); + GTK_WINDOW (de)); -- rd.acr = PSPPIRE_ACR (get_widget_assert (xml, "psppire-acr1")); ++ rd.acr = PSPPIRE_ACR (get_widget_assert (builder, "psppire-acr1")); g_signal_connect_swapped (rd.toggle[BUTTON_NEW_VALUE], "toggled", G_CALLBACK (set_acr), &rd); diff --cc src/ui/gui/regression-dialog.c index b0c11b07,b0c11b07,3e0e0fbc..2d8aca3e --- a/src/ui/gui/regression-dialog.c +++ b/src/ui/gui/regression-dialog.c @@@@ -223,11 -223,11 -223,11 +223,10 @@@@ voi regression_dialog (GObject *o, gpointer data) { gint response; - struct data_editor *de = data; - struct regression_dialog rd; -- GladeXML *xml = XML_NEW ("regression.glade"); ++ GtkBuilder *xml = builder_new ("regression.ui"); + PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data); -- PsppireVarStore *vs; GtkWidget *dialog = get_widget_assert (xml, "regression-dialog"); diff --cc src/ui/gui/select-cases-dialog.c index 58b2879d,58b2879d,143f7a6d..d953308a --- a/src/ui/gui/select-cases-dialog.c +++ b/src/ui/gui/select-cases-dialog.c @@@@ -18,10 -18,10 -18,9 +18,9 @@@@ #include "select-cases-dialog.h" #include -- #include #include "helper.h" #include "psppire-dialog.h" -#include "data-editor.h" +#include "psppire-data-window.h" #include "dialog-common.h" #include "dict-display.h" #include "widget-io.h" diff --cc src/ui/gui/syntax-editor.glade index 8895c8f3,8895c8f3,8895c8f3..8f565e12 --- a/src/ui/gui/syntax-editor.glade +++ b/src/ui/gui/syntax-editor.glade @@@@ -3,31 -3,31 -3,31 +3,6 @@@@ --- --- 640 --- 480 --- True --- Psppire Syntax Editor --- GTK_WINDOW_TOPLEVEL --- GTK_WIN_POS_NONE --- False --- True --- False --- True --- False --- False --- GDK_WINDOW_TYPE_HINT_NORMAL --- GDK_GRAVITY_NORTH_WEST --- True --- False --- --- --- --- True --- False --- 0 --- --- True GTK_PACK_DIRECTION_LTR @@@@ -275,14 -275,14 -275,14 +250,8 @@@@ --- --- 0 --- False --- False --- --- --- --- +++ +++ True True @@@@ -311,26 -311,26 -311,26 +280,10 @@@@ --- --- 0 --- True --- True --- --- --- --- +++ True True --- --- 0 --- False --- False --- --- --- --- --- diff --cc src/ui/gui/t-test-paired-samples.c index 58b68b2f,58b68b2f,ec709603..ca1d776a --- a/src/ui/gui/t-test-paired-samples.c +++ b/src/ui/gui/t-test-paired-samples.c @@@@ -17,10 -17,10 -17,9 +17,9 @@@@ #include #include -- #include #include -#include "data-editor.h" +#include "psppire-data-window.h" #include "psppire-dict.h" #include "psppire-var-store.h" diff --cc src/ui/gui/transpose-dialog.c index 9e8c18f4,9e8c18f4,272ef1b3..09756d37 --- a/src/ui/gui/transpose-dialog.c +++ b/src/ui/gui/transpose-dialog.c @@@@ -80,9 -80,9 -79,9 +79,9 @@@@ voi transpose_dialog (GObject *o, gpointer data) { gint response ; - struct data_editor *de = data; + PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data); -- GladeXML *xml = XML_NEW ("psppire.glade"); ++ GtkBuilder *xml = builder_new ("psppire.ui"); PsppireVarStore *vs = NULL; diff --cc src/ui/gui/weight-cases-dialog.c index 9d103e1c,9d103e1c,8b46ca5e..a464646f --- a/src/ui/gui/weight-cases-dialog.c +++ b/src/ui/gui/weight-cases-dialog.c @@@@ -20,13 -20,13 -20,12 +20,12 @@@@ #include "psppire-selector.h" #include "psppire-dialog.h" #include "helper.h" -#include "data-editor.h" +#include "psppire-data-window.h" #include "dict-display.h" #include -#include "syntax-editor.h" +#include "helper.h" #include -- #include #include #define _(msgid) gettext (msgid) @@@@ -104,10 -104,10 -103,10 +103,10 @@@@ voi 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; -- GladeXML *xml = XML_NEW ("psppire.glade"); ++ GtkBuilder *xml = builder_new ("psppire.ui"); GtkWidget *dialog = get_widget_assert (xml, "weight-cases-dialog"); GtkWidget *source = get_widget_assert (xml, "weight-cases-treeview");