diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-08-27 14:36:32 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-08-27 14:36:32 -0300 |
commit | 5b6b878289737e72ba7156ec320d2e811358327c (patch) | |
tree | 45f145b994c22b790086890e7e27113a8b33d6b0 /src/leap/bitmask/gui/mainwindow.py | |
parent | 700e70786553dfe39490e843d9e26711c2cc9bc3 (diff) | |
parent | 34aa27b9251ff32c22bc8f4c6826a460714602b3 (diff) |
Merge remote-tracking branch 'ivan/feature/preferences-select-services' into develop
Diffstat (limited to 'src/leap/bitmask/gui/mainwindow.py')
-rw-r--r-- | src/leap/bitmask/gui/mainwindow.py | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index c832887a..25747785 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -419,7 +419,8 @@ class MainWindow(QtGui.QMainWindow): Displays the preferences window. """ - PreferencesWindow(self, self._srp_auth, self._soledad).show() + PreferencesWindow( + self, self._srp_auth, self._soledad, self._settings).show() def _uncheck_logger_button(self): """ @@ -491,7 +492,8 @@ class MainWindow(QtGui.QMainWindow): """ # XXX: May be this can be divided into two methods? - self._login_widget.set_providers(self._configured_providers()) + providers = self._settings.get_configured_providers() + self._login_widget.set_providers(providers) self._show_systray() self.show() if IS_MAC: @@ -736,34 +738,14 @@ class MainWindow(QtGui.QMainWindow): QtGui.QMainWindow.closeEvent(self, e) - def _configured_providers(self): - """ - Returns the available providers based on the file structure - - :rtype: list - """ - - # TODO: check which providers have a valid certificate among - # other things, not just the directories - providers = [] - try: - providers = os.listdir( - os.path.join(self._provider_config.get_path_prefix(), - "leap", - "providers")) - except Exception as e: - logger.debug("Error listing providers, assume there are none. %r" - % (e,)) - - return providers - def _first_run(self): """ Returns True if there are no configured providers. False otherwise :rtype: bool """ - has_provider_on_disk = len(self._configured_providers()) != 0 + providers = self._settings.get_configured_providers() + has_provider_on_disk = len(providers) != 0 is_proper_provider = self._settings.get_properprovider() return not (has_provider_on_disk and is_proper_provider) |