summaryrefslogtreecommitdiff
path: root/src/leap/gui/firstrun/providersetup.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-11-27 00:12:22 +0900
committerkali <kali@leap.se>2012-11-27 00:43:01 +0900
commitd5136a5f3b2aa8b16e8341f2eb99d05993028acf (patch)
tree7ef847e02cb9d60fb38761d0001f41968ea5a23f /src/leap/gui/firstrun/providersetup.py
parent7a263b8ee74cc92ba39796cd9ad48395adfa7450 (diff)
inline validation at register page.
inline widget and focus and red marks and whistles.
Diffstat (limited to 'src/leap/gui/firstrun/providersetup.py')
-rw-r--r--src/leap/gui/firstrun/providersetup.py23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/leap/gui/firstrun/providersetup.py b/src/leap/gui/firstrun/providersetup.py
index 7904538d..1a362794 100644
--- a/src/leap/gui/firstrun/providersetup.py
+++ b/src/leap/gui/firstrun/providersetup.py
@@ -17,6 +17,9 @@ logger = logging.getLogger(__name__)
class ProviderSetupValidationPage(ValidationPage):
def __init__(self, parent=None):
super(ProviderSetupValidationPage, self).__init__(parent)
+ self.current_page = "providersetupvalidation"
+
+ # XXX needed anymore?
is_signup = self.field("is_signup")
self.is_signup = is_signup
@@ -33,7 +36,6 @@ class ProviderSetupValidationPage(ValidationPage):
generator that yields actual checks
that are executed in a separate thread
"""
- curpage = "providersetupvalidation"
full_domain = self.field('provider_domain')
wizard = self.wizard()
@@ -44,10 +46,6 @@ class ProviderSetupValidationPage(ValidationPage):
pCertChecker = wizard.providercertchecker(
domain=full_domain)
- def fail():
- self.is_done = False
- return False
-
yield(("head_sentinel", 0), lambda: None)
########################
@@ -73,19 +71,17 @@ class ProviderSetupValidationPage(ValidationPage):
except baseexceptions.LeapException as exc:
logger.error(exc.message)
- wizard.set_validation_error(
- curpage, exc.usermessage)
- return fail()
+ # XXX this should be _ method
+ return self.fail(self.tr(exc.usermessage))
except Exception as exc:
- wizard.set_validation_error(
- curpage, exc.message)
- return fail()
+ return self.fail(exc.message)
else:
return True
- yield(('Fetching CA certificate', 30), fetchcacert)
+ yield((self.tr('Fetching CA certificate'), 30),
+ fetchcacert)
#########################
# 2) check CA fingerprint
@@ -106,7 +102,8 @@ class ProviderSetupValidationPage(ValidationPage):
# should catch exception
#return False
- yield((self.tr("Checking CA fingerprint"), 60), checkcafingerprint)
+ yield((self.tr("Checking CA fingerprint"), 60),
+ checkcafingerprint)
#########################
# 2) check CA fingerprint