gimp r24935 - in branches/gimp-2-4: . app/actions
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r24935 - in branches/gimp-2-4: . app/actions
- Date: Thu, 21 Feb 2008 16:42:48 +0000 (GMT)
Author: mitch
Date: Thu Feb 21 16:42:48 2008
New Revision: 24935
URL: http://svn.gnome.org/viewvc/gimp?rev=24935&view=rev
Log:
2008-02-21 Michael Natterer <mitch gimp org>
Merged from trunk:
* 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.
Modified:
branches/gimp-2-4/ChangeLog
branches/gimp-2-4/app/actions/plug-in-actions.c
Modified: branches/gimp-2-4/app/actions/plug-in-actions.c
==============================================================================
--- branches/gimp-2-4/app/actions/plug-in-actions.c (original)
+++ branches/gimp-2-4/app/actions/plug-in-actions.c Thu Feb 21 16:42:48 2008
@@ -482,9 +482,21 @@
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);
@@ -494,6 +506,9 @@
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);
}
@@ -503,20 +518,32 @@
_("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),
@@ -537,9 +564,6 @@
"procedure", NULL,
NULL);
}
-
- /* update sensitivity of the actions */
- plug_in_actions_update (group, manager->gimp);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]