threads __init__, pyside6->pyqt6

This commit is contained in:
WorldTeacher
2024-05-07 15:33:35 +02:00
parent 24eefd9473
commit e999c51863
34 changed files with 972 additions and 985 deletions

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\plotdata.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtWidgets
from PyQt6 import QtCore, QtWidgets
class Ui_MainWindow(object):

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\setupwizard.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Wizard(object):
@@ -54,18 +54,34 @@ class Ui_Wizard(object):
def retranslateUi(self, Wizard):
_translate = QtCore.QCoreApplication.translate
Wizard.setWindowTitle(_translate("Wizard", "Wizard"))
self.textBrowser.setHtml(_translate("Wizard", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Setup für das Semesterapparatsprogram.</p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Im Anschluss werden wichtige Einstellungen gesetzt, welche auch im späteren Verlauf verändert werden können.</p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>"))
self.textBrowser.setHtml(
_translate(
"Wizard",
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">\n'
'<html><head><meta name="qrichtext" content="1" /><style type="text/css">\n'
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Setup für das Semesterapparatsprogram.</p>\n'
'<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>\n'
'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Im Anschluss werden wichtige Einstellungen gesetzt, welche auch im späteren Verlauf verändert werden können.</p>\n'
'<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>',
)
)
self.label.setText(_translate("Wizard", "Grundeinstellungen"))
self.label_2.setToolTip(_translate("Wizard", "Opens the downloaded files with the default applications set in the OS"))
self.label_2.setToolTip(
_translate(
"Wizard",
"Opens the downloaded files with the default applications set in the OS",
)
)
self.label_2.setText(_translate("Wizard", "Default Apps"))
self.label_3.setToolTip(_translate("Wizard", "Path where the downloaded files are stored. Defaults to ~/Desktop/SemapFiles"))
self.label_3.setToolTip(
_translate(
"Wizard",
"Path where the downloaded files are stored. Defaults to ~/Desktop/SemapFiles",
)
)
self.label_3.setText(_translate("Wizard", "Save Path"))
self.save_path.setPlaceholderText(_translate("Wizard", "~/Desktop/SemapFiles"))
self.btn_save_path_select.setText(_translate("Wizard", "..."))

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\edit_bookdata.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
from src.logic.dataclass import BookData

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\fileparser.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
from src.logic.webrequest import BibTextTransformer, WebRequest

View File

@@ -1,6 +1,6 @@
# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/dialogs/login.ui'
#
# Created by: PySide6 UI code generator 6.5.3
# Created by: PyQt6 UI code generator 6.5.3
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
@@ -8,10 +8,11 @@
import hashlib
from PySide6 import QtCore, QtWidgets
from PyQt6 import QtCore, QtWidgets
from src.backend.database import Database
from src.backend.admin_console import AdminCommands
from src.backend.database import Database
class Ui_Dialog(object):
def setupUi(self, Dialog):
@@ -66,11 +67,9 @@ class Ui_Dialog(object):
password = self.lineEdit_2.text()
print(type(username), password)
# Assuming 'Database' is a class to interact with your database
db = Database()
db = Database()
hashed_password = hashlib.sha256(
password.encode()
).hexdigest()
hashed_password = hashlib.sha256(password.encode()).hexdigest()
if len(db.getUsers()) == 0:
AdminCommands().create_admin()
self.lresult = 1 # Indicate successful login
@@ -110,3 +109,5 @@ if __name__ == "__main__":
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec())

View File

@@ -1,37 +1,42 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\mail_preview.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
import subprocess
import tempfile
import os
import re
import subprocess
import tempfile
from omegaconf import OmegaConf
from PyQt6 import QtCore, QtGui, QtWidgets
config = OmegaConf.load("config.yaml")
class Ui_eMailPreview(object):
def setupUi(
self,
eMailPreview,
app_id="",
app_name="",
app_subject="",
prof_name="",
data=None,
# app_id,
# app_name,
# app_subject,
# prof_name,
# prof_mail,
):
eMailPreview.setObjectName("eMailPreview")
eMailPreview.resize(676, 676)
self.buttonBox = QtWidgets.QDialogButtonBox(eMailPreview)
self.buttonBox.setGeometry(QtCore.QRect(310, 630, 341, 32))
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
self.buttonBox.setStandardButtons(
QtWidgets.QDialogButtonBox.StandardButton.Cancel
| QtWidgets.QDialogButtonBox.StandardButton.Ok
)
self.buttonBox.setObjectName("buttonBox")
self.gridLayoutWidget = QtWidgets.QWidget(eMailPreview)
self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 10, 661, 621))
@@ -46,7 +51,11 @@ class Ui_eMailPreview(object):
self.prof_name.setObjectName("prof_name")
self.gridLayout.addWidget(self.prof_name, 2, 2, 1, 1)
self.label_3 = QtWidgets.QLabel(self.gridLayoutWidget)
self.label_3.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignTop)
self.label_3.setAlignment(
QtCore.Qt.AlignmentFlag.AlignLeading
| QtCore.Qt.AlignmentFlag.AlignLeft
| QtCore.Qt.AlignmentFlag.AlignTop
)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 5, 0, 1, 1)
self.mail_name = QtWidgets.QLineEdit(self.gridLayoutWidget)
@@ -81,7 +90,12 @@ class Ui_eMailPreview(object):
self.gender_non = QtWidgets.QRadioButton(self.gridLayoutWidget)
self.gender_non.setObjectName("gender_non")
self.horizontalLayout_3.addWidget(self.gender_non)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
spacerItem = QtWidgets.QSpacerItem(
40,
20,
QtWidgets.QSizePolicy.Policy.Expanding,
QtWidgets.QSizePolicy.Policy.Minimum,
)
self.horizontalLayout_3.addItem(spacerItem)
self.gridLayout.addLayout(self.horizontalLayout_3, 4, 2, 1, 1)
self.label_6 = QtWidgets.QLabel(self.gridLayoutWidget)
@@ -89,23 +103,23 @@ class Ui_eMailPreview(object):
self.gridLayout.addWidget(self.label_6, 4, 0, 1, 1)
self.retranslateUi(eMailPreview)
self.buttonBox.accepted.connect(eMailPreview.accept) # type: ignore
self.buttonBox.rejected.connect(eMailPreview.reject) # type: ignore
self.buttonBox.accepted.connect(eMailPreview.accept) # type: ignore
self.buttonBox.rejected.connect(eMailPreview.reject) # type: ignore
QtCore.QMetaObject.connectSlotsByName(eMailPreview)
self._appid = app_id
self._appname = app_name
self._subject = app_subject
self.prof_name.setText(prof_name)
self._mail_data = ""
self._data = data
self.load_mail_templates()
# self._appid = app_id
# self._appname = app_name
# self._subject = app_subject
# self.prof_name.setText(prof_name)
# self._mail_data = ""
# self._prof_mail = prof_mail
# self.load_mail_templates()
self.comboBox.addItem("")
self.comboBox.setCurrentText("")
self.buttonBox.accepted.connect(self.save_mail)
self.comboBox.currentIndexChanged.connect(self.set_mail)
self.gender_female.clicked.connect(self.set_mail)
self.gender_male.clicked.connect(self.set_mail)
self.gender_non.clicked.connect(self.set_mail)
# self.buttonBox.accepted.connect(self.save_mail)
# self.comboBox.currentIndexChanged.connect(self.set_mail)
# self.gender_female.clicked.connect(self.set_mail)
# self.gender_male.clicked.connect(self.set_mail)
# self.gender_non.clicked.connect(self.set_mail)
def retranslateUi(self, eMailPreview):
_translate = QtCore.QCoreApplication.translate
@@ -120,64 +134,69 @@ class Ui_eMailPreview(object):
self.gender_non.setText(_translate("eMailPreview", "Divers"))
self.label_6.setText(_translate("eMailPreview", "Geschlecht"))
def get_greeting(self):
if self.gender_male.isChecked():
return "Sehr geehrter Herr"
elif self.gender_female.isChecked():
return "Sehr geehrte Frau"
elif self.gender_non.isChecked():
return "Guten Tag"
# def get_greeting(self):
# if self.gender_male.isChecked():
# return "Sehr geehrter Herr"
# elif self.gender_female.isChecked():
# return "Sehr geehrte Frau"
# elif self.gender_non.isChecked():
# return "Guten Tag"
def set_mail(self):
email_template = self.comboBox.currentText()
if email_template == "":
return
with open(f"mail_vorlagen/{email_template}", "r", encoding="utf-8") as f:
mail_template = f.read()
header = re.findall(r"Subject: (.*)", mail_template)
if header:
email_header = header[0]
else:
email_header = email_template.split(".eml")[0]
self.mail_header.setText(email_header)
self.mail_data = mail_template.split("<html>")[0]
mail_html = mail_template.split("<html>")[1]
mail_html = "<html>" + mail_html
mail_html = mail_html.format(
Profname=self.prof_name.text().split(" ")[1], Appname=self._appname, AppNr=self._appid, AppSubject = self._subject,greeting = self.get_greeting()
)
# def set_mail(self):
# email_template = self.comboBox.currentText()
# if email_template == "":
# return
# with open(f"mail_vorlagen/{email_template}", "r", encoding="utf-8") as f:
# mail_template = f.read()
# header = re.findall(r"Subject: (.*)", mail_template)
# if header:
# email_header = header[0]
# else:
# email_header = email_template.split(".eml")[0]
# self.mail_header.setText(email_header)
# self.mail_data = mail_template.split("<html>")[0]
# mail_html = mail_template.split("<html>")[1]
# mail_html = "<html>" + mail_html
# mail_html = mail_html.format(
# Profname=self.prof_name.text().split(" ")[1],
# Appname=self._appname,
# AppNr=self._appid,
# AppSubject=self._subject,
# greeting=self.get_greeting(),
# )
self.mail_body.setHtml(mail_html)
def load_mail_templates(self):
mail_templates = os.listdir("mail_vorlagen")
mail_templates = [f for f in mail_templates if f.endswith(".eml")]
print(mail_templates)
self.comboBox.addItems(mail_templates)
# self.mail_body.setHtml(mail_html)
# def load_mail_templates(self):
# mail_templates = os.listdir("mail_vorlagen")
# mail_templates = [f for f in mail_templates if f.endswith(".eml")]
# print(mail_templates)
# self.comboBox.addItems(mail_templates)
# def save_mail(self):
# # create a temporary file
# mail_header = self.mail_header.text()
# mail_body = self.mail_body.toHtml()
# mail = self.mail_data + mail_body
# mail = mail.replace("Subject:", f"Subject: {mail_header}")
# directory = config["database"]["tempdir"]
# directory = directory.replace("~", str(os.path.expanduser("~")))
# with tempfile.NamedTemporaryFile(
# mode="w", delete=False, suffix=".eml", encoding="utf-8", dir=directory
# ) as f:
# f.write(mail)
# self.mail_path = f.name
# print(self.mail_path)
# # open the file using thunderbird
# subprocess.Popen([f"{self.mail_path}"])
# # delete the file
# # os.remove(self.mail_path)
def save_mail(self):
# create a temporary file
mail_header = self.mail_header.text()
mail_body = self.mail_body.toHtml()
mail = self.mail_data + mail_body
mail = mail.replace("Subject:", f"Subject: {mail_header}")
directory = config["database"]["tempdir"]
directory = directory.replace("~", str(os.path.expanduser("~")))
with tempfile.NamedTemporaryFile(
mode="w", delete=False, suffix=".eml", encoding="utf-8", dir=directory
) as f:
f.write(mail)
self.mail_path = f.name
print(self.mail_path)
# open the file using thunderbird
subprocess.Popen([f"{self.mail_path}"])
# delete the file
# os.remove(self.mail_path)
def launch():
app = QtWidgets.QApplication([])
eMailPreview = QtWidgets.QDialog()
ui = Ui_eMailPreview()
ui.setupUi(eMailPreview, "1","Test","Biologie","Kirchner, Alexander")
ui.setupUi(eMailPreview, "1", "Test", "Biologie", "Kirchner, Alexander")
eMailPreview.show()
app.exec()
app.exec()

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\medianadder.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\new_subject.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtWidgets
from PyQt6 import QtCore, QtWidgets
class Ui_Dialog(object):
@@ -22,7 +22,12 @@ class Ui_Dialog(object):
self.verticalLayout.addWidget(self.label)
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setObjectName("gridLayout")
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
spacerItem = QtWidgets.QSpacerItem(
40,
20,
QtWidgets.QSizePolicy.Policy.Expanding,
QtWidgets.QSizePolicy.Policy.Minimum,
)
self.gridLayout.addItem(spacerItem, 0, 1, 1, 1)
self.checkBox = QtWidgets.QCheckBox(Dialog)
self.checkBox.setObjectName("checkBox")
@@ -42,22 +47,33 @@ class Ui_Dialog(object):
self.verticalLayout_2.addWidget(self.frame)
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
self.buttonBox.setStandardButtons(
QtWidgets.QDialogButtonBox.StandardButton.Cancel
| QtWidgets.QDialogButtonBox.StandardButton.Ok
)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout_2.addWidget(self.buttonBox)
self.frame.setVisible(False)
self.checkBox.stateChanged.connect(lambda: self.frame.setVisible(self.checkBox.isChecked()))
self.checkBox.stateChanged.connect(
lambda: self.frame.setVisible(self.checkBox.isChecked())
)
self.retranslateUi(Dialog)
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
self.label.setText(_translate("Dialog", "Das eingegebene Fach wurde nicht in der Datenbank gefunden. Soll es angelegt werden?"))
self.label.setText(
_translate(
"Dialog",
"Das eingegebene Fach wurde nicht in der Datenbank gefunden. Soll es angelegt werden?",
)
)
self.checkBox.setText(_translate("Dialog", "Ja"))
self.label_2.setText(_translate("Dialog", "Name des Neuen Faches:"))
def return_state(self):
return self.lineEdit.text()
return self.lineEdit.text()

