[kupfer] Move Show Notification action into the Show Text plugin
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] Move Show Notification action into the Show Text plugin
- Date: Sun, 14 Feb 2010 21:24:15 +0000 (UTC)
commit 975c5772f37e1d283c09cbc8cdd1434bf2974d2d
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Sun Feb 14 18:47:52 2010 +0100
Move Show Notification action into the Show Text plugin
kupfer/plugin/notification.py | 47 -----------------------------------------
kupfer/plugin/show_text.py | 26 ++++++++++++++++++++--
po/POTFILES.in | 1 -
3 files changed, 23 insertions(+), 51 deletions(-)
---
diff --git a/kupfer/plugin/show_text.py b/kupfer/plugin/show_text.py
index f041268..8e99ca0 100644
--- a/kupfer/plugin/show_text.py
+++ b/kupfer/plugin/show_text.py
@@ -2,14 +2,16 @@ __kupfer_name__ = _("Show Text")
__kupfer_actions__ = (
"ShowText",
"LargeType",
+ "ShowNotification",
)
__description__ = _("Display text in a window")
-__version__ = "0.1"
-__author__ = "Ulrik Sverdrup <ulrik sverdrup gmail com>"
+__version__ = ""
+__author__ = "US"
from kupfer.objects import Action
from kupfer.objects import TextLeaf
-from kupfer import icons, kupferstring, uiutils
+from kupfer import icons, uiutils
+from kupfer import textutils
class ShowText (Action):
@@ -44,3 +46,21 @@ class LargeType (Action):
def get_icon_name(self):
return "gtk-bold"
+class ShowNotification (Action):
+ def __init__(self):
+ Action.__init__(self, _("Show Notification"))
+
+ def activate(self, leaf):
+ title, body = textutils.extract_title_body(leaf.object)
+ if body:
+ uiutils.show_notification(title, body,
+ icon_name=self.get_icon_name())
+ else:
+ uiutils.show_notification(title)
+
+ def item_types(self):
+ yield TextLeaf
+
+ def get_icon_name(self):
+ return "gtk-bold"
+
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1e92ed5..958805b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -74,7 +74,6 @@ kupfer/plugin/higherorder.py
kupfer/plugin/image.py
kupfer/plugin/kupfer_plugins.py
kupfer/plugin/locate.py
-kupfer/plugin/notification.py
kupfer/plugin/openoffice.py
kupfer/plugin/opera.py
kupfer/plugin/pidgin.py
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]