pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp ./Smake lib/gtksheet/ChangeLog lib/gtkshee...


From: John Darrington
Subject: [Pspp-cvs] pspp ./Smake lib/gtksheet/ChangeLog lib/gtkshee...
Date: Tue, 30 May 2006 12:01:34 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Branch:         
Changes by:     John Darrington <address@hidden>        06/05/30 12:01:34

Modified files:
        .              : Smake 
        lib/gtksheet   : ChangeLog gtksheet.c gtksheet.h 
        src/data       : ChangeLog settings.c 
        src/libpspp    : ChangeLog automake.mk 
        src/ui/gui     : ChangeLog helper.c menu-actions.c 
                         menu-actions.h psppire-data-store.c 
                         psppire-var-store.c psppire-var-store.h 
                         psppire.c 
        tests/bugs     : alpha-freq.sh 
        tests/command  : autorecod.sh beg-data.sh count.sh file-label.sh 
                         flip.sh lag.sh list.sh loop.sh print.sh 
                         split-file.sh sysfile-info.sh 
        tests/expressions: variables.sh vectors.sh 
        tests/stats    : descript-basic.sh descript-missing.sh 
Added files:
        src/libpspp    : i18n.c i18n.h 

Log message:
        Internationalisation.
        Removed dependence on glib2.10
        Tidy up some files.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/Smake.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/lib/gtksheet/ChangeLog.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/lib/gtksheet/gtksheet.c.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/lib/gtksheet/gtksheet.h.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/ChangeLog.diff?tr1=1.49&tr2=1.50&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/settings.c.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/libpspp/ChangeLog.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/libpspp/automake.mk.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/libpspp/i18n.c?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/libpspp/i18n.h?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/ui/gui/ChangeLog.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/ui/gui/helper.c.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/ui/gui/menu-actions.c.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/ui/gui/menu-actions.h.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/ui/gui/psppire-data-store.c.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/ui/gui/psppire-var-store.c.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/ui/gui/psppire-var-store.h.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/ui/gui/psppire.c.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/bugs/alpha-freq.sh.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/command/autorecod.sh.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/command/beg-data.sh.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/command/count.sh.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/command/file-label.sh.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/command/flip.sh.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/command/lag.sh.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/command/list.sh.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/command/loop.sh.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/command/print.sh.diff?tr1=1.23&tr2=1.24&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/command/split-file.sh.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/command/sysfile-info.sh.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/expressions/variables.sh.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/expressions/vectors.sh.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/stats/descript-basic.sh.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/tests/stats/descript-missing.sh.diff?tr1=1.10&tr2=1.11&r1=text&r2=text

Patches:
Index: pspp/Smake
diff -u pspp/Smake:1.32 pspp/Smake:1.33
--- pspp/Smake:1.32     Mon May 15 08:12:18 2006
+++ pspp/Smake  Tue May 30 12:01:33 2006
@@ -20,6 +20,7 @@
        gettext \
        intprops \
        linebreak \
+       localcharset \
        memcasecmp \
        memchr \
        memcmp \
Index: pspp/lib/gtksheet/ChangeLog
diff -u pspp/lib/gtksheet/ChangeLog:1.8 pspp/lib/gtksheet/ChangeLog:1.9
--- pspp/lib/gtksheet/ChangeLog:1.8     Sat May 27 08:36:09 2006
+++ pspp/lib/gtksheet/ChangeLog Tue May 30 12:01:33 2006
@@ -1,3 +1,7 @@
+Di Mai 30 19:51:19 WST 2006 John Darrington <address@hidden>
+
+    * gtksheet.c gtksheet.h: constness. Removed dependence on glib2.10
+
 Sat May 27 16:29:36 WST 2006 John Darrington <address@hidden>
 
     * gtksheet.c: Removed call to gtk_entry_set_text, which caused warnings 
Index: pspp/lib/gtksheet/gtksheet.c
diff -u pspp/lib/gtksheet/gtksheet.c:1.9 pspp/lib/gtksheet/gtksheet.c:1.10
--- pspp/lib/gtksheet/gtksheet.c:1.9    Sat May 27 08:36:09 2006
+++ pspp/lib/gtksheet/gtksheet.c        Tue May 30 12:01:33 2006
@@ -104,6 +104,7 @@
 #define DEFAULT_COLUMN_WIDTH 80
 
 
+
 static gboolean gtk_sheet_cell_empty (const GtkSheet *sheet, gint row, gint 
col);
 
 static inline