View File

@@ -1,15 +1,15 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\parsed_titles.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
from src.logic import AutoAdder
from src.logic.log import MyLogger
from src.logic.threads import AutoAdder
logger = MyLogger("AutoTitleAdder")
@@ -156,3 +156,5 @@ class Ui_Form(object):
self.listWidget.takeItem(0)
# add first entry to listWidget_done
self.listWidget_done.addItem(text)

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\reminder.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):

View File

@@ -1,13 +1,13 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\settings.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from omegaconf import OmegaConf
from PySide6 import QtCore, QtWidgets
from PyQt6 import QtCore, QtWidgets
config = OmegaConf.load("config.yaml")
@@ -127,7 +127,7 @@ class Ui_Dialog(object):
'<html><head><meta name="qrichtext" content="1" /><style type="text/css">\n'
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hier können Einstellungen f<EFBFBD>r bestehende Dateiformate geändert, oder neue Dateiformate eingefügt werden</p>\n'
'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hier können Einstellungen für bestehende Dateiformate geändert, oder neue Dateiformate eingefügt werden</p>\n'
'<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>',
)
)

View File

@@ -1,14 +1,16 @@
# Form implementation generated from reading ui file 'ui\dialogs\apparat_extend.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
from src.backend.semester import generateSemesterByDate
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
@@ -94,12 +96,14 @@ class Ui_Dialog(object):
# else:
# self.rad_winter.setChecked(True)
return {
"semester": f"SoSe {int(self.sem_year.text()[-2:])}"
if self.rad_sommer.isChecked()
else f"WiSe {int(self.sem_year.text()[-2:])}/{int(self.sem_year.text()[-2:])+1}",
"dauerapp": self.dauerapp.isChecked()
if self.dauerapp.isChecked()
else False,
"semester": (
f"SoSe {int(self.sem_year.text()[-2:])}"
if self.rad_sommer.isChecked()
else f"WiSe {int(self.sem_year.text()[-2:])}/{int(self.sem_year.text()[-2:])+1}"
),
"dauerapp": (
self.dauerapp.isChecked() if self.dauerapp.isChecked() else False
),
}
@@ -112,3 +116,4 @@ if __name__ == "__main__":
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec())

