Created a new stock item for Reset buttons.
[pspp-builds.git] / src / ui / gui / psppire.c
index ff155d68fe71cc66e97dff9572a06435adae7045..6910ddd1f403e46cae869b93cc08d12af2f9e36c 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <assert.h>
 #include <libintl.h>
+#include <gsl/gsl_errno.h>
 
 #include "relocatable.h"
 
@@ -67,6 +68,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)
 {
@@ -78,14 +83,14 @@ initialize (void)
 
   bindtextdomain (PACKAGE, locale_dir);
 
-  textdomain (PACKAGE);
 
   glade_init ();
 
+  gsl_set_error_handler_off ();
   fmt_init ();
   fn_init ();
   outp_init ();
-  settings_init ();
+  settings_init (&viewer_width, &viewer_length);
   fh_init ();
   the_source_stream =
     create_source_stream (
@@ -111,13 +116,14 @@ initialize (void)
 
   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 "
+             "bottom-margin=0 paginate=off length=auto width=auto "
+            "emphasis=none "
              "output-file=\"" OUTPUT_FILE_NAME "\" append=yes"));
 
   unlink (OUTPUT_FILE_NAME);
 
   journal_enable ();
+  textdomain (PACKAGE);
 
   new_data_window (NULL, NULL);
 }
@@ -133,6 +139,7 @@ de_initialize (void)
 }
 
 
+
 struct icon_info
 {
   const char *file_name;
@@ -182,6 +189,19 @@ create_icon_factory (void)
        }
     }
 
+
+  {
+    /* Create our own "pspp-stock-reset" item, using the
+       GTK_STOCK_REFRESH icon set */
+
+    GtkStockItem item = {"pspp-stock-reset", N_("_Reset"), 0, 0, PACKAGE};
+    GtkIconSet *icon_set =
+      gtk_icon_factory_lookup_default (GTK_STOCK_REFRESH);
+
+    gtk_stock_add (&item, 1);
+    gtk_icon_factory_add (factory, "pspp-stock-reset", icon_set);
+  }
+
   gtk_icon_factory_add_default (factory);
 }