summaryrefslogtreecommitdiff
path: root/src/leap/baseapp/mainwindow.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-08 07:57:42 +0900
committerkali <kali@leap.se>2012-10-08 07:57:42 +0900
commit4d195cd5b6e6600ccf0df78946cab6038a1fcaec (patch)
tree1362b2844f7e008cad8c29f26861566129af6edd /src/leap/baseapp/mainwindow.py
parent3a77603eae5fea0b1efb226860e0264ccf96f41b (diff)
parent6728eb9afb21bad867e4052a6190a9bdb34c928a (diff)
Merge branch 'feature/network_check' into develop
Conflicts: src/leap/baseapp/mainwindow.py src/leap/eip/tests/test_checks.py
Diffstat (limited to 'src/leap/baseapp/mainwindow.py')
-rw-r--r--src/leap/baseapp/mainwindow.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py
index 1accac30..09e0c0bb 100644
--- a/src/leap/baseapp/mainwindow.py
+++ b/src/leap/baseapp/mainwindow.py
@@ -8,7 +8,9 @@ from PyQt4 import QtGui
from leap.baseapp.eip import EIPConductorAppMixin
from leap.baseapp.log import LogPaneMixin
from leap.baseapp.systray import StatusAwareTrayIconMixin
+from leap.baseapp.network import NetworkCheckerAppMixin
from leap.baseapp.leap_app import MainWindowMixin
+from leap.baseapp import dialogs
logger = logging.getLogger(name=__name__)
@@ -16,6 +18,7 @@ logger = logging.getLogger(name=__name__)
class LeapWindow(QtGui.QMainWindow,
MainWindowMixin, EIPConductorAppMixin,
StatusAwareTrayIconMixin,
+ NetworkCheckerAppMixin,
LogPaneMixin):
"""
main window for the leap app.
@@ -28,6 +31,7 @@ class LeapWindow(QtGui.QMainWindow,
statusChange = QtCore.pyqtSignal([object])
mainappReady = QtCore.pyqtSignal([])
initReady = QtCore.pyqtSignal([])
+ networkError = QtCore.pyqtSignal([object])
def __init__(self, opts):
logger.debug('init leap window')
@@ -38,6 +42,7 @@ class LeapWindow(QtGui.QMainWindow,
EIPConductorAppMixin.__init__(self, opts=opts)
StatusAwareTrayIconMixin.__init__(self)
+ NetworkCheckerAppMixin.__init__(self)
MainWindowMixin.__init__(self)
settings = QtCore.QSettings()
@@ -58,6 +63,8 @@ class LeapWindow(QtGui.QMainWindow,
lambda status: self.onStatusChange(status))
self.timer.timeout.connect(
lambda: self.onTimerTick())
+ self.networkError.connect(
+ lambda exc: self.onNetworkError(exc))
# do frwizard and init signals
self.mainappReady.connect(self.do_first_run_wizard_check)
@@ -93,5 +100,25 @@ class InitChecksThread(QtCore.QThread):
def run(self):
self.fun()
+#<<<<<<< HEAD
def begin(self):
self.start()
+#=======
+ # could send "ready" signal instead
+ # eipapp should catch that
+ #if self.conductor.autostart:
+ #self.start_or_stopVPN()
+#
+ #TODO: Put all Dialogs in one place
+ #@QtCore.pyqtSlot()
+ #def raise_Network_Error(self, exc):
+ #message = exc.message
+#
+ # XXX
+ # check headless = False before
+ # launching dialog.
+ # (so Qt tests can assert stuff)
+#
+ #dialog = dialogs.ErrorDialog()
+ #dialog.warningMessage(message, 'error')
+#>>>>>>> feature/network_check