View File

@@ -8,21 +8,57 @@
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QAbstractButton, QApplication, QCheckBox, QDialog,
QDialogButtonBox, QFrame, QLabel, QLineEdit,
QRadioButton, QSizePolicy, QWidget)
from PyQt6.QtCore import (
QCoreApplication,
QDate,
QDateTime,
QLocale,
QMetaObject,
QObject,
QPoint,
QRect,
QSize,
Qt,
QTime,
QUrl,
)
from PyQt6.QtGui import (
QBrush,
QColor,
QConicalGradient,
QCursor,
QFont,
QFontDatabase,
QGradient,
QIcon,
QImage,
QKeySequence,
QLinearGradient,
QPainter,
QPalette,
QPixmap,
QRadialGradient,
QTransform,
)
from PyQt6.QtWidgets import (
QAbstractButton,
QApplication,
QCheckBox,
QDialog,
QDialogButtonBox,
QFrame,
QLabel,
QLineEdit,
QRadioButton,
QSizePolicy,
QWidget,
)
class Ui_Dialog(object):
def setupUi(self, Dialog):
if not Dialog.objectName():
Dialog.setObjectName(u"Dialog")
Dialog.setObjectName("Dialog")
Dialog.resize(388, 103)
sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
@@ -32,37 +68,39 @@ class Ui_Dialog(object):
Dialog.setMinimumSize(QSize(388, 103))
Dialog.setMaximumSize(QSize(388, 103))
self.buttonBox = QDialogButtonBox(Dialog)
self.buttonBox.setObjectName(u"buttonBox")
self.buttonBox.setObjectName("buttonBox")
self.buttonBox.setGeometry(QRect(290, 30, 81, 241))
self.buttonBox.setOrientation(Qt.Vertical)
self.buttonBox.setStandardButtons(QDialogButtonBox.Abort|QDialogButtonBox.Save)
self.buttonBox.setStandardButtons(
QDialogButtonBox.Abort | QDialogButtonBox.Save
)
self.label = QLabel(Dialog)
self.label.setObjectName(u"label")
self.label.setObjectName("label")
self.label.setGeometry(QRect(10, 0, 281, 31))
font = QFont()
font.setPointSize(10)
self.label.setFont(font)
self.frame = QFrame(Dialog)
self.frame.setObjectName(u"frame")
self.frame.setObjectName("frame")
self.frame.setGeometry(QRect(10, 30, 241, 41))
self.frame.setFrameShape(QFrame.StyledPanel)
self.frame.setFrameShadow(QFrame.Raised)
self.line = QFrame(self.frame)
self.line.setObjectName(u"line")
self.line.setObjectName("line")
self.line.setGeometry(QRect(120, 0, 3, 61))
self.line.setFrameShape(QFrame.VLine)
self.line.setFrameShadow(QFrame.Sunken)
self.rad_sommer = QRadioButton(self.frame)
self.rad_sommer.setObjectName(u"rad_sommer")
self.rad_sommer.setObjectName("rad_sommer")
self.rad_sommer.setGeometry(QRect(10, 10, 82, 21))
self.rad_winter = QRadioButton(self.frame)
self.rad_winter.setObjectName(u"rad_winter")
self.rad_winter.setObjectName("rad_winter")
self.rad_winter.setGeometry(QRect(140, 10, 82, 21))
self.sem_year = QLineEdit(Dialog)
self.sem_year.setObjectName(u"sem_year")
self.sem_year.setObjectName("sem_year")
self.sem_year.setGeometry(QRect(10, 70, 121, 20))
self.checkBox = QCheckBox(Dialog)
self.checkBox.setObjectName(u"checkBox")
self.checkBox.setObjectName("checkBox")
self.checkBox.setGeometry(QRect(150, 70, 91, 21))
self.retranslateUi(Dialog)
@@ -70,14 +108,25 @@ class Ui_Dialog(object):
self.buttonBox.rejected.connect(Dialog.reject)
QMetaObject.connectSlotsByName(Dialog)
# setupUi
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"Dialog", None))
self.label.setText(QCoreApplication.translate("Dialog", u"Bis wann soll der Apparat verl\u00e4ngert werden?", None))
self.rad_sommer.setText(QCoreApplication.translate("Dialog", u"Sommer", None))
self.rad_winter.setText(QCoreApplication.translate("Dialog", u"Winter", None))
self.sem_year.setPlaceholderText(QCoreApplication.translate("Dialog", u"2023", None))
self.checkBox.setText(QCoreApplication.translate("Dialog", u"Dauerapparat", None))
Dialog.setWindowTitle(QCoreApplication.translate("Dialog", "Dialog", None))
self.label.setText(
QCoreApplication.translate(
"Dialog", "Bis wann soll der Apparat verl\u00e4ngert werden?", None
)
)
self.rad_sommer.setText(QCoreApplication.translate("Dialog", "Sommer", None))
self.rad_winter.setText(QCoreApplication.translate("Dialog", "Winter", None))
self.sem_year.setPlaceholderText(
QCoreApplication.translate("Dialog", "2023", None)
)
self.checkBox.setText(
QCoreApplication.translate("Dialog", "Dauerapparat", None)
)
# retranslateUi

