When 'Return'/'Enter' is pressed when play queue has focus, start playing from the first selected song.
BUG:16
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
7. Have cantata-dynamic helper script send a dbus message when it starts and
|
||||
stops - so that cantata main window can show the current status if the helper
|
||||
is started externally.
|
||||
8. When 'Return'/'Enter' is pressed when play queue has focus, start playing
|
||||
from the first selected song.
|
||||
|
||||
0.7.0
|
||||
-----
|
||||
|
||||
@@ -1234,6 +1234,17 @@ void MainWindow::mpdConnectionStateChanged(bool connected)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if ((Qt::Key_Enter==event->key() || Qt::Key_Return==event->key()) &&
|
||||
playQueue->hasFocus() && !playQueue->selectionModel()->selectedRows().isEmpty()) {
|
||||
//play the first selected song
|
||||
QModelIndexList selection=playQueue->selectionModel()->selectedRows();
|
||||
qSort(selection);
|
||||
playQueueItemActivated(selection.first());
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if (trayItem) {
|
||||
|
||||
@@ -190,6 +190,7 @@ public:
|
||||
const QDateTime & getDbUpdate() const;
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user