mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-16 11:19:18 +01:00
Really don't allow pausing last.fm streams
This commit is contained in:
parent
3526fb3bdc
commit
63d7afb404
@ -436,7 +436,7 @@ void MainWindow::InsertRadioItem(RadioItem* item) {
|
|||||||
void MainWindow::PlaylistRightClick(const QPoint& global_pos, const QModelIndex& index) {
|
void MainWindow::PlaylistRightClick(const QPoint& global_pos, const QModelIndex& index) {
|
||||||
playlist_menu_index_ = 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_->setText("Pause");
|
||||||
playlist_play_pause_->setIcon(QIcon(":media-playback-pause.png"));
|
playlist_play_pause_->setIcon(QIcon(":media-playback-pause.png"));
|
||||||
} else {
|
} 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_->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());
|
playlist_stop_after_->setEnabled(index.isValid());
|
||||||
|
|
||||||
// Are any of the selected songs editable?
|
// Are any of the selected songs editable?
|
||||||
|
@ -56,6 +56,10 @@ void Player::PlayPause() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Engine::Playing:
|
case Engine::Playing:
|
||||||
|
// We really shouldn't pause last.fm streams
|
||||||
|
if (playlist_->current_item()->options() & PlaylistItem::PauseDisabled)
|
||||||
|
break;
|
||||||
|
|
||||||
qDebug() << "Pausing";
|
qDebug() << "Pausing";
|
||||||
engine_->pause();
|
engine_->pause();
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user