rework logging, add more dataclasses, reworked config

This commit is contained in:
2024-12-17 10:02:56 +01:00
parent ccb4df10bb
commit eda556b5ea
41 changed files with 1624 additions and 865 deletions

View File

@@ -1,5 +1,5 @@
from .widget_sources.Ui_search_statistic_page import Ui_Dialog
from PyQt6 import QtWidgets, QtGui
from PyQt6 import QtWidgets, QtGui, QtCore
from PyQt6.QtCore import pyqtSignal
from src.backend import Database, generateSemesterByDate
from src.logic import custom_sort, Prof
@@ -55,13 +55,25 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
self.populate_tab()
def restore_apparat(self):
row = self.tableWidget.currentRow()
apparat = self.tableWidget.item(row, 1).text()
ic(apparat)
apparat_id = self.db.getApparatId(apparat)
# restore the apparat
self.db.restoreApparat(apparat_id)
# update the table
selected_rows = self.tableWidget.selectionModel().selectedRows()
apparats = []
if len(selected_rows) == 0:
# get position of right click
row = self.tableWidget.currentRow()
apparats.append(self.tableWidget.item(row, 1).text())
else:
for row in selected_rows:
apparats.append(self.tableWidget.item(row.row(), 1).text())
for apparat in apparats:
apparat_id = self.db.getApparatId(apparat)
self.db.restoreApparat(apparat_id)
# remove the red color from the row
# get row where the apparat is
row = self.tableWidget.findItems(apparat, QtCore.Qt.MatchFlag.MatchExactly)[
0
].row()
for j in range(5):
self.tableWidget.item(row, j).setBackground(QtGui.QColor(255, 255, 255))
self.reloadSignal.emit()
def statistics_table_context_menu(self, position):
@@ -140,7 +152,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
app_id = i["app_id"]
app_name = i["app_name"]
prof_name = i["prof_name"]
prof_mail = self.db.getProfData(prof_name)[0]
prof_mail = self.db.getProfData(prof_name).mail
self.mail_thread = Mail_Dialog(
app_id=app_id,
app_name=app_name,