summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 767534e)
raw | patch | inline | side by side (parent: 767534e)
author | gouldtj <gouldtj@users.sourceforge.net> | |
Sat, 1 Sep 2007 04:32:10 +0000 (04:32 +0000) | ||
committer | gouldtj <gouldtj@users.sourceforge.net> | |
Sat, 1 Sep 2007 04:32:10 +0000 (04:32 +0000) |
Pinned is still not working, somewhat usable state. Worth checking in.
index adcd2a3d7fddf950a40af6b28743216283220a30..be3abcd410a362635c2c39bac33682a6341a80a1 100644 (file)
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;
ExecutionEnv::livePreview (bool state) {
_mainloop->quit();
if (_livePreview && !state) {
- _canceled = true;
+ documentCancel();
}
if (!_livePreview && state) {
_humanWait = false;
return;
}
+void
+ExecutionEnv::shutdown (void) {
+ _mainloop->quit();
+ processingCancel();
+ documentCancel();
+ _finished = true;
+ _visibleDialog = NULL;
+}
} } /* namespace Inkscape, Extension */
index 3c4b13198efc812411bfc8a271332ac97b07d951..e46aafc074496a47a3a00cb3dc0672d1600b345b 100644 (file)
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);
index eb6cbf6fa9a8844b5c65e6db20bae65b36894b29..62e6b9ff8965515ac5631be03dc4e12dfc3da96a 100644 (file)
_help(help),
_name(name),
_exEnv(exEnv),
+ _createdExEnv(false),
_button_ok(NULL),
_button_cancel(NULL),
_button_preview(NULL),
_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();
+ }
}
}
index 059cfce45965a15964a3d1d5dd2f2dc08e021785..0f385922f65a6009d6c422d04960a94484236f0b 100644 (file)
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;