[kupfer] plugin.kupfer_plugins: Add ShowInfo action
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] plugin.kupfer_plugins: Add ShowInfo action
- Date: Wed, 28 Oct 2009 21:32:19 +0000 (UTC)
commit 7f8c714f12e4ed0178c0c8410e7d327c7e3f76a4
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Wed Oct 28 21:46:27 2009 +0100
plugin.kupfer_plugins: Add ShowInfo action
Add action to show information about a plugin, by opening the
preferences window showing the right page.
kupfer/plugin/kupfer_plugins.py | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/kupfer/plugin/kupfer_plugins.py b/kupfer/plugin/kupfer_plugins.py
index 23a04c8..f668e4c 100644
--- a/kupfer/plugin/kupfer_plugins.py
+++ b/kupfer/plugin/kupfer_plugins.py
@@ -1,9 +1,9 @@
from kupfer.objects import Action, Source, Leaf
-from kupfer import plugins
+from kupfer import plugin_support
# Since this is a core plugin we break some rules
# This module is normally out of bounds for plugins
-from kupfer import settings
+from kupfer import plugins, settings
__kupfer_name__ = _("Kupfer Plugins")
__kupfer_sources__ = ("KupferPlugins", )
@@ -11,10 +11,31 @@ __description__ = _("Access Kupfer's plugin list in Kupfer")
__version__ = ""
__author__ = "Ulrik Sverdrup <ulrik sverdrup gmail com>"
+__kupfer_settings__ = plugin_support.PluginSettings(
+ plugin_support.SETTING_PREFER_CATALOG,
+)
+
+class ShowInfo (Action):
+ def __init__(self):
+ Action.__init__(self, _("Show Information"))
+ def activate(self, leaf):
+ from kupfer import preferences
+ prefs = preferences.GetPreferencesWindowController()
+ plugin_id = leaf.object["name"]
+ prefs.show_focus_plugin(plugin_id)
+
+ def get_description(self):
+ pass
+ def get_icon_name(self):
+ return "dialog-information"
+
class Plugin (Leaf):
def __init__(self, obj, name):
Leaf.__init__(self, obj, name)
self.name_aliases.add(self.get_description())
+ def get_actions(self):
+ yield ShowInfo()
+
def get_description(self):
setctl = settings.GetSettingsController()
enabled = setctl.get_plugin_enabled(self.object["name"])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]