/* 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
PsppireWindowRegister *reg = psppire_window_register_new ();
+ g_signal_handler_disconnect (reg, window->remove_handler);
+ g_signal_handler_disconnect (reg, window->insert_handler);
psppire_window_register_remove (reg, window->list_name);
g_free (window->filename);
g_free (window->basename);
g_free (window->description);
g_free (window->list_name);
- g_signal_handler_disconnect (psppire_window_register_new (),
- window->remove_handler);
-
- g_signal_handler_disconnect (psppire_window_register_new (),
- window->insert_handler);
-
g_hash_table_destroy (window->menuitem_table);
if (G_OBJECT_CLASS (parent_class)->finalize)
/* 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);
G_CALLBACK (remove_menuitem),
window);
+ window->added_separator = FALSE;
window->dirty = FALSE;
g_signal_connect_swapped (window, "delete-event", G_CALLBACK (on_delete), window);
static void delete_recent (const char *file_name);
gboolean
-psppire_window_load (PsppireWindow *w, const gchar *file)
+psppire_window_load (PsppireWindow *w, const gchar *file, gpointer hint)
{
gboolean ok;
PsppireWindowIface *i = PSPPIRE_WINDOW_MODEL_GET_IFACE (w);
g_return_val_if_fail (i->load, FALSE);
- ok = i->load (w, file);
+ ok = i->load (w, file, hint);
if ( ok )
{
gtk_file_chooser_get_extra_widget (GTK_FILE_CHOOSER (dialog)));
if (any_reader_may_open (sysname))
- open_data_window (de, name);
+ open_data_window (de, name, NULL);
else
open_syntax_window (name, encoding);