From fec608699f903a17d31d6f0c903c785120c8c2a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Mon, 15 Jul 2013 16:38:17 -0300 Subject: Wrap long login status --- changes/bug_long_login_status | 1 + src/leap/gui/login.py | 4 ++++ src/leap/gui/ui/login.ui | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 changes/bug_long_login_status diff --git a/changes/bug_long_login_status b/changes/bug_long_login_status new file mode 100644 index 00000000..823ed524 --- /dev/null +++ b/changes/bug_long_login_status @@ -0,0 +1 @@ + o Wrap long login status messages to 40 characters. Fixes #3124 \ No newline at end of file diff --git a/src/leap/gui/login.py b/src/leap/gui/login.py index 8fc6ec24..80f2f3db 100644 --- a/src/leap/gui/login.py +++ b/src/leap/gui/login.py @@ -41,6 +41,8 @@ class LoginWidget(QtGui.QWidget): # combobox or click "Create Account" show_wizard = QtCore.Signal() + MAX_STATUS_WIDTH = 40 + def __init__(self, settings, parent=None): """ Constructs the LoginWidget. @@ -173,6 +175,8 @@ class LoginWidget(QtGui.QWidget): :param status: status message :type status: str """ + if len(status) > self.MAX_STATUS_WIDTH: + status = status[:self.MAX_STATUS_WIDTH] + "..." if error: status = "%s" % (status,) self.ui.lblStatus.setText(status) diff --git a/src/leap/gui/ui/login.ui b/src/leap/gui/ui/login.ui index 88c9ef44..42a6897a 100644 --- a/src/leap/gui/ui/login.ui +++ b/src/leap/gui/ui/login.ui @@ -7,7 +7,7 @@ 0 0 356 - 219 + 223 @@ -112,6 +112,9 @@ Qt::AlignCenter + + true + -- cgit v1.2.3