View File

@@ -8,28 +8,61 @@
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QAbstractButton, QApplication, QDialog, QDialogButtonBox,
QSizePolicy, QTextEdit, QWidget)
from PyQt6.QtCore import (
QCoreApplication,
QDate,
QDateTime,
QLocale,
QMetaObject,
QObject,
QPoint,
QRect,
QSize,
Qt,
QTime,
QUrl,
)
from PyQt6.QtGui import (
QBrush,
QColor,
QConicalGradient,
QCursor,
QFont,
QFontDatabase,
QGradient,
QIcon,
QImage,
QKeySequence,
QLinearGradient,
QPainter,
QPalette,
QPixmap,
QRadialGradient,
QTransform,
)
from PyQt6.QtWidgets import (
QAbstractButton,
QApplication,
QDialog,
QDialogButtonBox,
QSizePolicy,
QTextEdit,
QWidget,
)
class Ui_extend_confirm(object):
def setupUi(self, extend_confirm):
if not extend_confirm.objectName():
extend_confirm.setObjectName(u"extend_confirm")
extend_confirm.setObjectName("extend_confirm")
extend_confirm.resize(380, 97)
self.buttonBox = QDialogButtonBox(extend_confirm)
self.buttonBox.setObjectName(u"buttonBox")
self.buttonBox.setObjectName("buttonBox")
self.buttonBox.setGeometry(QRect(290, 20, 81, 241))
self.buttonBox.setOrientation(Qt.Vertical)
self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok)
self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok)
self.textEdit = QTextEdit(extend_confirm)
self.textEdit.setObjectName(u"textEdit")
self.textEdit.setObjectName("textEdit")
self.textEdit.setGeometry(QRect(10, 10, 271, 81))
self.retranslateUi(extend_confirm)
@@ -37,9 +70,14 @@ class Ui_extend_confirm(object):
self.buttonBox.rejected.connect(extend_confirm.reject)
QMetaObject.connectSlotsByName(extend_confirm)
# setupUi
def retranslateUi(self, extend_confirm):
extend_confirm.setWindowTitle(QCoreApplication.translate("extend_confirm", u"Dialog", None))
extend_confirm.setWindowTitle(
QCoreApplication.translate("extend_confirm", "Dialog", None)
)
# retranslateUi

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'ui/dialogs/extend_apparat.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Frame(object):
@@ -18,7 +18,10 @@ class Ui_Frame(object):
self.label.setObjectName("label")
self.buttonBox = QtWidgets.QDialogButtonBox(Frame)
self.buttonBox.setGeometry(QtCore.QRect(90, 90, 156, 23))
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
self.buttonBox.setStandardButtons(
QtWidgets.QDialogButtonBox.StandardButton.Cancel
| QtWidgets.QDialogButtonBox.StandardButton.Ok
)
self.buttonBox.setObjectName("buttonBox")
self.sem_winter = QtWidgets.QRadioButton(Frame)
self.sem_winter.setGeometry(QtCore.QRect(60, 40, 82, 17))
@@ -36,16 +39,20 @@ class Ui_Frame(object):
def retranslateUi(self, Frame):
_translate = QtCore.QCoreApplication.translate
Frame.setWindowTitle(_translate("Frame", "Frame"))
self.label.setText(_translate("Frame", "Bis wann soll der Apparat verlängert werden?"))
self.label.setText(
_translate("Frame", "Bis wann soll der Apparat verlängert werden?")
)
self.sem_winter.setText(_translate("Frame", "Winter"))
self.sem_sommer.setText(_translate("Frame", "Sommer"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Frame = QtWidgets.QFrame()
ui = Ui_Frame()
ui.setupUi(Frame)
Frame.show()
sys.exit(app.exec())

View File

@@ -2,7 +2,7 @@ import os
import sys
from omegaconf import OmegaConf
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
from src.ui.dialogs.Ui_mail_preview import Ui_eMailPreview as Ui_Dialog
@@ -38,13 +38,23 @@ class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
self.prof_name.setText(prof_name)
self.mail_name.setText(self.prof_mail)
self.load_mail_templates()
# if default_mail is not None:
# # get the nearest match to the default mail
# for i in range(self.comboBox.count()):
# if default_mail in self.comboBox.itemText(i):
# default_mail = self.comboBox.itemText(i)
# break
# self.comboBox.setCurrentText(default_mail)
# 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)
if default_mail is not None:
# get the nearest match to the default mail
for i in range(self.comboBox.count()):
if default_mail in self.comboBox.itemText(i):
default_mail = self.comboBox.itemText(i)
break
self.comboBox.setCurrentText(default_mail)
self.gender_female.clicked.connect(self.set_mail)
self.gender_male.clicked.connect(self.set_mail)
@@ -66,12 +76,13 @@ class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
self.comboBox.addItem(template)
def get_greeting(self):
prof = self.profname
if self.gender_male.isChecked():
return "Sehr geehrter Herr"
return f"Sehr geehrter Herr {prof.split(' ')[-1]},"
elif self.gender_female.isChecked():
return "Sehr geehrte Frau"
return f"Sehr geehrte Frau {prof.split(' ')[-1]},"
elif self.gender_non.isChecked():
return "Guten Tag"
return f"Guten Tag {prof},"
def set_mail(self):
email_template = self.comboBox.currentText()
@@ -97,6 +108,7 @@ 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
@@ -176,3 +188,10 @@ if __name__ == "__main__":

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'ui\dialogs\mail_preview.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):

View File

@@ -1,4 +1,4 @@
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
from .Ui_medianadder import Ui_Dialog

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/dialogs/new_subject.ui'
#
# Created by: PySide6 UI code generator 6.5.3
# Created by: PyQt6 UI code generator 6.5.3
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
@@ -22,7 +22,12 @@ class Ui_Dialog(object):
self.verticalLayout.addWidget(self.label)
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setObjectName("gridLayout")
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
spacerItem = QtWidgets.QSpacerItem(
40,
20,
QtWidgets.QSizePolicy.Policy.Expanding,
QtWidgets.QSizePolicy.Policy.Minimum,
)
self.gridLayout.addItem(spacerItem, 0, 1, 1, 1)
self.checkBox = QtWidgets.QCheckBox(parent=Dialog)
self.checkBox.setObjectName("checkBox")
@@ -42,18 +47,27 @@ class Ui_Dialog(object):
self.verticalLayout_2.addWidget(self.frame)
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
self.buttonBox.setStandardButtons(
QtWidgets.QDialogButtonBox.StandardButton.Cancel
| QtWidgets.QDialogButtonBox.StandardButton.Ok
)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout_2.addWidget(self.buttonBox)
self.retranslateUi(Dialog)
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
self.label.setText(_translate("Dialog", "Das eingegebene Fach wurde nicht in der Datenbank gefunden. Soll es angelegt werden?"))
self.label.setText(
_translate(
"Dialog",
"Das eingegebene Fach wurde nicht in der Datenbank gefunden. Soll es angelegt werden?",
)
)
self.checkBox.setText(_translate("Dialog", "Ja"))
self.label_2.setText(_translate("Dialog", "Name des Neuen Faches:"))

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/dialogs/parsed_titles.ui'
#
# Created by: PySide6 UI code generator 6.5.3
# Created by: PyQt6 UI code generator 6.5.3
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
@@ -38,7 +38,12 @@ class Ui_Form(object):
self.label_2 = QtWidgets.QLabel(parent=self.horizontalLayoutWidget)
self.label_2.setObjectName("label_2")
self.horizontalLayout.addWidget(self.label_2)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
spacerItem = QtWidgets.QSpacerItem(
40,
20,
QtWidgets.QSizePolicy.Policy.Expanding,
QtWidgets.QSizePolicy.Policy.Minimum,
)
self.horizontalLayout.addItem(spacerItem)
self.frame_2 = QtWidgets.QFrame(parent=Form)
self.frame_2.setGeometry(QtCore.QRect(10, 80, 381, 201))
@@ -54,7 +59,9 @@ class Ui_Form(object):
self.listWidget = QtWidgets.QListWidget(parent=self.horizontalLayoutWidget_2)
self.listWidget.setObjectName("listWidget")
self.horizontalLayout_2.addWidget(self.listWidget)
self.listWidget_done = QtWidgets.QListWidget(parent=self.horizontalLayoutWidget_2)
self.listWidget_done = QtWidgets.QListWidget(
parent=self.horizontalLayoutWidget_2
)
self.listWidget_done.setObjectName("listWidget_done")
self.horizontalLayout_2.addWidget(self.listWidget_done)
self.progressBar = QtWidgets.QProgressBar(parent=Form)
@@ -63,7 +70,10 @@ class Ui_Form(object):
self.progressBar.setObjectName("progressBar")
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Form)
self.buttonBox.setGeometry(QtCore.QRect(230, 290, 156, 23))
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
self.buttonBox.setStandardButtons(
QtWidgets.QDialogButtonBox.StandardButton.Cancel
| QtWidgets.QDialogButtonBox.StandardButton.Ok
)
self.buttonBox.setObjectName("buttonBox")
self.toolButton = QtWidgets.QToolButton(parent=Form)
self.toolButton.setGeometry(QtCore.QRect(20, 290, 25, 19))
@@ -79,3 +89,4 @@ class Ui_Form(object):
self.count.setText(_translate("Form", "0"))
self.label_2.setText(_translate("Form", "Signaturen gefunden."))
self.toolButton.setText(_translate("Form", "..."))

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'ui\dialogs\confirm_extend.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_extend_confirm(object):

View File

@@ -1,5 +1,5 @@
from omegaconf import OmegaConf
from PySide6 import QtWidgets
from PyQt6 import QtWidgets
from src.ui.dialogs.Ui_settings import Ui_Dialog as _settings

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/plotdata.ui'
#
# Created by: PySide6 UI code generator 6.5.3
# Created by: PyQt6 UI code generator 6.5.3
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):

