ui changes
This commit is contained in:
@@ -632,12 +632,14 @@ class Ui_MainWindow(object):
|
||||
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
|
||||
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.horizontalLayoutWidget)
|
||||
self.verticalLayout_5.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_5.setSpacing(0)
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
self.steps = QtWidgets.QFrame(parent=self.horizontalLayoutWidget)
|
||||
self.steps.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.steps.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.steps.setObjectName("steps")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.steps)
|
||||
self.verticalLayout_3.setSpacing(0)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(parent=self.steps)
|
||||
self.groupBox_2.setEnabled(True)
|
||||
@@ -647,6 +649,7 @@ class Ui_MainWindow(object):
|
||||
sizePolicy.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth())
|
||||
self.groupBox_2.setSizePolicy(sizePolicy)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(11)
|
||||
font.setBold(True)
|
||||
self.groupBox_2.setFont(font)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
@@ -684,6 +687,7 @@ class Ui_MainWindow(object):
|
||||
sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth())
|
||||
self.groupBox.setSizePolicy(sizePolicy)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(11)
|
||||
font.setBold(True)
|
||||
self.groupBox.setFont(font)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
|
||||
@@ -3,7 +3,7 @@ from PyQt6 import QtCore, QtWidgets
|
||||
from src.logic.dataclass import BookData
|
||||
|
||||
from .dialog_sources.Ui_edit_bookdata import Ui_Dialog
|
||||
|
||||
from src import Icon
|
||||
|
||||
class BookDataUI(QtWidgets.QDialog, Ui_Dialog):
|
||||
def __init__(self, parent=None):
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Geschlecht</string>
|
||||
<string>Anrede</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -50,7 +50,7 @@ class MailTemplateDialog(QtWidgets.QDialog, NewMailTemplateDesignerDialog):
|
||||
dialog.setWindowIcon(Icon("save").icon)
|
||||
save = dialog.exec()
|
||||
template_name = dialog.textValue()
|
||||
if template_name != "":
|
||||
if template_name != "" and save == 1:
|
||||
template = template_name + ".eml"
|
||||
if template in os.listdir("mail_vorlagen"):
|
||||
# warning dialog
|
||||
@@ -69,9 +69,6 @@ class MailTemplateDialog(QtWidgets.QDialog, NewMailTemplateDesignerDialog):
|
||||
ret = dialog.exec()
|
||||
if ret == QtWidgets.QMessageBox.StandardButton.No:
|
||||
return
|
||||
|
||||
if save == 1:
|
||||
|
||||
mail = f"""Subject: {self.subject.text()}
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/html; charset="UTF-8"
|
||||
@@ -201,7 +198,7 @@ Content-Transfer-Encoding: 8bit
|
||||
# warning dialog
|
||||
Icon("template_fail", self.testTemplate)
|
||||
dialog = QtWidgets.QMessageBox()
|
||||
Icon("warning", dialog)
|
||||
dialog.setWindowIcon(Icon("warning").icon)
|
||||
|
||||
dialog.setText("Folgende Platzhalter fehlen im Template:")
|
||||
|
||||
|
||||
@@ -1622,6 +1622,9 @@
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="steps">
|
||||
<property name="frameShape">
|
||||
@@ -1631,6 +1634,9 @@
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="enabled">
|
||||
@@ -1644,6 +1650,7 @@
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
@@ -1712,6 +1719,7 @@
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
||||
@@ -1366,23 +1366,6 @@ class Ui(Ui_Semesterapparat):
|
||||
self.calendarWidget.updateCells()
|
||||
|
||||
def open_reminder(self):
|
||||
# def __update_message():
|
||||
# message_select = self.spin_select_message.value()
|
||||
# try:
|
||||
# message = messages[message_select - 1]
|
||||
# except IndexError:
|
||||
# self.message_frame.hide()
|
||||
# return
|
||||
# self.message_box.setText(message["message"])
|
||||
# appnr = message["appnr"]
|
||||
# appnr = "/" if appnr is None else str(appnr)
|
||||
# self.line_app_info.setText(appnr)
|
||||
|
||||
def __delete_message(id):
|
||||
# print("trying to delete message", id)
|
||||
self.db.deleteMessage(id)
|
||||
#
|
||||
|
||||
selected_date = self.calendarWidget.selectedDate().toString("yyyy-MM-dd")
|
||||
# # print(selected_date)
|
||||
messages = self.db.getMessages(selected_date)
|
||||
@@ -1417,17 +1400,106 @@ class Ui(Ui_Semesterapparat):
|
||||
|
||||
def media_context_menu(self, position):
|
||||
menu = QtWidgets.QMenu()
|
||||
delete_action = menu.addAction("Löschen")
|
||||
edit_action = menu.addAction("Bearbeiten")
|
||||
apparat_add_action = menu.addAction("Zum Apparat hinzufügen")
|
||||
menu.addAction(delete_action)
|
||||
menu.addAction(edit_action)
|
||||
menu.addAction(apparat_add_action)
|
||||
|
||||
delete_action = QtGui.QAction("Löschen")
|
||||
edit_action = QtGui.QAction("Bearbeiten")
|
||||
apparat_add_action = QtGui.QAction("Zum Apparat hinzufügen")
|
||||
apparat_move_action = QtGui.QAction("In Apparat verschieben")
|
||||
apparat_copy_action = QtGui.QAction("In Apparat kopieren")
|
||||
|
||||
apparatmenu = menu.addMenu("Apparate")
|
||||
generalmenu = menu.addMenu("Allgemeines")
|
||||
apparatmenu.addActions(
|
||||
[apparat_add_action, apparat_copy_action, apparat_move_action]
|
||||
)
|
||||
generalmenu.addActions([edit_action, delete_action])
|
||||
# disable apparat_add_action
|
||||
apparat_add_action.setEnabled(False)
|
||||
delete_action.triggered.connect(self.delete_medium)
|
||||
edit_action.triggered.connect(self.edit_medium)
|
||||
apparat_add_action.triggered.connect(self.add_to_apparat)
|
||||
apparat_copy_action.triggered.connect(self.copy_to_apparat)
|
||||
apparat_move_action.triggered.connect(self.move_to_apparat)
|
||||
menu.exec(self.tableWidget_apparat_media.mapToGlobal(position))
|
||||
|
||||
def copy_to_apparat(self):
|
||||
selected_rows = self.tableWidget_apparat_media.selectionModel().selectedRows()
|
||||
signatures = []
|
||||
for row in selected_rows:
|
||||
signature = self.tableWidget_apparat_media.item(row.row(), 1).text()
|
||||
book_id = self.db.getBookIdBasedOnSignature(
|
||||
self.active_apparat,
|
||||
self.db.getProfId(self.profdata),
|
||||
signature,
|
||||
)
|
||||
signatures.append(book_id)
|
||||
result, apparat = self.confirm_action_dialog(
|
||||
"In welchen Apparat sollen die Medien kopiert werden?"
|
||||
)
|
||||
if result == 1:
|
||||
for book_id in signatures:
|
||||
self.db.copyBookToApparat(book_id, apparat)
|
||||
else:
|
||||
return
|
||||
|
||||
def move_to_apparat(self):
|
||||
selected_rows = self.tableWidget_apparat_media.selectionModel().selectedRows()
|
||||
signatures = []
|
||||
for row in selected_rows:
|
||||
signature = self.tableWidget_apparat_media.item(row.row(), 1).text()
|
||||
book_id = self.db.getBookIdBasedOnSignature(
|
||||
self.active_apparat,
|
||||
self.db.getProfId(self.profdata),
|
||||
signature,
|
||||
)
|
||||
signatures.append(book_id)
|
||||
result, apparat = self.confirm_action_dialog(
|
||||
"In welchen Apparat sollen die Medien verschoben werden?"
|
||||
)
|
||||
if result == 1:
|
||||
for book_id in signatures:
|
||||
self.db.moveBookToApparat(book_id, apparat)
|
||||
self.update_app_media_list()
|
||||
else:
|
||||
return
|
||||
|
||||
def confirm_action_dialog(self, message, title="Bestätigung"):
|
||||
appnrs = self.db.getUnavailableApparatNumbers()
|
||||
appnrs = [str(i) for i in appnrs]
|
||||
appnrs.remove(self.active_apparat)
|
||||
if len(appnrs) == 0:
|
||||
# create a warning dialog, saying no apparats present
|
||||
self.confirm_popup("Keine weiteren Apparate vorhanden", title="Fehler")
|
||||
return (None, None)
|
||||
dialog = QtWidgets.QDialog()
|
||||
dialog.setWindowTitle(title)
|
||||
# add a label to the dialog
|
||||
label = QtWidgets.QLabel()
|
||||
label.setText(message)
|
||||
# add a combobox to the dialog
|
||||
drpdwn = QtWidgets.QComboBox()
|
||||
drpdwn.addItems(appnrs)
|
||||
drpdwn.addItem("")
|
||||
|
||||
# set layout of dialog
|
||||
layout = QtWidgets.QVBoxLayout()
|
||||
layout.addWidget(label)
|
||||
layout.addWidget(drpdwn)
|
||||
|
||||
# add buttons
|
||||
okay_button = QtWidgets.QPushButton("Okay")
|
||||
cancel_button = QtWidgets.QPushButton("Abbrechen")
|
||||
layout.addWidget(okay_button)
|
||||
layout.addWidget(cancel_button)
|
||||
okay_button.clicked.connect(dialog.accept)
|
||||
cancel_button.clicked.connect(dialog.reject)
|
||||
|
||||
dialog.setLayout(layout)
|
||||
|
||||
return dialog.exec(), self.db.getApparatId(
|
||||
self.db.getApparatNameByAppNr(drpdwn.currentText())
|
||||
)
|
||||
|
||||
def add_to_apparat(self):
|
||||
"""use playwright in background to add medium to apparat"""
|
||||
signature = self.tableWidget_apparat_media.item(
|
||||
@@ -1457,6 +1529,7 @@ class Ui(Ui_Semesterapparat):
|
||||
widget = QtWidgets.QDialog()
|
||||
bookedit = edit_bookdata_ui()
|
||||
bookedit.setupUi(widget)
|
||||
widget.setWindowIcon(Icon("settings").icon)
|
||||
# change title of dialog
|
||||
widget.setWindowTitle("Metadaten")
|
||||
bookedit.populate_fields(data)
|
||||
|
||||
Reference in New Issue
Block a user