make documentation toggleable by settings.yaml / cli
This commit is contained in:
@@ -87,6 +87,7 @@ class MainUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
self.activeUser = None
|
self.activeUser = None
|
||||||
self.activeState = "Rückgabe"
|
self.activeState = "Rückgabe"
|
||||||
self.docu = DocumentationThread()
|
self.docu = DocumentationThread()
|
||||||
|
if config.documentation:
|
||||||
self.docu.start()
|
self.docu.start()
|
||||||
|
|
||||||
self.duedate.setDate(loanDate)
|
self.duedate.setDate(loanDate)
|
||||||
@@ -102,6 +103,7 @@ class MainUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
def shutdown(self, *args):
|
def shutdown(self, *args):
|
||||||
#kill documentation thread
|
#kill documentation thread
|
||||||
log.info("Shutting down")
|
log.info("Shutting down")
|
||||||
|
if config.documentation:
|
||||||
self.docu.terminate()
|
self.docu.terminate()
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
@@ -139,6 +141,7 @@ class MainUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
settings = Settings()
|
settings = Settings()
|
||||||
settings.exec()
|
settings.exec()
|
||||||
result = settings.result()
|
result = settings.result()
|
||||||
|
print(settings.settingschanged, settings.restart_required)
|
||||||
if result == 1:
|
if result == 1:
|
||||||
#dialog to ask if program should be restarted
|
#dialog to ask if program should be restarted
|
||||||
dialog = QtWidgets.QMessageBox()
|
dialog = QtWidgets.QMessageBox()
|
||||||
@@ -165,7 +168,15 @@ class MainUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
def openDocumentation(self):
|
def openDocumentation(self):
|
||||||
log.info("Opening Documentation")
|
log.info("Opening Documentation")
|
||||||
|
if config.documentation:
|
||||||
webbrowser.open("http://localhost:{}/".format(docport))
|
webbrowser.open("http://localhost:{}/".format(docport))
|
||||||
|
else:
|
||||||
|
dialog = QtWidgets.QMessageBox()
|
||||||
|
dialog.setWindowTitle("Dokumentation nicht verfügbar")
|
||||||
|
dialog.setIcon(QtWidgets.QMessageBox.Icon.Warning)
|
||||||
|
dialog.setWindowIcon(Icon("warning").icon)
|
||||||
|
dialog.setText("Dokumentation nicht verfügbar")
|
||||||
|
dialog.exec()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user