Remove subject filtering, keep only priority buttons
Some checks failed
build / build-pip (push) Failing after 12s
build / build-win64 (push) Has been cancelled
build / build-macos (push) Has been cancelled

- Remove subject filter menu and related code
- Simplify filtering to priority groups only
- Keep Remove Filters button for priority reset
- Clean up unused code and UI elements
This commit is contained in:
kdusek
2025-12-01 18:03:54 +01:00
parent 4c3b6925e5
commit efdc63e1ab
5 changed files with 0 additions and 81 deletions

View File

@@ -28,7 +28,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
hidden = QtCore.pyqtSignal()
activated = QtCore.pyqtSignal()
priority_filter_changed = QtCore.pyqtSignal(set)
subject_filter_changed = QtCore.pyqtSignal(set)
def __init__(
self,
@@ -100,10 +99,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
self.pb_critical.setChecked(True)
self.pb_critical.setCheckable(False)
self.subject_menu = QtWidgets.QMenu(self.pb_subject)
self.pb_subject.setMenu(self.subject_menu)
self.subject_actions = {}
self.pb_remove_filters.clicked.connect(self.on_remove_filters_clicked)
# set refresh shortcut (usually ctrl-r)
@@ -280,32 +275,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
priorities.add(9)
self.priority_filter_changed.emit(priorities)
def on_subject_action_toggled(self):
titles = set()
for title, action in self.subject_actions.items():
if action.isChecked():
titles.add(title)
print("Subject filter toggled, allowed titles:", titles)
self.subject_filter_changed.emit(titles)
def on_remove_filters_clicked(self):
# Reset priority buttons
self.pb_low.setChecked(True)
self.pb_normal.setChecked(True)
self.pb_high.setChecked(True)
# Critical is always on
# Reset subject filters
self.messages_proxy_model.set_allowed_titles(set())
for action in self.subject_actions.values():
action.setChecked(True)
def update_subject_filters(self, titles: set[str]):
print("Updating subject filters with titles:", titles)
self.subject_menu.clear()
self.subject_actions.clear()
for title in sorted(titles):
action = self.subject_menu.addAction(title)
action.setCheckable(True)
action.setChecked(True)
action.triggered.connect(self.on_subject_action_toggled)
self.subject_actions[title] = action