feat: add Unflag to the sample table context menu

Below Mount/Unmount, acting on the selection like the queue actions.
Flagging happens by dropping rows on the Flagged chip; until now
there was no way back. Disabled when nothing in the selection is
flagged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
duan_jandClaude Fable 5 authored and duan_j committed 2026-08-17 15:34:58 +02:00
1 parent 4175cb8edf
commit 900bc2f6f7
1 file changed
+9
+9
View File
@@ -318,6 +318,11 @@ class TellSamplePanel(QFrame):
mount_action = menu.addAction("Mount")
# Unmount moved here from the removed bottom-row button — same signal.
unmount_action = menu.addAction("Unmount")
menu.addSeparator()
# Flagging happens by dropping rows on the Flagged chip; this is the
# only way back, so it lives here even though Flag does not.
unflag_action = menu.addAction(f"Unflag{count}")
unflag_action.setEnabled(any(s.db_id in self.table_model.flagged_ids for s in selected))
action = menu.exec_(self.table_view.viewport().mapToGlobal(position))
@@ -331,6 +336,10 @@ class TellSamplePanel(QFrame):
elif action == remove_queue_action:
self.remove_from_queue.emit(SampleShortInfoList(s=selected))
self.table_view.clearSelection()
elif action == unflag_action:
for s in selected:
self.table_model.set_flagged(s.db_id, False)
self.table_view.clearSelection()
def header_context_menu(self, pos):
header = self.table_view.horizontalHeader()