1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-15 18:58:55 +01:00

Really don't allow pausing last.fm streams

This commit is contained in:
David Sansome 2010-01-17 15:48:31 +00:00
parent 3526fb3bdc
commit 63d7afb404
2 changed files with 13 additions and 2 deletions

View File

@ -436,7 +436,7 @@ void MainWindow::InsertRadioItem(RadioItem* item) {
void MainWindow::PlaylistRightClick(const QPoint& global_pos, const QModelIndex& index) {
playlist_menu_index_ = index;
if (playlist_->current_index() == index.row()) {
if (playlist_->current_index() == index.row() && player_->GetState() == Engine::Playing) {
playlist_play_pause_->setText("Pause");
playlist_play_pause_->setIcon(QIcon(":media-playback-pause.png"));
} else {
@ -444,7 +444,14 @@ void MainWindow::PlaylistRightClick(const QPoint& global_pos, const QModelIndex&
playlist_play_pause_->setIcon(QIcon(":media-playback-start.png"));
}
playlist_play_pause_->setEnabled(index.isValid());
if (index.isValid()) {
playlist_play_pause_->setEnabled(
playlist_->current_index() != index.row() ||
! (playlist_->item_at(index.row())->options() & PlaylistItem::PauseDisabled));
} else {
playlist_play_pause_->setEnabled(false);
}
playlist_stop_after_->setEnabled(index.isValid());
// Are any of the selected songs editable?

View File

@ -56,6 +56,10 @@ void Player::PlayPause() {
break;
case Engine::Playing:
// We really shouldn't pause last.fm streams
if (playlist_->current_item()->options() & PlaylistItem::PauseDisabled)
break;
qDebug() << "Pausing";
engine_->pause();
break;