From bc5774a8297b4be5c913670a62cf9184dcf533d0 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Mon, 9 Oct 2006 23:16:46 +0000 Subject: [PATCH] allow an effect to be hidden from the effects menu --- src/extension/effect.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index 71ddf3e24..168688f0e 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -32,6 +32,8 @@ Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation * if (!strcmp(this->get_id(), "org.inkscape.filter.dropshadow")) return; + bool hidden = false; + if (repr != NULL) { Inkscape::XML::Node * child_repr; @@ -41,6 +43,9 @@ Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation * if (!strcmp(child_repr->name(), "effects-menu")) { // printf("Found local effects menu in %s\n", this->get_name()); local_effects_menu = sp_repr_children(child_repr); + if (child_repr->attribute("hidden") && !strcmp(child_repr->attribute("hidden"), "yes")) { + hidden = true; + } } if (!strcmp(child_repr->name(), "menu-name") || !strcmp(child_repr->name(), "_menu-name")) { @@ -65,7 +70,8 @@ Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation * _menu_node = sp_repr_new("verb"); _menu_node->setAttribute("verb-id", this->get_id(), false); - merge_menu(_effects_list->parent(), _effects_list, local_effects_menu, _menu_node); + if (!hidden) + merge_menu(_effects_list->parent(), _effects_list, local_effects_menu, _menu_node); } return; -- 2.30.2