summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changes/4490_preferences-selects-current-login-widget-provider2
-rw-r--r--src/leap/bitmask/gui/mainwindow.py6
-rw-r--r--src/leap/bitmask/gui/preferenceswindow.py9
3 files changed, 10 insertions, 7 deletions
diff --git a/changes/4490_preferences-selects-current-login-widget-provider b/changes/4490_preferences-selects-current-login-widget-provider
new file mode 100644
index 00000000..e4c9e907
--- /dev/null
+++ b/changes/4490_preferences-selects-current-login-widget-provider
@@ -0,0 +1,2 @@
+- Make the preferences window selects the current selected provider in the
+ login widget even if the user is not logged in. Closes #4490.
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index e21d6cd2..25e25e45 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -467,9 +467,9 @@ class MainWindow(QtGui.QMainWindow):
Displays the preferences window.
"""
- preferences_window = PreferencesWindow(self, self._srp_auth,
- self._provider_config,
- self._soledad)
+ preferences_window = PreferencesWindow(
+ self, self._srp_auth, self._provider_config, self._soledad,
+ self._login_widget.get_selected_provider())
self.soledad_ready.connect(preferences_window.set_soledad_ready)
preferences_window.show()
diff --git a/src/leap/bitmask/gui/preferenceswindow.py b/src/leap/bitmask/gui/preferenceswindow.py
index 8e9ef95a..b4bddef2 100644
--- a/src/leap/bitmask/gui/preferenceswindow.py
+++ b/src/leap/bitmask/gui/preferenceswindow.py
@@ -42,7 +42,7 @@ class PreferencesWindow(QtGui.QDialog):
"""
Window that displays the preferences.
"""
- def __init__(self, parent, srp_auth, provider_config, soledad):
+ def __init__(self, parent, srp_auth, provider_config, soledad, domain):
"""
:param parent: parent object of the PreferencesWindow.
:parent type: QWidget
@@ -52,6 +52,8 @@ class PreferencesWindow(QtGui.QDialog):
:type provider_config: ProviderConfig
:param soledad: Soledad instance
:type soledad: Soledad
+ :param domain: the selected domain in the login widget
+ :type domain: unicode
"""
QtGui.QDialog.__init__(self, parent)
self.AUTOMATIC_GATEWAY_LABEL = self.tr("Automatic")
@@ -83,9 +85,6 @@ class PreferencesWindow(QtGui.QDialog):
# 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_SERVICE)
@@ -111,6 +110,8 @@ class PreferencesWindow(QtGui.QDialog):
"In order to change your password you need to be logged in.")
self._set_password_change_status(msg)
+ self._select_provider_by_name(domain)
+
self.ui.gbPasswordChange.setEnabled(pw_enabled)
def set_soledad_ready(self):