summaryrefslogtreecommitdiffstats
path: root/searchdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'searchdialog.cpp')
-rw-r--r--searchdialog.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/searchdialog.cpp b/searchdialog.cpp
index 0cb442c..04fbf18 100644
--- a/searchdialog.cpp
+++ b/searchdialog.cpp
@@ -22,10 +22,11 @@ SearchDialog::SearchDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent,
//search bar
QLabel *typeL = new QLabel(tr("Search by:"));
mTypeSel = new QComboBox;
- mTypeSel->addItem(tr("Title"), Title);
- mTypeSel->addItem(tr("Filename"), Filename);
mTypeSel->addItem(tr("Actor"), Actors);
+ mTypeSel->addItem(tr("Filename"), Filename);
+ mTypeSel->addItem(tr("Title"), Title);
connect(mTypeSel, QOverload<int>::of(&QComboBox::activated), this, &SearchDialog::doSearch);
+ connect(mTypeSel, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SearchDialog::doSearch);
mSearch = new QLineEdit;
QPushButton *goB = new QPushButton(tr("Go!"));
connect(goB, &QPushButton::clicked, this, &SearchDialog::doSearch);
@@ -321,6 +322,23 @@ void SearchDialog::keyPressEvent(QKeyEvent *e){
hide();
goto exit;
}
+ if(e->key() == Qt::Key_L && (e->modifiers() & Qt::ControlModifier)){
+ mSearch->selectAll();
+ mSearch->setFocus();
+ goto exit;
+ }
+ if(e->key() == Qt::Key_M && (e->modifiers() & Qt::ControlModifier)){
+ mTypeSel->setCurrentIndex(0);
+ goto exit;
+ }
+ if(e->key() == Qt::Key_F && (e->modifiers() & Qt::ControlModifier)){
+ mTypeSel->setCurrentIndex(1);
+ goto exit;
+ }
+ if(e->key() == Qt::Key_T && (e->modifiers() & Qt::ControlModifier)){
+ mTypeSel->setCurrentIndex(2);
+ goto exit;
+ }
return QDialog::keyPressEvent(e);
exit: