Fixes an event cycle on the search entry

When pasting a string on the search entry that triggers suggestions
(google, etc) and this is done on the favorites tab, a cycle of changed
events occurs. It throws an exception, although everything still seems
to work.
With this fix the search entry isn't modified when changing tabs.
This commit is contained in:
hordepfo 2014-05-07 16:32:18 +01:00 committed by Clement Lefebvre
parent 1b8e8b05fc
commit c2275c4f4f

View File

@ -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
@ -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 = []