gui: Fix File|Open in syntax editor.
[pspp-builds.git] / src / ui / gui / psppire-syntax-window.c
index eea46eba303027c8a1647e611aa1dd453dba6521..2e90ba76535ac69733731a4207aaf69f38d23cc5 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2008, 2009, 2010  Free Software Foundation
+   Copyright (C) 2008, 2009, 2010, 2011  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
 #include <config.h>
 
 #include <gtk/gtk.h>
-#include "executor.h"
-#include "helper.h"
-
-#include <language/lexer/lexer.h>
-#include <libpspp/message.h>
 #include <stdlib.h>
 
-#include "help-menu.h"
-#include "psppire.h"
-#include "psppire-data-window.h"
-#include "psppire-window-register.h"
-#include "psppire-syntax-window.h"
+#include "language/lexer/lexer.h"
+#include "libpspp/message.h"
+#include "ui/gui/executor.h"
+#include "ui/gui/help-menu.h"
+#include "ui/gui/helper.h"
+#include "ui/gui/psppire-data-window.h"
+#include "ui/gui/psppire-syntax-window.h"
+#include "ui/gui/psppire-syntax-window.h"
+#include "ui/gui/psppire-window-register.h"
+#include "ui/gui/psppire.h"
+#include "ui/gui/psppire.h"
 
-#include "xalloc.h"
+#include "gl/xalloc.h"
 
 #include <gettext.h>
 #define _(msgid) gettext (msgid)
@@ -163,12 +164,9 @@ editor_execute_syntax (const PsppireSyntaxWindow *sw, GtkTextIter start,
 
   lex_reader_set_file_name (reader, psppire_window_get_filename (win));
 
-  execute_syntax (reader);
+  execute_syntax (psppire_default_data_window (), reader);
 }
-
-
 \f
-
 /* Delete the currently selected text */
 static void
 on_edit_delete (PsppireSyntaxWindow *sw)
@@ -661,6 +659,11 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window)
                    window);
 #endif
 
+  g_signal_connect_swapped (get_action_assert (xml, "file_open"),
+                   "activate",
+                   G_CALLBACK (psppire_window_open),
+                   window);
+
   g_signal_connect_swapped (get_action_assert (xml, "file_save"),
                    "activate",
                    G_CALLBACK (syntax_save),