From: gouldtj Date: Sat, 1 Sep 2007 04:35:23 +0000 (+0000) Subject: r16430@tres: ted | 2007-08-30 20:32:23 -0700 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ff7598024c290e28d5d4656dbbbcd51ab0f14e3d;p=inkscape.git r16430@tres: ted | 2007-08-30 20:32:23 -0700 Adding in a timer so that the preferences aren't acted on immediately. This should give the illusion of more interactivity. --- diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp index 9f50f0c6a..4134b71aa 100644 --- a/src/extension/execution-env.cpp +++ b/src/extension/execution-env.cpp @@ -30,7 +30,6 @@ namespace Extension { ExecutionEnv::ExecutionEnv (Effect * effect, Inkscape::UI::View::View * doc, Gtk::Widget * controls, sigc::signal * changeSignal, Gtk::Dialog * prefDialog) : _visibleDialog(NULL), - _effect(effect), _prefsVisible(false), _finished(false), _humanWait(false), @@ -39,7 +38,8 @@ ExecutionEnv::ExecutionEnv (Effect * effect, Inkscape::UI::View::View * doc, Gtk _livePreview(true), _selfdelete(false), _changeSignal(changeSignal), - _doc(doc) { + _doc(doc), + _effect(effect) { SPDesktop *desktop = (SPDesktop *)_doc; sp_namedview_document_from_window(desktop); @@ -81,6 +81,7 @@ ExecutionEnv::ExecutionEnv (Effect * effect, Inkscape::UI::View::View * doc, Gtk ExecutionEnv::~ExecutionEnv (void) { _dialogsig.disconnect(); + _timersig.disconnect(); if (_prefsVisible) { _changesig.disconnect(); } @@ -95,6 +96,13 @@ ExecutionEnv::~ExecutionEnv (void) { void ExecutionEnv::preferencesChange (void) { + _timersig.disconnect(); + _timersig = Glib::signal_timeout().connect(sigc::mem_fun(this, &ExecutionEnv::preferencesTimer), 100, Glib::PRIORITY_DEFAULT_IDLE); + return; +} + +bool +ExecutionEnv::preferencesTimer (void) { //std::cout << "Preferences are a changin'" << std::endl; _prefsChanged = true; if (_humanWait) { @@ -105,7 +113,7 @@ ExecutionEnv::preferencesChange (void) { processingCancel(); documentCancel(); } - return; + return false; } void diff --git a/src/extension/execution-env.h b/src/extension/execution-env.h index 85e97ef18..34b368afa 100644 --- a/src/extension/execution-env.h +++ b/src/extension/execution-env.h @@ -39,6 +39,7 @@ private: std::list _selected; sigc::connection _dialogsig; sigc::connection _changesig; + sigc::connection _timersig; public: Effect * _effect; @@ -47,7 +48,6 @@ public: ~ExecutionEnv (void); void run (void); - void preferencesChange (void); void livePreview (bool state = true); void shutdown (bool del = false); @@ -56,6 +56,8 @@ private: void createWorkingDialog (void); void workingCanceled (const int resp); void preferencesResponse (const int resp); + void preferencesChange (void); + bool preferencesTimer (void); void processingCancel (void); void processingComplete(void); void documentCancel (void);