[kupfer/next] Display "disabled" in plugin info when not loaded
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer/next] Display "disabled" in plugin info when not loaded
- Date: Mon, 1 Feb 2010 08:37:50 +0000 (UTC)
commit fa56fb0f941df63d3661e73a525c73491c51099a
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Fri Jan 22 00:31:54 2010 +0100
Display "disabled" in plugin info when not loaded
kupfer/core/plugins.py | 4 ++++
kupfer/ui/preferences.py | 7 ++++++-
2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/core/plugins.py b/kupfer/core/plugins.py
index 9c903a6..01ff5cc 100644
--- a/kupfer/core/plugins.py
+++ b/kupfer/core/plugins.py
@@ -248,3 +248,7 @@ def get_plugin_error(plugin_name):
return plugin.error_message
except ImportError, e:
return "'%s' is not a plugin" % plugin_name
+
+def is_plugin_loaded(plugin_name):
+ return (plugin_name in imported_plugins and
+ not get_plugin_attribute(plugin_name, "is_fake_plugin"))
diff --git a/kupfer/ui/preferences.py b/kupfer/ui/preferences.py
index b9536b9..0d204e9 100644
--- a/kupfer/ui/preferences.py
+++ b/kupfer/ui/preferences.py
@@ -310,7 +310,7 @@ class PreferencesWindowController (pretty.OutputMixin):
import_error_localized = _("Python module '%s' is needed") % u"\\1"
import_error_pat = u"No module named ([^\s]+)"
if re.match(import_error_pat, error):
- error = re.sub("No module named ([^\s]+)",
+ error = re.sub(import_error_pat,
import_error_localized,
error, count=1)
label = gtk.Label()
@@ -318,6 +318,11 @@ class PreferencesWindowController (pretty.OutputMixin):
label.set_markup(u"<b>%s</b>\n%s" %
(_("Plugin could not be read due to an error:"), error))
about.pack_start(label, False)
+ elif not plugins.is_plugin_loaded(plugin_id):
+ label = gtk.Label()
+ label.set_alignment(0, 0)
+ label.set_text(u"(%s)" % _("disabled"))
+ about.pack_start(label, False)
wid = self._make_plugin_info_widget(plugin_id)
about.pack_start(wid, False)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]