diff --git a/app/actions/filters-actions.c b/app/actions/filters-actions.c index 31578b0f4b..2f4def28fa 100644 --- a/app/actions/filters-actions.c +++ b/app/actions/filters-actions.c @@ -804,7 +804,6 @@ filters_actions_setup (GimpActionGroup *group) g_free (action_name); action_name = g_strdup_printf ("filters-%s-%d", formatted_op_name, i++); } - g_free (formatted_op_name); title = gegl_operation_class_get_key (op_class, "title"); op_name = op_class->name; @@ -824,8 +823,12 @@ filters_actions_setup (GimpActionGroup *group) entry.value = op_class->name; entry.help_id = GIMP_HELP_TOOL_GEGL; - if (gegl_operation_class_get_key (op_class, "gimp:help-id")) - entry.help_id = gegl_operation_class_get_key (op_class, "gimp:help-id"); + if (gegl_operation_class_get_key (op_class, "gimp:menu-path") && + g_str_has_prefix (op_class->name, "gegl:")) + /* We automatically create an help ID from the operation name + * for all core GEGL operations with a menu path key. + */ + entry.help_id = formatted_op_name; gimp_action_group_add_string_actions (group, "filters-action", &entry, 1, @@ -859,6 +862,7 @@ filters_actions_setup (GimpActionGroup *group) g_free (label); g_free (action_name); + g_free (formatted_op_name); } g_object_set_data_full (G_OBJECT (group), diff --git a/app/actions/gimpgeglprocedure.c b/app/actions/gimpgeglprocedure.c index c27338aa5d..a52ff7f353 100644 --- a/app/actions/gimpgeglprocedure.c +++ b/app/actions/gimpgeglprocedure.c @@ -48,7 +48,11 @@ #include "core/gimpsettings.h" #include "core/gimptoolinfo.h" +#include "widgets/gimpaction.h" +#include "widgets/gimpactiongroup.h" #include "widgets/gimphelp-ids.h" +#include "widgets/gimpstringaction.h" +#include "widgets/gimpuimanager.h" #include "tools/gimpoperationtool.h" #include "tools/tool_manager.h" @@ -161,13 +165,35 @@ static const gchar * gimp_gegl_procedure_get_help_id (GimpProcedure *procedure) { GimpGeglProcedure *proc = GIMP_GEGL_PROCEDURE (procedure); + GList *managers; + GimpActionGroup *group; + const gchar *help_id = NULL; + + managers = gimp_ui_managers_from_name (""); + group = gimp_ui_manager_get_action_group (managers->data, "filters"); if (procedure->help_id) - return procedure->help_id; - else if (gegl_operation_get_key (proc->operation, "gimp:help-id")) - return gegl_operation_get_key (proc->operation, "gimp:help-id"); + { + return procedure->help_id; + } + else if (group) + { + GList *actions; + GList *iter; - return GIMP_HELP_TOOL_GEGL; + actions = gimp_action_group_list_actions (group); + for (iter = actions; iter; iter = iter->next) + if (GIMP_IS_STRING_ACTION (iter->data) && + g_strcmp0 (GIMP_STRING_ACTION (iter->data)->value, proc->operation) == 0) + { + help_id = gimp_action_get_help_id (iter->data); + break; + } + + g_list_free (actions); + } + + return help_id == NULL ? GIMP_HELP_TOOL_GEGL : help_id; } static const gchar *