start singleAPIThread only when apienabled = true

This commit is contained in:
Jonathan Warren 2013-03-22 12:34:12 -04:00
parent 3f6142ba31
commit 05b55c799f

View File

@ -4134,9 +4134,6 @@ class MyForm(QtGui.QMainWindow):
QtCore.QObject.connect(self.workerThread, QtCore.SIGNAL("updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject)"), self.updateSentItemStatusByAckdata) QtCore.QObject.connect(self.workerThread, QtCore.SIGNAL("updateSentItemStatusByAckdata(PyQt_PyObject,PyQt_PyObject)"), self.updateSentItemStatusByAckdata)
QtCore.QObject.connect(self.workerThread, QtCore.SIGNAL("updateStatusBar(PyQt_PyObject)"), self.updateStatusBar) QtCore.QObject.connect(self.workerThread, QtCore.SIGNAL("updateStatusBar(PyQt_PyObject)"), self.updateStatusBar)
self.singleAPIThread = singleAPI()
self.singleAPIThread.start()
if safeConfigGetBoolean('bitmessagesettings','apienabled'): if safeConfigGetBoolean('bitmessagesettings','apienabled'):
try: try:
apiNotifyPath = config.get('bitmessagesettings','apinotifypath') apiNotifyPath = config.get('bitmessagesettings','apinotifypath')
@ -4147,6 +4144,8 @@ class MyForm(QtGui.QMainWindow):
print 'Trying to call', apiNotifyPath print 'Trying to call', apiNotifyPath
printLock.release() printLock.release()
call([apiNotifyPath, "startingUp"]) call([apiNotifyPath, "startingUp"])
self.singleAPIThread = singleAPI()
self.singleAPIThread.start()
self.singleAPISignalHandlerThread = singleAPISignalHandler() self.singleAPISignalHandlerThread = singleAPISignalHandler()
self.singleAPISignalHandlerThread.start() self.singleAPISignalHandlerThread.start()
QtCore.QObject.connect(self.singleAPISignalHandlerThread, QtCore.SIGNAL("updateStatusBar(PyQt_PyObject)"), self.updateStatusBar) QtCore.QObject.connect(self.singleAPISignalHandlerThread, QtCore.SIGNAL("updateStatusBar(PyQt_PyObject)"), self.updateStatusBar)