aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/desktop-utils')
-rw-r--r--src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp11
-rw-r--r--src-qt5/desktop-utils/lumina-screenshot/MainUI.h5
2 files changed, 16 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp b/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp
index 364c391c..be0fc02b 100644
--- a/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp
+++ b/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp
@@ -72,6 +72,13 @@ MainUI::MainUI()
IMG->setDefaultSize(ui->scrollArea->maximumViewportSize());
IMG->LoadImage( QApplication::screens().at(0)->grabWindow(QApplication::desktop()->winId()).toImage() ); //initial screenshot
lastScreenShot = QDateTime::currentDateTime();
+
+ // Shortcuts
+ quitShortcut = new QShortcut(Qt::CTRL + Qt::Key_Q, this);
+ connect(quitShortcut, SIGNAL(activated()), this, SLOT(on_quitShortcut_Triggered()) );
+ openShortcut = new QShortcut(Qt::CTRL + Qt::Key_O, this);
+ connect(openShortcut, SIGNAL(activated()), this, SLOT(quicksave()) );
+
//ui->label_screenshot->setPixmap( cpic.scaled(ui->label_screenshot->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation) );
}
@@ -330,3 +337,7 @@ void MainUI::closeEvent(QCloseEvent *ev){
}
QMainWindow::closeEvent(ev);
}
+
+void MainUI::on_quitShortcut_Triggered(){
+ QApplication::quit();
+}
diff --git a/src-qt5/desktop-utils/lumina-screenshot/MainUI.h b/src-qt5/desktop-utils/lumina-screenshot/MainUI.h
index a76ae19f..91d4966f 100644
--- a/src-qt5/desktop-utils/lumina-screenshot/MainUI.h
+++ b/src-qt5/desktop-utils/lumina-screenshot/MainUI.h
@@ -19,6 +19,7 @@
#include <QAction>
#include <QScreen>
#include <QTabBar>
+#include <QShortcut>
#include <LuminaXDG.h>
#include <LUtils.h>
@@ -60,6 +61,8 @@ private:
QRect pointsToRect(QPoint pt1, QPoint pt2);
+ QShortcut *quitShortcut, *openShortcut;
+
private slots:
//Button Slots
void closeApplication(){
@@ -82,6 +85,8 @@ private slots:
bool getWindow(); //set the "cwin" variable as appropriate
void getPixmap(); //set the "cpic" variable to the new screenshot
+ void on_quitShortcut_Triggered();
+
protected:
void mousePressEvent(QMouseEvent *ev);
void mouseMoveEvent(QMouseEvent *ev);
bgstack15