def __init__(self): global wallet app = Application() window = MainWindow() window.move(QtGui.QApplication.desktop().screen().rect().center() - window.rect().center()) window.show() retcode = app.exec_() wallet.stop_all() sys.exit(retcode)
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)