move files

This commit is contained in:
WorldTeacher
2024-05-16 15:33:17 +02:00
parent ef5f862a2b
commit d2b4a24c05
44 changed files with 538 additions and 711 deletions

View File

@@ -4,7 +4,7 @@ import sys
from omegaconf import OmegaConf
from PyQt6 import QtCore, QtGui, QtWidgets
from src.ui.dialogs.Ui_mail_preview import Ui_eMailPreview as Ui_Dialog
from .dialog_sources.Ui_mail_preview import Ui_eMailPreview as Ui_Dialog
config = OmegaConf.load("config.yaml")
@@ -18,7 +18,7 @@ class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
prof_name,
prof_mail,
parent=None,
default_mail="Information zum Semesterapparat {AppNr} - {AppName}.eml",
default_mail="Information zum Semesterapparat",
):
super().__init__(parent)
self.setupUi(
@@ -39,14 +39,7 @@ class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
self.mail_name.setText(self.prof_mail)
self.load_mail_templates()
# if none of the radio buttons is checked, disable the accept button of the dialog
if (
self.gender_female.isChecked()
or self.gender_male.isChecked()
or self.gender_male.isChecked()
):
self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setEnabled(True)
else:
self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setEnabled(False)
self.btn_okay.setEnabled(False)
if default_mail is not None:
# get the nearest match to the default mail
@@ -78,10 +71,13 @@ class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
def get_greeting(self):
prof = self.profname
if self.gender_male.isChecked():
self.btn_okay.setEnabled(True)
return f"Sehr geehrter Herr {prof.split(' ')[-1]},"
elif self.gender_female.isChecked():
self.btn_okay.setEnabled(True)
return f"Sehr geehrte Frau {prof.split(' ')[-1]},"
elif self.gender_non.isChecked():
self.btn_okay.setEnabled(True)
return f"Guten Tag {prof},"
def set_mail(self):
@@ -108,7 +104,6 @@ class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
)
self.mail_body.setHtml(mail_html)
self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setEnabled(True)
def createAndSendMail(self):
import smtplib
@@ -184,14 +179,3 @@ if __name__ == "__main__":
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec())