diff options
Diffstat (limited to 'searchdialog.cpp')
-rw-r--r-- | searchdialog.cpp | 17 |
1 files changed, 17 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; |