summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2007-09-01 04:32:10 +0000
committergouldtj <gouldtj@users.sourceforge.net>2007-09-01 04:32:10 +0000
commitf512b9915196be7533eb6633504e2af73423bc15 (patch)
tree9ae83b84e925aab747be09c70392c305f03af3b0 /src
parentr16339@tres: ted | 2007-08-19 19:47:57 -0700 (diff)
downloadinkscape-f512b9915196be7533eb6633504e2af73423bc15.tar.gz
inkscape-f512b9915196be7533eb6633504e2af73423bc15.zip
r16340@tres: ted | 2007-08-20 19:02:50 -0700
Pinned is still not working, somewhat usable state. Worth checking in. (bzr r3639)
Diffstat (limited to 'src')
-rw-r--r--src/extension/execution-env.cpp23
-rw-r--r--src/extension/execution-env.h3
-rw-r--r--src/extension/prefdialog.cpp15
-rw-r--r--src/extension/prefdialog.h2
4 files changed, 37 insertions, 6 deletions
diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp
index adcd2a3d7..be3abcd41 100644
--- a/src/extension/execution-env.cpp
+++ b/src/extension/execution-env.cpp
@@ -28,7 +28,7 @@ namespace Inkscape {
namespace Extension {
-ExecutionEnv::ExecutionEnv (Effect * effect, Inkscape::UI::View::View * doc, Gtk::Widget * controls) :
+ExecutionEnv::ExecutionEnv (Effect * effect, Inkscape::UI::View::View * doc, Gtk::Widget * controls, Gtk::Dialog * prefDialog) :
_effect(effect),
_visibleDialog(NULL),
_prefsVisible(false),
@@ -56,10 +56,15 @@ ExecutionEnv::ExecutionEnv (Effect * effect, Inkscape::UI::View::View * doc, Gtk
_mainloop = Glib::MainLoop::create(false);
- if (controls != NULL) {
- createPrefsDialog(controls);
+ if (prefDialog == NULL) {
+ if (controls != NULL) {
+ createPrefsDialog(controls);
+ } else {
+ createWorkingDialog();
+ }
} else {
- createWorkingDialog();
+ _visibleDialog = prefDialog;
+ _prefsVisible = true;
}
return;
@@ -224,7 +229,7 @@ void
ExecutionEnv::livePreview (bool state) {
_mainloop->quit();
if (_livePreview && !state) {
- _canceled = true;
+ documentCancel();
}
if (!_livePreview && state) {
_humanWait = false;
@@ -233,6 +238,14 @@ ExecutionEnv::livePreview (bool state) {
return;
}
+void
+ExecutionEnv::shutdown (void) {
+ _mainloop->quit();
+ processingCancel();
+ documentCancel();
+ _finished = true;
+ _visibleDialog = NULL;
+}
} } /* namespace Inkscape, Extension */
diff --git a/src/extension/execution-env.h b/src/extension/execution-env.h
index 3c4b13198..e46aafc07 100644
--- a/src/extension/execution-env.h
+++ b/src/extension/execution-env.h
@@ -39,12 +39,13 @@ private:
public:
Effect * _effect;
- ExecutionEnv (Effect * effect, Inkscape::UI::View::View * doc, Gtk::Widget * controls = NULL);
+ ExecutionEnv (Effect * effect, Inkscape::UI::View::View * doc, Gtk::Widget * controls = NULL, Gtk::Dialog * prefDialog = NULL);
~ExecutionEnv (void);
void run (void);
void preferencesChange (void);
void livePreview (bool state = true);
+ void shutdown (void);
private:
void createPrefsDialog (Gtk::Widget * controls);
diff --git a/src/extension/prefdialog.cpp b/src/extension/prefdialog.cpp
index eb6cbf6fa..62e6b9ff8 100644
--- a/src/extension/prefdialog.cpp
+++ b/src/extension/prefdialog.cpp
@@ -43,6 +43,7 @@ PrefDialog::PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * co
_help(help),
_name(name),
_exEnv(exEnv),
+ _createdExEnv(false),
_button_ok(NULL),
_button_cancel(NULL),
_button_preview(NULL),
@@ -168,12 +169,26 @@ PrefDialog::pinned_toggle (void) {
_button_ok->set_label(Gtk::Stock::EXECUTE.id);
_button_cancel->set_label(Gtk::Stock::CLOSE.id);
+
+ if (_exEnv != NULL) {
+ _exEnv->shutdown();
+ if (_createdExEnv) {
+ delete _exEnv;
+ }
+ _exEnv = NULL;
+ }
} else {
_button_preview->set_sensitive(true);
set_modal(true);
_button_ok->set_label(Gtk::Stock::OK.id);
_button_cancel->set_label(Gtk::Stock::CANCEL.id);
+
+ if (_exEnv == NULL) {
+ _exEnv = new ExecutionEnv(_effect, SP_ACTIVE_DESKTOP, NULL, this);
+ _createdExEnv = true;
+ _exEnv->run();
+ }
}
}
diff --git a/src/extension/prefdialog.h b/src/extension/prefdialog.h
index 059cfce45..0f385922f 100644
--- a/src/extension/prefdialog.h
+++ b/src/extension/prefdialog.h
@@ -32,6 +32,8 @@ class PrefDialog : public Gtk::Dialog {
Glib::ustring _name;
/** \brief An execution environment if there is one */
ExecutionEnv * _exEnv;
+ /** \brief Whether we created the \a _exEnv variable */
+ bool _createdExEnv;
/** \brief A pointer to the OK button */
Gtk::Button * _button_ok;