app: Make Windows → Recently Closed Docks work again

Set a dialog factory entry on the session info object in
global_recent_docks so it can be properly restored.
This commit is contained in:
Martin Nordholts 2010-02-13 18:37:51 +01:00
parent 1046e30724
commit 9bf0d80c9c
1 changed files with 11 additions and 3 deletions

View File

@ -612,9 +612,11 @@ static gboolean
gimp_dock_window_delete_event (GtkWidget *widget,
GdkEventAny *event)
{
GimpDockWindow *dock_window = GIMP_DOCK_WINDOW (widget);
GimpDock *dock = gimp_dock_window_get_dock (dock_window);
GimpSessionInfo *info = NULL;
GimpDockWindow *dock_window = GIMP_DOCK_WINDOW (widget);
GimpDock *dock = gimp_dock_window_get_dock (dock_window);
GimpSessionInfo *info = NULL;
const gchar *entry_name = NULL;
GimpDialogFactoryEntry *entry = NULL;
/* Don't add docks with just a singe dockable to the list of
* recently closed dock since those can be brought back through the
@ -632,6 +634,12 @@ gimp_dock_window_delete_event (GtkWidget *widget,
gimp_session_info_get_info (info);
gimp_session_info_set_widget (info, NULL);
entry_name = (gimp_dock_window_has_toolbox (dock_window) ?
"gimp-toolbox-window" :
"gimp-dock-window");
entry = gimp_dialog_factory_find_entry (global_dock_factory, entry_name);
gimp_session_info_set_factory_entry (info, entry);
gimp_container_add (global_recent_docks, GIMP_OBJECT (info));
g_object_unref (info);