various changes, new dialogs
This commit is contained in:
@@ -5,3 +5,4 @@ from .graph import DataGraph
|
||||
from .Ui_message_widget import Ui_Form as Message_Widget
|
||||
from .calendar_entry import CalendarEntry
|
||||
from .MessageCalendar import MessageCalendar
|
||||
from .searchPage import SearchStatisticPage
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(1244, 756)
|
||||
Dialog.resize(1244, 767)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.tabWidget_2 = QtWidgets.QTabWidget(parent=Dialog)
|
||||
@@ -98,31 +98,40 @@ class Ui_Dialog(object):
|
||||
self.tabWidget_2.addTab(self.tab_3, "")
|
||||
self.tab_4 = QtWidgets.QWidget()
|
||||
self.tab_4.setObjectName("tab_4")
|
||||
self.formLayoutWidget = QtWidgets.QWidget(parent=self.tab_4)
|
||||
self.formLayoutWidget.setGeometry(QtCore.QRect(10, 10, 451, 121))
|
||||
self.formLayoutWidget.setObjectName("formLayoutWidget")
|
||||
self.formLayout_6 = QtWidgets.QFormLayout(self.formLayoutWidget)
|
||||
self.formLayout_6.setContentsMargins(0, 0, 0, 0)
|
||||
self.formLayout_6.setObjectName("formLayout_6")
|
||||
self.label_25 = QtWidgets.QLabel(parent=self.formLayoutWidget)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.tab_4)
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.gridLayout = QtWidgets.QGridLayout()
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.label_25 = QtWidgets.QLabel(parent=self.tab_4)
|
||||
self.label_25.setObjectName("label_25")
|
||||
self.formLayout_6.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_25)
|
||||
self.seach_by_signature = QtWidgets.QLineEdit(parent=self.formLayoutWidget)
|
||||
self.seach_by_signature.setClearButtonEnabled(True)
|
||||
self.seach_by_signature.setObjectName("seach_by_signature")
|
||||
self.formLayout_6.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.seach_by_signature)
|
||||
self.label_26 = QtWidgets.QLabel(parent=self.formLayoutWidget)
|
||||
self.gridLayout.addWidget(self.label_25, 0, 0, 1, 1)
|
||||
self.label_26 = QtWidgets.QLabel(parent=self.tab_4)
|
||||
self.label_26.setObjectName("label_26")
|
||||
self.formLayout_6.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_26)
|
||||
self.search_by_title = QtWidgets.QLineEdit(parent=self.formLayoutWidget)
|
||||
self.gridLayout.addWidget(self.label_26, 1, 0, 1, 1)
|
||||
self.search_by_title = QtWidgets.QLineEdit(parent=self.tab_4)
|
||||
self.search_by_title.setFocusPolicy(QtCore.Qt.FocusPolicy.ClickFocus)
|
||||
self.search_by_title.setClearButtonEnabled(True)
|
||||
self.search_by_title.setObjectName("search_by_title")
|
||||
self.formLayout_6.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.search_by_title)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.formLayout_6.setItem(2, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem2)
|
||||
self.gridLayout.addWidget(self.search_by_title, 1, 1, 1, 1)
|
||||
self.book_search = QtWidgets.QPushButton(parent=self.tab_4)
|
||||
self.book_search.setGeometry(QtCore.QRect(10, 180, 75, 23))
|
||||
self.book_search.setObjectName("book_search")
|
||||
self.gridLayout.addWidget(self.book_search, 3, 0, 1, 1)
|
||||
self.seach_by_signature = QtWidgets.QLineEdit(parent=self.tab_4)
|
||||
self.seach_by_signature.setFocusPolicy(QtCore.Qt.FocusPolicy.ClickFocus)
|
||||
self.seach_by_signature.setClearButtonEnabled(True)
|
||||
self.seach_by_signature.setObjectName("seach_by_signature")
|
||||
self.gridLayout.addWidget(self.seach_by_signature, 0, 1, 1, 1)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.gridLayout.addItem(spacerItem2, 2, 0, 1, 1)
|
||||
self.gridLayout.setRowMinimumHeight(0, 1)
|
||||
self.gridLayout.setRowMinimumHeight(1, 1)
|
||||
self.gridLayout.setRowMinimumHeight(2, 1)
|
||||
self.gridLayout.setRowMinimumHeight(3, 1)
|
||||
self.horizontalLayout_3.addLayout(self.gridLayout)
|
||||
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_3.addItem(spacerItem3)
|
||||
self.horizontalLayout_3.setStretch(0, 30)
|
||||
self.horizontalLayout_3.setStretch(1, 70)
|
||||
self.tabWidget_2.addTab(self.tab_4, "")
|
||||
self.verticalLayout.addWidget(self.tabWidget_2)
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout()
|
||||
@@ -155,8 +164,8 @@ class Ui_Dialog(object):
|
||||
self.btn_notify_for_deletion = QtWidgets.QPushButton(parent=self.apparatResult)
|
||||
self.btn_notify_for_deletion.setObjectName("btn_notify_for_deletion")
|
||||
self.horizontalLayout_7.addWidget(self.btn_notify_for_deletion)
|
||||
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_7.addItem(spacerItem3)
|
||||
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_7.addItem(spacerItem4)
|
||||
self.verticalLayout_4.addLayout(self.horizontalLayout_7)
|
||||
self.tableWidget = QtWidgets.QTableWidget(parent=self.apparatResult)
|
||||
self.tableWidget.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
@@ -208,7 +217,7 @@ class Ui_Dialog(object):
|
||||
self.statistics_table.horizontalHeader().setDefaultSectionSize(80)
|
||||
self.statistics_table.horizontalHeader().setMinimumSectionSize(40)
|
||||
self.statistics_table.horizontalHeader().setSortIndicatorShown(True)
|
||||
self.statistics_table.horizontalHeader().setStretchLastSection(True)
|
||||
self.statistics_table.horizontalHeader().setStretchLastSection(False)
|
||||
self.statistics_table.verticalHeader().setStretchLastSection(True)
|
||||
self.verticalLayout_6.addWidget(self.statistics_table)
|
||||
self.dataLayout = QtWidgets.QHBoxLayout()
|
||||
@@ -297,6 +306,7 @@ class Ui_Dialog(object):
|
||||
self.label_25.setText(_translate("Dialog", "Signatur"))
|
||||
self.label_26.setText(_translate("Dialog", "Titel"))
|
||||
self.book_search.setText(_translate("Dialog", "Suchen"))
|
||||
self.seach_by_signature.setStatusTip(_translate("Dialog", "Trunkierung mit * am Ende unterstützt"))
|
||||
self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_4), _translate("Dialog", "Suchen"))
|
||||
self.btn_del_select_apparats.setText(_translate("Dialog", "Ausgewählte Löschen"))
|
||||
self.btn_notify_for_deletion.setStatusTip(_translate("Dialog", "Zeigt für jeden ausgewählten Apparat eine eMail-Vorlage an"))
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1244</width>
|
||||
<height>756</height>
|
||||
<height>767</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -207,78 +207,88 @@
|
||||
<attribute name="title">
|
||||
<string>Suchen</string>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="formLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>451</width>
|
||||
<height>121</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_6">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_25">
|
||||
<property name="text">
|
||||
<string>Signatur</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>seach_by_signature</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="seach_by_signature">
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_26">
|
||||
<property name="text">
|
||||
<string>Titel</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>search_by_title</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="search_by_title">
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="book_search">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>180</y>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Suchen</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="30,70">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout" rowminimumheight="1,1,1,1">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_25">
|
||||
<property name="text">
|
||||
<string>Signatur</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>seach_by_signature</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_26">
|
||||
<property name="text">
|
||||
<string>Titel</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>search_by_title</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="search_by_title">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QPushButton" name="book_search">
|
||||
<property name="text">
|
||||
<string>Suchen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="seach_by_signature">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Trunkierung mit * am Ende unterstützt</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -443,7 +453,7 @@
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderStretchLastSection">
|
||||
<bool>true</bool>
|
||||
|
||||
Reference in New Issue
Block a user