diff options
-rw-r--r-- | changes/bug-4003_fix-non-ascii-password-change | 2 | ||||
-rw-r--r-- | changes/bug-4093_change-password-policy | 2 | ||||
-rw-r--r-- | changes/bug-4117_select-current-logged-in-provider-in-preferences-window | 2 | ||||
-rw-r--r-- | changes/bug-improvie-error-handling | 1 | ||||
-rw-r--r-- | changes/bug_fix_keyring_save | 4 | ||||
-rw-r--r-- | changes/bug_tighter_clustering_eip_meter | 4 | ||||
-rw-r--r-- | changes/feature-4132_remove-autostart-eip-setting | 4 | ||||
-rw-r--r-- | changes/feature_hide_unused_services | 4 | ||||
-rw-r--r-- | src/leap/bitmask/gui/mail_status.py | 2 | ||||
-rw-r--r-- | src/leap/bitmask/gui/mainwindow.py | 10 | ||||
-rw-r--r-- | src/leap/bitmask/gui/preferenceswindow.py | 48 | ||||
-rw-r--r-- | src/leap/bitmask/services/mail/imap.py | 7 | ||||
-rw-r--r-- | src/leap/bitmask/services/soledad/soledadbootstrapper.py | 9 |
13 files changed, 75 insertions, 24 deletions
diff --git a/changes/bug-4003_fix-non-ascii-password-change b/changes/bug-4003_fix-non-ascii-password-change index 2d6a0ed8..58de5078 100644 --- a/changes/bug-4003_fix-non-ascii-password-change +++ b/changes/bug-4003_fix-non-ascii-password-change @@ -1 +1 @@ - - Fix problem changing a non-ascii password. Closes #4003. +- Fix problem changing a non-ascii password. Closes #4003. diff --git a/changes/bug-4093_change-password-policy b/changes/bug-4093_change-password-policy new file mode 100644 index 00000000..87f6fd15 --- /dev/null +++ b/changes/bug-4093_change-password-policy @@ -0,0 +1,2 @@ + - Enable password change in the client only if it has started the correct + services. Closes #4093. diff --git a/changes/bug-4117_select-current-logged-in-provider-in-preferences-window b/changes/bug-4117_select-current-logged-in-provider-in-preferences-window new file mode 100644 index 00000000..46a031e0 --- /dev/null +++ b/changes/bug-4117_select-current-logged-in-provider-in-preferences-window @@ -0,0 +1,2 @@ + - Select the current logged in provider in the preferences window. Closes + #4117. diff --git a/changes/bug-improvie-error-handling b/changes/bug-improvie-error-handling new file mode 100644 index 00000000..405dd771 --- /dev/null +++ b/changes/bug-improvie-error-handling @@ -0,0 +1 @@ +- Capture soledad boostrap errors after latest soledad changes. diff --git a/changes/bug_fix_keyring_save b/changes/bug_fix_keyring_save index 3be0e05b..64bb82a9 100644 --- a/changes/bug_fix_keyring_save +++ b/changes/bug_fix_keyring_save @@ -1,2 +1,2 @@ - - Refactor keyring handling and make it properly save user and - password. Fixes #4190.
\ No newline at end of file +- Refactor keyring handling and make it properly save user and + password. Fixes #4190. diff --git a/changes/bug_tighter_clustering_eip_meter b/changes/bug_tighter_clustering_eip_meter index 32101c9e..dca8f2cd 100644 --- a/changes/bug_tighter_clustering_eip_meter +++ b/changes/bug_tighter_clustering_eip_meter @@ -1,2 +1,2 @@ - - Align left the speed and transferred displays for EIP. Fixes - #4204.
\ No newline at end of file +- Align left the speed and transferred displays for EIP. Fixes + #4204. diff --git a/changes/feature-4132_remove-autostart-eip-setting b/changes/feature-4132_remove-autostart-eip-setting index 5f3e6b7d..f95e4125 100644 --- a/changes/feature-4132_remove-autostart-eip-setting +++ b/changes/feature-4132_remove-autostart-eip-setting @@ -1,2 +1,2 @@ - - Remove autostart eip option from settings panel, rely on last used - setting. Closes #4132. +- Remove autostart eip option from settings panel, rely on last used + setting. Closes #4132. diff --git a/changes/feature_hide_unused_services b/changes/feature_hide_unused_services index abcdeb6f..dc942da2 100644 --- a/changes/feature_hide_unused_services +++ b/changes/feature_hide_unused_services @@ -1,2 +1,2 @@ - - Hide the GUI for services that are not supported on the set of - configured providers. Closes #4170.
\ No newline at end of file +- Hide the GUI for services that are not supported on the set of + configured providers. Closes #4170. diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py index c2c06dbb..c1e82d4d 100644 --- a/src/leap/bitmask/gui/mail_status.py +++ b/src/leap/bitmask/gui/mail_status.py @@ -364,9 +364,7 @@ class MailStatusWidget(QtGui.QWidget): ext_status = None if req.event == proto.IMAP_UNREAD_MAIL: - if self._started: - print "printing foo" if req.content != "0": self._set_mail_status(self.tr("%s Unread Emails") % (req.content,), ready=2) diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index ce3f113b..5eb9e6dc 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -446,13 +446,11 @@ class MainWindow(QtGui.QMainWindow): Displays the preferences window. """ - preferences_window = PreferencesWindow(self, self._srp_auth) + preferences_window = PreferencesWindow(self, self._srp_auth, + self._provider_config) - if sameProxiedObjects(self._soledad, None): - preferences_window.set_soledad_ready(self._soledad) - else: - self.soledad_ready.connect( - lambda: preferences_window.set_soledad_ready(self._soledad)) + self.soledad_ready.connect( + lambda: preferences_window.set_soledad_ready(self._soledad)) preferences_window.show() diff --git a/src/leap/bitmask/gui/preferenceswindow.py b/src/leap/bitmask/gui/preferenceswindow.py index b043afe6..acb39b07 100644 --- a/src/leap/bitmask/gui/preferenceswindow.py +++ b/src/leap/bitmask/gui/preferenceswindow.py @@ -40,12 +40,14 @@ class PreferencesWindow(QtGui.QDialog): """ Window that displays the preferences. """ - def __init__(self, parent, srp_auth): + def __init__(self, parent, srp_auth, provider_config): """ :param parent: parent object of the PreferencesWindow. :parent type: QWidget :param srp_auth: SRPAuth object configured in the main app. :type srp_auth: SRPAuth + :param provider_config: ProviderConfig object. + :type provider_config: ProviderConfig """ QtGui.QDialog.__init__(self, parent) self.AUTOMATIC_GATEWAY_LABEL = self.tr("Automatic") @@ -72,6 +74,36 @@ class PreferencesWindow(QtGui.QDialog): else: self._add_configured_providers() + pw_enabled = False + + # check if the user is logged in + if srp_auth is not None and srp_auth.get_token() is not None: + # check if provider has 'mx' ... + domain = provider_config.get_domain() + self._select_provider_by_name(domain) + if provider_config.provides_mx(): + enabled_services = self._settings.get_enabled_services(domain) + mx_name = get_service_display_name('mx') + + # ... and if the user have it enabled + if 'mx' not in enabled_services: + msg = self.tr("You need to enable {0} in order to change " + "the password.".format(mx_name)) + self._set_password_change_status(msg, error=True) + else: + msg = self.tr( + "You need to wait until {0} is ready in " + "order to change the password.".format(mx_name)) + self._set_password_change_status(msg) + else: + pw_enabled = True + else: + msg = self.tr( + "In order to change your password you need to be logged in.") + self._set_password_change_status(msg) + + self.ui.gbPasswordChange.setEnabled(pw_enabled) + def set_soledad_ready(self, soledad): """ SLOT @@ -84,6 +116,7 @@ class PreferencesWindow(QtGui.QDialog): :type soledad: Soledad """ self._soledad = soledad + self.ui.lblPasswordChangeStatus.setVisible(False) self.ui.gbPasswordChange.setEnabled(True) def _set_password_change_status(self, status, error=False, success=False): @@ -98,6 +131,9 @@ class PreferencesWindow(QtGui.QDialog): elif success: status = "<font color='green'><b>%s</b></font>" % (status,) + if not self.ui.gbPasswordChange.isEnabled(): + status = "<font color='black'>%s</font>" % (status,) + self.ui.lblPasswordChangeStatus.setVisible(True) self.ui.lblPasswordChangeStatus.setText(status) @@ -218,6 +254,16 @@ class PreferencesWindow(QtGui.QDialog): for provider in self._settings.get_configured_providers(): self.ui.cbProvidersServices.addItem(provider) + def _select_provider_by_name(self, name): + """ + Given a provider name/domain, selects it in the combobox. + + :param name: name or domain for the provider + :type name: str + """ + provider_index = self.ui.cbProvidersServices.findText(name) + self.ui.cbProvidersServices.setCurrentIndex(provider_index) + def _service_selection_changed(self, service, state): """ SLOT diff --git a/src/leap/bitmask/services/mail/imap.py b/src/leap/bitmask/services/mail/imap.py index 4828180e..2667f156 100644 --- a/src/leap/bitmask/services/mail/imap.py +++ b/src/leap/bitmask/services/mail/imap.py @@ -41,9 +41,10 @@ def get_mail_check_period(): try: period = int(period_str) except (ValueError, TypeError): - logger.warning("BAD value found for %s: %s" % ( - INCOMING_CHECK_PERIOD_ENV, - period_str)) + if period is not None: + logger.warning("BAD value found for %s: %s" % ( + INCOMING_CHECK_PERIOD_ENV, + period_str)) except Exception as exc: logger.warning("Unhandled error while getting %s: %r" % ( INCOMING_CHECK_PERIOD_ENV, diff --git a/src/leap/bitmask/services/soledad/soledadbootstrapper.py b/src/leap/bitmask/services/soledad/soledadbootstrapper.py index 79bec1eb..54ef67eb 100644 --- a/src/leap/bitmask/services/soledad/soledadbootstrapper.py +++ b/src/leap/bitmask/services/soledad/soledadbootstrapper.py @@ -41,7 +41,7 @@ from leap.common.check import leap_assert, leap_assert_type, leap_check from leap.common.files import which from leap.keymanager import KeyManager, openpgp from leap.keymanager.errors import KeyNotFound -from leap.soledad.client import Soledad +from leap.soledad.client import Soledad, BootstrapSequenceError logger = logging.getLogger(__name__) @@ -260,7 +260,10 @@ class SoledadBootstrapper(AbstractBootstrapper): logger.debug("SOLEDAD initialization TIMED OUT...") self.soledad_timeout.emit() except socket.error as exc: - logger.error("Socket error while initializing soledad") + logger.warning("Socket error while initializing soledad") + self.soledad_timeout.emit() + except BootstrapSequenceError as exc: + logger.warning("Error while initializing soledad") self.soledad_timeout.emit() # unrecoverable @@ -283,7 +286,7 @@ class SoledadBootstrapper(AbstractBootstrapper): Raises SoledadSyncError if not successful. """ try: - logger.error("trying to sync soledad....") + logger.debug("trying to sync soledad....") self._soledad.sync() except SSLError as exc: logger.error("%r" % (exc,)) |