X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire.c;h=974d18b7e0d70f9cff244fbff3d5ee600ab126ba;hb=df7e825aff8143a6624899a4594707fafb1ad82f;hp=e424e212468e0c0a052e6cb201f395cffa239a8e;hpb=68b73d179454af3151156c62c2e27804019900d2;p=pspp-builds.git diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index e424e212..974d18b7 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -16,8 +16,10 @@ #include +#include #include #include +#include #include "relocatable.h" @@ -28,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -36,6 +37,7 @@ #include #include #include +#include #include #include @@ -43,8 +45,6 @@ #include "psppire-var-store.h" #include "psppire-data-store.h" #include "helper.h" -#include "data-sheet.h" -#include "var-sheet.h" #include "message-dialog.h" #include "output-viewer.h" @@ -66,6 +66,10 @@ replace_casereader (struct casereader *s) psppire_data_store_set_case_file (the_data_store, pcf); } +#define _(msgid) gettext (msgid) +#define N_(msgid) msgid + + void initialize (void) { @@ -77,21 +81,20 @@ initialize (void) bindtextdomain (PACKAGE, locale_dir); - textdomain (PACKAGE); glade_init (); - fmt_init (); + gsl_set_error_handler_off (); fn_init (); outp_init (); - settings_init (); + settings_init (&viewer_width, &viewer_length); fh_init (); the_source_stream = create_source_stream ( fn_getenv_default ("STAT_INCLUDE_PATH", include_path) ); - the_dataset = create_dataset (NULL, NULL); + the_dataset = create_dataset (); message_dialog_init (the_source_stream); @@ -108,13 +111,28 @@ initialize (void) create_icon_factory (); - outp_configure_driver_line ( - ss_cstr ("gui:ascii:screen:squeeze=on headers=off top-margin=0 " - "bottom-margin=0 paginate=off length=50 " - "width=" OUTPUT_LINE_WIDTH_str " emphasis=none " - "output-file=\"" OUTPUT_FILE_NAME "\" append=yes")); + { + 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); + } - unlink (OUTPUT_FILE_NAME); + journal_enable (); + textdomain (PACKAGE); new_data_window (NULL, NULL); } @@ -130,6 +148,7 @@ de_initialize (void) } + struct icon_info { const char *file_name; @@ -179,6 +198,26 @@ create_icon_factory (void) } } + { + /* Create our own "pspp-stock-reset" item, using the + GTK_STOCK_REFRESH icon set */ + + GtkStockItem items[] = { + {"pspp-stock-reset", N_("_Reset"), 0, 0, PACKAGE}, + {"pspp-stock-select", N_("_Select"), 0, 0, PACKAGE} + }; + + + gtk_stock_add (items, 2); + gtk_icon_factory_add (factory, "pspp-stock-reset", + gtk_icon_factory_lookup_default (GTK_STOCK_REFRESH) + ); + + gtk_icon_factory_add (factory, "pspp-stock-select", + gtk_icon_factory_lookup_default (GTK_STOCK_INDEX) + ); + } + gtk_icon_factory_add_default (factory); }