summaryrefslogtreecommitdiff
path: root/src/leap/baseapp/network.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-12-17 05:05:37 +0900
committerkali <kali@leap.se>2012-12-17 05:05:37 +0900
commit89694babd14a9b2ba76095911b6884e359a12282 (patch)
treec80c8f458e94d137be20060820abc51a89099a0a /src/leap/baseapp/network.py
parent0c2275222cf77bf5975a25a75ab0e50ac752bc9e (diff)
network checker launched by signal
fixes problem with provider domain not being defined during first run.
Diffstat (limited to 'src/leap/baseapp/network.py')
-rw-r--r--src/leap/baseapp/network.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/leap/baseapp/network.py b/src/leap/baseapp/network.py
index 7363cfaa..a33265e5 100644
--- a/src/leap/baseapp/network.py
+++ b/src/leap/baseapp/network.py
@@ -9,23 +9,27 @@ from PyQt4 import QtCore
from leap.baseapp.dialogs import ErrorDialog
from leap.base.network import NetworkCheckerThread
+from leap.util.misc import null_check
+
class NetworkCheckerAppMixin(object):
"""
initialize an instance of the Network Checker,
which gathers error and passes them on.
"""
-
def __init__(self, *args, **kwargs):
provider = kwargs.pop('provider', None)
if provider:
self.init_network_checker(provider)
def init_network_checker(self, provider):
- self.network_checker = NetworkCheckerThread(
- error_cb=self.networkError.emit,
- debug=self.debugmode,
- provider=provider)
+ null_check(provider, "provider_domain")
+ if not hasattr(self, 'network_checker'):
+ self.network_checker = NetworkCheckerThread(
+ error_cb=self.networkError.emit,
+ debug=self.debugmode,
+ provider=provider)
+ self.network_checker.start()
@QtCore.pyqtSlot(object)
def runNetworkChecks(self):