View File

@@ -12,7 +12,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>1601</width>
<width>1589</width>
<height>800</height>
</rect>
</property>
@@ -30,7 +30,7 @@
</property>
<property name="maximumSize">
<size>
<width>1920</width>
<width>1590</width>
<height>800</height>
</size>
</property>
@@ -70,7 +70,7 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<property name="sizePolicy">
@@ -265,7 +265,6 @@
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@@ -290,7 +289,6 @@
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>50</weight>
<bold>false</bold>
<kerning>false</kerning>
</font>
@@ -391,7 +389,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -411,7 +408,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -434,7 +430,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -454,7 +449,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -477,7 +471,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -497,7 +490,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -520,7 +512,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -540,7 +531,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -560,7 +550,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -586,7 +575,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -606,7 +594,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -629,7 +616,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -649,7 +635,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -669,7 +654,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -689,7 +673,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -715,7 +698,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -735,7 +717,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -758,7 +739,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -778,7 +758,6 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -810,7 +789,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -830,7 +808,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -850,7 +827,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -870,7 +846,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -890,7 +865,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -913,7 +887,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -933,7 +906,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -953,7 +925,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -973,7 +944,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -1000,7 +970,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -1014,7 +983,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -1025,7 +993,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -1051,7 +1018,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -1095,7 +1061,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -1129,7 +1094,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -1260,7 +1224,6 @@
<property name="font">
<font>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@@ -1670,7 +1633,7 @@
<enum>QFrame::Raised</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="stackedWidget_4Page1">
<widget class="QTabWidget" name="tabWidget_3">
@@ -2466,7 +2429,6 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -2489,7 +2451,6 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -2504,7 +2465,7 @@
<property name="geometry">
<rect>
<x>20</x>
<y>140</y>
<y>110</y>
<width>241</width>
<height>41</height>
</rect>
@@ -2512,7 +2473,6 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@@ -2548,7 +2508,6 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
@@ -2575,7 +2534,6 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
@@ -2602,7 +2560,6 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
@@ -2629,7 +2586,6 @@
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
@@ -2657,7 +2613,7 @@
</property>
<property name="icon">
<iconset>
<normaloff>../../../.designer/backup/icons/information.png</normaloff>../../../.designer/backup/icons/information.png</iconset>
<normaloff>../../../../../.designer/backup/icons/information.png</normaloff>../../../../../.designer/backup/icons/information.png</iconset>
</property>
<property name="checkable">
<bool>false</bool>
@@ -2817,8 +2773,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1601</width>
<height>30</height>
<width>1589</width>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuDatei">
@@ -2880,25 +2836,25 @@
</widget>
<tabstops>
<tabstop>drpdwn_app_nr</tabstop>
<tabstop>prof_title</tabstop>
<tabstop>drpdwn_prof_name</tabstop>
<tabstop>prof_mail</tabstop>
<tabstop>prof_tel_nr</tabstop>
<tabstop>app_name</tabstop>
<tabstop>app_fach</tabstop>
<tabstop>sem_year</tabstop>
<tabstop>check_eternal_app</tabstop>
<tabstop>btn_add_document</tabstop>
<tabstop>btn_open_document</tabstop>
<tabstop>check_file</tabstop>
<tabstop>check_send_mail</tabstop>
<tabstop>btn_apparat_save</tabstop>
<tabstop>btn_apparat_apply</tabstop>
<tabstop>check_send_mail</tabstop>
<tabstop>chkbx_show_del_media</tabstop>
<tabstop>btn_reserve</tabstop>
<tabstop>prof_id_adis</tabstop>
<tabstop>apparat_id_adis</tabstop>
<tabstop>tabWidget_2</tabstop>
<tabstop>btn_del_select_apparats</tabstop>
<tabstop>tabWidget_3</tabstop>
<tabstop>seach_by_signature</tabstop>
<tabstop>search_by_title</tabstop>
<tabstop>select_action_box</tabstop>
<tabstop>user_create_frame_username</tabstop>
<tabstop>user_frame_userrole</tabstop>
@@ -2913,8 +2869,6 @@
<tabstop>update_user</tabstop>
<tabstop>edit_faculty_member_title</tabstop>
<tabstop>edit_faculty_member_select_member</tabstop>
<tabstop>faculty_member_old_telnr</tabstop>
<tabstop>faculty_member_oldmail</tabstop>
<tabstop>edit_faculty_member_new_title</tabstop>
<tabstop>edit_faculty_member_new_surname</tabstop>
<tabstop>user_faculty_member_new_name</tabstop>
@@ -2931,6 +2885,12 @@
<tabstop>box_appnrs</tabstop>
<tabstop>btn_copy_adis_command</tabstop>
<tabstop>spin_select_message</tabstop>
<tabstop>chkbx_show_del_media</tabstop>
<tabstop>btn_reserve</tabstop>
<tabstop>book_search</tabstop>
<tabstop>btn_del_select_apparats</tabstop>
<tabstop>tabWidget_3</tabstop>
<tabstop>book_search_result</tabstop>
</tabstops>
<resources/>
<connections/>

