rebase codebase, delete trunk, move threads to backend

This commit is contained in:
2025-01-14 16:20:08 +01:00
parent fba652006f
commit 08cd18f3f1
106 changed files with 1604 additions and 1057 deletions

View File

@@ -5,12 +5,11 @@ from PyQt6 import QtCore, QtWidgets, QtGui
from PyQt6.QtGui import QRegularExpressionValidator
from PyQt6.QtCore import QDate
from src import Icon, logger
from src.backend import recreateElsaFile, Semester, Database
from src.backend import Semester, Database
from src.logic import elsa_word_to_csv, Prof
from src.ui import popus_confirm
from src.ui.dialogs import ElsaAddEntry
from src.ui.widgets import FilePicker
from src.ui.widgets import DataGraph
from src.ui.dialogs import ElsaAddEntry, popus_confirm
from src.ui.widgets import FilePicker, DataGraph
class ElsaDialog(QtWidgets.QDialog, Ui_Dialog):
def __init__(self):
@@ -137,7 +136,8 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog):
def elsa_context_menu(self, position):
menu = QtWidgets.QMenu()
# TODO: add functions
pass
pass
def elsa_table_entry(self):
data = ElsaAddEntry()
selected_row = self.table_elsa_list.currentRow()
@@ -157,7 +157,7 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog):
else:
data.search(pages=pages)
data.exec()
def add_new_elsa(self):
self.create_frame_elsa.setEnabled(True)
self.elsa_cancel_create.setEnabled(True)
@@ -196,7 +196,7 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog):
self.db.updateElsaApparat(elsa_id, prof, semester, date)
self.elsa_update.setEnabled(False)
self.cancel_elsa_creation()
def confirm_popup(self, message: str, title: str):
popup = popus_confirm(title=title)
popup.textEdit.setReadOnly(True)
@@ -225,7 +225,7 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog):
mail=self.newProf_mail.text(),
telnr=self.newProf_telnr.text(),
title=self.newProf_title.text(),
fullname=f"{prof.split(", ")[0]} {prof.split(", ")[1]}",
fullname=f"{prof.split(', ')[0]} {prof.split(', ')[1]}",
)
prof_id = self.db.getProfId(profdata)
logger.debug(profdata, prof_id)
@@ -443,7 +443,7 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog):
self.elsa_table.setRowCount(0)
elsa_apparats = self.db.getElsaApparats()
elsa_apparats = natsorted(elsa_apparats, key=lambda x: x[2], reverse=True)
# x = semester, y = number of apparats
# x = semester, y = number of apparats
for apparat in elsa_apparats:
data = self.insert_elsa_into_table(apparat)
@@ -474,10 +474,11 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog):
0, 1, QtWidgets.QTableWidgetItem(str(self.graph_data["y"][i]))
)
self.elsa_statistics.addTab(graph, "Graph")
def launch():
logger.debug("Launching Elsa Dialog")
app = QtWidgets.QApplication([])
window = ElsaDialog()
window.show()
app.exec()
app.exec()