From 9851a675d56d8fb2f4f26bf3970bda70c0ae1073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Schreiner?= Date: Sun, 25 Mar 2012 10:33:49 +0200 Subject: [PATCH] Set a placeholder text for cityEdit only if the user's version of Qt supports it. fixes #832 --- weboob/applications/qflatboob/query.py | 3 +++ weboob/applications/qflatboob/ui/query.ui | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/weboob/applications/qflatboob/query.py b/weboob/applications/qflatboob/query.py index e4e37522..6b06c6ec 100644 --- a/weboob/applications/qflatboob/query.py +++ b/weboob/applications/qflatboob/query.py @@ -41,6 +41,9 @@ class QueryDialog(QDialog): self.connect(self.ui.citiesList, SIGNAL('itemDoubleClicked(QListWidgetItem*)'), self.removeCity) self.connect(self.ui.buttonBox, SIGNAL('accepted()'), self.okButton) + if hasattr(self.ui.cityEdit, "setPlaceholderText"): + self.ui.cityEdit.setPlaceholderText("Press enter to search city") + def keyPressEvent(self, event): """ Disable handler and to prevent closing the window. diff --git a/weboob/applications/qflatboob/ui/query.ui b/weboob/applications/qflatboob/ui/query.ui index ab3edca1..51b4b80a 100644 --- a/weboob/applications/qflatboob/ui/query.ui +++ b/weboob/applications/qflatboob/ui/query.ui @@ -56,11 +56,7 @@ - - - Press enter to search city - - +