def __init__(self): global wallet app = Application() if wallet.connected(): window = MainWindow() center = QtGui.QApplication.desktop().screen().rect().center() window.move(center - window.rect().center()) window.show() else: # not connected msg = "Couldn't connect to server!" QtGui.QMessageBox.critical(None, '', msg, QtGui.QMessageBox.Ok) return retcode = app.exec_() wallet.stop_all() sys.exit(retcode)
def updateStatus(self): self.setStatus(wallet.connected())