diff --git a/src/actions/actions-effect.cpp b/src/actions/actions-effect.cpp index 29569672c775ff116871823eb46a422a14386a1e..c102acafe1ae77de2353782d39b93e430428c166 100644 --- a/src/actions/actions-effect.cpp +++ b/src/actions/actions-effect.cpp @@ -55,12 +55,19 @@ last_effect_pref(InkscapeApplication *app) effect->prefs(InkscapeApplication::instance()->get_active_view()); } +void +no_selection_after_effect(InkscapeApplication *app) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->setBool("/options/noselectionaftereffect", true); +} + std::vector> raw_data_effect = { // clang-format off - {"app.edit-remove-filter", N_("Remove Filters"), "Filter", N_("Remove any filters from selected objects")}, - {"app.last-effect", N_("Previous Extension"), "Extension", N_("Repeat the last extension with the same settings")}, - {"app.last-effect-pref", N_("Previous Extension Settings"), "Extension", N_("Repeat the last extension with new settings")} + {"app.edit-remove-filter", N_("Remove Filters"), "Filter", N_("Remove any filters from selected objects")}, + {"app.last-effect", N_("Previous Extension"), "Extension", N_("Repeat the last extension with the same settings")}, + {"app.last-effect-pref", N_("Previous Extension Settings"), "Extension", N_("Repeat the last extension with new settings")}, + {"app.no-selection-after-effect", N_("No Selection After Effect"), "Extension", N_("Reselect or not after extension execution")} // clang-format on }; @@ -70,9 +77,10 @@ add_actions_effect(InkscapeApplication* app) auto *gapp = app->gio_app(); // clang-format off - gapp->add_action( "edit-remove-filter", sigc::bind(sigc::ptr_fun(&edit_remove_filter), app)); - gapp->add_action( "last-effect", sigc::bind(sigc::ptr_fun(&last_effect), app)); - gapp->add_action( "last-effect-pref", sigc::bind(sigc::ptr_fun(&last_effect_pref), app)); + gapp->add_action( "edit-remove-filter", sigc::bind(sigc::ptr_fun(&edit_remove_filter), app)); + gapp->add_action( "last-effect", sigc::bind(sigc::ptr_fun(&last_effect), app)); + gapp->add_action( "last-effect-pref", sigc::bind(sigc::ptr_fun(&last_effect_pref), app)); + gapp->add_action( "no-selection-after-effect", sigc::bind(sigc::ptr_fun(&no_selection_after_effect), app)); // clang-format on if (!app) { diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp index 0875d132fa75937b78f7a4a1a1582e240d8428cf..78d36a965eb67dff762070ff6a10cc39d3fb6162 100644 --- a/src/extension/execution-env.cpp +++ b/src/extension/execution-env.cpp @@ -207,7 +207,12 @@ ExecutionEnv::run () { _effect->get_imp()->effect(_effect, _doc, _docCache); desktop->clearWaitingCursor(); _state = ExecutionEnv::COMPLETE; - selection->restoreBackup(); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + if (!prefs->getBool("/options/noselectionaftereffect", false)) { + selection->restoreBackup(); + } else { + prefs->setBool("/options/noselectionaftereffect", false); + } // _runComplete.signal(); return; }