aboutsummaryrefslogtreecommitdiff
path: root/lumina-search
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-10-15 07:29:31 -0400
committerKen Moore <moorekou@gmail.com>2015-10-15 07:29:31 -0400
commit3d6730ac6fdd70ad15ad48fb3213c65695d8f46b (patch)
treefcd314c8d36bc7fa64892b90fa96173e6e1bf6f6 /lumina-search
parentFix a crash in the thumbnail loading routine where an invalid item can accide... (diff)
downloadlumina-3d6730ac6fdd70ad15ad48fb3213c65695d8f46b.tar.gz
lumina-3d6730ac6fdd70ad15ad48fb3213c65695d8f46b.tar.bz2
lumina-3d6730ac6fdd70ad15ad48fb3213c65695d8f46b.zip
Add the "Escape" keyboard shortcut to close lumina-search.
Diffstat (limited to 'lumina-search')
-rw-r--r--lumina-search/MainUI.cpp3
-rw-r--r--lumina-search/MainUI.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/lumina-search/MainUI.cpp b/lumina-search/MainUI.cpp
index 08356093..363d788e 100644
--- a/lumina-search/MainUI.cpp
+++ b/lumina-search/MainUI.cpp
@@ -26,6 +26,8 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
searcher = new Worker();
searcher->moveToThread(workthread);
+ closeShort = new QShortcut(QKeySequence(tr("Esc")), this);
+
//Setup the connections
connect(livetime, SIGNAL(timeout()), this, SLOT(startSearch()) );
connect(this, SIGNAL(SearchTerm(QString, bool)), searcher, SLOT(StartSearch(QString, bool)) );
@@ -41,6 +43,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
connect(ui->listWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(LaunchItem(QListWidgetItem*)) );
connect(ui->listWidget, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(LaunchItem(QListWidgetItem*)) );
connect(ui->tool_configure, SIGNAL(clicked()), this, SLOT(configureSearch()) );
+ connect(closeShort, SIGNAL(activated()), this, SLOT( close() ) );
//Setup the settings file
QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina");
diff --git a/lumina-search/MainUI.h b/lumina-search/MainUI.h
index 0a9f4acb..599a5195 100644
--- a/lumina-search/MainUI.h
+++ b/lumina-search/MainUI.h
@@ -14,6 +14,7 @@
#include <QThread>
#include <QProcess>
#include <QListWidgetItem>
+#include <QShortcut>
#include <LuminaXDG.h>
@@ -43,6 +44,7 @@ private:
QTimer *livetime;
Worker *searcher;
QSettings *settings;
+ QShortcut *closeShort;
void updateDefaultStatusTip();
bgstack15