app: don't let applying a tool preset overwrite the tool option's name

GimpConfig needs some was to "lock" properties, or some other proper
solution to this problem.
This commit is contained in:
Michael Natterer 2011-11-24 22:05:00 +01:00
parent 72c89397e4
commit 31d443a465
1 changed files with 7 additions and 0 deletions

View File

@ -630,6 +630,7 @@ tool_manager_preset_changed (GimpContext *user_context,
GimpToolManager *tool_manager)
{
GimpToolInfo *preset_tool;
gchar *options_name;
gboolean tool_change = FALSE;
if (! preset || user_context->gimp->busy)
@ -643,9 +644,15 @@ tool_manager_preset_changed (GimpContext *user_context,
if (! tool_change)
tool_manager_disconnect_options (tool_manager, user_context, preset_tool);
/* save the name, we don't want to overwrite it */
options_name = g_strdup (gimp_object_get_name (preset_tool->tool_options));
gimp_config_copy (GIMP_CONFIG (preset->tool_options),
GIMP_CONFIG (preset_tool->tool_options), 0);
/* restore the saved name */
gimp_object_take_name (GIMP_OBJECT (preset_tool->tool_options), options_name);
if (tool_change)
gimp_context_set_tool (user_context, preset_tool);
else