summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/extension/effect.cpp7
-rw-r--r--src/extension/extension.cpp13
-rw-r--r--src/extension/extension.h2
3 files changed, 10 insertions, 12 deletions
diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp
index 1a84e3df1..a380c9710 100644
--- a/src/extension/effect.cpp
+++ b/src/extension/effect.cpp
@@ -224,11 +224,8 @@ bool
Effect::check ()
{
if (!Extension::check()) {
- /** \todo Check to see if parent has this as its only child,
- if so, delete it too */
- if (_menu_node != nullptr)
- sp_repr_unparent(_menu_node);
- _menu_node = nullptr;
+ _verb.sensitive(nullptr, false);
+ _verb.set_tip(Extension::getErrorReason().c_str()); // TODO: insensitive menuitems don't show a tooltip
return false;
}
return true;
diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp
index 2c5f6a978..02f7f517d 100644
--- a/src/extension/extension.cpp
+++ b/src/extension/extension.cpp
@@ -291,22 +291,21 @@ Extension::loaded ()
bool
Extension::check ()
{
- bool retval = true;
-
const char * inx_failure = _(" This is caused by an improper .inx file for this extension."
" An improper .inx file could have been caused by a faulty installation of Inkscape.");
if (repr == nullptr) {
printFailure(Glib::ustring(_("the XML description of it got lost.")) + inx_failure);
- retval = false;
+ return false;
}
if (imp == nullptr) {
printFailure(Glib::ustring(_("no implementation was defined for the extension.")) + inx_failure);
- retval = false;
+ return false;
}
+ bool retval = true;
for (auto _dep : _deps) {
- if (_dep->check() == FALSE) {
+ if (_dep->check() == false) {
printFailure(Glib::ustring(_("a dependency was not met.")));
error_file_write(_dep->info_string());
retval = false;
@@ -330,8 +329,8 @@ Extension::check ()
void
Extension::printFailure (Glib::ustring reason)
{
- error_file_write(Glib::ustring::compose(_("Extension \"%1\" failed to load because %2"), _name, reason));
- return;
+ _error_reason = Glib::ustring::compose(_("Extension \"%1\" failed to load because %2"), _name, reason);
+ error_file_write(_error_reason);
}
/**
diff --git a/src/extension/extension.h b/src/extension/extension.h
index e34317d79..4a857947e 100644
--- a/src/extension/extension.h
+++ b/src/extension/extension.h
@@ -115,6 +115,7 @@ private:
std::vector<Dependency *> _deps; /**< Dependencies for this extension */
static FILE *error_file; /**< This is the place where errors get reported */
bool _gui;
+ std::string _error_reason; /**< Short, textual explanation for the latest error */
protected:
Inkscape::XML::Node *repr; /**< The XML description of the Extension */
@@ -142,6 +143,7 @@ public:
void deactivate ();
bool deactivated ();
void printFailure (Glib::ustring reason);
+ std::string getErrorReason() { return _error_reason; };
Implementation::Implementation * get_imp () { return imp; };
void set_execution_env (ExecutionEnv * env) { execution_env = env; };
ExecutionEnv *get_execution_env () { return execution_env; };