From 776410582f483ba74ce1068ff0dc0e9f068fb5d7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sat, 1 Sep 2007 04:36:03 +0000 Subject: r16442@tres: ted | 2007-08-30 21:51:42 -0700 One preference dialog per effect. Nothing crazy here. Also setting the timer to be ref counted in lock/unlock mode. This way the whole thing stays locked while the dialog is shown. (bzr r3653) --- src/extension/effect.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/extension/effect.cpp') diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index a20f1c6e9..7ac4825a3 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -35,7 +35,8 @@ Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation * _name_noprefs(Glib::ustring(get_name()) + _(" (No preferences)")), _verb(get_id(), get_name(), NULL, NULL, this, true), _verb_nopref(_id_noprefs.c_str(), _name_noprefs.c_str(), NULL, NULL, this, false), - _menu_node(NULL), _workingDialog(true) + _menu_node(NULL), _workingDialog(true), + _prefDialog(NULL) { Inkscape::XML::Node * local_effects_menu = NULL; @@ -206,6 +207,11 @@ Effect::check (void) bool Effect::prefs (Inkscape::UI::View::View * doc) { + if (_prefDialog != NULL) { + _prefDialog->raise(); + return true; + } + if (!loaded()) set_state(Extension::STATE_LOADED); if (!loaded()) return false; @@ -237,7 +243,7 @@ Effect::prefs (Inkscape::UI::View::View * doc) void Effect::effect (Inkscape::UI::View::View * doc) { - printf("Execute effect\n"); + //printf("Execute effect\n"); if (!loaded()) set_state(Extension::STATE_LOADED); if (!loaded()) return; @@ -300,6 +306,18 @@ Effect::get_info_widget(void) return Extension::get_info_widget(); } +void +Effect::set_pref_dialog (PrefDialog * prefdialog) +{ + _prefDialog = prefdialog; + if (_prefDialog == NULL) { + timer->unlock(); + } else { + timer->lock(); + } + return; +} + /** \brief Create an action for a \c EffectVerb \param view Which view the action should be created for \return The built action. -- cgit v1.2.3