summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--searchdialog.cpp17
-rw-r--r--searchdialog.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/searchdialog.cpp b/searchdialog.cpp
index ff469ee..79beb0f 100644
--- a/searchdialog.cpp
+++ b/searchdialog.cpp
@@ -11,6 +11,8 @@
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSettings>
+#include <QKeyEvent>
+#include <QApplication>
#include "searchdialog.h"
#include "helper.h"
@@ -81,6 +83,7 @@ SearchDialog::~SearchDialog(){
void SearchDialog::doSearch(){
int type = mTypeSel->currentData().toInt();
+ qApp->setOverrideCursor(Qt::BusyCursor);
if(type == Title){
doSearchTitle();
}else if(type == Filename){
@@ -88,16 +91,19 @@ void SearchDialog::doSearch(){
}else if(type == Actors){
doSearchActor();
}
+ qApp->restoreOverrideCursor();
}
void SearchDialog::doResult(const QModelIndex &cur, const QModelIndex &prev){
Q_UNUSED(prev)
int type = mTypeSel->currentData().toInt();
+ qApp->setOverrideCursor(Qt::BusyCursor);
if(type == Title || type == Filename){
doResultName(cur, type);
}else if(type == Actors){
doResultActor(cur);
}
+ qApp->restoreOverrideCursor();
}
void SearchDialog::doSearchTitle(){
@@ -293,6 +299,17 @@ void SearchDialog::readSettings(){
}
}
+void SearchDialog::keyPressEvent(QKeyEvent *e){
+ if(e->key() == Qt::Key_X && (e->modifiers() & Qt::ControlModifier)){
+ hide();
+ goto exit;
+ }
+ return QDialog::keyPressEvent(e);
+
+ exit:
+ e->accept();
+}
+
void SearchDialog::doChild(QStandardItem *item, int childMode){
QStringList res;
QIcon aIcon;
diff --git a/searchdialog.h b/searchdialog.h
index efe081e..0ef4aad 100644
--- a/searchdialog.h
+++ b/searchdialog.h
@@ -29,6 +29,9 @@ class SearchDialog : public QDialog {
void writeSettings();
void readSettings();
+ protected:
+ virtual void keyPressEvent(QKeyEvent *e);
+
private:
void doChild(QStandardItem *item, int childMode);
void doActorGenres(QStandardItem *item);