various changes, new dialogs
This commit is contained in:
@@ -4,8 +4,8 @@ from PyQt6.QtCore import pyqtSignal
|
||||
from src.backend import Database, generateSemesterByDate
|
||||
from src.logic import custom_sort
|
||||
from src import MyLogger
|
||||
from src import Icon
|
||||
from src.ui import DataGraph, Mail_Dialog, StatusWidget
|
||||
from src.ui.dialogs import Mail_Dialog
|
||||
from src.ui.widgets import DataGraph, StatusWidget
|
||||
from natsort import natsorted
|
||||
from icecream import ic
|
||||
|
||||
@@ -16,6 +16,7 @@ class MyComboBox(QtWidgets.QComboBox):
|
||||
super().__init__(parent)
|
||||
|
||||
|
||||
|
||||
class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
|
||||
apparat_open = pyqtSignal(str)
|
||||
reloadSignal = pyqtSignal()
|
||||
@@ -155,7 +156,6 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
|
||||
return self.tabWidget_3.currentIndex()
|
||||
|
||||
def gridchange(self):
|
||||
print("gridchange")
|
||||
if self.check_deletable.isChecked():
|
||||
self.box_semester.setEnabled(False)
|
||||
self.box_appnrs.setEnabled(False)
|
||||
@@ -266,6 +266,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
|
||||
|
||||
def statistics(self):
|
||||
"""Generate the statistics based on the selected filters."""
|
||||
self.tableWidget.setRowCount(0)
|
||||
active_semseter = generateSemesterByDate()
|
||||
self.db_err_message.setText("")
|
||||
self.btn_del_select_apparats.setEnabled(True)
|
||||
@@ -312,7 +313,6 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
|
||||
params = {
|
||||
key: value for key, value in params.items() if value != "Alle"
|
||||
} # remove empty lines to prevent errors
|
||||
print(params)
|
||||
result = self.db.statistic_request(**params)
|
||||
# add QTableWidgetItems to the table
|
||||
# self.tableWidget.setRowCount(len(result))
|
||||
@@ -326,7 +326,6 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
|
||||
sem_year = int(sem_year.split("/")[0])
|
||||
else:
|
||||
sem_year = int(sem_year)
|
||||
print(sem_year)
|
||||
for entry in result:
|
||||
if "deletable" in params.keys():
|
||||
entry_sem_time = entry[5].split(" ")[0]
|
||||
@@ -345,7 +344,6 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
|
||||
data.append(entry)
|
||||
self.tableWidget.setRowCount(len(data))
|
||||
for i in range(len(data)):
|
||||
print("adding", data[i][1])
|
||||
# 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]))
|
||||
@@ -368,7 +366,6 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog):
|
||||
)
|
||||
# # remove empty rows
|
||||
for row in range(self.tableWidget.rowCount()):
|
||||
print(row, self.tableWidget.item(row, 1))
|
||||
if self.tableWidget.item(row, 1) is None:
|
||||
self.tableWidget.removeRow(row)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user