From dc10833bedcdecf081a7c79678614c5521445164 Mon Sep 17 00:00:00 2001 From: antialias Date: Wed, 22 Aug 2012 19:47:41 -0700 Subject: grabs a definition.json file if one isn't present. includes some basic error handling and tests. uses the requests library for network interactions and mocks for simulating network states. --- src/leap/baseapp/mainwindow.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/leap/baseapp') diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py index bc844437..912a51b6 100644 --- a/src/leap/baseapp/mainwindow.py +++ b/src/leap/baseapp/mainwindow.py @@ -11,6 +11,8 @@ from PyQt4.QtGui import (QMainWindow, QWidget, QVBoxLayout, QMessageBox, QTextBrowser, qApp) from PyQt4.QtCore import (pyqtSlot, pyqtSignal, QTimer) +from leap.base.configuration import Configuration + from leap.baseapp.dialogs import ErrorDialog from leap.eip import exceptions as eip_exceptions @@ -18,6 +20,9 @@ from leap.eip.eipconnection import EIPConnection from leap.gui import mainwindow_rc +#TODO: Get rid of this and do something clever +DEFAULT_PROVIDER_URL = "http://localhost/definition.json" + class LeapWindow(QMainWindow): #XXX tbd: refactor into model / view / controller @@ -30,6 +35,8 @@ class LeapWindow(QMainWindow): super(LeapWindow, self).__init__() self.debugmode = getattr(opts, 'debug', False) + self.configuration = Configuration() + self.vpn_service_started = False self.createWindowHeader() @@ -81,6 +88,12 @@ class LeapWindow(QMainWindow): # bunch of self checks. # XXX move somewhere else alltogether. # + if self.configuration.error is True: + dialog = ErrorDialog() + dialog.criticalMessage( + 'There is a problem with the default ' + 'definition.json file', + 'error') if self.conductor.missing_provider is True: dialog = ErrorDialog() -- cgit v1.2.3