Beispiel #1
0
 def openSettings(self):
     s = QtGui.qApp.settings
     dlg = SettingsDialog(s)
     if dlg.exec_() != SettingsDialog.Accepted:
         return
     ns = dlg.getData()
     if ns.connection != s.connection:
         msg = 'Server connection changed, you should restart to reflect changes'
         QMessageBox.information(self, 'Major changes', msg)
     elif ns.camera_type != s.camera_type:
         msg = 'Camera Type Changed, you should restart to reflect changes'
         QMessageBox.information(self, 'Major changes', msg)
     QtGui.qApp.settings = ns
     QtGui.qApp.saveConfig()
Beispiel #2
0
    logo = QPixmap('./ui/png/tasklogo.png')
    app.setWindowIcon(QIcon(logo))

    style = qdarkstyle.load_stylesheet()
    app.setStyleSheet(style)

    try:
        lbl = _show_splash_screen()
        istgutgelaufen = True
        app.loadConfig()
        app.connectServer()
    except Exception as ex:
        istgutgelaufen = False
        QMessageBox.critical(None, "ma", str(ex))
    finally:
        lbl.hide()

    if istgutgelaufen:
        app.mainWindow = MainWindow()
        app.mainWindow.show()
        app.exec_()
        app.closeConnection()
    else:
        # wenns nicht gut geht, dialog auftun, dass man connection aendern kann
        dlg = SettingsDialog(app.settings)
        dlg.show()
        app.exec_()
        if dlg.result() == SettingsDialog.Accepted:
            app.settings = dlg.getData()
            app.saveConfig()