From c752f90f2e242b96a6a63aa56466d22d8db8ceb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Thu, 13 Jun 2013 16:16:47 -0300 Subject: Always use best provider config Also, set the expected user@provider after stopping EIP, in case it was automatically started with another provider --- src/leap/gui/mainwindow.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py index 67fe34e3..aa9154e2 100644 --- a/src/leap/gui/mainwindow.py +++ b/src/leap/gui/mainwindow.py @@ -805,7 +805,7 @@ class MainWindow(QtGui.QMainWindow): if not self._already_started_eip: self._status_panel.set_provider( "%s@%s" % (self._login_widget.get_user(), - self._provider_config.get_domain())) + self._get_best_provider_config().get_domain())) self.ui.stackedWidget.setCurrentIndex(self.EIP_STATUS_INDEX) @@ -952,7 +952,7 @@ class MainWindow(QtGui.QMainWindow): self._settings.set_defaultprovider( provider_config.get_domain()) - provider = self._provider_config.get_domain() + provider = provider_config.get_domain() if self._logged_user is not None: provider = "%s@%s" % (self._logged_user, provider) @@ -1005,6 +1005,11 @@ class MainWindow(QtGui.QMainWindow): self._start_eip) self._already_started_eip = False + if self._logged_user: + self._status_panel.set_provider( + "%s@%s" % (self._logged_user, + self._get_best_provider_config().get_domain())) + def _get_best_provider_config(self): """ Returns the best ProviderConfig to use at a moment. We may -- cgit v1.2.3