[kupfer] plugin.show_text: Add Show Text plugin



commit 748c989e2fd6cee7cd36ef84673cb203eb9a4293
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Tue Oct 27 05:41:22 2009 +0100

    plugin.show_text: Add Show Text plugin
    
    Enable two actions:
    
    * Show Text to show text in a text result window, works fine for code
      snippets and documents.
    
    * Large Type to show very short text pieces very large on-screen,
      like Quicksilver's action by the same name.

 kupfer/plugin/show_text.py |   50 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 50 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/show_text.py b/kupfer/plugin/show_text.py
new file mode 100644
index 0000000..cf3eec1
--- /dev/null
+++ b/kupfer/plugin/show_text.py
@@ -0,0 +1,50 @@
+import subprocess
+
+import glib
+import gtk
+
+from kupfer.objects import Action
+from kupfer.objects import TextLeaf
+from kupfer import icons, kupferstring, uiutils
+
+__kupfer_name__ = _("Show Text")
+__kupfer_actions__ = (
+		"ShowText",
+		"LargeType",
+	)
+__description__ = _("Display text in a window")
+__version__ = "0.1"
+__author__ = "Ulrik Sverdrup <ulrik sverdrup gmail com>"
+
+class ShowText (Action):
+	def __init__(self):
+		Action.__init__(self, _("Show Text"))
+
+	def activate(self, leaf):
+		uiutils.show_text_result(leaf.object, title=_("Show Text"))
+
+	def item_types(self):
+		yield TextLeaf
+
+	def get_description(self):
+		return _("Display text in a window")
+	def get_icon_name(self):
+		return "gtk-bold"
+
+class LargeType (Action):
+	def __init__(self):
+		Action.__init__(self, _("Large Type"))
+
+	def activate(self, leaf):
+		uiutils.show_large_type(leaf.object)
+
+	def item_types(self):
+		yield TextLeaf
+
+	def get_description(self):
+		return _("Display text in a window")
+	def get_gicon(self):
+		return icons.ComposedIcon("gtk-bold", "zoom-in")
+	def get_icon_name(self):
+		return "gtk-bold"
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]