View File

@@ -8,83 +8,146 @@
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QCheckBox, QFrame, QLabel,
QLineEdit, QSizePolicy, QTextBrowser, QToolButton,
QWidget, QWizard, QWizardPage)
from PyQt6.QtCore import (
QCoreApplication,
QDate,
QDateTime,
QLocale,
QMetaObject,
QObject,
QPoint,
QRect,
QSize,
Qt,
QTime,
QUrl,
)
from PyQt6.QtGui import (
QBrush,
QColor,
QConicalGradient,
QCursor,
QFont,
QFontDatabase,
QGradient,
QIcon,
QImage,
QKeySequence,
QLinearGradient,
QPainter,
QPalette,
QPixmap,
QRadialGradient,
QTransform,
)
from PyQt6.QtWidgets import (
QApplication,
QCheckBox,
QFrame,
QLabel,
QLineEdit,
QSizePolicy,
QTextBrowser,
QToolButton,
QWidget,
QWizard,
QWizardPage,
)
class Ui_Wizard(object):
def setupUi(self, Wizard):
if not Wizard.objectName():
Wizard.setObjectName(u"Wizard")
Wizard.setObjectName("Wizard")
Wizard.resize(640, 480)
Wizard.setMaximumSize(QSize(640, 480))
self.wizardPage1 = QWizardPage()
self.wizardPage1.setObjectName(u"wizardPage1")
self.wizardPage1.setObjectName("wizardPage1")
self.textBrowser = QTextBrowser(self.wizardPage1)
self.textBrowser.setObjectName(u"textBrowser")
self.textBrowser.setObjectName("textBrowser")
self.textBrowser.setGeometry(QRect(200, 10, 256, 192))
Wizard.addPage(self.wizardPage1)
self.wizardPage2 = QWizardPage()
self.wizardPage2.setObjectName(u"wizardPage2")
self.wizardPage2.setObjectName("wizardPage2")
self.label = QLabel(self.wizardPage2)
self.label.setObjectName(u"label")
self.label.setObjectName("label")
self.label.setGeometry(QRect(10, 0, 131, 16))
self.label_2 = QLabel(self.wizardPage2)
self.label_2.setObjectName(u"label_2")
self.label_2.setObjectName("label_2")
self.label_2.setGeometry(QRect(10, 40, 71, 16))
self.default_apps = QCheckBox(self.wizardPage2)
self.default_apps.setObjectName(u"default_apps")
self.default_apps.setObjectName("default_apps")
self.default_apps.setGeometry(QRect(100, 40, 70, 17))
self.label_3 = QLabel(self.wizardPage2)
self.label_3.setObjectName(u"label_3")
self.label_3.setObjectName("label_3")
self.label_3.setGeometry(QRect(10, 70, 61, 16))
self.custom_applications = QFrame(self.wizardPage2)
self.custom_applications.setObjectName(u"custom_applications")
self.custom_applications.setObjectName("custom_applications")
self.custom_applications.setGeometry(QRect(280, 10, 331, 361))
self.custom_applications.setFrameShape(QFrame.StyledPanel)
self.custom_applications.setFrameShadow(QFrame.Raised)
self.save_path = QLineEdit(self.wizardPage2)
self.save_path.setObjectName(u"save_path")
self.save_path.setObjectName("save_path")
self.save_path.setGeometry(QRect(80, 70, 113, 20))
self.btn_save_path_select = QToolButton(self.wizardPage2)
self.btn_save_path_select.setObjectName(u"btn_save_path_select")
self.btn_save_path_select.setObjectName("btn_save_path_select")
self.btn_save_path_select.setGeometry(QRect(200, 70, 25, 19))
Wizard.addPage(self.wizardPage2)
self.retranslateUi(Wizard)
QMetaObject.connectSlotsByName(Wizard)
# setupUi
def retranslateUi(self, Wizard):
Wizard.setWindowTitle(QCoreApplication.translate("Wizard", u"Wizard", None))
self.textBrowser.setHtml(QCoreApplication.translate("Wizard", u"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Setup f\u00fcr das Semesterapparatsprogram.</p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Im Anschluss werden wichtige Einstellungen gesetzt, welche auch im sp\u00e4teren Verlauf ver\u00e4ndert werden k\u00f6nnen.</p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margi"
"n-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>", None))
self.label.setText(QCoreApplication.translate("Wizard", u"Grundeinstellungen", None))
#if QT_CONFIG(tooltip)
self.label_2.setToolTip(QCoreApplication.translate("Wizard", u"Opens the downloaded files with the default applications set in the OS", None))
#endif // QT_CONFIG(tooltip)
self.label_2.setText(QCoreApplication.translate("Wizard", u"Default Apps", None))
Wizard.setWindowTitle(QCoreApplication.translate("Wizard", "Wizard", None))
self.textBrowser.setHtml(
QCoreApplication.translate(
"Wizard",
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">\n'
'<html><head><meta name="qrichtext" content="1" /><style type="text/css">\n'
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Setup f\u00fcr das Semesterapparatsprogram.</p>\n'
'<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>\n'
'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Im Anschluss werden wichtige Einstellungen gesetzt, welche auch im sp\u00e4teren Verlauf ver\u00e4ndert werden k\u00f6nnen.</p>\n'
'<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margi'
'n-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>',
None,
)
)
self.label.setText(
QCoreApplication.translate("Wizard", "Grundeinstellungen", None)
)
# if QT_CONFIG(tooltip)
self.label_2.setToolTip(
QCoreApplication.translate(
"Wizard",
"Opens the downloaded files with the default applications set in the OS",
None,
)
)
# endif // QT_CONFIG(tooltip)
self.label_2.setText(QCoreApplication.translate("Wizard", "Default Apps", None))
self.default_apps.setText("")
#if QT_CONFIG(tooltip)
self.label_3.setToolTip(QCoreApplication.translate("Wizard", u"Path where the downloaded files are stored. Defaults to ~/Desktop/SemapFiles", None))
#endif // QT_CONFIG(tooltip)
self.label_3.setText(QCoreApplication.translate("Wizard", u"Save Path", None))
self.save_path.setPlaceholderText(QCoreApplication.translate("Wizard", u"~/Desktop/SemapFiles", None))
self.btn_save_path_select.setText(QCoreApplication.translate("Wizard", u"...", None))
# if QT_CONFIG(tooltip)
self.label_3.setToolTip(
QCoreApplication.translate(
"Wizard",
"Path where the downloaded files are stored. Defaults to ~/Desktop/SemapFiles",
None,
)
)
# endif // QT_CONFIG(tooltip)
self.label_3.setText(QCoreApplication.translate("Wizard", "Save Path", None))
self.save_path.setPlaceholderText(
QCoreApplication.translate("Wizard", "~/Desktop/SemapFiles", None)
)
self.btn_save_path_select.setText(
QCoreApplication.translate("Wizard", "...", None)
)
# retranslateUi

