X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire.c;h=928a1c92886f46030460947d0cc7c2b5a30b9501;hb=dfc7fb690935c5ef3a3f3c927d8a82b21085fdfc;hp=599d8108ddb7d8b91897eb6f16bf0cf27003ec1b;hpb=7fbfc32fc3c636959b0a25b3e76609f86519e84a;p=pspp-builds.git diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index 599d8108..928a1c92 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -16,11 +16,12 @@ #include -#include +#include #include #include #include +#include #include #include #include "relocatable.h" @@ -48,7 +49,7 @@ #include "psppire-dict.h" #include "psppire-var-store.h" #include "psppire-data-store.h" -#include "helper.h" +#include "executor.h" #include "message-dialog.h" #include @@ -81,7 +82,6 @@ replace_casereader (struct casereader *s) #define N_(msgid) msgid -const char * output_file_name (void); void @@ -89,12 +89,8 @@ initialize (struct command_line_processor *clp, int argc, char **argv) { PsppireDict *dictionary = 0; - /* gtk_init messes with the locale. - So unset the bits we want to control ourselves */ - setlocale (LC_NUMERIC, "C"); - - bindtextdomain (PACKAGE, locale_dir); + i18n_init (); preregister_widgets (); @@ -125,25 +121,7 @@ initialize (struct command_line_processor *clp, int argc, char **argv) create_icon_factory (); - { - const char *filename = output_file_name (); - - struct string config_string; - - ds_init_empty (&config_string); - - ds_put_format (&config_string, - "gui:ascii:screen:squeeze=on headers=off top-margin=0 " - "bottom-margin=0 paginate=off length=auto width=auto " - "emphasis=none " - "output-file=\"%s\" append=yes", filename); - - outp_configure_driver_line (ds_ss (&config_string)); - - unlink (filename); - - ds_destroy (&config_string); - } + psppire_output_window_setup (); journal_enable (); textdomain (PACKAGE); @@ -171,6 +149,7 @@ de_initialize (void) message_dialog_done (); settings_done (); outp_done (); + i18n_done (); } @@ -297,7 +276,7 @@ parse_non_options (int key, char *arg, struct argp_state *state) if ( local_is_utf8) { - utf8 = strdup (arg); + utf8 = xstrdup (arg); } else { @@ -327,7 +306,7 @@ parse_non_options (int key, char *arg, struct argp_state *state) g_free (utf8); if ( filename == NULL) - filename = strdup (arg); + filename = xstrdup (arg); psppire_window_load (PSPPIRE_WINDOW (the_data_window), filename); @@ -342,16 +321,3 @@ 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; -}