Commit 4d8e0023 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

don't call plug_in_actions_update() because that updated the sensitivity

2008-02-21  Michael Natterer  <mitch@gimp.org>

	* app/actions/plug-in-actions.c (plug_in_actions_history_changed):
	don't call plug_in_actions_update() because that updated the
	sensitivity of *all* plug-in actions according to the properties
	of the *current* image. Instead, look up the original GtkAction of
	the history items of *this* action group and copy the sensitivity
	from that action. Fixes bug #517683.


svn path=/trunk/; revision=24934
parent 698810f4
2008-02-21 Michael Natterer <mitch@gimp.org>
* app/actions/plug-in-actions.c (plug_in_actions_history_changed):
don't call plug_in_actions_update() because that updated the
sensitivity of *all* plug-in actions according to the properties
of the *current* image. Instead, look up the original GtkAction of
the history items of *this* action group and copy the sensitivity
from that action. Fixes bug #517683.
2008-02-21 Sven Neumann <sven@gimp.org>
* tools/pdbgen/app.pl (marshal_outargs): insert a missing newline
......
......@@ -481,9 +481,21 @@ plug_in_actions_history_changed (GimpPlugInManager *manager,
if (proc)
{
GtkAction *actual_action;
const gchar *label;
gchar *repeat;
gchar *reshow;
gboolean sensitive = FALSE;
/* copy the sensitivity of the plug-in procedure's actual action
* instead of calling plug_in_actions_update() because doing the
* latter would set the sensitivity of this image's action on
* all images' actions. See bug #517683.
*/
actual_action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
GIMP_OBJECT (proc)->name);
if (actual_action)
sensitive = gtk_action_get_sensitive (actual_action);
label = gimp_plug_in_procedure_get_label (proc);
......@@ -493,6 +505,9 @@ plug_in_actions_history_changed (GimpPlugInManager *manager,
gimp_action_group_set_action_label (group, "plug-in-repeat", repeat);
gimp_action_group_set_action_label (group, "plug-in-reshow", reshow);
gimp_action_group_set_action_sensitive (group, "plug-in-repeat", sensitive);
gimp_action_group_set_action_sensitive (group, "plug-in-reshow", sensitive);
g_free (repeat);
g_free (reshow);
}
......@@ -502,20 +517,32 @@ plug_in_actions_history_changed (GimpPlugInManager *manager,
_("Repeat Last"));
gimp_action_group_set_action_label (group, "plug-in-reshow",
_("Re-Show Last"));
gimp_action_group_set_action_sensitive (group, "plug-in-repeat", FALSE);
gimp_action_group_set_action_sensitive (group, "plug-in-reshow", FALSE);
}
for (i = 0; i < gimp_plug_in_manager_history_length (manager); i++)
{
GtkAction *action;
gchar *name = g_strdup_printf ("plug-in-recent-%02d", i + 1);
GtkAction *actual_action;
gchar *name = g_strdup_printf ("plug-in-recent-%02d", i + 1);
gboolean sensitive = FALSE;
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), name);
g_free (name);
proc = gimp_plug_in_manager_history_nth (manager, i);
/* see comment above */
actual_action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
GIMP_OBJECT (proc)->name);
if (actual_action)
sensitive = gtk_action_get_sensitive (actual_action);
g_object_set (action,
"visible", TRUE,
"sensitive", sensitive,
"procedure", proc,
"label", gimp_plug_in_procedure_get_label (proc),
"stock-id", gimp_plug_in_procedure_get_stock_id (proc),
......@@ -536,9 +563,6 @@ plug_in_actions_history_changed (GimpPlugInManager *manager,
"procedure", NULL,
NULL);
}
/* update sensitivity of the actions */
plug_in_actions_update (group, manager->gimp);
}
static gboolean
......
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