[kupfer] browser: "Type to Search *Catalog*" as welcoming words



commit d3c75922a6b70c22ea8e6961f11492ca907f2fc1
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Wed Oct 21 21:16:14 2009 +0200

    browser: "Type to Search *Catalog*" as welcoming words

 kupfer/browser.py |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/kupfer/browser.py b/kupfer/browser.py
index 83e0499..5adf8fb 100644
--- a/kupfer/browser.py
+++ b/kupfer/browser.py
@@ -258,7 +258,8 @@ class MatchView (gtk.Bin):
 			return
 		
 		if not self.cur_match or self.match_state is not State.Match:
-			self.label.set_text(self.cur_text)
+			# Allow markup in the text string if we have no match
+			self.label.set_markup(self.cur_text)
 			return
 
 		# update the text label
@@ -634,23 +635,27 @@ class LeafSearch (Search):
 		if empty and self.source:
 			return _("%s is empty") % self.source, get_pbuf(self.source)
 		elif self.source:
-			return (_('No matches in %s for "%s"') % (self.source, self.text),
-					get_pbuf(self.source))
+			return (_('No matches in %(src)s for "%(query)s"') % {
+				"src": u"<i>%s</i>" % escape_markup_str(unicode(self.source)),
+				"query": escape_markup_str(self.text),
+				},
+				get_pbuf(self.source))
 		else:
 			return unicode(self.dummy), self.dummy.get_pixbuf(self.icon_size)
 	def setup_empty(self):
 		icon = None
-		title = _("Searching...")
+		title = _("Type to Search")
 		get_pbuf = \
 			lambda m: (m.get_thumbnail(self.icon_size*4/3, self.icon_size) or \
 					m.get_pixbuf(self.icon_size))
 		if self.source:
 			icon = get_pbuf(self.source)
-			title = _("Searching %(source)s...") % {"source":self.source}
+			title = (_("Type to Search %s") %
+					u"<i>%s</i>" % escape_markup_str(unicode(self.source)))
 
 		self._set_match(None)
 		self.match_state = State.Wait
-		self.match_view.set_match_state(unicode(title), icon, state=State.Wait)
+		self.match_view.set_match_state(title, icon, state=State.Wait)
 
 class ActionSearch (Search):
 	"""



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