/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2009, 2010, 2011 Free Software Foundation
+ Copyright (C) 2009, 2010, 2011, 2013 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 <config.h>
#include "psppire-window.h"
+#include "psppire-window-base.h"
#include <gtk/gtk.h>
#include "data/dataset.h"
#include "helper.h"
-#include "psppire-conf.h"
#include "psppire-data-window.h"
#include "psppire-encoding-selector.h"
#include "psppire-syntax-window.h"
};
psppire_window_type =
- g_type_register_static (GTK_TYPE_WINDOW, "PsppireWindow",
+ g_type_register_static (PSPPIRE_TYPE_WINDOW_BASE, "PsppireWindow",
&psppire_window_info, G_TYPE_FLAG_ABSTRACT);
}
}
-static void
-on_realize (GtkWindow *window, gpointer data)
-{
- PsppireConf *conf = psppire_conf_new ();
-
- const gchar *base = G_OBJECT_TYPE_NAME (window);
-
- psppire_conf_set_window_geometry (conf, base, window);
-}
-
-
static void
psppire_window_finalize (GObject *object)
{
/* Add a separator before adding the first real item. If we add a separator
at any other time, sometimes GtkUIManager removes it. */
- if (g_hash_table_size (window->menuitem_table) == 0)
+ if (!window->added_separator)
{
GtkWidget *separator = gtk_separator_menu_item_new ();
gtk_widget_show (separator);
gtk_menu_shell_append (window->menu, separator);
+ window->added_separator = TRUE;
}
filename = g_filename_display_name (key);
{
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);
G_CALLBACK (remove_menuitem),
window);
+ window->added_separator = FALSE;
window->dirty = FALSE;
g_signal_connect_swapped (window, "delete-event", G_CALLBACK (on_delete), window);
g_object_set (window, "icon-name", "pspp", NULL);
-
- g_signal_connect (window, "realize",
- G_CALLBACK (on_realize), window);
}
/*