summaryrefslogtreecommitdiffstats
path: root/src/extension/prefdialog.cpp
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2017-11-03 00:55:01 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2018-05-09 19:42:10 +0000
commit61cbbcbe02f11d67e4fe9f3c4f452442d2e9f778 (patch)
tree3ed5e5b78b00cf25892a3a18e118eee41cbc15ec /src/extension/prefdialog.cpp
parentFix typo (diff)
downloadinkscape-61cbbcbe02f11d67e4fe9f3c4f452442d2e9f778.tar.gz
inkscape-61cbbcbe02f11d67e4fe9f3c4f452442d2e9f778.zip
Start migrating 0.92 patch to master
Diffstat (limited to 'src/extension/prefdialog.cpp')
-rw-r--r--src/extension/prefdialog.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/extension/prefdialog.cpp b/src/extension/prefdialog.cpp
index 0247e18e9..4c799eb68 100644
--- a/src/extension/prefdialog.cpp
+++ b/src/extension/prefdialog.cpp
@@ -18,6 +18,8 @@
// Used to get SP_ACTIVE_DESKTOP
#include "inkscape.h"
#include "desktop.h"
+#include "document.h"
+#include "document-undo.h"
#include "effect.h"
#include "implementation/implementation.h"
@@ -61,6 +63,13 @@ PrefDialog::PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * co
controls = _effect->get_imp()->prefs_effect(_effect, SP_ACTIVE_DESKTOP, &_signal_param_change, NULL);
_signal_param_change.connect(sigc::mem_fun(this, &PrefDialog::param_change));
}
+ SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ if (desktop) {
+ Inkscape::Selection * selection = desktop->getSelection();
+ if (selection) {
+ selection->emptyBackup();
+ }
+ }
hbox->pack_start(*controls, true, true, 0);
hbox->show();
@@ -170,12 +179,29 @@ PrefDialog::run (void) {
void
PrefDialog::preview_toggle (void) {
+ SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ SPDocument *document = SP_ACTIVE_DOCUMENT;
+ Inkscape::Selection * selection = NULL;
+ bool modified = document->isModifiedSinceSave();
+ if(desktop) {
+ selection = desktop->getSelection();
+ if (!selection->isEmpty()) {
+ selection->setBackup();
+ }
+ }
if(_param_preview->get_bool(NULL, NULL)) {
- set_modal(true);
if (_exEnv == NULL) {
+ set_modal(true);
+ if (desktop && selection) {
+ desktop->on_live_extension = true;
+
+ }
_exEnv = new ExecutionEnv(_effect, SP_ACTIVE_DESKTOP, NULL, false, false);
_effect->set_execution_env(_exEnv);
_exEnv->run();
+ if (desktop && selection) {
+ selection->clear();
+ }
}
} else {
set_modal(false);