Reworked settings so as to use one large struct instead of lots of static
[pspp-builds.git] / src / ui / gui / psppire.c
index e424e212468e0c0a052e6cb201f395cffa239a8e..07557fed5136d3c1230b1ae6e1ab3a6b306d7908 100644 (file)
 
 #include <config.h>
 
+#include <locale.h>
 #include <assert.h>
 #include <libintl.h>
+#include <gsl/gsl_errno.h>
 
 #include "relocatable.h"
 
@@ -36,6 +38,7 @@
 #include <language/lexer/lexer.h>
 #include <libpspp/version.h>
 #include <output/output.h>
+#include <output/journal.h>
 
 #include <gtk/gtk.h>
 #include <glade/glade.h>
@@ -66,6 +69,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 +84,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);
@@ -110,12 +116,15 @@ 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);
 }
 
@@ -130,6 +139,7 @@ de_initialize (void)
 }
 
 
+
 struct icon_info
 {
   const char *file_name;
@@ -179,6 +189,27 @@ 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);
 }