#include <config.h>
#include <stdlib.h>
+#include <gettext.h>
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
+
#include <data/file-handle-def.h>
#include <data/sys-file-reader.h>
#include "psppire-var-store.h"
#include "psppire-data-store.h"
-#define _(A) A
-#define N_(A) A
extern GladeXML *xml;
static const gchar handle_name[] = "psppire_handle";
-static const gchar untitled[] = _("Untitled");
+static const gchar untitled[] = N_("Untitled");
-static const gchar window_title[]=_("PSPP Data Editor");
+static const gchar window_title[] = N_("PSPP Data Editor");
+/* Sets the title bar to TEXT */
static void
psppire_set_window_title(const gchar *text)
{
GtkWidget *data_editor = get_widget_assert(xml, "data_editor");
- gchar *title = g_strdup_printf("%s --- %s", text, window_title);
+ 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");
psppire_dict_clear(the_dictionary);
psppire_case_array_clear(the_cases);
- psppire_set_window_title(untitled);
+ psppire_set_window_title(gettext(untitled));
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)
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");
select_sheet(PAGE_VAR_SHEET);
}
-
-/* Callback which occurs when gtk_main is entered */
-gboolean
-callbacks_on_init(gpointer data)
-{
- psppire_set_window_title(untitled);
-
- var_data_selection_init();
-
- return FALSE;
-}