[kupfer] Remove DummyLeaf and DummyAction



commit c4b0fd4a87a54aeef66b1ed35052cb0c6a79fd39
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Thu Dec 17 02:47:10 2009 +0100

    Remove DummyLeaf and DummyAction
    
    These objects are a worthless redirection.

 kupfer/browser.py |   15 +++++----------
 kupfer/objects.py |   20 --------------------
 2 files changed, 5 insertions(+), 30 deletions(-)
---
diff --git a/kupfer/browser.py b/kupfer/browser.py
index 5274473..4ec8b40 100644
--- a/kupfer/browser.py
+++ b/kupfer/browser.py
@@ -663,10 +663,6 @@ class LeafSearch (Search):
 	"""
 	Customize for leaves search	
 	"""
-	def __init__(self, **kwargs):
-		from objects import DummyLeaf
-		self.dummy = DummyLeaf()
-		super(LeafSearch, self).__init__(**kwargs)
 	def get_nomatch_name_icon(self, empty):
 		get_pbuf = \
 			lambda m: (m.get_thumbnail(self.icon_size*4/3, self.icon_size) or \
@@ -682,7 +678,9 @@ class LeafSearch (Search):
 				},
 				get_pbuf(self.source))
 		else:
-			return unicode(self.dummy), self.dummy.get_pixbuf(self.icon_size)
+			return _("No matches"), icons.get_icon_for_name("kupfer-object",
+					self.icon_size)
+
 	def setup_empty(self):
 		icon = None
 		title = _("Type to search")
@@ -702,12 +700,9 @@ class ActionSearch (Search):
 	"""
 	Customization for Actions
 	"""
-	def __init__(self, **kwargs):
-		from objects import DummyAction
-		self.dummy = DummyAction()
-		super(ActionSearch, self).__init__(**kwargs)
 	def get_nomatch_name_icon(self, empty=False):
-		return unicode(self.dummy), self.dummy.get_pixbuf(self.icon_size)
+		return _("No action"), icons.get_icon_for_name("gtk-execute",
+				self.icon_size)
 	def setup_empty(self):
 		self.handle_no_matches()
 		self.hide_table()
diff --git a/kupfer/objects.py b/kupfer/objects.py
index 4a641b7..dd7baf5 100644
--- a/kupfer/objects.py
+++ b/kupfer/objects.py
@@ -178,13 +178,6 @@ class Leaf (KupferObject):
 		"""Default (builtin) actions for this Leaf"""
 		return ()
 
-class DummyLeaf (Leaf):
-	"""
-	Dummy Leaf, representing No Leaf available
-	"""
-	def __init__(self):
-		super(DummyLeaf, self).__init__(None, _("No matches"))
-
 class FileLeaf (Leaf, TextRepresentation):
 	"""
 	Represents one file
@@ -710,19 +703,6 @@ class Execute (Launch):
 		else:
 			return _("Run this program")
 
-
-class DummyAction (Action):
-	"""
-	Represents "No action", to be shown when there is no action
-	"""
-	def __init__(self, name=None):
-		if not name:
-			name = _("No action")
-		super(DummyAction, self).__init__(name)
-	
-	def get_icon_name(self):
-		return "gtk-execute"
-
 class Source (KupferObject, pretty.OutputMixin):
 	"""
 	Source: Data provider for a kupfer browser



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