View File

@@ -8,7 +8,7 @@
# WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (
from PyQt6.QtCore import (
QCoreApplication,
QDate,
QDateTime,
@@ -22,8 +22,7 @@ from PySide6.QtCore import (
QTime,
QUrl,
)
from PySide6.QtGui import (
QWidgetAction,
from PyQt6.QtGui import (
QBrush,
QColor,
QConicalGradient,
@@ -40,8 +39,9 @@ from PySide6.QtGui import (
QPixmap,
QRadialGradient,
QTransform,
QWidgetAction,
)
from PySide6.QtWidgets import (
from PyQt6.QtWidgets import (
QApplication,
QCheckBox,
QComboBox,
@@ -474,3 +474,4 @@ class Ui_MainWindow(object):
)
# retranslateUi

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\widgets\message_widget.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
from src.backend.database import Database

View File

@@ -1,12 +1,12 @@
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\widgets\progress_overview_widget.ui'
#
# Created by: PySide6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.3.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
@@ -63,7 +63,7 @@ class Ui_Form(object):
font = QtGui.QFont()
font.setPointSize(10)
font.setBold(True)
font.setItalic(False)
font.setItal#ic(False)
font.setUnderline(False)
font.setWeight(75)
font.setKerning(True)

View File

@@ -1,6 +1,6 @@
# import pysignal pyslot
from PySide6.QtCore import Signal
from PySide6.QtWidgets import (
from PyQt6.QtCore import pyqtSignal as Signal
from PyQt6.QtWidgets import (
QApplication,
QTreeWidget,
QTreeWidgetItem,
@@ -10,7 +10,7 @@ from PySide6.QtWidgets import (
class StatusWidget(QWidget):
person_double_clicked = Signal(str,str, int)
person_double_clicked = Signal(str, str, int)
def __init__(self, data, header_label: str):
super(StatusWidget, self).__init__()
@@ -23,6 +23,7 @@ class StatusWidget(QWidget):
layout.addWidget(self.tree_widget)
self.setLayout(layout)
self.tree_widget.itemDoubleClicked.connect(self.on_item_double_clicked)
def on_item_double_clicked(self, item: QTreeWidgetItem, column: int):
parent_depth = 0
parent = item.parent()
@@ -31,7 +32,7 @@ class StatusWidget(QWidget):
parent = parent.parent()
print(parent_depth)
# Emit the person_double_clicked signal with the name of the person and the parent depth
self.person_double_clicked.emit(self.header,item.text(column), parent_depth)
self.person_double_clicked.emit(self.header, item.text(column), parent_depth)
def populate_tree(self, data):
if data == {}:
@@ -70,7 +71,8 @@ if __name__ == "__main__":
widget = StatusWidget(data, "test")
widget.show()
#detect emit signal
# detect emit signal
widget.person_double_clicked.connect(lambda x: print(x))
sys.exit(app.exec())

View File

@@ -1,29 +1,32 @@
from PySide6.QtWidgets import QFileDialog, QApplication
from PySide6.QtCore import QSettings
import sys
from PyQt6.QtCore import QSettings
from PyQt6.QtWidgets import QApplication, QFileDialog
class FilePicker:
def __init__(self):
self.settings = QSettings("PH-Freiburg", "SAP")
self.last_path = self.settings.value("last_path", "/")
self.multi_select = True
def pick_files(self):
filepicker = QFileDialog()
filepicker.setFileMode(QFileDialog.FileMode.ExistingFiles)
filepicker.setDirectory(self.last_path)
filepicker.setOption(QFileDialog.Option.DontUseNativeDialog, True)
#enable multi select
# enable multi select
filepicker.setOption(QFileDialog.Option.DontUseCustomDirectoryIcons, True)
files, _ = filepicker.getOpenFileNames(caption='Open file', directory=self.last_path)
files, _ = filepicker.getOpenFileNames(caption="Open file", dir=self.last_path)
if files:
self.last_path = files[0]
self.settings.setValue("last_path", self.last_path)
return files
if __name__ == '__main__':
if __name__ == "__main__":
app = QApplication(sys.argv)
picker = FilePicker()
files = picker.pick_files()
print(files)
print(files)

View File

@@ -5,7 +5,7 @@ matplotlib.use("QtAgg")
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
from PySide6 import QtCore, QtWidgets
from PyQt6 import QtCore, QtWidgets
class graph(FigureCanvas):
@@ -25,7 +25,7 @@ class GraphWidget(QtWidgets.QWidget):
self.toolbar = NavigationToolbar(self.graph, self)
# set legend
self.graph.axes.legend(legend_labels, loc="upper left")
#set x-axis text to be slanted
# set x-axis text to be slanted
self.graph.axes.set_xticklabels(data["x"], rotation=45, ha="right")
# set the layout
layout = QtWidgets.QVBoxLayout()
@@ -49,3 +49,4 @@ if __name__ == "__main__":
widget = GraphWidget(data=data, legend_labels=["+", "-"])
widget.show()
sys.exit(app.exec())

View File

@@ -1,4 +1,4 @@
from PySide6 import QtCore, QtGui, QtWidgets
from PyQt6 import QtCore, QtGui, QtWidgets
from Ui_progress_overview_widget import Ui_Form