Add message filtering by priority and subject, with CRITICAL always visible

- Implement MessagesProxyModel for client-side filtering
- Add priority filter buttons (LOW 0-3, NORMAL 4-8, HIGH 9, CRITICAL 10 always shown)
- Add subject filter menu with checkable actions for message titles
- Add Remove Filters button to reset all filters
- Restore priority 10 persistent notification setting in options
- Fix settings dialog errors and update UI layouts
- Ensure CRITICAL priority messages cannot be filtered out but can toggle persistent pop-ups
This commit is contained in:
kdusek
2025-12-01 18:02:05 +01:00
parent 09f85c5902
commit 4c3b6925e5
11 changed files with 422 additions and 221 deletions

View File

@@ -1,6 +1,6 @@
# Form implementation generated from reading ui file 'gotify_tray/gui/designs\widget_main.ui'
# Form implementation generated from reading ui file 'gotify_tray/gui/designs/widget_main.ui'
#
# Created by: PyQt6 UI code generator 6.5.0
# Created by: PyQt6 UI code generator 6.9.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
@@ -47,6 +47,43 @@ class Ui_MainWindow(object):
self.pb_delete_all.setObjectName("pb_delete_all")
self.horizontalLayout.addWidget(self.pb_delete_all)
self.verticalLayout_2.addLayout(self.horizontalLayout)
self.filtersLayout = QtWidgets.QHBoxLayout()
self.filtersLayout.setObjectName("filtersLayout")
self.label_priority = QtWidgets.QLabel(parent=self.verticalLayoutWidget)
self.label_priority.setObjectName("label_priority")
self.filtersLayout.addWidget(self.label_priority)
self.pb_low = QtWidgets.QPushButton(parent=self.verticalLayoutWidget)
self.pb_low.setCheckable(True)
self.pb_low.setChecked(True)
self.pb_low.setObjectName("pb_low")
self.filtersLayout.addWidget(self.pb_low)
self.pb_normal = QtWidgets.QPushButton(parent=self.verticalLayoutWidget)
self.pb_normal.setCheckable(True)
self.pb_normal.setChecked(True)
self.pb_normal.setObjectName("pb_normal")
self.filtersLayout.addWidget(self.pb_normal)
self.pb_high = QtWidgets.QPushButton(parent=self.verticalLayoutWidget)
self.pb_high.setCheckable(True)
self.pb_high.setChecked(True)
self.pb_high.setObjectName("pb_high")
self.filtersLayout.addWidget(self.pb_high)
self.pb_critical = QtWidgets.QPushButton(parent=self.verticalLayoutWidget)
self.pb_critical.setCheckable(True)
self.pb_critical.setChecked(True)
self.pb_critical.setObjectName("pb_critical")
self.filtersLayout.addWidget(self.pb_critical)
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.filtersLayout.addItem(spacerItem2)
self.label_subject = QtWidgets.QLabel(parent=self.verticalLayoutWidget)
self.label_subject.setObjectName("label_subject")
self.filtersLayout.addWidget(self.label_subject)
self.pb_subject = QtWidgets.QPushButton(parent=self.verticalLayoutWidget)
self.pb_subject.setObjectName("pb_subject")
self.filtersLayout.addWidget(self.pb_subject)
self.pb_remove_filters = QtWidgets.QPushButton(parent=self.verticalLayoutWidget)
self.pb_remove_filters.setObjectName("pb_remove_filters")
self.filtersLayout.addWidget(self.pb_remove_filters)
self.verticalLayout_2.addLayout(self.filtersLayout)
self.listView_messages = QtWidgets.QListView(parent=self.verticalLayoutWidget)
self.listView_messages.setAutoScroll(True)
self.listView_messages.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
@@ -66,6 +103,14 @@ class Ui_MainWindow(object):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Form"))
self.label_application.setText(_translate("MainWindow", "Application"))
self.label_priority.setText(_translate("MainWindow", "Priority:"))
self.pb_low.setText(_translate("MainWindow", "LOW"))
self.pb_normal.setText(_translate("MainWindow", "NORMAL"))
self.pb_high.setText(_translate("MainWindow", "HIGH"))
self.pb_critical.setText(_translate("MainWindow", "CRITICAL"))
self.label_subject.setText(_translate("MainWindow", "Subject:"))
self.pb_subject.setText(_translate("MainWindow", "Subject"))
self.pb_remove_filters.setText(_translate("MainWindow", "Remove Filters"))
if __name__ == "__main__":