rebase codebase, delete trunk, move threads to backend
This commit is contained in:
@@ -4,8 +4,7 @@ from PyQt6.QtCore import pyqtSignal
|
||||
from src.backend import Database, Semester
|
||||
from src import logger
|
||||
from src.logic import custom_sort, Prof, sort_semesters_list
|
||||
from src.ui import ApparatExtendDialog
|
||||
from src.ui.dialogs import Mail_Dialog
|
||||
from src.ui.dialogs import Mail_Dialog, ApparatExtendDialog
|
||||
from src.ui.widgets import DataGraph, StatusWidget
|
||||
|
||||
from natsort import natsorted
|
||||
@@ -129,7 +128,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
|
||||
self.book_search_result.setItem(
|
||||
0, 1, QtWidgets.QTableWidgetItem(book[0].signature)
|
||||
)
|
||||
# print(book[1])
|
||||
# #print(book[1])
|
||||
self.book_search_result.setItem(
|
||||
0,
|
||||
2,
|
||||
@@ -170,7 +169,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
|
||||
self.btn_notify_for_deletion.setEnabled(False)
|
||||
|
||||
def setStatisticTableSize(self):
|
||||
# # print(self.statistics_table.size(), self.statistics_table.rowCount())
|
||||
# # #print(self.statistics_table.size(), self.statistics_table.rowCount())
|
||||
size = self.statistics_table.size()
|
||||
h = size.height()
|
||||
w = size.width()
|
||||
@@ -286,7 +285,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
|
||||
selected_apparats.append(self.tableWidget.item(i, 2).text())
|
||||
selected_apparat_rows.append(i)
|
||||
# delete all selected apparats
|
||||
# # print(selected_apparats)
|
||||
# # #print(selected_apparats)
|
||||
logger.info(f"Deleting apparats: {selected_apparats}")
|
||||
for apparat in selected_apparats:
|
||||
self.db.deleteApparat(apparat, self.semester)
|
||||
@@ -374,7 +373,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
|
||||
# set the items 0 = clickable checkbox, 1 = appname, 2 = profname, 3 = fach
|
||||
self.tableWidget.setItem(i, 0, QtWidgets.QTableWidgetItem(""))
|
||||
self.tableWidget.setItem(i, 1, QtWidgets.QTableWidgetItem(data[i][1]))
|
||||
#set tooltip for the apparat name
|
||||
# set tooltip for the apparat name
|
||||
self.tableWidget.item(i, 1).setToolTip(data[i][1])
|
||||
self.tableWidget.setItem(i, 2, QtWidgets.QTableWidgetItem(str(data[i][4])))
|
||||
self.tableWidget.setItem(i, 3, QtWidgets.QTableWidgetItem(data[i][2]))
|
||||
@@ -439,12 +438,12 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
|
||||
apparat = args[1]
|
||||
if header == "deleted" and parent_depth == 2:
|
||||
# TODO: warn message here
|
||||
print("warning")
|
||||
logger.warning("Semesterapparat wurde bereits gelöscht")
|
||||
if parent_depth == 1:
|
||||
# person selected case - open all apparats from this person in the tableWidget
|
||||
self.tableWidget.setRowCount(0)
|
||||
name = apparat.split("(")[0].strip()
|
||||
prof_id = self.db.getProfId({"profname":name})
|
||||
prof_id = self.db.getProfId({"profname": name})
|
||||
apparats = self.db.getApparatsByProf(prof_id)
|
||||
for app in apparats:
|
||||
# set the items 0 = clickable checkbox, 1 = appname, 2 = profname, 3 = fach
|
||||
@@ -472,13 +471,13 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
|
||||
"Dieser Semesterapparat kann nicht gelöscht werden, da er bereits gelöscht wurde"
|
||||
)
|
||||
elif parent_depth == 2:
|
||||
# print("depth", parent_depth)
|
||||
# #print("depth", parent_depth)
|
||||
# apparat selected case - open the apparat in the frame
|
||||
self.apparat_open.emit(apparat)
|
||||
return
|
||||
|
||||
def emit_signal(self, *args):
|
||||
# print("emit_signal", *args)
|
||||
# #print("emit_signal", *args)
|
||||
self.apparat_open.emit(args[1])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user