summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Nicoletti <[email protected]>2018-01-26 11:07:21 -0200
committerDaniel Nicoletti <[email protected]>2018-01-26 11:07:21 -0200
commit6547b707093e58cc0b4a83e1c7876d1003349e38 (patch)
tree2575f09a1c12124aaba21127ced0c5d593b80715
parentab9c8293c48875a67ebb2a44f3637bfa0101bfbc (diff)
Allow canceling a job with Delete key shortcut
-rw-r--r--printqueue/PrintQueueUi.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/printqueue/PrintQueueUi.cpp b/printqueue/PrintQueueUi.cpp
index cf2d780..ce0fb7c 100644
--- a/printqueue/PrintQueueUi.cpp
+++ b/printqueue/PrintQueueUi.cpp
@@ -35,6 +35,7 @@
#include <QProcess>
#include <QDebug>
#include <QPointer>
+#include <QShortcut>
#include <KMessageBox>
#include <KIconLoader>
@@ -173,6 +174,10 @@ PrintQueueUi::PrintQueueUi(const KCupsPrinter &printer, QWidget *parent) :
// Restore the dialog size
KConfigGroup configGroup(KSharedConfig::openConfig(QLatin1String("print-manager")), "PrintQueue");
KWindowConfig::restoreWindowSize(windowHandle(), configGroup);
+
+ auto delJobShortcut = new QShortcut(QKeySequence::Delete, ui->jobsView);
+ delJobShortcut->setContext(Qt::WidgetShortcut);
+ connect(delJobShortcut, &QShortcut::activated, this, &PrintQueueUi::cancelJob);
}
PrintQueueUi::~PrintQueueUi()