make documentation toggleable by settings.yaml / cli
This commit is contained in:
@@ -87,7 +87,8 @@ class MainUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self.activeUser = None
|
||||
self.activeState = "Rückgabe"
|
||||
self.docu = DocumentationThread()
|
||||
self.docu.start()
|
||||
if config.documentation:
|
||||
self.docu.start()
|
||||
|
||||
self.duedate.setDate(loanDate)
|
||||
# functions
|
||||
@@ -102,7 +103,8 @@ class MainUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
def shutdown(self, *args):
|
||||
#kill documentation thread
|
||||
log.info("Shutting down")
|
||||
self.docu.terminate()
|
||||
if config.documentation:
|
||||
self.docu.terminate()
|
||||
sys.exit()
|
||||
|
||||
|
||||
@@ -139,6 +141,7 @@ class MainUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
settings = Settings()
|
||||
settings.exec()
|
||||
result = settings.result()
|
||||
print(settings.settingschanged, settings.restart_required)
|
||||
if result == 1:
|
||||
#dialog to ask if program should be restarted
|
||||
dialog = QtWidgets.QMessageBox()
|
||||
@@ -165,7 +168,15 @@ class MainUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
def openDocumentation(self):
|
||||
log.info("Opening Documentation")
|
||||
webbrowser.open("http://localhost:{}/".format(docport))
|
||||
if config.documentation:
|
||||
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