summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/wizard.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/gui/wizard.py')
-rw-r--r--src/leap/bitmask/gui/wizard.py79
1 files changed, 47 insertions, 32 deletions
diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py
index ebcee400..cc8c2624 100644
--- a/src/leap/bitmask/gui/wizard.py
+++ b/src/leap/bitmask/gui/wizard.py
@@ -145,8 +145,7 @@ class Wizard(QtGui.QWizard):
@QtCore.Slot()
def _wizard_finished(self):
"""
- SLOT
- TRIGGER:
+ TRIGGERS:
self.finished
This method is called when the wizard is accepted or rejected.
@@ -210,15 +209,19 @@ class Wizard(QtGui.QWizard):
def get_services(self):
return self._selected_services
- @QtCore.Slot()
+ @QtCore.Slot(unicode)
def _enable_check(self, reset=True):
"""
- SLOT
- TRIGGER:
+ TRIGGERS:
self.ui.lnProvider.textChanged
Enables/disables the 'check' button in the SELECT_PROVIDER_PAGE
depending on the lnProvider content.
+
+ :param reset: this contains the text of the line edit, and when is
+ called directly defines whether we want to reset the
+ checks.
+ :type reset: unicode or bool
"""
enabled = len(self.ui.lnProvider.text()) != 0
enabled = enabled or self.ui.rbExistingProvider.isChecked()
@@ -282,11 +285,11 @@ class Wizard(QtGui.QWizard):
# register button
self.ui.btnRegister.setVisible(visible)
+ @QtCore.Slot()
def _registration_finished(self):
"""
- SLOT
TRIGGERS:
- self._backend.signaler.srp_registration_finished
+ self._backend.signaler.srp_registration_finished
The registration has finished successfully, so we do some final steps.
"""
@@ -308,11 +311,11 @@ class Wizard(QtGui.QWizard):
self.page(self.REGISTER_USER_PAGE).set_completed()
self.button(QtGui.QWizard.BackButton).setEnabled(False)
+ @QtCore.Slot()
def _registration_failed(self):
"""
- SLOT
TRIGGERS:
- self._backend.signaler.srp_registration_failed
+ self._backend.signaler.srp_registration_failed
The registration has failed, so we report the problem.
"""
@@ -322,11 +325,11 @@ class Wizard(QtGui.QWizard):
self._set_register_status(error_msg, error=True)
self.ui.btnRegister.setEnabled(True)
+ @QtCore.Slot()
def _registration_taken(self):
"""
- SLOT
TRIGGERS:
- self._backend.signaler.srp_registration_taken
+ self._backend.signaler.srp_registration_taken
The requested username is taken, warn the user about that.
"""
@@ -368,12 +371,12 @@ class Wizard(QtGui.QWizard):
self.ui.lblCheckCaFpr.setPixmap(None)
self.ui.lblCheckApiCert.setPixmap(None)
+ @QtCore.Slot()
def _check_provider(self):
"""
- SLOT
TRIGGERS:
- self.ui.btnCheck.clicked
- self.ui.lnProvider.returnPressed
+ self.ui.btnCheck.clicked
+ self.ui.lnProvider.returnPressed
Starts the checks for a given provider
"""
@@ -403,10 +406,10 @@ class Wizard(QtGui.QWizard):
self._provider_select_defer = self._backend.\
setup_provider(self._domain)
+ @QtCore.Slot(bool)
def _skip_provider_checks(self, skip):
"""
- SLOT
- Triggered:
+ TRIGGERS:
self.ui.rbExistingProvider.toggled
Allows the user to move to the next page without make any checks,
@@ -447,10 +450,11 @@ class Wizard(QtGui.QWizard):
label.setPixmap(self.ERROR_ICON)
logger.error(error)
+ @QtCore.Slot(dict)
def _name_resolution(self, data):
"""
- SLOT
- TRIGGER: self._backend.signaler.prov_name_resolution
+ TRIGGERS:
+ self._backend.signaler.prov_name_resolution
Sets the status for the name resolution check
"""
@@ -466,10 +470,11 @@ class Wizard(QtGui.QWizard):
self.ui.btnCheck.setEnabled(not passed)
self.ui.lnProvider.setEnabled(not passed)
+ @QtCore.Slot(dict)
def _https_connection(self, data):
"""
- SLOT
- TRIGGER: self._backend.signaler.prov_https_connection
+ TRIGGERS:
+ self._backend.signaler.prov_https_connection
Sets the status for the https connection check
"""
@@ -485,10 +490,11 @@ class Wizard(QtGui.QWizard):
self.ui.btnCheck.setEnabled(not passed)
self.ui.lnProvider.setEnabled(not passed)
+ @QtCore.Slot(dict)
def _download_provider_info(self, data):
"""
- SLOT
- TRIGGER: self._backend.signaler.prov_download_provider_info
+ TRIGGERS:
+ self._backend.signaler.prov_download_provider_info
Sets the status for the provider information download
check. Since this check is the last of this set, it also
@@ -519,10 +525,11 @@ class Wizard(QtGui.QWizard):
else:
self.ui.cbProviders.setEnabled(True)
+ @QtCore.Slot(dict)
def _download_ca_cert(self, data):
"""
- SLOT
- TRIGGER: self._backend.signaler.prov_download_ca_cert
+ TRIGGERS:
+ self._backend.signaler.prov_download_ca_cert
Sets the status for the download of the CA certificate check
"""
@@ -531,10 +538,11 @@ class Wizard(QtGui.QWizard):
if passed:
self.ui.lblCheckCaFpr.setPixmap(self.QUESTION_ICON)
+ @QtCore.Slot(dict)
def _check_ca_fingerprint(self, data):
"""
- SLOT
- TRIGGER: self._backend.signaler.prov_check_ca_fingerprint
+ TRIGGERS:
+ self._backend.signaler.prov_check_ca_fingerprint
Sets the status for the CA fingerprint check
"""
@@ -543,10 +551,11 @@ class Wizard(QtGui.QWizard):
if passed:
self.ui.lblCheckApiCert.setPixmap(self.QUESTION_ICON)
+ @QtCore.Slot(dict)
def _check_api_certificate(self, data):
"""
- SLOT
- TRIGGER: self._backend.signaler.prov_check_api_certificate
+ TRIGGERS:
+ self._backend.signaler.prov_check_api_certificate
Sets the status for the API certificate check. Also finishes
the provider bootstrapper thread since it's not needed anymore
@@ -556,10 +565,12 @@ class Wizard(QtGui.QWizard):
True, self.SETUP_PROVIDER_PAGE)
self._provider_setup_ok = True
+ @QtCore.Slot(str, int)
def _service_selection_changed(self, service, state):
"""
- SLOT
- TRIGGER: service_checkbox.stateChanged
+ TRIGGERS:
+ service_checkbox.stateChanged
+
Adds the service to the state if the state is checked, removes
it otherwise
@@ -604,12 +615,16 @@ class Wizard(QtGui.QWizard):
self.tr("Something went wrong while trying to "
"load service %s" % (service,)))
+ @QtCore.Slot(int)
def _current_id_changed(self, pageId):
"""
- SLOT
- TRIGGER: self.currentIdChanged
+ TRIGGERS:
+ self.currentIdChanged
Prepares the pages when they appear
+
+ :param pageId: the new current page id.
+ :type pageId: int
"""
if pageId == self.SELECT_PROVIDER_PAGE:
self._clear_register_widgets()