/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2009 Free Software Foundation
+ Copyright (C) 2009, 2010 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
#include <gtk/gtkmain.h>
#include <stdlib.h>
+#include <xalloc.h>
#include <gettext.h>
#define _(msgid) gettext (msgid)
name = g_value_get_string (&def);
}
- candidate_name = strdup (name);
+ candidate_name = xstrdup (name);
while ( psppire_window_register_lookup (reg, candidate_name))
{
}
-static gboolean
-save_geometry (GtkWidget *window, GdkEvent *event, gpointer data)
-{
- const gchar *base = G_OBJECT_TYPE_NAME (window);
-
- PsppireConf *conf = psppire_conf_new ();
-
- psppire_conf_save_window_geometry (conf, base, event);
-
- return FALSE;
-}
-
-
static void
psppire_window_finalize (GObject *object)
{
g_param_spec_string ("filename",
"File name",
"The name of the file associated with this window, if any",
- "Untitled",
+ /* TRANSLATORS: This will form a filename. Please avoid whitespace. */
+ _("Untitled"),
G_PARAM_CONSTRUCT | G_PARAM_READWRITE);
g_unichar_to_utf8 (0x2014, mdash);
{
PsppireWindowRegister *reg = psppire_window_register_new ();
+ const gchar *base = G_OBJECT_TYPE_NAME (w);
+
+ PsppireConf *conf = psppire_conf_new ();
+
+ psppire_conf_save_window_geometry (conf, base, GTK_WINDOW (w));
+
+
if ( w->dirty )
{
gint response = psppire_window_query_save (w);
{
window->name = NULL;
window->menu = NULL;
- window->description = strdup ("");
+ window->description = xstrdup ("");
window->menuitem_table = g_hash_table_new (g_str_hash, g_str_equal);
g_object_set (window, "icon-name", "psppicon", NULL);
- g_signal_connect (window, "configure-event",
- G_CALLBACK (save_geometry), window);
-
- g_signal_connect (window, "window-state-event",
- G_CALLBACK (save_geometry), window);
-
g_signal_connect (window, "realize",
G_CALLBACK (on_realize), window);