diff options
Diffstat (limited to 'src/extension/implementation')
| -rw-r--r-- | src/extension/implementation/implementation.cpp | 23 | ||||
| -rw-r--r-- | src/extension/implementation/script.cpp | 32 | ||||
| -rw-r--r-- | src/extension/implementation/script.h | 7 |
3 files changed, 21 insertions, 41 deletions
diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp index 5fdb47835..6614604ff 100644 --- a/src/extension/implementation/implementation.cpp +++ b/src/extension/implementation/implementation.cpp @@ -19,6 +19,12 @@ #include <extension/input.h> #include <extension/effect.h> +#include "selection.h" +#include "desktop.h" +#include "desktop-handles.h" +#include "ui/view/view.h" +#include "util/glib-list-iterators.h" + namespace Inkscape { namespace Extension { namespace Implementation { @@ -91,8 +97,21 @@ Implementation::save(Inkscape::Extension::Output */*module*/, SPDocument */*doc* } /* Implementation::save */ Gtk::Widget * -Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View */*view*/, sigc::signal<void> * /*changeSignal*/, ImplementationDocumentCache * /*docCache*/) { - return module->autogui(NULL, NULL); +Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal<void> * changeSignal, ImplementationDocumentCache * docCache) { + if (module->param_visible_count() == 0) return NULL; + + SPDocument * current_document = view->doc(); + + using Inkscape::Util::GSListConstIterator; + GSListConstIterator<SPItem *> selected = + sp_desktop_selection((SPDesktop *)view)->itemList(); + Inkscape::XML::Node * first_select = NULL; + if (selected != NULL) { + const SPItem * item = *selected; + first_select = SP_OBJECT_REPR(item); + } + + return module->autogui(current_document, first_select, changeSignal); } /* Implementation::prefs_effect */ void diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 67e351496..4eeb3f27f 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -540,38 +540,6 @@ Script::prefs_output(Inkscape::Extension::Output *module) return module->autogui(NULL, NULL); } - - -/** - \return A dialog for preferences - \brief A stub funtion right now - \param module Module who's preferences need getting - - This function should really do something, right now it doesn't. -*/ -Gtk::Widget * -Script::prefs_effect( Inkscape::Extension::Effect *module, - Inkscape::UI::View::View *view, - sigc::signal<void> * changeSignal, - ImplementationDocumentCache * /*docCache*/ ) -{ - SPDocument * current_document = view->doc(); - - using Inkscape::Util::GSListConstIterator; - GSListConstIterator<SPItem *> selected = - sp_desktop_selection((SPDesktop *)view)->itemList(); - Inkscape::XML::Node * first_select = NULL; - if (selected != NULL) { - const SPItem * item = *selected; - first_select = SP_OBJECT_REPR(item); - } - - return module->autogui(current_document, first_select, changeSignal); -} - - - - /** \return A new document that has been opened \brief This function uses a filename that is put in, and calls diff --git a/src/extension/implementation/script.h b/src/extension/implementation/script.h index c2a717a04..226a6beb2 100644 --- a/src/extension/implementation/script.h +++ b/src/extension/implementation/script.h @@ -87,13 +87,6 @@ public: virtual void save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename); - /** - * - */ - virtual Gtk::Widget *prefs_effect(Inkscape::Extension::Effect *module, - Inkscape::UI::View::View * view, - sigc::signal<void> * changeSignal, - ImplementationDocumentCache * docCache); /** * |
