diff options
| author | Felipe Corr??a da Silva Sanches <juca@members.fsf.org> | 2011-05-27 23:37:38 +0000 |
|---|---|---|
| committer | Felipe C. da S. Sanches <juca@members.fsf.org> | 2011-05-27 23:37:38 +0000 |
| commit | 3d6053d862638f21a5028cbf9f6eb77c9b4bc791 (patch) | |
| tree | bfe4752ca523ed36d03736c54b7f9752b496a417 | |
| parent | typography extensions: (diff) | |
| download | inkscape-3d6053d862638f21a5028cbf9f6eb77c9b4bc791.tar.gz inkscape-3d6053d862638f21a5028cbf9f6eb77c9b4bc791.zip | |
Add "silent" option to extension inx file so that extension authors can opt-out of displaying the "working, please wait" dialog.
Extensions that are tipically slow can still have the dialog show up by simply not adding this attribute to the inx file.
(bzr r10240)
| -rw-r--r-- | src/extension/execution-env.cpp | 5 | ||||
| -rw-r--r-- | src/extension/extension.cpp | 14 | ||||
| -rw-r--r-- | src/extension/extension.h | 2 |
3 files changed, 20 insertions, 1 deletions
diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp index f9e099c26..a2550024a 100644 --- a/src/extension/execution-env.cpp +++ b/src/extension/execution-env.cpp @@ -141,7 +141,10 @@ ExecutionEnv::createWorkingDialog (void) { true); // modal _visibleDialog->signal_response().connect(sigc::mem_fun(this, &ExecutionEnv::workingCanceled)); g_free(dlgmessage); - _visibleDialog->show(); + + if (!_effect->is_silent()){ + _visibleDialog->show(); + } return; } diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index e67a4b95f..a70c79943 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -59,6 +59,7 @@ Parameter * get_param (const gchar * name); */ Extension::Extension (Inkscape::XML::Node * in_repr, Implementation::Implementation * in_imp) : _help(NULL) + , silent(false) , _gui(true) { repr = in_repr; @@ -105,6 +106,9 @@ Extension::Extension (Inkscape::XML::Node * in_repr, Implementation::Implementat if (!strcmp(chname, "dependency")) { _deps.push_back(new Dependency(child_repr)); } /* dependency */ + if (!strcmp(chname, "options")) { + silent = !strcmp( child_repr->attribute("silent"), "true" ); + } child_repr = sp_repr_next(child_repr); } @@ -310,6 +314,16 @@ Extension::get_repr (void) } /** + \return bool + \brief Whether this extension should hide the "working, please wait" dialog +*/ +bool +Extension::is_silent (void) +{ + return silent; +} + +/** \return The textual id of this extension \brief Get the ID of this extension - not a copy don't delete! */ diff --git a/src/extension/extension.h b/src/extension/extension.h index 936d2a907..dba8eeb45 100644 --- a/src/extension/extension.h +++ b/src/extension/extension.h @@ -99,6 +99,7 @@ private: state_t _state; /**< Which state the Extension is currently in */ std::vector<Dependency *> _deps; /**< Dependencies for this extension */ static std::ofstream error_file; /**< This is the place where errors get reported */ + bool silent; bool _gui; protected: @@ -120,6 +121,7 @@ public: gchar * get_name (void); /** \brief Gets the help string for this extension */ gchar const * get_help (void) { return _help; } + bool is_silent (void); void deactivate (void); bool deactivated (void); void printFailure (Glib::ustring reason); |
