From 5fc48bf44bb127d54c001ab2e668dd5bed3c8f2d Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Mon, 30 Sep 2013 12:26:46 -0300 Subject: Move echo-mode-setting to the ui file. --- src/leap/bitmask/gui/ui/wizard.ui | 12 ++++++++++-- src/leap/bitmask/gui/wizard.py | 3 --- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/leap') diff --git a/src/leap/bitmask/gui/ui/wizard.ui b/src/leap/bitmask/gui/ui/wizard.ui index 2a412784..420c74ae 100644 --- a/src/leap/bitmask/gui/ui/wizard.ui +++ b/src/leap/bitmask/gui/ui/wizard.ui @@ -626,10 +626,18 @@ - + + + QLineEdit::Password + + - + + + QLineEdit::Password + + diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index bb38b136..5c00f631 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -110,9 +110,6 @@ class Wizard(QtGui.QWizard): self.currentIdChanged.connect(self._current_id_changed) - self.ui.lblPassword.setEchoMode(QtGui.QLineEdit.Password) - self.ui.lblPassword2.setEchoMode(QtGui.QLineEdit.Password) - self.ui.lnProvider.textChanged.connect( self._enable_check) -- cgit v1.2.3 From 057f42dcc2c23b93b872301d01a944fde5025439 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Mon, 30 Sep 2013 18:28:00 -0300 Subject: Add providers combobox with configured providers. --- src/leap/bitmask/gui/ui/wizard.ui | 171 ++++++++++++++++++++++++++++++++------ src/leap/bitmask/gui/wizard.py | 6 ++ 2 files changed, 151 insertions(+), 26 deletions(-) (limited to 'src/leap') diff --git a/src/leap/bitmask/gui/ui/wizard.ui b/src/leap/bitmask/gui/ui/wizard.ui index 420c74ae..b796b795 100644 --- a/src/leap/bitmask/gui/ui/wizard.ui +++ b/src/leap/bitmask/gui/ui/wizard.ui @@ -134,17 +134,7 @@ - - - - - - - Check - - - - + Qt::Vertical @@ -157,17 +147,7 @@ - - - - https:// - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - + Checking for a valid provider @@ -276,13 +256,73 @@ - + + + + + Configure or select a provider + + + + + + https:// + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + false + + + + + + + Check + + + + + + + Configure new provider + + + true + + + + + + + Use existing one + + + + + + + https:// + + + + + + @@ -764,12 +804,91 @@ btnRegister rdoRegister rdoLogin - lnProvider - btnCheck - + + + rbExistingProvider + toggled(bool) + cbProviders + setFocus() + + + 167 + 192 + + + 265 + 191 + + + + + rbNewProvider + toggled(bool) + lnProvider + setFocus() + + + 171 + 164 + + + 246 + 164 + + + + + rbExistingProvider + toggled(bool) + lnProvider + setDisabled(bool) + + + 169 + 196 + + + 327 + 163 + + + + + rbNewProvider + toggled(bool) + cbProviders + setDisabled(bool) + + + 169 + 162 + + + 269 + 193 + + + + + rbExistingProvider + toggled(bool) + btnCheck + setDisabled(bool) + + + 154 + 193 + + + 498 + 170 + + + + diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index 5c00f631..f71ce06b 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -26,6 +26,7 @@ from functools import partial from PySide import QtCore, QtGui from twisted.internet import threads +from leap.bitmask.config.leapsettings import LeapSettings from leap.bitmask.config.providerconfig import ProviderConfig from leap.bitmask.crypto.srpregister import SRPRegister from leap.bitmask.provider.providerbootstrapper import ProviderBootstrapper @@ -141,6 +142,11 @@ class Wizard(QtGui.QWizard): self.ui.label_12.setVisible(False) self.ui.lblProviderPolicy.setVisible(False) + # Load configured providers into wizard + ls = LeapSettings() + providers = ls.get_configured_providers() + self.ui.cbProviders.addItems(providers) + def get_domain(self): return self._domain -- cgit v1.2.3 From 201e9917a957b68e02a540ee395b32521f699eda Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Tue, 1 Oct 2013 12:33:17 -0300 Subject: Skip checks for an existing provider. --- src/leap/bitmask/gui/wizard.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/leap') 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) -- cgit v1.2.3