X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire.c;h=bdd5ad5332f4062d4b0bf6927a42ea2b57223d30;hb=8953baa61127d6d3b91f763663ea647bf3e4e793;hp=9dd3b71372f6334fea60115c325aa35724353f06;hpb=dff7c7a05e6da0de78544fa97c6882bd4a40d977;p=pspp-builds.git diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index 9dd3b713..bdd5ad53 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -25,7 +25,7 @@ #include #include "relocatable.h" -#include "data-editor.h" +#include "psppire-data-window.h" #include "psppire.h" #include @@ -52,7 +52,8 @@ #include "message-dialog.h" #include -#include "output-viewer.h" + +#include "psppire-output-window.h" #include #include @@ -67,6 +68,7 @@ static void create_icon_factory (void); struct source_stream *the_source_stream ; struct dataset * the_dataset = NULL; +static GtkWidget *the_data_window; static void replace_casereader (struct casereader *s) @@ -77,6 +79,10 @@ replace_casereader (struct casereader *s) #define _(msgid) gettext (msgid) #define N_(msgid) msgid + +const char * output_file_name (void); + + void initialize (struct command_line_processor *clp, int argc, char **argv) { @@ -116,8 +122,6 @@ initialize (struct command_line_processor *clp, int argc, char **argv) the_data_store = psppire_data_store_new (dictionary); replace_casereader (NULL); - - create_icon_factory (); { @@ -143,14 +147,16 @@ initialize (struct command_line_processor *clp, int argc, char **argv) journal_enable (); textdomain (PACKAGE); + the_data_window = psppire_data_window_new (); + command_line_processor_replace_aux (clp, &post_init_argp, the_source_stream); command_line_processor_replace_aux (clp, &non_option_argp, the_source_stream); command_line_processor_parse (clp, argc, argv); - new_data_window (NULL, NULL); - execute_syntax (create_syntax_string_source ("")); + + gtk_widget_show (the_data_window); } @@ -288,6 +294,9 @@ parse_non_options (int key, char *arg, struct argp_state *state) ERRMODE_CONTINUE); ds_destroy (&syntax); + + psppire_window_set_filename (the_data_window, arg); + break; } default: @@ -298,3 +307,17 @@ parse_non_options (int key, char *arg, struct argp_state *state) const struct argp non_option_argp = {NULL, parse_non_options, 0, 0, 0, 0, 0}; + + +const char * +output_file_name (void) +{ + const char *dir = default_output_path (); + static char *filename = NULL; + + if ( NULL == filename ) + filename = xasprintf ("%s%s", dir, OUTPUT_FILE_NAME); + + + return filename; +}