Commit ea6efc38 authored by Martin Nordholts's avatar Martin Nordholts
Browse files

app: Make Recently Used Docks work with GIMP 2.6 dockrc files

In GIMP 2.6 dockrc did not contain the factory entries for the session
infos, so set that up manually if needed. Also take the opportunity to
add a copyright notice to dialogs.c since tha file is almost rewritten
by now...
parent dec798e0
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* dialogs.c
* Copyright (C) 2010 Martin Nordholts <martinn@src.gnome.org>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
......@@ -420,6 +423,23 @@ dialogs_exit (Gimp *gimp)
}
}
static void
dialogs_ensure_factory_entry_on_recent_dock (GimpSessionInfo *info)
{
if (! gimp_session_info_get_factory_entry (info))
{
GimpDialogFactoryEntry *entry = NULL;
/* The recent docks container only contains session infos for
* dock windows
*/
entry = gimp_dialog_factory_find_entry (global_dialog_factory,
"gimp-dock-window");
gimp_session_info_set_factory_entry (info, entry);
}
}
void
dialogs_load_recent_docks (Gimp *gimp)
{
......@@ -443,6 +463,13 @@ dialogs_load_recent_docks (Gimp *gimp)
g_clear_error (&error);
}
/* In GIMP 2.6 dockrc did not contain the factory entries for the
* session infos, so set that up manually if needed
*/
gimp_container_foreach (global_recent_docks,
(GFunc) dialogs_ensure_factory_entry_on_recent_dock,
NULL);
gimp_list_reverse (GIMP_LIST (global_recent_docks));
g_free (filename);
......
# recently closed docks
(GimpSessionInfo "Palettes - FG/BG - Images"
(factory-entry "gimp-dock-window")
(position 586 116)
(size 200 573)
(open-on-exit)
(aux-info
(show-image-menu "false")
(follow-active-image "true"))
(gimp-dock
(book
(current-page 0)
(dockable "gimp-palette-list"
(tab-style preview)))
(book
(position 141)
(current-page 0)
(dockable "gimp-color-editor"
(tab-style preview)
(aux-info
(current-page "GimpColorSelect"))))
(book
(position 414)
(current-page 0)
(dockable "gimp-image-list"
(tab-style preview)))))
(GimpSessionInfo "Selection, Fonts"
(factory-entry "gimp-dock-window")
(position 200 179)
(size 200 300)
(open-on-exit)
(aux-info
(show-image-menu "false")
(follow-active-image "true"))
(gimp-dock
(book
(current-page 1)
(dockable "gimp-selection-editor"
(tab-style icon))
(dockable "gimp-font-list"
(tab-style preview)))))
# end of recently closed docks
......@@ -85,7 +85,7 @@ int main(int argc, char **argv)
* variant
*/
sessionrc_filename = gimp_personal_rc_file ("sessionrc-expected");
dockrc_filename = gimp_personal_rc_file ("dockrc");
dockrc_filename = gimp_personal_rc_file ("dockrc-expected");
/* Remeber the modtimes and MD5s */
if (!gimp_test_get_file_state_verbose (sessionrc_filename,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment