diff options
author | Tomas Touceda <chiiph@leap.se> | 2013-04-10 09:27:14 -0300 |
---|---|---|
committer | kali <kali@leap.se> | 2013-04-10 22:05:07 +0900 |
commit | 0cbff90910fa35a9489a5542d093211c61d2267f (patch) | |
tree | d92aeae06be1df7f74e4215ab5a80a6a4752d3de /src | |
parent | 6365c882b16ad164622fc66ad41d9cd0d02e17b1 (diff) |
Move ensure server to the very beginning
Also, fix documentation for a slot and mini-refactor a method
for improved translations.
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/app.py | 3 | ||||
-rw-r--r-- | src/leap/gui/mainwindow.py | 24 |
2 files changed, 14 insertions, 13 deletions
diff --git a/src/leap/app.py b/src/leap/app.py index 7cf78dc9..4112b404 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -22,6 +22,7 @@ import sys from functools import partial from PySide import QtCore, QtGui +from leap.common.events import server from leap.util import __version__ as VERSION from leap.util import leap_argparse from leap.gui import locale_rc @@ -44,6 +45,8 @@ def main(): Launches the main event loop """ + server.ensure_server(port=8090) + _, opts = leap_argparse.init_leapc_args() debug = opts.debug standalone = opts.standalone diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py index 71dff1c5..0d59e24b 100644 --- a/src/leap/gui/mainwindow.py +++ b/src/leap/gui/mainwindow.py @@ -42,7 +42,6 @@ from leap.services.eip.vpnlaunchers import (VPNLauncherException, EIPNoPolkitAuthAgentAvailable) from leap.util import __version__ as VERSION from leap.util.checkerthread import CheckerThread -from leap.common.events import server from leap.common.events import ( register, events_pb2 as proto, @@ -78,8 +77,6 @@ class MainWindow(QtGui.QMainWindow): """ QtGui.QMainWindow.__init__(self) - server.ensure_server(port=8090) - register(signal=proto.UPDATER_NEW_UPDATES, callback=self._new_updates_available) self._updates_content = "" @@ -269,15 +266,17 @@ class MainWindow(QtGui.QMainWindow): def _updates_details(self): """ + SLOT + TRIGGER: self.ui.btnMore.clicked + Parses and displays the updates details """ - msg = "" - if len(self._updates_content) == 0: - # We assume that if there is nothing in the contents, then - # the LEAPClient bundle is what needs updating. - msg = self.tr("The LEAPClient app is ready to update, please" - " restart the application.") - else: + msg = self.tr("The LEAPClient app is ready to update, please" + " restart the application.") + + # We assume that if there is nothing in the contents, then + # the LEAPClient bundle is what needs updating. + if len(self._updates_content) > 0: files = self._updates_content.split(", ") files_str = "" for f in files: @@ -285,9 +284,8 @@ class MainWindow(QtGui.QMainWindow): final_name = final_name.replace(".thp", "") files_str += final_name files_str += "\n" - msg = self.tr("The LEAPClient app is ready to update, please" - " restart the application so the following " - "components get updated:\n%s") % (files_str,) + msg += self.tr(" The following components will be updated:\n%s") \ + % (files_str,) QtGui.QMessageBox.information(self, self.tr("Updates available"), |