From 437e28d328fd12bc757245cb8aa5039172811661 Mon Sep 17 00:00:00 2001 From: Sergei Izmailov Date: Mon, 27 May 2019 00:59:36 +0300 Subject: feature: Allow effect extensions to disable working dialog Effect extensions with custom GUI don't need 'effect is working' dialog window which distracts from effect main window. New "suppress-working-dialog" optional attribute added to effect node of `.inx` file. --- src/extension/effect.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/extension/effect.cpp') diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index f69ece42f..618b6f84a 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -63,6 +63,9 @@ Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation * if (child->attribute("needs-live-preview") && !strcmp(child->attribute("needs-live-preview"), "false")) { no_live_preview = true; } + if (child->attribute("suppress-working-dialog") && !strcmp(child->attribute("suppress-working-dialog"), "true")) { + _workingDialog = false; + } for (Inkscape::XML::Node *effect_child = child->firstChild(); effect_child != nullptr; effect_child = effect_child->next()) { if (!strcmp(effect_child->name(), INKSCAPE_EXTENSION_NS "effects-menu")) { // printf("Found local effects menu in %s\n", this->get_name()); @@ -269,7 +272,7 @@ Effect::effect (Inkscape::UI::View::View * doc) if (!loaded()) set_state(Extension::STATE_LOADED); if (!loaded()) return; - ExecutionEnv executionEnv(this, doc); + ExecutionEnv executionEnv(this, doc, nullptr, _workingDialog, true); execution_env = &executionEnv; timer->lock(); executionEnv.run(); -- cgit v1.2.3 From 40b26e345fc729d5cc89105c437c2b934da8dd0e Mon Sep 17 00:00:00 2001 From: Sergei Izmailov Date: Mon, 27 May 2019 20:13:14 +0300 Subject: Rename "suppress-working-dialog" effect attribute to "application" --- src/extension/effect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/effect.cpp') diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index 618b6f84a..d0079e7cc 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -63,7 +63,7 @@ Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation * if (child->attribute("needs-live-preview") && !strcmp(child->attribute("needs-live-preview"), "false")) { no_live_preview = true; } - if (child->attribute("suppress-working-dialog") && !strcmp(child->attribute("suppress-working-dialog"), "true")) { + if (child->attribute("application") && !strcmp(child->attribute("application"), "true")) { _workingDialog = false; } for (Inkscape::XML::Node *effect_child = child->firstChild(); effect_child != nullptr; effect_child = effect_child->next()) { -- cgit v1.2.3 From 9317c612c998b18b2334ea17ca89d9b9e2a97085 Mon Sep 17 00:00:00 2001 From: Sergei Izmailov Date: Mon, 27 May 2019 20:14:01 +0300 Subject: Fix indentation --- src/extension/effect.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/extension/effect.cpp') diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index d0079e7cc..2b08e4da1 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -58,13 +58,13 @@ Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation * for (Inkscape::XML::Node *child = repr->firstChild(); child != nullptr; child = child->next()) { if (!strcmp(child->name(), INKSCAPE_EXTENSION_NS "effect")) { if (child->attribute("needs-document") && !strcmp(child->attribute("needs-document"), "false")) { - no_doc = true; + no_doc = true; } if (child->attribute("needs-live-preview") && !strcmp(child->attribute("needs-live-preview"), "false")) { - no_live_preview = true; + no_live_preview = true; } if (child->attribute("application") && !strcmp(child->attribute("application"), "true")) { - _workingDialog = false; + _workingDialog = false; } for (Inkscape::XML::Node *effect_child = child->firstChild(); effect_child != nullptr; effect_child = effect_child->next()) { if (!strcmp(effect_child->name(), INKSCAPE_EXTENSION_NS "effects-menu")) { -- cgit v1.2.3 From c79a9bc365eb0b1f638e7ffa670dffb61c665e22 Mon Sep 17 00:00:00 2001 From: Sergei Izmailov Date: Wed, 29 May 2019 02:59:11 +0300 Subject: Rename effect attribute to "implements-custom-gui" Effect with `implements-custom-gui="true"` MUST implement custom GUI --- src/extension/effect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/effect.cpp') diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index 2b08e4da1..3c9940240 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -63,7 +63,7 @@ Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation * if (child->attribute("needs-live-preview") && !strcmp(child->attribute("needs-live-preview"), "false")) { no_live_preview = true; } - if (child->attribute("application") && !strcmp(child->attribute("application"), "true")) { + if (child->attribute("implements-custom-gui") && !strcmp(child->attribute("implements-custom-gui"), "true")) { _workingDialog = false; } for (Inkscape::XML::Node *effect_child = child->firstChild(); effect_child != nullptr; effect_child = effect_child->next()) { -- cgit v1.2.3