1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-17 12:02:48 +01:00

Minor changes requested by hatstand.

This commit is contained in:
Gavin Howard 2014-08-18 08:08:14 -06:00
parent a468085c3a
commit d8ba0c4f91
4 changed files with 13 additions and 12 deletions

View File

@ -56,7 +56,7 @@ PlaylistContainer::PlaylistContainer(QWidget* parent)
ui_->file_path_box->addItem("Relative"); ui_->file_path_box->addItem("Relative");
connect(ui_->file_path_box, SIGNAL(currentIndexChanged(int)), connect(ui_->file_path_box, SIGNAL(currentIndexChanged(int)),
SLOT(PathSettingChanged())); SLOT(PathSettingChanged(int)));
no_matches_label_ = new QLabel(ui_->playlist); no_matches_label_ = new QLabel(ui_->playlist);
no_matches_label_->setAlignment(Qt::AlignTop | Qt::AlignHCenter); no_matches_label_->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
@ -470,8 +470,6 @@ bool PlaylistContainer::eventFilter(QObject* objectWatched, QEvent* event) {
return QWidget::eventFilter(objectWatched, event); return QWidget::eventFilter(objectWatched, event);
} }
void PlaylistContainer::PathSettingChanged() { void PlaylistContainer::PathSettingChanged(int index) {
int value = ui_->file_path_box->currentIndex(); settings_.setValue(Playlist::kPathType, index);
Playlist::Path path = static_cast<Playlist::Path>(value);
settings_.setValue(Playlist::kPathType, int(path));
} }

View File

@ -94,7 +94,7 @@ signals:
void UpdateNoMatchesLabel(); void UpdateNoMatchesLabel();
void PathSettingChanged(); void PathSettingChanged(int index);
private: private:
void UpdateActiveIcon(const QIcon& icon); void UpdateActiveIcon(const QIcon& icon);

View File

@ -108,7 +108,7 @@ void M3UParser::Save(const SongList& songs, QIODevice* device,
QSettings s; QSettings s;
s.beginGroup(Playlist::kSettingsGroup); s.beginGroup(Playlist::kSettingsGroup);
bool writeMetadata = s.value("write_metadata", true).toBool(); bool writeMetadata = s.value(Playlist::kWriteMetadata, true).toBool();
s.endGroup(); s.endGroup();
for (const Song& song : songs) { for (const Song& song : songs) {

View File

@ -148,7 +148,7 @@ void BehaviourSettingsPage::Load() {
break; break;
} }
ui_->b_write_metadata->setChecked(s.value(Playlist::kWriteMetadata, true).toBool()); ui_->b_write_metadata->setChecked(s.value(Playlist::kWriteMetadata, true).toBool());
ui_->b_quickchange_menu->setChecked(s.value(Playlist::kQuickChangeMenu, true).toBool()); ui_->b_quickchange_menu->setChecked(s.value(Playlist::kQuickChangeMenu, false).toBool());
s.endGroup(); s.endGroup();
s.beginGroup(PlaylistTabBar::kSettingsGroup); s.beginGroup(PlaylistTabBar::kSettingsGroup);
@ -179,12 +179,15 @@ void BehaviourSettingsPage::Save() {
ui_->menu_playmode->itemData(ui_->menu_playmode->currentIndex()).toInt()); ui_->menu_playmode->itemData(ui_->menu_playmode->currentIndex()).toInt());
Playlist::Path path = Playlist::Path_Automatic; Playlist::Path path = Playlist::Path_Automatic;
if (ui_->b_automatic_path->isChecked()) if (ui_->b_automatic_path->isChecked()) {
path = Playlist::Path_Automatic; path = Playlist::Path_Automatic;
if (ui_->b_absolute_path->isChecked()) }
else if (ui_->b_absolute_path->isChecked()) {
path = Playlist::Path_Absolute; path = Playlist::Path_Absolute;
if (ui_->b_relative_path->isChecked()) }
else if (ui_->b_relative_path->isChecked()) {
path = Playlist::Path_Relative; path = Playlist::Path_Relative;
}
s.beginGroup(MainWindow::kSettingsGroup); s.beginGroup(MainWindow::kSettingsGroup);
s.setValue("showtray", ui_->b_show_tray_icon_->isChecked()); s.setValue("showtray", ui_->b_show_tray_icon_->isChecked());
@ -206,7 +209,7 @@ void BehaviourSettingsPage::Save() {
s.beginGroup(Playlist::kSettingsGroup); s.beginGroup(Playlist::kSettingsGroup);
s.setValue("greyoutdeleted", ui_->b_grey_out_deleted_->isChecked()); s.setValue("greyoutdeleted", ui_->b_grey_out_deleted_->isChecked());
s.setValue("click_edit_inline", ui_->b_click_edit_inline_->isChecked()); s.setValue("click_edit_inline", ui_->b_click_edit_inline_->isChecked());
s.setValue(Playlist::kPathType, int(path)); s.setValue(Playlist::kPathType, static_cast<int>(path));
s.setValue(Playlist::kWriteMetadata, ui_->b_write_metadata->isChecked()); s.setValue(Playlist::kWriteMetadata, ui_->b_write_metadata->isChecked());
s.setValue(Playlist::kQuickChangeMenu, ui_->b_quickchange_menu->isChecked()); s.setValue(Playlist::kQuickChangeMenu, ui_->b_quickchange_menu->isChecked());
s.endGroup(); s.endGroup();