summaryrefslogtreecommitdiff
path: root/src/leap/gui/firstrun
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-11-21 06:15:41 +0900
committerkali <kali@leap.se>2012-11-21 06:15:41 +0900
commit53c6c92e26970de7de0bddca0034e72af7d0ce48 (patch)
tree141fedb84ecc5ffe0e14e873ce6fe3a0d3ec4de3 /src/leap/gui/firstrun
parent8ad4957531f5279cf65df36b015d83443deded33 (diff)
add red border to failed field
Diffstat (limited to 'src/leap/gui/firstrun')
-rw-r--r--src/leap/gui/firstrun/providerselect.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/leap/gui/firstrun/providerselect.py b/src/leap/gui/firstrun/providerselect.py
index b6482379..2786c494 100644
--- a/src/leap/gui/firstrun/providerselect.py
+++ b/src/leap/gui/firstrun/providerselect.py
@@ -12,7 +12,7 @@ from leap.base import exceptions as baseexceptions
from leap.gui.constants import APP_LOGO
from leap.gui.progress import InlineValidationPage
-from leap.gui.styles import ErrorLabelStyleSheet
+from leap.gui import styles
from leap.util.web import get_https_domain_and_port
logger = logging.getLogger(__name__)
@@ -70,7 +70,7 @@ class SelectProviderPage(InlineValidationPage):
#self.registerField('provider_name_index', providerNameSelect)
validationMsg = QtGui.QLabel("")
- validationMsg.setStyleSheet(ErrorLabelStyleSheet)
+ validationMsg.setStyleSheet(styles.ErrorLabelStyleSheet)
self.validationMsg = validationMsg
providerCheckButton = QtGui.QPushButton(self.tr("chec&k"))
self.providerCheckButton = providerCheckButton
@@ -284,11 +284,16 @@ class SelectProviderPage(InlineValidationPage):
bad_str = getattr(self, 'bad_string', None)
cur_str = self.providerNameEdit.text()
showerr = self.validationMsg.setText
+ markred = lambda: self.providerNameEdit.setStyleSheet(
+ styles.ErrorLineEdit)
+ umarkrd = lambda: self.providerNameEdit.setStyleSheet(
+ styles.RegularLineEdit)
if bad_str is None:
# first time we fall here.
# save the current bad_string value
self.bad_string = cur_str
showerr(errors)
+ markred()
else:
# not the first time
# XXX hey, this is getting convoluted.
@@ -298,9 +303,11 @@ class SelectProviderPage(InlineValidationPage):
# enter a domain.
if cur_str == bad_str:
showerr(errors)
+ markred()
else:
if not getattr(self, 'domain_checked', None):
showerr('')
+ umarkrd()
else:
self.bad_string = cur_str
showerr(errors)