Merge pull request #90 from hordepfo/search-button-clear-fix
Fixes search button clearing the search entry
This commit is contained in:
		
						commit
						9ef295f167
					
				| @ -561,14 +561,14 @@ class pluginclass( object ): | |||||||
|     def onHideMenu( self ): |     def onHideMenu( self ): | ||||||
|         self.settings.set( "int", "last-active-tab", self.lastActiveTab ) |         self.settings.set( "int", "last-active-tab", self.lastActiveTab ) | ||||||
| 
 | 
 | ||||||
|     def changeTab( self, tabNum ): |     def changeTab( self, tabNum, clear = True ): | ||||||
|         notebook = self.builder.get_object( "notebook2" ) |         notebook = self.builder.get_object( "notebook2" ) | ||||||
|         if tabNum == 0: |         if tabNum == 0: | ||||||
|             notebook.set_current_page( 0 ) |             notebook.set_current_page( 0 ) | ||||||
|         elif tabNum == 1: |         elif tabNum == 1: | ||||||
|             notebook.set_current_page( 1 ) |             notebook.set_current_page( 1 ) | ||||||
| 
 | 
 | ||||||
|         self.focusSearchEntry() |         self.focusSearchEntry(clear) | ||||||
|         self.lastActiveTab = tabNum |         self.lastActiveTab = tabNum | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -590,12 +590,12 @@ class pluginclass( object ): | |||||||
|             self.mintMenuWin.stopHiding() |             self.mintMenuWin.stopHiding() | ||||||
|         return False |         return False | ||||||
| 
 | 
 | ||||||
|     def focusSearchEntry( self ): |     def focusSearchEntry( self, clear = True ): | ||||||
|         # grab_focus() does select all text, |         # grab_focus() does select all text, | ||||||
|         # restoring the original selection is somehow broken, so just select the end |         # restoring the original selection is somehow broken, so just select the end | ||||||
|         # of the existing text, that's the most likely candidate anyhow |         # of the existing text, that's the most likely candidate anyhow | ||||||
|         self.searchEntry.grab_focus() |         self.searchEntry.grab_focus() | ||||||
|         if self.rememberFilter: |         if self.rememberFilter or not clear: | ||||||
|             gtk.gtk_editable_set_position(hash(self.searchEntry), -1) |             gtk.gtk_editable_set_position(hash(self.searchEntry), -1) | ||||||
|         else: |         else: | ||||||
|             self.searchEntry.set_text("") |             self.searchEntry.set_text("") | ||||||
| @ -818,8 +818,7 @@ class pluginclass( object ): | |||||||
|             else: |             else: | ||||||
|                 text = widget.get_text() |                 text = widget.get_text() | ||||||
|                 if self.lastActiveTab != 1: |                 if self.lastActiveTab != 1: | ||||||
|                     self.changeTab( 1 ) |                     self.changeTab( 1, clear = False ) | ||||||
|                     widget.set_text( text )  |  | ||||||
|                 text = widget.get_text() |                 text = widget.get_text() | ||||||
|                 showns = False # Are any app shown? |                 showns = False # Are any app shown? | ||||||
|                 shownList = [] |                 shownList = [] | ||||||
| @ -1124,7 +1123,7 @@ class pluginclass( object ): | |||||||
|         #menu.reposition() |         #menu.reposition() | ||||||
|         #menu.reposition() |         #menu.reposition() | ||||||
|         #self.mintMenuWin.grab() |         #self.mintMenuWin.grab() | ||||||
|         self.focusSearchEntry() |         self.focusSearchEntry(clear = False) | ||||||
|         return True |         return True | ||||||
|          |          | ||||||
|     def pos_func(self, menu=None): |     def pos_func(self, menu=None): | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user