summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2013-10-31 16:53:14 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2013-10-31 17:10:09 -0300
commitb2a62d05985ab3bc50fc36e5b9e89765e39da58e (patch)
tree35062cb92d8eceaf0d48fa48d5a8a8f3c85599e0 /src/leap/bitmask/gui
parent51cfd78c39d8eeab0c3004b7acb3ce0411742556 (diff)
Select the logged in provider in the pref. window.
[Closes #4117]
Diffstat (limited to 'src/leap/bitmask/gui')
-rw-r--r--src/leap/bitmask/gui/preferenceswindow.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/leap/bitmask/gui/preferenceswindow.py b/src/leap/bitmask/gui/preferenceswindow.py
index 86fe9433..acb39b07 100644
--- a/src/leap/bitmask/gui/preferenceswindow.py
+++ b/src/leap/bitmask/gui/preferenceswindow.py
@@ -77,10 +77,11 @@ class PreferencesWindow(QtGui.QDialog):
pw_enabled = False
# check if the user is logged in
- if srp_auth is not None and srp_auth.get_session_id() is not None:
+ 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():
- domain = provider_config.get_domain()
enabled_services = self._settings.get_enabled_services(domain)
mx_name = get_service_display_name('mx')
@@ -253,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