Commit 48485e4f authored by Glen Ditchfield's avatar Glen Ditchfield 🐛
Browse files

Bind keyboard shortcuts in the Search dialog's results

Bind the Delete key to the "Delete" action, and Return to "Edit...".
This finishes off
BUG: 315894
parent 064fc10d
Pipeline #71998 passed with stage
in 9 minutes and 50 seconds
......@@ -22,6 +22,7 @@
#include <QDialogButtonBox>
#include <QPushButton>
#include <QShortcut>
SearchDialog::SearchDialog(CalendarView *calendarview)
: QDialog(calendarview)
......@@ -82,6 +83,11 @@ SearchDialog::SearchDialog(CalendarView *calendarview)
// connect(m_popupMenu, &KOEventPopupMenu::toggleTodoCompletedSignal, this,
// &SearchDialog::toggleTodoCompletedSignal);
const auto delKey = new QShortcut(QKeySequence(Qt::Key_Delete), this);
connect(delKey, &QShortcut::activated, this, &SearchDialog::slotDeleteSelection);
const auto retKey = new QShortcut(QKeySequence(Qt::Key_Return), this);
connect(retKey, &QShortcut::activated, this, &SearchDialog::slotEditSelection);
readConfig();
}
......@@ -264,6 +270,22 @@ void SearchDialog::writeConfig()
group.sync();
}
void SearchDialog::slotDeleteSelection()
{
const auto selected = listView->selectedIncidences();
if (selected.count() > 0) {
Q_EMIT deleteIncidenceSignal(selected.at(0));
}
}
void SearchDialog::slotEditSelection()
{
const auto selected = listView->selectedIncidences();
if (selected.count() > 0) {
Q_EMIT editIncidenceSignal(selected.at(0));
}
}
void SearchDialog::slotHelpRequested()
{
PimCommon::Util::invokeHelp(QStringLiteral("korganizer/search-view.html"));
......
......@@ -44,6 +44,8 @@ public:
private Q_SLOTS:
void popupMenu(const QPoint &point);
void slotDeleteSelection();
void slotEditSelection();
void slotHelpRequested();
Q_SIGNALS:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment