Relocate the locale directory.
[pspp-builds.git] / src / ui / gui / psppire.c
index bc49a3cb2f054fcddb4b104135c4a922a12fe270..a7b22037b868e7d523726c8f80faab41ebe1acc8 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2004, 2005, 2006  Free Software Foundation
+   Copyright (C) 2004, 2005, 2006, 2009  Free Software Foundation
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -30,7 +30,6 @@
 #include <data/casereader.h>
 #include <data/datasheet.h>
 #include <data/file-handle-def.h>
-#include <data/format.h>
 #include <data/settings.h>
 #include <data/file-name.h>
 #include <data/procedure.h>
@@ -46,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"
@@ -82,13 +79,12 @@ initialize (void)
      So unset the bits we want to control ourselves */
   setlocale (LC_NUMERIC, "C");
 
-  bindtextdomain (PACKAGE, locale_dir);
+  bindtextdomain (PACKAGE, relocate (locale_dir));
 
 
   glade_init ();
 
   gsl_set_error_handler_off ();
-  fmt_init ();
   fn_init ();
   outp_init ();
   settings_init (&viewer_width, &viewer_length);
@@ -115,13 +111,25 @@ 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=auto width=auto "
-            "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);
 
-  unlink (OUTPUT_FILE_NAME);
+    outp_configure_driver_line (ds_ss (&config_string));
+
+    unlink (filename);
+
+    ds_destroy (&config_string);
+  }
 
   journal_enable ();
   textdomain (PACKAGE);
@@ -190,7 +198,6 @@ create_icon_factory (void)
        }
     }
 
-
   {
     /* Create our own "pspp-stock-reset" item, using the
        GTK_STOCK_REFRESH icon set */