[kupfer: 6/24] plugin.truecrypt: add "dismount all" action



commit 2769876f4536ae743d5a2f5540aa1e5fb502a859
Author: Karol BÄ?dkowski <karol bedkowsk+gh gmail com>
Date:   Mon Nov 16 11:11:45 2009 +0100

    plugin.truecrypt: add "dismount all" action

 kupfer/plugin/truecrypt.py |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/plugin/truecrypt.py b/kupfer/plugin/truecrypt.py
index a1d95ca..3db6fdd 100644
--- a/kupfer/plugin/truecrypt.py
+++ b/kupfer/plugin/truecrypt.py
@@ -5,11 +5,12 @@ from xml.etree import ElementTree
 import gio
 
 from kupfer.objects import (Action, Source, Leaf, PicklingHelperMixin, 
-		AppLeafContentMixin)
+		AppLeafContentMixin, AppLeaf)
 from kupfer import utils
 
 __kupfer_name__ = _("TrueCrypt")
 __kupfer_sources__ = ("VolumeSource", )
+__kupfer_actions__ = ('DismountAll', )
 __description__ = _("Volumes from TrueCrypt History.")
 __version__ = "1.0"
 __author__ = "Karol BÄ?dkowski <karol bedkowski gmail com>"
@@ -40,6 +41,23 @@ class MountVolume(Action):
 		utils.launch_commandline('truecrypt ' + leaf.object)
 
 
+class DismountAll(Action):
+	def __init__(self):
+		Action.__init__(self, _("Dismount All Mounted Volumes"))
+
+	def activate(self, leaf, iobj=None):
+		utils.launch_commandline('truecrypt -d')
+
+	def get_icon_name(self):
+		return "hdd_unmount"
+
+	def item_types(self):
+		yield AppLeaf
+
+	def valid_for_item(self, leaf):
+		return leaf.get_id() == 'truecrypt'
+
+
 class VolumeSource (AppLeafContentMixin, Source, PicklingHelperMixin):
 	appleaf_content_id = "truecrypt"
 



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