Add option to continue to next song in playlist on error

Also rename some settings. Add option to grey out songs both on playback and
on startup.
This commit is contained in:
Jonas Kvinge 2018-10-30 23:20:02 +01:00
parent 4993201b70
commit 6105b99a7f
4 changed files with 32 additions and 11 deletions

View File

@ -1310,9 +1310,11 @@ void Playlist::ItemsLoaded(QFuture<PlaylistItemList> future) {
QSettings s;
s.beginGroup(kSettingsGroup);
bool greyout = s.value("greyout_songs_startup", true).toBool();
s.endGroup();
// Should we gray out deleted songs asynchronously on startup?
if (s.value("greyoutdeleted", false).toBool()) {
if (greyout) {
QtConcurrent::run(this, &Playlist::InvalidateDeletedSongs);
}

View File

@ -109,7 +109,7 @@
</widget>
</item>
<item>
<spacer name="horizontalSpacer_1">
<spacer name="spacer_fading_1">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -160,7 +160,7 @@
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<spacer name="spacer_fading_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -178,7 +178,7 @@
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<spacer name="spacer_bottom">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>

View File

@ -71,7 +71,10 @@ void PlaylistSettingsPage::Load() {
ui_->combobox_doubleclickaddmode->setCurrentIndex(ui_->combobox_doubleclickaddmode->findData(s.value("doubleclick_addmode", MainWindow::AddBehaviour_Append).toInt()));
ui_->combobox_doubleclickplaymode->setCurrentIndex(ui_->combobox_doubleclickplaymode->findData(s.value("doubleclick_playmode", MainWindow::PlayBehaviour_Never).toInt()));
ui_->combobox_menuplaymode->setCurrentIndex(ui_->combobox_menuplaymode->findData(s.value("menu_playmode", MainWindow::PlayBehaviour_Never).toInt()));
ui_->checkbox_greyoutdeleted->setChecked(s.value("greyoutdeleted", false).toBool());
ui_->checkbox_continueonerror->setChecked(s.value("continue_on_error", false).toBool());
ui_->checkbox_greyout_songs_startup->setChecked(s.value("greyout_songs_startup", true).toBool());
ui_->checkbox_greyout_songs_play->setChecked(s.value("greyout_songs_play", true).toBool());
Playlist::Path path = Playlist::Path(s.value(Playlist::kPathType, Playlist::Path_Automatic).toInt());
switch (path) {
@ -119,10 +122,12 @@ void PlaylistSettingsPage::Save() {
}
s.beginGroup(PlaylistSettingsPage::kSettingsGroup);
s.setValue("continue_on_error", ui_->checkbox_continueonerror->isChecked());
s.setValue("greyout_songs_startup", ui_->checkbox_greyout_songs_startup->isChecked());
s.setValue("greyout_songs_play", ui_->checkbox_greyout_songs_play->isChecked());
s.setValue("doubleclick_addmode", doubleclick_addmode);
s.setValue("doubleclick_playmode", doubleclick_playmode);
s.setValue("menu_playmode", menu_playmode);
s.setValue("greyoutdeleted", ui_->checkbox_greyoutdeleted->isChecked());
s.setValue(Playlist::kPathType, static_cast<int>(path));
s.setValue("warn_close_playlist", ui_->checkbox_warncloseplaylist->isChecked());
s.setValue("editmetadatainline", ui_->checkbox_editmetadatainline->isChecked());

View File

@ -22,9 +22,23 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkbox_greyoutdeleted">
<widget class="QCheckBox" name="checkbox_continueonerror">
<property name="text">
<string>Grey out non existent songs in my playlists</string>
<string>Continue to the next item in the playlist if a song is unavailable</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkbox_greyout_songs_play">
<property name="text">
<string>Grey out unavailable songs in playlists on playback</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkbox_greyout_songs_startup">
<property name="text">
<string>Grey out unavailable songs in playlists on startup</string>
</property>
</widget>
</item>
@ -178,7 +192,7 @@
<item>
<widget class="QRadioButton" name="radiobutton_automaticpath">
<property name="text">
<string>Auto&amp;matic</string>
<string>A&amp;utomatic</string>
</property>
<property name="checked">
<bool>true</bool>
@ -188,14 +202,14 @@
<item>
<widget class="QRadioButton" name="radiobutton_absolutepath">
<property name="text">
<string>Absolute</string>
<string>Absolu&amp;te</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radiobutton_relativepath">
<property name="text">
<string>Relati&amp;ve</string>
<string>Re&amp;lative</string>
</property>
</widget>
</item>