[Deskbar] [PATCH] Reintroduce save-last-search



Raphael, this is for you :-D

Back in the days the Cuemiac stored the last search you made. This was
removed because the query text in the entry would be highlighted on
popup, thus overwriting the middle-click clipboard :-(

Now the glorious days has returned! The entry/model is now only cleared
if the middle-click clipboard contains some text. Hooray!

Cheers
Mikkel
? description-pak
? deskbar-applet_0.9cvs-20050125-1_i386.deb
? deskbar/evolution/.deps
? deskbar/evolution/.libs
? deskbar/evolution/_evolution.la
? deskbar/gnomedesktop/.deps
? deskbar/gnomedesktop/.libs
? deskbar/gnomedesktop/_gnomedesktop.la
? deskbar/gnomedesktop/_gnomedesktop.lo
? deskbar/gnomedesktop/_gnomedesktopmodule.lo
? deskbar/iconentry/.deps
? deskbar/iconentry/.libs
? deskbar/iconentry/_iconentry.la
? deskbar/iconentry/_iconentry.lo
? deskbar/iconentry/_iconentrymodule.lo
? deskbar/iconentry/ephy-icon-entry.lo
? deskbar/keybinder/.deps
? deskbar/keybinder/.libs
? deskbar/keybinder/_keybinder.la
? po/.intltool-merge-cache
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/deskbar-applet/ChangeLog,v
retrieving revision 1.256
diff -u -r1.256 ChangeLog
--- ChangeLog	31 Jan 2006 01:29:32 -0000	1.256
+++ ChangeLog	31 Jan 2006 02:47:46 -0000
@@ -1,4 +1,12 @@
+2006-01-31  Mikkel Kamstrup Erlandsen  <kamstrup daimi au dk>
 
+	* deskbar/ui/cuemiac/Cuemiac.py:
+	Reintroduce the abandoned save-last-search feature of the Cuemiac.
+	The model and entry are only cleared if the X middle click buffer contains some
+	text.
+	The feature was abandoned precisely because middle-click pasting was impossible
+	since the Cuemiac entry already contained highlighted text on popping up.
+	
 ========== Version 2.13.90 released ==========
 
 2006-01-31  Raphael Slinckx  <rslinckx cvs gnome org>
Index: deskbar/ui/cuemiac/Cuemiac.py
===================================================================
RCS file: /cvs/gnome/deskbar-applet/deskbar/ui/cuemiac/Cuemiac.py,v
retrieving revision 1.37
diff -u -r1.37 Cuemiac.py
--- deskbar/ui/cuemiac/Cuemiac.py	31 Jan 2006 01:29:34 -0000	1.37
+++ deskbar/ui/cuemiac/Cuemiac.py	31 Jan 2006 02:47:46 -0000
@@ -610,6 +610,7 @@
 		DeskbarUI.__init__ (self, applet, prefs)
 		
 		self.default_entry_pixbuf = deskbar.Utils.load_icon("deskbar-applet-small.png", width=-1)
+		self.clipboard = gtk.clipboard_get (selection="PRIMARY")
 		
 		self.deskbar_button = DeskbarAppletButton (applet)
 		self.deskbar_button.connect ("toggled-main", lambda x,y: self.show_entry())
@@ -697,10 +698,13 @@
 	
 	def show_entry (self):
 		if self.deskbar_button.get_active_main ():
-			#if self.entry.get_text().strip() == "":
-			self.entry.set_text("")
-			self.model.clear ()
-			self.scroll_win.hide ()
+			# If the entry is empty or there's something in the middle-click-clipboard
+			# clear the popup so that we can paste into the entry.
+			if self.entry.get_text().strip() == "" or self.clipboard.wait_for_text():
+				self.entry.set_text("")
+				self.model.clear ()
+				self.scroll_win.hide ()
+				
 			self.deskbar_button.button_arrow.set_active (False)
 			self.adjust_popup_size ()
 			self.popup.update_position ()
@@ -728,6 +732,9 @@
 			#self.entry.event(fevent)
 			#self.entry.notify("has-focus")
 			
+			# Unselect what we have in the entry, so we don't occupy the middle-click-clipboard
+			# thus clearing the model on next popup
+			self.entry.select_region (0,0)
 			self.popup.hide ()
 			self.emit ("stop-query")
 	
@@ -861,7 +868,6 @@
 				# If we clear some text, tell async handlers to stop.
 				self.emit ("stop-query")
 			
-			self.entry.set_text("")
 			self.deskbar_button.set_active_main (False)
 			return True
 		


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