summaryrefslogtreecommitdiff
path: root/src/leap/gui
diff options
context:
space:
mode:
authorTomas Touceda <chiiph@leap.se>2013-05-15 16:16:32 -0300
committerTomás Touceda <chiiph@leap.se>2013-05-16 17:17:32 -0300
commitb0abf507bb8eb570328172b659ab072bc4b08634 (patch)
treefc63016e64d35fbcda5f836cb4e0dbb93ab6e850 /src/leap/gui
parent709cbe02bee29cc75ffe9ccbc65c2db4e53e270f (diff)
Integrate soledad and keymanager in the client
Diffstat (limited to 'src/leap/gui')
-rw-r--r--src/leap/gui/mainwindow.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py
index fdf84766..7eb956cb 100644
--- a/src/leap/gui/mainwindow.py
+++ b/src/leap/gui/mainwindow.py
@@ -37,6 +37,7 @@ from leap.gui.wizard import Wizard
from leap.services.eip.eipbootstrapper import EIPBootstrapper
from leap.services.eip.eipconfig import EIPConfig
from leap.services.eip.providerbootstrapper import ProviderBootstrapper
+from leap.services.soledad.soledadbootstrapper import SoledadBootstrapper
from leap.platform_init import IS_MAC, IS_WIN
from leap.platform_init.initializers import init_platform
from leap.services.eip.vpn import VPN
@@ -175,6 +176,10 @@ class MainWindow(QtGui.QMainWindow):
self._eip_bootstrapper.download_client_certificate.connect(
self._finish_eip_bootstrap)
+ self._soledad_bootstrapper = SoledadBootstrapper()
+ self._soledad_bootstrapper.download_config.connect(
+ self._soledad_bootstrapped_stage)
+
self._vpn = VPN()
self._vpn.state_changed.connect(self._update_vpn_state)
self._vpn.status_changed.connect(self._update_vpn_status)
@@ -233,6 +238,8 @@ class MainWindow(QtGui.QMainWindow):
self._bypass_checks = bypass_checks
+ self._soledad = None
+
if self._first_run():
self._wizard_firstrun = True
self._wizard = Wizard(self._checker_thread,
@@ -686,8 +693,35 @@ class MainWindow(QtGui.QMainWindow):
"""
self.ui.stackedWidget.setCurrentIndex(self.EIP_STATUS_INDEX)
self._systray.setIcon(self.LOGGED_IN_ICON)
+
+ self._soledad_bootstrapper.run_soledad_setup_checks(
+ self._checker_thread,
+ self._provider_config,
+ self.ui.lnUser.text(),
+ self.ui.lnPassword.text(),
+ download_if_needed=True)
+
self._download_eip_config()
+ def _soledad_bootstrapped_stage(self, data):
+ """
+ SLOT
+ TRIGGERS:
+ self._soledad_bootstrapper.download_config
+
+ If there was a problem, displays it, otherwise it does nothing.
+ This is used for intermediate bootstrapping stages, in case
+ they fail.
+
+ :param data: result from the bootstrapping stage for Soledad
+ :type data: dict
+ """
+ passed = data[self._soledad_bootstrapper.PASSED_KEY]
+ if not passed:
+ logger.error(data[self._soledad_bootstrapper.ERROR_KEY])
+ else:
+ logger.debug("Done bootstrapping Soledad")
+
def _get_socket_host(self):
"""
Returns the socket and port to be used for VPN