aboutsummaryrefslogtreecommitdiffstats
path: root/src/messagedetailsdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/messagedetailsdialog.cpp')
-rw-r--r--src/messagedetailsdialog.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/messagedetailsdialog.cpp b/src/messagedetailsdialog.cpp
index e862fce..b024989 100644
--- a/src/messagedetailsdialog.cpp
+++ b/src/messagedetailsdialog.cpp
@@ -98,6 +98,17 @@ MessageDetailsDialog::MessageDetailsDialog(const QList<ThreadRenderItem> &items,
requestSearch(
row, SearchTerm::SearchMode::Narrow);
});
+ auto *exclude =
+ menu.addAction(tr("Exclude from search"));
+ // Visible but greyed rather than hidden: someone
+ // exploring a fresh window is exactly who should see
+ // that the feature exists.
+ exclude->setEnabled(m_hasQuery);
+ connect(exclude, &QAction::triggered, this,
+ [this, row]() {
+ requestSearch(
+ row, SearchTerm::SearchMode::Exclude);
+ });
menu.exec(value->mapToGlobal(pos));
});
}
@@ -156,5 +167,9 @@ void MessageDetailsDialog::requestSearch(const HeaderRow &row,
{
if (row.query.isEmpty())
return;
+ // Nothing to exclude FROM: the entry is greyed, and this is the second
+ // layer in case it is reached another way.
+ if (mode == SearchTerm::SearchMode::Exclude && !m_hasQuery)
+ return;
emit searchRequested(row.query, mode);
}