summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/leap/bitmask/gui/wizard.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py
index f71ce06b..7cff742e 100644
--- a/src/leap/bitmask/gui/wizard.py
+++ b/src/leap/bitmask/gui/wizard.py
@@ -82,6 +82,8 @@ class Wizard(QtGui.QWizard):
self._show_register = False
+ self._use_existing_provider = False
+
self.ui.grpCheckProvider.setVisible(False)
self.ui.btnCheck.clicked.connect(self._check_provider)
self.ui.lnProvider.returnPressed.connect(self._check_provider)
@@ -123,6 +125,8 @@ class Wizard(QtGui.QWizard):
self.ui.btnRegister.clicked.connect(
self._register)
+ self.ui.rbExistingProvider.toggled.connect(self._skip_provider_checks)
+
usernameRe = QtCore.QRegExp(self.BARE_USERNAME_REGEX)
self.ui.lblUser.setValidator(
QtGui.QRegExpValidator(usernameRe, self))
@@ -318,6 +322,25 @@ class Wizard(QtGui.QWizard):
self._provider_select_defer = self._provider_bootstrapper.\
run_provider_select_checks(self._domain)
+ def _skip_provider_checks(self, skip):
+ """
+ SLOT
+ Triggered:
+ self.ui.rbExistingProvider.toggled
+
+ Allows the user to move to the next page without make any checks,
+ used when we are selecting an already configured provider.
+
+ :param skip: if we should skip checks or not
+ :type skip: bool
+ """
+ if skip:
+ self._reset_provider_check()
+
+ self.page(self.SELECT_PROVIDER_PAGE).set_completed(skip)
+ self.button(QtGui.QWizard.NextButton).setEnabled(skip)
+ self._use_existing_provider = skip
+
def _complete_task(self, data, label, complete=False, complete_page=-1):
"""
Checks a task and completes a page if specified
@@ -564,4 +587,14 @@ class Wizard(QtGui.QWizard):
else:
return self.SERVICES_PAGE
+ if self.currentPage() == self.page(self.SELECT_PROVIDER_PAGE):
+ if self._use_existing_provider:
+ self._domain = self.ui.cbProviders.currentText()
+ self._provider_config = ProviderConfig.get_provider_config(
+ self._domain)
+ if self._show_register:
+ return self.REGISTER_USER_PAGE
+ else:
+ return self.SERVICES_PAGE
+
return QtGui.QWizard.nextId(self)