Allow playing of tracks already in queue

This commit is contained in:
Mark Furneaux 2018-03-18 22:03:04 -04:00
parent 6e387c2578
commit a789ce82ca
2 changed files with 14 additions and 3 deletions

View File

@ -152,6 +152,17 @@ void Queue::ToggleTracks(const QModelIndexList& source_indexes) {
}
void Queue::InsertFirst(const QModelIndexList& source_indexes) {
for (const QModelIndex& source_index : source_indexes) {
QModelIndex proxy_index = mapFromSource(source_index);
if (proxy_index.isValid()) {
// Already in the queue, so remove it to be reinserted later
const int row = proxy_index.row();
beginRemoveRows(QModelIndex(), row, row);
source_indexes_.removeAt(row);
endRemoveRows();
}
}
const int rows = source_indexes.count();
// Enqueue the tracks at the beginning
beginInsertRows(QModelIndex(), 0, rows - 1);

View File

@ -1763,10 +1763,10 @@ void MainWindow::PlaylistRightClick(const QPoint& global_pos,
else
playlist_queue_->setText(tr("Toggle queue status"));
if (in_queue == 0 && not_in_queue == 1)
playlist_queue_play_next_->setText(tr("Play next"));
else if (in_queue == 0 && not_in_queue > 1)
if (all > 1)
playlist_queue_play_next_->setText(tr("Play selected tracks next"));
else
playlist_queue_play_next_->setText(tr("Play next"));
if (in_skipped == 1 && not_in_skipped == 0)
playlist_skip_->setText(tr("Unskip track"));