feat: add option to change shortcuts, set return modes

This commit is contained in:
WorldTeacher
2024-09-30 11:21:26 +02:00
parent 114d6fb1ca
commit 4164da4f55
7 changed files with 303 additions and 191 deletions

View File

@@ -12,7 +12,7 @@ from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(492, 306)
Dialog.resize(492, 445)
self.formLayout = QtWidgets.QFormLayout(Dialog)
self.formLayout.setObjectName("formLayout")
self.label = QtWidgets.QLabel(parent=Dialog)
@@ -21,6 +21,39 @@ class Ui_Dialog(object):
self.institution_name = QtWidgets.QLineEdit(parent=Dialog)
self.institution_name.setObjectName("institution_name")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.institution_name)
self.label_2 = QtWidgets.QLabel(parent=Dialog)
self.label_2.setObjectName("label_2")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.default_loan_duration = QtWidgets.QSpinBox(parent=Dialog)
self.default_loan_duration.setProperty("value", 7)
self.default_loan_duration.setObjectName("default_loan_duration")
self.horizontalLayout_2.addWidget(self.default_loan_duration)
self.label_13 = QtWidgets.QLabel(parent=Dialog)
self.label_13.setMaximumSize(QtCore.QSize(43, 16777215))
self.label_13.setObjectName("label_13")
self.horizontalLayout_2.addWidget(self.label_13)
self.formLayout.setLayout(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_2)
self.label_7 = QtWidgets.QLabel(parent=Dialog)
self.label_7.setObjectName("label_7")
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_7)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.delete_inactive_user_duration = QtWidgets.QSpinBox(parent=Dialog)
self.delete_inactive_user_duration.setMaximum(9999)
self.delete_inactive_user_duration.setProperty("value", 365)
self.delete_inactive_user_duration.setObjectName("delete_inactive_user_duration")
self.horizontalLayout.addWidget(self.delete_inactive_user_duration)
self.label_12 = QtWidgets.QLabel(parent=Dialog)
self.label_12.setMaximumSize(QtCore.QSize(43, 16777215))
self.label_12.setObjectName("label_12")
self.horizontalLayout.addWidget(self.label_12)
self.formLayout.setLayout(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout)
self.returnMode = QtWidgets.QCheckBox(parent=Dialog)
self.returnMode.setTristate(False)
self.returnMode.setObjectName("returnMode")
self.formLayout.setWidget(4, QtWidgets.QFormLayout.ItemRole.FieldRole, self.returnMode)
self.label_3 = QtWidgets.QLabel(parent=Dialog)
self.label_3.setObjectName("label_3")
self.formLayout.setWidget(5, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_3)
@@ -54,11 +87,6 @@ class Ui_Dialog(object):
self.btn_select_database_backupLocation.setObjectName("btn_select_database_backupLocation")
self.databasesettings.addWidget(self.btn_select_database_backupLocation, 2, 2, 1, 1)
self.formLayout.setLayout(5, QtWidgets.QFormLayout.ItemRole.FieldRole, self.databasesettings)
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Discard|QtWidgets.QDialogButtonBox.StandardButton.Ok)
self.buttonBox.setObjectName("buttonBox")
self.formLayout.setWidget(7, QtWidgets.QFormLayout.ItemRole.FieldRole, self.buttonBox)
self.label_9 = QtWidgets.QLabel(parent=Dialog)
self.label_9.setObjectName("label_9")
self.formLayout.setWidget(6, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_9)
@@ -92,35 +120,31 @@ class Ui_Dialog(object):
self.report_day.addItem("")
self.gridLayout.addWidget(self.report_day, 0, 1, 1, 1)
self.formLayout.setLayout(6, QtWidgets.QFormLayout.ItemRole.FieldRole, self.gridLayout)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.delete_inactive_user_duration = QtWidgets.QSpinBox(parent=Dialog)
self.delete_inactive_user_duration.setMaximum(9999)
self.delete_inactive_user_duration.setProperty("value", 365)
self.delete_inactive_user_duration.setObjectName("delete_inactive_user_duration")
self.horizontalLayout.addWidget(self.delete_inactive_user_duration)
self.label_12 = QtWidgets.QLabel(parent=Dialog)
self.label_12.setMaximumSize(QtCore.QSize(43, 16777215))
self.label_12.setObjectName("label_12")
self.horizontalLayout.addWidget(self.label_12)
self.formLayout.setLayout(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout)
self.label_7 = QtWidgets.QLabel(parent=Dialog)
self.label_7.setObjectName("label_7")
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_7)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.default_loan_duration = QtWidgets.QSpinBox(parent=Dialog)
self.default_loan_duration.setProperty("value", 7)
self.default_loan_duration.setObjectName("default_loan_duration")
self.horizontalLayout_2.addWidget(self.default_loan_duration)
self.label_13 = QtWidgets.QLabel(parent=Dialog)
self.label_13.setMaximumSize(QtCore.QSize(43, 16777215))
self.label_13.setObjectName("label_13")
self.horizontalLayout_2.addWidget(self.label_13)
self.formLayout.setLayout(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_2)
self.label_2 = QtWidgets.QLabel(parent=Dialog)
self.label_2.setObjectName("label_2")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2)
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Discard|QtWidgets.QDialogButtonBox.StandardButton.Ok)
self.buttonBox.setObjectName("buttonBox")
self.formLayout.setWidget(9, QtWidgets.QFormLayout.ItemRole.FieldRole, self.buttonBox)
self.shortcutchanger = QtWidgets.QTableWidget(parent=Dialog)
self.shortcutchanger.setObjectName("shortcutchanger")
self.shortcutchanger.setColumnCount(3)
self.shortcutchanger.setRowCount(0)
item = QtWidgets.QTableWidgetItem()
self.shortcutchanger.setHorizontalHeaderItem(0, item)
item = QtWidgets.QTableWidgetItem()
self.shortcutchanger.setHorizontalHeaderItem(1, item)
item = QtWidgets.QTableWidgetItem()
self.shortcutchanger.setHorizontalHeaderItem(2, item)
self.formLayout.setWidget(8, QtWidgets.QFormLayout.ItemRole.FieldRole, self.shortcutchanger)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.label_14 = QtWidgets.QLabel(parent=Dialog)
self.label_14.setObjectName("label_14")
self.verticalLayout.addWidget(self.label_14)
self.label_15 = QtWidgets.QLabel(parent=Dialog)
self.label_15.setObjectName("label_15")
self.verticalLayout.addWidget(self.label_15)
self.formLayout.setLayout(8, QtWidgets.QFormLayout.ItemRole.LabelRole, self.verticalLayout)
self.retranslateUi(Dialog)
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
@@ -137,6 +161,13 @@ class Ui_Dialog(object):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
self.label.setText(_translate("Dialog", "Name der Einrichtung"))
self.label_2.setText(_translate("Dialog", "Leihdauer"))
self.label_13.setText(_translate("Dialog", "Tage(n)"))
self.label_7.setText(_translate("Dialog", "Inaktive Nutzer\n"
"Löschen nach"))
self.label_12.setText(_translate("Dialog", "Tage(n)"))
self.returnMode.setToolTip(_translate("Dialog", "Wenn aktiv: Wenn ein Medium zurückgegeben wird, wird die nächste Aktion des Moduswechsels zum normalen Rückgabemodus führen"))
self.returnMode.setText(_translate("Dialog", "Erweiterter Rückgabemodus"))
self.label_3.setText(_translate("Dialog", "Datenbank"))
self.label_4.setText(_translate("Dialog", "Speicherort"))
self.label_6.setText(_translate("Dialog", "Sicherungspfad"))
@@ -154,8 +185,12 @@ class Ui_Dialog(object):
self.report_day.setItemText(2, _translate("Dialog", "Mittwoch"))
self.report_day.setItemText(3, _translate("Dialog", "Donnerstag"))
self.report_day.setItemText(4, _translate("Dialog", "Freitag"))
self.label_12.setText(_translate("Dialog", "Tage(n)"))
self.label_7.setText(_translate("Dialog", "Inaktive Nutzer\n"
"Löschen nach"))
self.label_13.setText(_translate("Dialog", "Tage(n)"))
self.label_2.setText(_translate("Dialog", "Leihdauer"))
item = self.shortcutchanger.horizontalHeaderItem(0)
item.setText(_translate("Dialog", "Name"))
item = self.shortcutchanger.horizontalHeaderItem(1)
item.setText(_translate("Dialog", "Standard"))
item = self.shortcutchanger.horizontalHeaderItem(2)
item.setText(_translate("Dialog", "Aktuell"))
self.label_14.setText(_translate("Dialog", "Shortcuts"))
self.label_15.setText(_translate("Dialog", "(Erst nach Neustart\n"
"wirksam)"))