Set placeholder on global_search_entry in RPCContextReload if it exists

RPCContextReload is asynchronous so global_search_entry could not yet be set
when the callback is called.

issue6062
review29771002
This commit is contained in:
Cédric Krier committed 2016-11-25 10:57:47 +01:00
1 parent d649269e06
commit 0c64fb31ac
1 file changed
+3 -1
+3 -1
View File
@@ -276,6 +276,7 @@ class Main(object):
def set_global_search(self):
self.global_search_entry = PlaceholderEntry()
self.global_search_entry.set_placeholder_text(_('Search'))
global_search_completion = gtk.EntryCompletion()
global_search_completion.set_match_func(lambda *a: True)
global_search_completion.set_model(gtk.ListStore(
@@ -824,7 +825,8 @@ class Main(object):
self.favorite_unset()
CONFIG['client.lang'] = prefs['language']
# Set placeholder after language is set to get correct translation
self.global_search_entry.set_placeholder_text(_('Search'))
if self.global_search_entry:
self.global_search_entry.set_placeholder_text(_('Search'))
CONFIG.save()
def _get_preferences():