From 5cb5b9e1af04866000b332e4abbbbdbb052ba455 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Tue, 6 Aug 2013 11:10:56 -0300 Subject: Update code to use the new EIP schema selection. --- src/leap/gui/mainwindow.py | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'src/leap/gui') diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py index 89790239..d1f3e805 100644 --- a/src/leap/gui/mainwindow.py +++ b/src/leap/gui/mainwindow.py @@ -1221,29 +1221,34 @@ class MainWindow(QtGui.QMainWindow): loaded """ leap_assert(self._eip_config, "We need an eip config!") + passed = data[self._eip_bootstrapper.PASSED_KEY] + + if not passed: + error_msg = self.tr("There was a problem with the provider") + self._status_panel.set_eip_status(error_msg, error=True) + logger.error(data[self._eip_bootstrapper.ERROR_KEY]) + self._already_started_eip = False + return provider_config = self._get_best_provider_config() domain = provider_config.get_domain() - if data[self._eip_bootstrapper.PASSED_KEY] and \ - (self._eip_config.loaded() or - self._eip_config.load(os.path.join("leap", - "providers", - domain, - "eip-service.json"))): - self._start_eip() + loaded = self._eip_config.loaded() + if not loaded: + eip_config_path = os.path.join("leap", "providers", + domain, "eip-service.json") + api_version = provider_config.get_api_version() + self._eip_config.set_api_version(api_version) + loaded = self._eip_config.load(eip_config_path) + + if loaded: + self._start_eip() else: - if data[self._eip_bootstrapper.PASSED_KEY]: - self._status_panel.set_eip_status( - self.tr("Could not load Encrypted Internet " - "Configuration."), - error=True) - else: - self._status_panel.set_eip_status( - data[self._eip_bootstrapper.ERROR_KEY], - error=True) - self._already_started_eip = False + self._status_panel.set_eip_status( + self.tr("Could not load Encrypted Internet " + "Configuration."), + error=True) def _logout(self): """ -- cgit v1.2.3