From 0c64fb31acf7afc5758b2aecf6ab05642c81fc49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 25 Nov 2016 10:57:47 +0100 Subject: [PATCH] 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 --- tryton/gui/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tryton/gui/main.py b/tryton/gui/main.py index 749cf3d098..c0f49d0a3e 100644 --- a/tryton/gui/main.py +++ b/tryton/gui/main.py @@ -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():