From 3fd7b55de96484e02accb991fb2c0c3ce0aa9883 Mon Sep 17 00:00:00 2001 From: antialias Date: Tue, 25 Sep 2012 17:37:48 -0400 Subject: First check for threaded network checks. TODO: tests. --- src/leap/baseapp/mainwindow.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/leap/baseapp/mainwindow.py') diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py index 10b23d9a..7b2ecb1d 100644 --- a/src/leap/baseapp/mainwindow.py +++ b/src/leap/baseapp/mainwindow.py @@ -8,6 +8,7 @@ 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 logger = logging.getLogger(name=__name__) @@ -16,6 +17,7 @@ logger = logging.getLogger(name=__name__) class LeapWindow(QtGui.QMainWindow, MainWindowMixin, EIPConductorAppMixin, StatusAwareTrayIconMixin, + NetworkCheckerAppMixin, LogPaneMixin): """ main window for the leap app. @@ -36,6 +38,7 @@ class LeapWindow(QtGui.QMainWindow, self.createLogBrowser() EIPConductorAppMixin.__init__(self, opts=opts) StatusAwareTrayIconMixin.__init__(self) + NetworkCheckerAppMixin.__init__(self) MainWindowMixin.__init__(self) # bind signals -- cgit v1.2.3 From 95ce59c8833cb2ba951630080cdbc1e6d756a666 Mon Sep 17 00:00:00 2001 From: antialias Date: Mon, 1 Oct 2012 15:10:55 -0400 Subject: Still some QT related problems. Hand off to kali to fix. --- src/leap/baseapp/mainwindow.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/leap/baseapp/mainwindow.py') diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py index 7b2ecb1d..000db8c9 100644 --- a/src/leap/baseapp/mainwindow.py +++ b/src/leap/baseapp/mainwindow.py @@ -28,6 +28,7 @@ class LeapWindow(QtGui.QMainWindow, newLogLine = QtCore.pyqtSignal([str]) statusChange = QtCore.pyqtSignal([object]) + networkError = QtCore.pyqtSignal([object]) def __init__(self, opts): logger.debug('init leap window') @@ -57,3 +58,16 @@ class LeapWindow(QtGui.QMainWindow, # 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 = ErrorDialog() + dialog.warningMessage(message, 'error') -- cgit v1.2.3 From 31c0afa5eb9bc7566ca39099520e8adc7b531e22 Mon Sep 17 00:00:00 2001 From: kali Date: Fri, 5 Oct 2012 20:15:12 +0900 Subject: pep8 --- src/leap/baseapp/mainwindow.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/leap/baseapp/mainwindow.py') diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py index 000db8c9..e48666a4 100644 --- a/src/leap/baseapp/mainwindow.py +++ b/src/leap/baseapp/mainwindow.py @@ -10,6 +10,7 @@ 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__) @@ -68,6 +69,6 @@ class LeapWindow(QtGui.QMainWindow, # check headless = False before # launching dialog. # (so Qt tests can assert stuff) - - dialog = ErrorDialog() + + dialog = dialogs.ErrorDialog() dialog.warningMessage(message, 'error') -- cgit v1.2.3 From 6728eb9afb21bad867e4052a6190a9bdb34c928a Mon Sep 17 00:00:00 2001 From: kali Date: Mon, 8 Oct 2012 07:50:24 +0900 Subject: popup dialog error when network error happens we are shutting down for now. we should be acting upon failures in the near future. lowered the recurrent checks interval to 10 seconds. --- src/leap/baseapp/mainwindow.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/leap/baseapp/mainwindow.py') diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py index e48666a4..fdbaf693 100644 --- a/src/leap/baseapp/mainwindow.py +++ b/src/leap/baseapp/mainwindow.py @@ -52,6 +52,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)) # ... all ready. go! -- cgit v1.2.3