[Xfce4-commits] <thunarx-python:master> Updated documentation and added an example plugin showing emblem usage

Adam Plumb noreply at xfce.org
Thu May 27 18:14:24 CEST 2010


Updating branch refs/heads/master
         to 1bed1ea12dc2b14515b7e7f19a5dc9c3e7c4cec1 (commit)
       from 9a1ea0979e0dd2743fc2d5c8466a9f101c31b64f (commit)

commit 1bed1ea12dc2b14515b7e7f19a5dc9c3e7c4cec1
Author: Adam Plumb <adamplumb at gmail.com>
Date:   Wed Jan 20 14:00:36 2010 -0500

    Updated documentation and added an example plugin showing emblem usage

 docs/documentation.py                  |    2 +-
 docs/examples/thunarx-emblem-plugin.py |   20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/docs/documentation.py b/docs/documentation.py
index ab36874..f22df44 100644
--- a/docs/documentation.py
+++ b/docs/documentation.py
@@ -122,7 +122,7 @@ class FileInfo:
 
     def set_emblem(self, emblem):
         """
-        @type   emblem  string
+        @type   emblem  string or None
         """
         pass
 
diff --git a/docs/examples/thunarx-emblem-plugin.py b/docs/examples/thunarx-emblem-plugin.py
new file mode 100644
index 0000000..fa2c665
--- /dev/null
+++ b/docs/examples/thunarx-emblem-plugin.py
@@ -0,0 +1,20 @@
+import thunarx
+import gtk
+
+class ThunarxEmblemPlugin(thunarx.MenuProvider):
+    def __init__(self):
+        pass
+        
+    def get_file_actions(self, window, files):
+        action = gtk.Action("ET::ShowEmblem1", "Show Emblem", "Show Emblem", None)
+        action.connect("activate", self.show_emblem, files)
+
+        action2 = gtk.Action("ET::ShowEmblem2", "Hide Emblem", "Hide Emblem", None)
+        action2.connect("activate", self.hide_emblem, files)
+        return [action,action2]
+        
+    def show_emblem(self, action, files):
+        files[0].set_emblem("default")
+
+    def hide_emblem(self, action, files):
+        files[0].set_emblem(None)



More information about the Xfce4-commits mailing list