aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/jumptotrackdialog.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2017-06-17 13:16:59 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2017-06-17 13:16:59 +0000
commit694a3c5cf3c78ad38b1a2cdbe75331a44f9035df (patch)
tree8bd9b0792baf0a366adff6e9c6dae31065193cab /src/qmmpui/jumptotrackdialog.cpp
parentb2576ddc181d3758e3a57d9cac871ee7d7e2ef06 (diff)
downloadqmmp-694a3c5cf3c78ad38b1a2cdbe75331a44f9035df.tar.gz
qmmp-694a3c5cf3c78ad38b1a2cdbe75331a44f9035df.tar.bz2
qmmp-694a3c5cf3c78ad38b1a2cdbe75331a44f9035df.zip
"jump to track" dialog: always use double click (#918)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7239 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/jumptotrackdialog.cpp')
-rw-r--r--src/qmmpui/jumptotrackdialog.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/qmmpui/jumptotrackdialog.cpp b/src/qmmpui/jumptotrackdialog.cpp
index 8fbd6d8d9..2fa623125 100644
--- a/src/qmmpui/jumptotrackdialog.cpp
+++ b/src/qmmpui/jumptotrackdialog.cpp
@@ -48,8 +48,8 @@ JumpToTrackDialog::JumpToTrackDialog(PlayListModel *model, QWidget* parent)
m_proxyModel->setSortLocaleAware(true);
songsListView->setModel(m_proxyModel);
- connect(songsListView,SIGNAL(activated(QModelIndex)),SLOT(jumpTo(QModelIndex)));
- connect(songsListView,SIGNAL(activated(QModelIndex)),SLOT(accept()));
+ connect(songsListView,SIGNAL(doubleClicked(QModelIndex)),SLOT(jumpTo(QModelIndex)));
+ connect(songsListView,SIGNAL(doubleClicked(QModelIndex)),SLOT(accept()));
connect(songsListView->selectionModel(),SIGNAL(currentRowChanged(QModelIndex, QModelIndex)),
SLOT(queueUnqueue(QModelIndex, QModelIndex)));
@@ -60,6 +60,7 @@ JumpToTrackDialog::JumpToTrackDialog(PlayListModel *model, QWidget* parent)
new QShortcut(tr("F5"),this,SLOT(on_refreshPushButton_clicked()));
filterLineEdit->installEventFilter(this);
+ songsListView->installEventFilter(this);
connect(filterLineEdit, SIGNAL(textChanged(QString)),
m_proxyModel, SLOT(setFilterFixedString(QString)));
@@ -176,5 +177,20 @@ bool JumpToTrackDialog::eventFilter(QObject *o, QEvent *e)
return true;
}
}
+ else if(o == songsListView && e->type() == QEvent::KeyPress)
+ {
+ QKeyEvent *key_event = static_cast<QKeyEvent *>(e);
+ QModelIndex index = songsListView->currentIndex();
+
+ if(key_event->key() == Qt::Key_Return)
+ {
+ if(index.isValid())
+ {
+ jumpTo(index);
+ accept();
+ }
+ return true;
+ }
+ }
return QDialog::eventFilter(o, e);
}