Refactor common code in dialog implementations
[pspp-builds.git] / src / ui / gui / split-file-dialog.c
index f548a7aac297e57d38852017c246606b40c5c91a..c44d5591cd9c08e20f88cd2bd90bf63658c09318 100644 (file)
@@ -23,7 +23,7 @@
 #include "psppire-data-window.h"
 #include "dict-display.h"
 #include <language/syntax-string-source.h>
-#include "psppire-syntax-window.h"
+#include "helper.h"
 #include <data/dictionary.h>
 
 #include <gtk/gtk.h>
@@ -221,6 +221,7 @@ split_file_dialog (GObject *o, gpointer data)
     case GTK_RESPONSE_OK:
       {
        gchar *syntax = generate_syntax (&sfd);
+
        struct getl_interface *sss = create_syntax_string_source (syntax);
        execute_syntax (sss);
 
@@ -230,12 +231,7 @@ split_file_dialog (GObject *o, gpointer data)
     case PSPPIRE_RESPONSE_PASTE:
       {
        gchar *syntax = generate_syntax (&sfd);
-
-        GtkWidget *se = psppire_syntax_window_new ();
-
-       gtk_text_buffer_insert_at_cursor (PSPPIRE_SYNTAX_WINDOW (se)->buffer, syntax, -1);
-
-       gtk_widget_show (se);
+        paste_syntax_in_new_window (syntax);
 
        g_free (syntax);
       }