X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire.c;h=9181d7e571b963575c2aea5ec00e4a6bf9beb2a6;hb=e6b6e7d67f173867d731ebca6b8fbad5a2f82560;hp=d2262e45e67ba634b6aac8b152d6fb80590028de;hpb=0536ee7f632fbc31e54d4f6782940b107bcc7efe;p=pspp diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index d2262e45e6..9181d7e571 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -38,6 +38,7 @@ #include "output/driver.h" #include "output/journal.h" #include "output/message-item.h" +#include "output/spv/spv.h" #include "ui/gui/dict-display.h" #include "ui/gui/executor.h" @@ -104,7 +105,7 @@ initialize (const struct init_source *is) bind_textdomain_codeset (PACKAGE, "UTF-8"); break; case 8: - if ( ! gtk_parse_args (is->argc, is->argv) ) + if (! gtk_parse_args (is->argc, is->argv)) { perror ("Error parsing arguments"); exit (1); @@ -174,7 +175,7 @@ psppire_set_lexer (struct lexer *lexer) GtkWindow * -psppire_preload_file (const gchar *file) +psppire_preload_file (const gchar *file, GtkWindow *victim) { const gchar *local_encoding = "UTF-8"; @@ -190,11 +191,18 @@ psppire_preload_file (const gchar *file) /* Check to see if the file is a .sav or a .por file. If not assume that it is a syntax file */ if (retval == 1) - w = open_data_window (NULL, filename, NULL, NULL); + w = open_data_window (PSPPIRE_WINDOW (victim), filename, NULL, NULL); else if (retval == 0) { - create_data_window (); - w = open_syntax_window (filename, NULL); + char *error = spv_detect (filename); + if (!error) + read_spv_file (filename); + else + { + free (error); + create_data_window (); + open_syntax_window (filename, NULL); + } } fh_unref (fh);