Add settings option to stop playback if song fails to play (#5905)

This commit is contained in:
Adrian Garcia 2017-11-21 05:00:36 -05:00 committed by John Maguire
parent 7b1b43ffed
commit 27fc915921
3 changed files with 24 additions and 1 deletions

View File

@ -613,7 +613,16 @@ void Player::InvalidSongRequested(const QUrl& url) {
emit SongChangeRequestProcessed(url, false);
// ... and now when our listeners have completed their processing of the
// current item we can change the current item by skipping to the next song
NextItem(Engine::Auto);
QSettings s;
s.beginGroup(kSettingsGroup);
bool stop_playback = s.value("stop_play_if_fail", 0).toBool();
s.endGroup();
if (!stop_playback) {
NextItem(Engine::Auto);
}
}
void Player::RegisterUrlHandler(UrlHandler* handler) {

View File

@ -141,6 +141,8 @@ void BehaviourSettingsPage::Load() {
s.endGroup();
s.beginGroup(Player::kSettingsGroup);
ui_->stop_play_if_fail_->setChecked(
s.value("stop_play_if_fail", false).toBool());
ui_->menu_previousmode->setCurrentIndex(ui_->menu_previousmode->findData(
s.value("menu_previousmode", Player::PreviousBehaviour_DontRestart)
.toInt()));
@ -241,6 +243,8 @@ void BehaviourSettingsPage::Save() {
s.endGroup();
s.beginGroup(Player::kSettingsGroup);
s.setValue("stop_play_if_fail",
ui_->stop_play_if_fail_->isChecked());
s.setValue("menu_previousmode", menu_previousmode);
s.setValue("seek_step_sec", ui_->seek_step_sec->value());
s.endGroup();

View File

@ -136,6 +136,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="stop_play_if_fail_">
<property name="text">
<string>Stop playback if song fails to play</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="b_grey_out_deleted_">
<property name="text">