summaryrefslogtreecommitdiffstats
path: root/src/extension/extension.cpp
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-10-15 21:55:27 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-10-15 21:56:31 +0000
commit5c3063637d71802a43d52add816a9db133c37d02 (patch)
treeb9661d2c6be0bfa70ceecbc460c7651e19a33a3d /src/extension/extension.cpp
parentProperly initialize sensitivity of menuitems with verb default (diff)
downloadinkscape-5c3063637d71802a43d52add816a9db133c37d02.tar.gz
inkscape-5c3063637d71802a43d52add816a9db133c37d02.zip
Extensions: Disable effects that failed to load
Instead of removing them from the menu, they're now shown as inactive (greyed out), so users have a chance to know they even exists, without having to know about extension-errors.log Unfortunately tooltips seem to be hidden for insensitive menuitems as well, so we currently have no way of informing the user directly in the UI about the problem. Fixes https://gitlab.com/inkscape/inkscape/issues/470
Diffstat (limited to 'src/extension/extension.cpp')
-rw-r--r--src/extension/extension.cpp13
1 files changed, 6 insertions, 7 deletions
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);
}
/**