@@ -720,7 +721,7 @@
                                                 GtkRequisition *requisition);
 
 /* Attributes routines */
-static void init_attributes                    (GtkSheet *sheet, gint col,  
+static void init_attributes                    (const GtkSheet *sheet, gint 
col,  
                                                 GtkSheetCellAttr *attributes);
 
 
@@ -3959,11 +3960,12 @@
 
  GTK_SHEET_SET_FLAGS(sheet, GTK_SHEET_IS_FROZEN);
 
- if(text && strlen(text) > 0){
-      gtk_sheet_get_attributes(sheet, row, col, &attributes); 
-      justification=attributes.justification;
-      gtk_sheet_set_cell(sheet, row, col, justification, text);
- }
+ if(text && strlen(text) > 0)
+   {
+     gtk_sheet_get_attributes(sheet, row, col, &attributes); 
+     justification = attributes.justification;
+     gtk_sheet_set_cell(sheet, row, col, justification, text);
+   }
 
  if(sheet->freeze_count == 0)
         GTK_SHEET_UNSET_FLAGS(sheet, GTK_SHEET_IS_FROZEN);
@@ -6135,7 +6137,7 @@
 gtk_sheet_size_allocate_entry(GtkSheet *sheet)
 {
  GtkAllocation shentry_allocation;
- GtkSheetCellAttr attributes;
+ GtkSheetCellAttr attributes = { 0 };
  GtkEntry *sheet_entry;
  GtkStyle *style = NULL, *previous_style = NULL;
  gint row, col;
@@ -6147,40 +6149,41 @@
 
  sheet_entry = GTK_ENTRY(gtk_sheet_get_entry(sheet));
 
- gtk_sheet_get_attributes(sheet, sheet->active_cell.row, 
sheet->active_cell.col, &attributes); 
+ gtk_sheet_get_attributes(sheet, sheet->active_cell.row, 
sheet->active_cell.col,                               &attributes);
 
- if(GTK_WIDGET_REALIZED(sheet->sheet_entry)){
+ if(GTK_WIDGET_REALIZED(sheet->sheet_entry))
+    {
 
-  if(!GTK_WIDGET(sheet_entry)->style) 
+      if(!GTK_WIDGET(sheet_entry)->style) 
         gtk_widget_ensure_style(GTK_WIDGET(sheet_entry));
 
-  previous_style = GTK_WIDGET(sheet_entry)->style;
+      previous_style = GTK_WIDGET(sheet_entry)->style;
 
-  style = gtk_style_copy(previous_style);
-  style->bg[GTK_STATE_NORMAL] = attributes.background;
-  style->fg[GTK_STATE_NORMAL] = attributes.foreground;
-  style->text[GTK_STATE_NORMAL] = attributes.foreground;
-  style->bg[GTK_STATE_ACTIVE] = attributes.background;
-  style->fg[GTK_STATE_ACTIVE] = attributes.foreground;
-  style->text[GTK_STATE_ACTIVE] = attributes.foreground;
-
-  pango_font_description_free(style->font_desc);
-  style->font_desc = pango_font_description_copy(attributes.font_desc);
-
-  GTK_WIDGET(sheet_entry)->style = style;
-  gtk_widget_size_request(sheet->sheet_entry, NULL);
-  GTK_WIDGET(sheet_entry)->style = previous_style;
-
-  if(style != previous_style){
-    if(!GTK_IS_ITEM_ENTRY(sheet->sheet_entry)){
-      style->bg[GTK_STATE_NORMAL] = previous_style->bg[GTK_STATE_NORMAL];
-      style->fg[GTK_STATE_NORMAL] = previous_style->fg[GTK_STATE_NORMAL];
-      style->bg[GTK_STATE_ACTIVE] = previous_style->bg[GTK_STATE_ACTIVE];
-      style->fg[GTK_STATE_ACTIVE] = previous_style->fg[GTK_STATE_ACTIVE];
+      style = gtk_style_copy(previous_style);
+      style->bg[GTK_STATE_NORMAL] = attributes.background;
+      style->fg[GTK_STATE_NORMAL] = attributes.foreground;
+      style->text[GTK_STATE_NORMAL] = attributes.foreground;
+      style->bg[GTK_STATE_ACTIVE] = attributes.background;
+      style->fg[GTK_STATE_ACTIVE] = attributes.foreground;
+      style->text[GTK_STATE_ACTIVE] = attributes.foreground;
+
+      pango_font_description_free(style->font_desc);
+      style->font_desc = pango_font_description_copy(attributes.font_desc);
+
+      GTK_WIDGET(sheet_entry)->style = style;
+      gtk_widget_size_request(sheet->sheet_entry, NULL);
+      GTK_WIDGET(sheet_entry)->style = previous_style;
+
+      if(style != previous_style){
+       if(!GTK_IS_ITEM_ENTRY(sheet->sheet_entry)){
+         style->bg[GTK_STATE_NORMAL] = previous_style->bg[GTK_STATE_NORMAL];
+         style->fg[GTK_STATE_NORMAL] = previous_style->fg[GTK_STATE_NORMAL];
+         style->bg[GTK_STATE_ACTIVE] = previous_style->bg[GTK_STATE_ACTIVE];
+         style->fg[GTK_STATE_ACTIVE] = previous_style->fg[GTK_STATE_ACTIVE];
+       }
+       gtk_widget_set_style(GTK_WIDGET(sheet_entry), style);
+      }
     }
-    gtk_widget_set_style(GTK_WIDGET(sheet_entry), style);
-  }
- }
 
  if(GTK_IS_ITEM_ENTRY(sheet_entry))
     max_size = GTK_ITEM_ENTRY(sheet_entry)->text_max_size;
@@ -6230,12 +6233,13 @@
 
  }
 
- if(!GTK_IS_ITEM_ENTRY(sheet->sheet_entry)){
-   shentry_allocation.x += 2;
-   shentry_allocation.y += 2;
-   shentry_allocation.width -= MIN(shentry_allocation.width, 3);
-   shentry_allocation.height -= MIN(shentry_allocation.height, 3);
- }
+ if(!GTK_IS_ITEM_ENTRY(sheet->sheet_entry))
+   {
+     shentry_allocation.x += 2;
+     shentry_allocation.y += 2;
+     shentry_allocation.width -= MIN(shentry_allocation.width, 3);
+     shentry_allocation.height -= MIN(shentry_allocation.height, 3);
+   }
 
  gtk_widget_size_allocate(sheet->sheet_entry, &shentry_allocation);
 
@@ -7213,7 +7217,8 @@
 
 
 gboolean
-gtk_sheet_get_attributes(GtkSheet *sheet, gint row, gint col, GtkSheetCellAttr 
*attributes)
+gtk_sheet_get_attributes(const GtkSheet *sheet, gint row, gint col, 
+                        GtkSheetCellAttr *attributes)
 {
  const GdkColor *fg, *bg; 
  const GtkJustification *j ; 
@@ -7228,7 +7233,7 @@
  init_attributes(sheet, col, attributes);
 
  if ( !sheet->model) 
-        return FALSE;
+   return FALSE;
 
  attributes->is_editable = g_sheet_model_is_editable(sheet->model, row, col);
  attributes->is_visible = g_sheet_model_is_visible(sheet->model, row, col);
@@ -7255,7 +7260,7 @@
 }
 
 static void
-init_attributes(GtkSheet *sheet, gint col, GtkSheetCellAttr *attributes)
+init_attributes(const GtkSheet *sheet, gint col, GtkSheetCellAttr *attributes)
 {
  /* DEFAULT VALUES */    
  attributes->foreground = GTK_WIDGET(sheet)->style->black;
@@ -7276,9 +7281,7 @@
  attributes->is_editable = TRUE;
  attributes->is_visible = TRUE;
  attributes->font_desc = GTK_WIDGET(sheet)->style->font_desc;
-
 }       
- 
 
 
 /********************************************************************
@@ -7913,7 +7916,7 @@
 GtkSheetButton *
 gtk_sheet_button_new(void)
 {
-  GtkSheetButton *button = g_slice_new(GtkSheetButton);
+  GtkSheetButton *button = g_malloc(sizeof(GtkSheetButton));
   
   button->state = GTK_STATE_NORMAL;
   button->label = NULL;
@@ -7929,5 +7932,5 @@
 gtk_sheet_button_free(GtkSheetButton *button)
 {
   g_free(button->label);
-  g_slice_free(GtkSheetButton, button);
+  g_free(button);
 }
Index: pspp/lib/gtksheet/gtksheet.h
diff -u pspp/lib/gtksheet/gtksheet.h:1.4 pspp/lib/gtksheet/gtksheet.h:1.5
--- pspp/lib/gtksheet/gtksheet.h:1.4    Sat May 20 13:18:28 2006
+++ pspp/lib/gtksheet/gtksheet.h        Tue May 30 12:01:33 2006
@@ -659,7 +659,7 @@
 /* get cell attributes of the given cell */
 /* TRUE means that the cell is currently allocated */
 gboolean
-gtk_sheet_get_attributes               (GtkSheet *sheet, 
+gtk_sheet_get_attributes               (const GtkSheet *sheet, 
                                        gint row, gint col, 
                                        GtkSheetCellAttr *attributes);
 
Index: pspp/src/data/ChangeLog
diff -u pspp/src/data/ChangeLog:1.49 pspp/src/data/ChangeLog:1.50
--- pspp/src/data/ChangeLog:1.49        Wed May 10 04:11:07 2006
+++ pspp/src/data/ChangeLog     Tue May 30 12:01:33 2006
@@ -1,3 +1,7 @@
+Tue May 30 19:52:33 WST 2006 John Darrington <address@hidden>
+
+       * settings.c: Added call to i18n{done, init}.
+
 Tue May  9 21:09:17 2006  Ben Pfaff  <address@hidden>
 
        * procedure.h: Add WARN_UNUSED_RESULT to procedure function
Index: pspp/src/data/settings.c
diff -u pspp/src/data/settings.c:1.2 pspp/src/data/settings.c:1.3
--- pspp/src/data/settings.c:1.2        Sat Mar 11 07:16:40 2006
+++ pspp/src/data/settings.c    Tue May 30 12:01:33 2006
@@ -25,6 +25,7 @@
 #include "format.h"
 #include "value.h"
 #include "xalloc.h"
+#include <libpspp/i18n.h>
 
 static int viewlength = 24;
 static int viewwidth = 79;
@@ -87,11 +88,13 @@
 settings_init (void)
 {
   init_viewport ();
+  i18n_init ();
 }
 
 void
 settings_done (void)
 {
+  i18n_done ();
 }
 
 /* Screen length in lines. */
Index: pspp/src/libpspp/ChangeLog
diff -u pspp/src/libpspp/ChangeLog:1.26 pspp/src/libpspp/ChangeLog:1.27
--- pspp/src/libpspp/ChangeLog:1.26     Tue May 16 13:51:39 2006
+++ pspp/src/libpspp/ChangeLog  Tue May 30 12:01:33 2006
@@ -1,3 +1,7 @@
+Tue May 30 19:45:12 WST 2006 John Darrington <address@hidden>
+
+       * i18n.c i18n.h: New files.
+
 Tue May 16 06:50:35 2006  Ben Pfaff  <address@hidden>
 
        * automake.mk (src/libpspp/version.c): Removed groff_font_path,
Index: pspp/src/libpspp/automake.mk
diff -u pspp/src/libpspp/automake.mk:1.10 pspp/src/libpspp/automake.mk:1.11
--- pspp/src/libpspp/automake.mk:1.10   Tue May 16 13:51:39 2006
+++ pspp/src/libpspp/automake.mk        Tue May 30 12:01:33 2006
@@ -16,6 +16,8 @@
        src/libpspp/freaderror.h \
        src/libpspp/hash.c \
        src/libpspp/hash.h \
+       src/libpspp/i18n.c \
+       src/libpspp/i18n.h \
        src/libpspp/magic.c \
        src/libpspp/magic.h \
        src/libpspp/misc.c \
Index: pspp/src/ui/gui/ChangeLog
diff -u pspp/src/ui/gui/ChangeLog:1.16 pspp/src/ui/gui/ChangeLog:1.17
--- pspp/src/ui/gui/ChangeLog:1.16      Sat May 27 08:36:10 2006
+++ pspp/src/ui/gui/ChangeLog   Tue May 30 12:01:33 2006
@@ -1,3 +1,16 @@
+   
+Tue May 30 19:53:35 WST 2006 John Darringotn <address@hidden>
+
+   * menu-actions.c menu-actions.h psppire.c: Fixed up load/new 
+   interactions with startup.
+
+   * psppire-data-store.c: Fixed bad i18n call.
+
+   * pspppire-var-store.c, psppire-var-store.h: constness.
+
+   * helper.c: Implemented proper way to convert from PSPP to UTF8 encoding.
+
+
 Sat May 27 16:25:38 WST 2006 John Darrington <address@hidden>
 
    * customentry.c data-sheet.c menu-actions.c message-dialog.c 
Index: pspp/src/ui/gui/helper.c
diff -u pspp/src/ui/gui/helper.c:1.5 pspp/src/ui/gui/helper.c:1.6
--- pspp/src/ui/gui/helper.c:1.5        Sun May 14 00:01:39 2006
+++ pspp/src/ui/gui/helper.c    Tue May 30 12:01:33 2006
@@ -1,10 +1,12 @@
-
 #include "helper.h"
 #include <data/data-in.h>
 #include <libpspp/message.h>
 
+#include <libpspp/i18n.h>
+
 #include <ctype.h>
 #include <string.h>
+#include <data/settings.h>
 
 /* Formats a value according to FORMAT 
    The returned string must be freed when no longer required */
@@ -80,21 +82,6 @@
 char *
 pspp_locale_to_utf8(const gchar *text, gssize len, GError **err)
 {
-  GError *tmp_error = 0;
-
-  gchar *s;
-
-  if ( ! text ) 
-    return 0;
-
-  s = g_locale_to_utf8(text, len, 0, 0, &tmp_error);
-
-  if ( tmp_error)
-    {
-      g_warning("Error converting to UTF8: %s", tmp_error->message);
-      g_propagate_error (err, tmp_error);
-    }
-
-  return s;
+  return recode_string(CONV_PSPP_TO_UTF8, text, len);
 }
 
Index: pspp/src/ui/gui/menu-actions.c
diff -u pspp/src/ui/gui/menu-actions.c:1.7 pspp/src/ui/gui/menu-actions.c:1.8
--- pspp/src/ui/gui/menu-actions.c:1.7  Sat May 27 08:36:10 2006
+++ pspp/src/ui/gui/menu-actions.c      Tue May 30 12:01:33 2006
@@ -62,6 +62,7 @@
 static const gchar window_title[] = N_("PSPP Data Editor");
 
 
+/* Sets the title bar to TEXT */
 static void
 psppire_set_window_title(const gchar *text)
 {
@@ -70,13 +71,11 @@
   gchar *title = g_strdup_printf("%s --- %s", text, gettext(window_title));
 
   gtk_window_set_title(GTK_WINDOW(data_editor), title);
-
-  g_free(title);
 }
 
-void
-on_new1_activate                       (GtkMenuItem     *menuitem,
-                                        gpointer         user_data)
+
+gboolean
+clear_file(void)
 {
   GtkWidget *data_sheet = get_widget_assert(xml, "data_sheet");
   GtkWidget *var_sheet = get_widget_assert(xml, "variable_sheet");
@@ -93,8 +92,18 @@
   if (psppire_handle)
     fh_free(psppire_handle);
   psppire_handle = 0 ;
+
+  return TRUE;
 }
 
+void
+on_new1_activate                       (GtkMenuItem     *menuitem,
+                                        gpointer         user_data)
+{
+  clear_file();
+}
+
+
 
 static gboolean
 populate_case_from_reader(struct ccase *c, gpointer aux)
@@ -593,8 +602,10 @@
   switch_menus(page_num);
 }
 
-static void
-var_data_selection_init()
+
+/* Initialised things on the variable sheet */
+void
+var_data_selection_init(void)
 {
   notebook = GTK_NOTEBOOK(get_widget_assert(xml, "notebook1"));
   menuitems[PAGE_DATA_SHEET] = get_widget_assert(xml, "data1");
@@ -626,14 +637,3 @@
   select_sheet(PAGE_VAR_SHEET);
 }
 
-
-/* Callback which occurs when gtk_main is entered */
-gboolean
-callbacks_on_init(gpointer data)
-{
-  psppire_set_window_title(gettext(untitled));
-
-  var_data_selection_init();
-
-  return FALSE;
-}
Index: pspp/src/ui/gui/menu-actions.h
diff -u pspp/src/ui/gui/menu-actions.h:1.2 pspp/src/ui/gui/menu-actions.h:1.3
--- pspp/src/ui/gui/menu-actions.h:1.2  Sat May 20 13:18:28 2006
+++ pspp/src/ui/gui/menu-actions.h      Tue May 30 12:01:33 2006
@@ -77,15 +77,15 @@
                 gint int1, gint int2);
 
 
-gboolean callbacks_on_init(gpointer data) ;
-
-
 /* Switch between the VAR SHEET and the DATA SHEET */
 enum {PAGE_DATA_SHEET = 0, PAGE_VAR_SHEET};
 
 gboolean load_system_file(const gchar *file_name);
+gboolean clear_file(void);
 
 void select_sheet(gint page);
+void var_data_selection_init(void);
+
 
 #endif
 
Index: pspp/src/ui/gui/psppire-data-store.c
diff -u pspp/src/ui/gui/psppire-data-store.c:1.11 
pspp/src/ui/gui/psppire-data-store.c:1.12
--- pspp/src/ui/gui/psppire-data-store.c:1.11   Sat May 27 08:36:10 2006
+++ pspp/src/ui/gui/psppire-data-store.c        Tue May 30 12:01:33 2006
@@ -401,7 +401,6 @@
      FP.  No null terminator is appended to the buffer.  */
   data_out (s->str, fp, v);
 
-  
   text = pspp_locale_to_utf8(s->str, fp->w, 0);
   g_string_free(s, TRUE);
 
@@ -579,7 +578,7 @@
 /* Return the width that an  'M' character would occupy when typeset at
    row, col */
 static guint 
-M_width(GtkSheet *sheet, gint row, gint col)
+M_width(const GtkSheet *sheet, gint row, gint col)
 {
   GtkSheetCellAttr attributes;
   PangoRectangle rect;
@@ -673,7 +672,7 @@
   PsppireDataStore *ds = PSPPIRE_DATA_STORE(geom);
 
   if ( unit >= psppire_dict_get_var_cnt(ds->dict) )
-    return pspp_locale_to_utf8(null_var_name, -1, 0);
+    return g_locale_to_utf8(null_var_name, -1, 0, 0, 0);
 
   pv = psppire_dict_get_variable(ds->dict, unit);
 
Index: pspp/src/ui/gui/psppire-var-store.c
diff -u pspp/src/ui/gui/psppire-var-store.c:1.8 
pspp/src/ui/gui/psppire-var-store.c:1.9
--- pspp/src/ui/gui/psppire-var-store.c:1.8     Sat May 27 08:36:10 2006
+++ pspp/src/ui/gui/psppire-var-store.c Tue May 30 12:01:33 2006
@@ -640,7 +640,7 @@
 
 
 void
-psppire_var_store_set_font(PsppireVarStore *store, PangoFontDescription *fd)
+psppire_var_store_set_font(PsppireVarStore *store, const PangoFontDescription 
*fd)
 {
   g_return_if_fail (store);
   g_return_if_fail (PSPPIRE_IS_VAR_STORE (store));
Index: pspp/src/ui/gui/psppire-var-store.h
diff -u pspp/src/ui/gui/psppire-var-store.h:1.2 
pspp/src/ui/gui/psppire-var-store.h:1.3
--- pspp/src/ui/gui/psppire-var-store.h:1.2     Wed Mar 15 03:29:11 2006
+++ pspp/src/ui/gui/psppire-var-store.h Tue May 30 12:01:33 2006
@@ -59,7 +59,7 @@
   /*< private >*/
   PsppireDict *dict;
   GdkColor disabled;
-  PangoFontDescription *font_desc;
+  const PangoFontDescription *font_desc;
 };
 
 struct _PsppireVarStoreClass
@@ -86,7 +86,7 @@
 /* Return the number of variables */
 gint psppire_var_store_get_var_cnt(PsppireVarStore      *var_store);
 
-void psppire_var_store_set_font(PsppireVarStore *store, PangoFontDescription 
*fd);
+void psppire_var_store_set_font(PsppireVarStore *store, const 
PangoFontDescription *fd);
 
 
 #ifdef __cplusplus
Index: pspp/src/ui/gui/psppire.c
diff -u pspp/src/ui/gui/psppire.c:1.9 pspp/src/ui/gui/psppire.c:1.10
--- pspp/src/ui/gui/psppire.c:1.9       Sat May 27 08:36:10 2006
+++ pspp/src/ui/gui/psppire.c   Tue May 30 12:01:33 2006
@@ -18,16 +18,14 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA. */
 
-/*
- * Initial main.c file generated by Glade. Edit as required.
- * Glade will not overwrite this file.
- */
 
 #include <assert.h>
 #include <libintl.h>
 
 #include <libpspp/version.h>
 #include <libpspp/copyleft.h>
+#include <data/settings.h>
+
 #include <getopt.h>
 #include <gtk/gtk.h>
 #include <gtk/gtk.h>
@@ -56,20 +54,6 @@
 static bool parse_command_line (int *argc, char ***argv, 
                                gchar **filename, GError **err);
 
-static void
-i18n_init (void) 
-{
-#if ENABLE_NLS
-#if HAVE_LC_MESSAGES
-  setlocale (LC_MESSAGES, "");
-#endif
-  setlocale (LC_MONETARY, "");
-  bindtextdomain (PACKAGE, locale_dir);
-  textdomain (PACKAGE);
-#endif /* ENABLE_NLS */
-}
-
-
 int 
 main(int argc, char *argv[]) 
 {
@@ -83,16 +67,29 @@
 
   gtk_init(&argc, &argv);
 
+  /* gtk_init messes with the locale. 
+     So unset the bits we want to control ourselves */
+  setlocale (LC_NUMERIC, "C");
+
+  bindtextdomain (PACKAGE, locale_dir);
+  textdomain (PACKAGE);
+
   if ( ! parse_command_line(&argc, &argv, &filename, &err) ) 
     {
       g_clear_error(&err);
       return 1;
     }
 
-
   glade_init();
 
-  i18n_init();
+
+  settings_init();
+
+  
+
+  /* 
+  set_pspp_locale("da_DK");
+  */
 
   message_dialog_init();
 
@@ -125,16 +122,20 @@
   
   gtk_sheet_set_model(data_sheet, G_SHEET_MODEL(data_store));
 
-  gtk_init_add(callbacks_on_init, 0);
-
   if (filename)
     gtk_init_add((GtkFunction)load_system_file, filename);
+  else
+    gtk_init_add((GtkFunction)clear_file, 0);
+
+  var_data_selection_init();
 
   /* start the event loop */
   gtk_main();
 
   message_dialog_done();
 
+  settings_done();
+
   return 0;
 }
 
Index: pspp/tests/bugs/alpha-freq.sh
diff -u pspp/tests/bugs/alpha-freq.sh:1.7 pspp/tests/bugs/alpha-freq.sh:1.8
--- pspp/tests/bugs/alpha-freq.sh:1.7   Sat Mar 11 07:16:40 2006
+++ pspp/tests/bugs/alpha-freq.sh       Tue May 30 12:01:33 2006
@@ -18,6 +18,8 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
 
 cleanup()
 {
Index: pspp/tests/command/autorecod.sh
diff -u pspp/tests/command/autorecod.sh:1.13 
pspp/tests/command/autorecod.sh:1.14
--- pspp/tests/command/autorecod.sh:1.13        Sat Mar 11 07:16:40 2006
+++ pspp/tests/command/autorecod.sh     Tue May 30 12:01:34 2006
@@ -18,6 +18,8 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
 
 cleanup()
 {
Index: pspp/tests/command/beg-data.sh
diff -u pspp/tests/command/beg-data.sh:1.12 pspp/tests/command/beg-data.sh:1.13
--- pspp/tests/command/beg-data.sh:1.12 Sat Mar 11 07:16:40 2006
+++ pspp/tests/command/beg-data.sh      Tue May 30 12:01:34 2006
@@ -17,6 +17,8 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
 
 cleanup()
 {
Index: pspp/tests/command/count.sh
diff -u pspp/tests/command/count.sh:1.13 pspp/tests/command/count.sh:1.14
--- pspp/tests/command/count.sh:1.13    Tue May  2 03:51:43 2006
+++ pspp/tests/command/count.sh Tue May 30 12:01:34 2006
@@ -17,6 +17,8 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
 
 cleanup()
 {
Index: pspp/tests/command/file-label.sh
diff -u pspp/tests/command/file-label.sh:1.13 
pspp/tests/command/file-label.sh:1.14
--- pspp/tests/command/file-label.sh:1.13       Sat Mar 11 07:16:40 2006
+++ pspp/tests/command/file-label.sh    Tue May 30 12:01:34 2006
@@ -17,6 +17,8 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
 
 cleanup()
 {
Index: pspp/tests/command/flip.sh
diff -u pspp/tests/command/flip.sh:1.11 pspp/tests/command/flip.sh:1.12
--- pspp/tests/command/flip.sh:1.11     Sat Mar 11 07:16:40 2006
+++ pspp/tests/command/flip.sh  Tue May 30 12:01:34 2006
@@ -17,6 +17,8 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
 
 cleanup()
 {
Index: pspp/tests/command/lag.sh
diff -u pspp/tests/command/lag.sh:1.11 pspp/tests/command/lag.sh:1.12
--- pspp/tests/command/lag.sh:1.11      Sat Mar 11 07:16:40 2006
+++ pspp/tests/command/lag.sh   Tue May 30 12:01:34 2006
@@ -17,6 +17,8 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
 
 cleanup()
 {
Index: pspp/tests/command/list.sh
diff -u pspp/tests/command/list.sh:1.16 pspp/tests/command/list.sh:1.17
--- pspp/tests/command/list.sh:1.16     Sat Mar 11 07:16:40 2006
+++ pspp/tests/command/list.sh  Tue May 30 12:01:34 2006
@@ -17,6 +17,8 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
 
 cleanup()
 {
Index: pspp/tests/command/loop.sh
diff -u pspp/tests/command/loop.sh:1.14 pspp/tests/command/loop.sh:1.15
--- pspp/tests/command/loop.sh:1.14     Sat Mar 11 07:16:40 2006
+++ pspp/tests/command/loop.sh  Tue May 30 12:01:34 2006
@@ -17,6 +17,9 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
+
 
 cleanup()
 {
Index: pspp/tests/command/print.sh
diff -u pspp/tests/command/print.sh:1.23 pspp/tests/command/print.sh:1.24
--- pspp/tests/command/print.sh:1.23    Sat Mar 11 07:16:40 2006
+++ pspp/tests/command/print.sh Tue May 30 12:01:34 2006
@@ -17,6 +17,8 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
 
 cleanup()
 {
Index: pspp/tests/command/split-file.sh
diff -u pspp/tests/command/split-file.sh:1.10 
pspp/tests/command/split-file.sh:1.11
--- pspp/tests/command/split-file.sh:1.10       Sat Mar 11 07:16:40 2006
+++ pspp/tests/command/split-file.sh    Tue May 30 12:01:34 2006
@@ -17,6 +17,9 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
+
 
 cleanup()
 {
Index: pspp/tests/command/sysfile-info.sh
diff -u pspp/tests/command/sysfile-info.sh:1.10 
pspp/tests/command/sysfile-info.sh:1.11
--- pspp/tests/command/sysfile-info.sh:1.10     Sat Mar 11 07:16:40 2006
+++ pspp/tests/command/sysfile-info.sh  Tue May 30 12:01:34 2006
@@ -17,6 +17,8 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
 
 cleanup()
 {
Index: pspp/tests/expressions/variables.sh
diff -u pspp/tests/expressions/variables.sh:1.8 
pspp/tests/expressions/variables.sh:1.9
--- pspp/tests/expressions/variables.sh:1.8     Sat Mar 11 07:16:40 2006
+++ pspp/tests/expressions/variables.sh Tue May 30 12:01:34 2006
@@ -14,6 +14,8 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
 
 cleanup()
 {
Index: pspp/tests/expressions/vectors.sh
diff -u pspp/tests/expressions/vectors.sh:1.8 
pspp/tests/expressions/vectors.sh:1.9
--- pspp/tests/expressions/vectors.sh:1.8       Sat Mar 11 07:16:40 2006
+++ pspp/tests/expressions/vectors.sh   Tue May 30 12:01:34 2006
@@ -14,6 +14,9 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
+
 
 cleanup()
 {
Index: pspp/tests/stats/descript-basic.sh
diff -u pspp/tests/stats/descript-basic.sh:1.10 
pspp/tests/stats/descript-basic.sh:1.11
--- pspp/tests/stats/descript-basic.sh:1.10     Sat Mar 11 07:16:40 2006
+++ pspp/tests/stats/descript-basic.sh  Tue May 30 12:01:34 2006
@@ -16,11 +16,13 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
 
 cleanup()
 {
      cd /
-#     rm -rf $TEMPDIR
+     rm -rf $TEMPDIR
 }
 
 
Index: pspp/tests/stats/descript-missing.sh
diff -u pspp/tests/stats/descript-missing.sh:1.10 
pspp/tests/stats/descript-missing.sh:1.11
--- pspp/tests/stats/descript-missing.sh:1.10   Sat Mar 11 07:16:40 2006
+++ pspp/tests/stats/descript-missing.sh        Tue May 30 12:01:34 2006
@@ -16,6 +16,8 @@
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
 
+LANG=C
+export LANG
 
 cleanup()
 {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]