diff options
| author | John Bintz <me@johnbintz.com> | 2006-08-13 18:45:40 +0000 |
|---|---|---|
| committer | johncoswell <johncoswell@users.sourceforge.net> | 2006-08-13 18:45:40 +0000 |
| commit | e945f1a347023c8cc50165ed97a2295b85a3e75a (patch) | |
| tree | 9255eb62c79f091fbbd18426b6592c035b933ebf /src/ui | |
| parent | added functions to allow update events to process during long-running operations (diff) | |
| download | inkscape-e945f1a347023c8cc50165ed97a2295b85a3e75a.tar.gz inkscape-e945f1a347023c8cc50165ed97a2295b85a3e75a.zip | |
add interface for disabling interaction during long-running operations
(bzr r1596)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/view/edit-widget-interface.h | 8 | ||||
| -rw-r--r-- | src/ui/view/edit-widget.cpp | 27 | ||||
| -rw-r--r-- | src/ui/view/edit-widget.h | 5 |
3 files changed, 39 insertions, 1 deletions
diff --git a/src/ui/view/edit-widget-interface.h b/src/ui/view/edit-widget-interface.h index 605c72b59..7cc0133d3 100644 --- a/src/ui/view/edit-widget-interface.h +++ b/src/ui/view/edit-widget-interface.h @@ -5,7 +5,9 @@ * * Authors: * Ralf Stephan <ralf@ark.in-berlin.de> + * John Bintz <jcoswell@coswellproductions.org> * + * Copyright (C) 2006 John Bintz * Copyright (C) 2005 Ralf Stephan * * Released under GNU GPL. Read the file 'COPYING' for more information. @@ -73,6 +75,12 @@ struct EditWidgetInterface /// Force a redraw of the canvas virtual void requestCanvasUpdateAndWait() = 0; + /// Enable interaction on this desktop + virtual void enableInteraction() = 0; + + /// Disable interaction on this desktop + virtual void disableInteraction() = 0; + /// Update the "active desktop" indicator virtual void activateDesktop() = 0; diff --git a/src/ui/view/edit-widget.cpp b/src/ui/view/edit-widget.cpp index 6a4306147..83566c199 100644 --- a/src/ui/view/edit-widget.cpp +++ b/src/ui/view/edit-widget.cpp @@ -16,7 +16,9 @@ * Derek P. Moore <derekm@hackunix.org> * Lauris Kaplinski <lauris@kaplinski.com> * Frank Felfe <innerspace@iname.com> + * John Bintz <jcoswell@coswellproductions.org> * + * Copyright (C) 2006 John Bintz * Copyright (C) 1999-2005 Authors * Copyright (C) 2000-2001 Ximian, Inc. * @@ -74,7 +76,8 @@ EditWidget::EditWidget (SPDocument *doc) _act_grp(Gtk::ActionGroup::create()), _ui_mgr(Gtk::UIManager::create()), _update_s_f(false), - _update_a_f(false) + _update_a_f(false), + _interaction_disabled_counter(0) { g_warning("Creating new EditWidget"); @@ -1303,6 +1306,28 @@ EditWidget::requestCanvasUpdateAndWait() } void +EditWidget::enableInteraction() +{ + g_return_if_fail(_interaction_disabled_counter > 0); + + _interaction_disabled_counter--; + + if (_interaction_disabled_counter == 0) { + this->set_sensitive(true); + } +} + +void +EditWidget::disableInteraction() +{ + if (_interaction_disabled_counter == 0) { + this->set_sensitive(false); + } + + _interaction_disabled_counter++; +} + +void EditWidget::activateDesktop() { /// \todo active_desktop_indicator not implemented diff --git a/src/ui/view/edit-widget.h b/src/ui/view/edit-widget.h index 096137c2a..55a52be4c 100644 --- a/src/ui/view/edit-widget.h +++ b/src/ui/view/edit-widget.h @@ -6,7 +6,9 @@ * Bryce W. Harrington <bryce@bryceharrington.org> * Derek P. Moore <derekm@hackunix.org> * Ralf Stephan <ralf@ark.in-berlin.de> + * John Bintz <jcoswell@coswellproductions.org> * + * Copyright (C) 2006 John Bintz * Copyright (C) 2004 Bryce Harrington * * Released under GNU GPL. Read the file 'COPYING' for more information. @@ -109,6 +111,8 @@ public: virtual void destroy(); virtual void requestCanvasUpdate(); virtual void requestCanvasUpdateAndWait(); + virtual void enableInteraction(); + virtual void disableInteraction(); virtual void activateDesktop(); virtual void deactivateDesktop(); virtual void viewSetPosition (NR::Point p); @@ -193,6 +197,7 @@ private: void onAdjValueChanged(); bool _update_s_f, _update_a_f; + unsigned int _interaction_disabled_counter; sigc::connection _namedview_modified_connection; }; |
