From 7cf2ee6397ac05ca8a925b8667fc313cc321a099 Mon Sep 17 00:00:00 2001 From: Massimo Valentini Date: Tue, 7 Feb 2012 16:56:41 +0100 Subject: [PATCH] Bug 586451: Alpha Logo scripts incorrectly become... sensitive after "Refresh Scripts" --- app/actions/plug-in-actions.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/actions/plug-in-actions.c b/app/actions/plug-in-actions.c index ce58868391..64a31a274f 100644 --- a/app/actions/plug-in-actions.c +++ b/app/actions/plug-in-actions.c @@ -28,6 +28,7 @@ #include "actions-types.h" #include "core/gimp.h" +#include "core/gimpcontext.h" #include "core/gimpdrawable.h" #include "core/gimpimage.h" @@ -497,6 +498,25 @@ plug_in_actions_add_proc (GimpActionGroup *group, g_free (path_original); g_free (path_translated); } + + if ((proc->menu_label || proc->menu_paths) && + ! proc->file_proc && + proc->image_types_val) + { + GimpContext *context = gimp_get_user_context (group->gimp); + GimpImage *image = context ? gimp_context_get_image (context) : NULL; + GimpDrawable *drawable = NULL; + gboolean sensitive; + + if (image) + drawable = gimp_image_get_active_drawable (image); + + sensitive = gimp_plug_in_procedure_get_sensitive (proc, drawable); + + gimp_action_group_set_action_sensitive (group, + gimp_object_get_name (proc), + sensitive); + } } static void