Restore the blur amount setting when the settings dialog is loaded. Also remove some unusued variables. Fixes issue 3497

This commit is contained in:
David Sansome 2013-02-17 13:55:54 +11:00
parent 578e143cf1
commit c03f69daa7
3 changed files with 4 additions and 10 deletions

View File

@ -73,7 +73,6 @@ class PlaylistView : public QTreeView {
// Constants for settings: are persistent, values should not be changed
static const char* kSettingBackgroundImageType;
static const char* kSettingBackgroundImageFilename;
static const int kSettingBackgroundBlurLevel;
static ColumnAlignmentMap DefaultColumnAlignment();

View File

@ -51,13 +51,14 @@ AppearanceSettingsPage::AppearanceSettingsPage(SettingsDialog* dialog)
ui_->setupUi(this);
setWindowIcon(IconLoader::Load("view-media-visualization"));
connect(ui_->blur_slider, SIGNAL(valueChanged(int)), SLOT(BlurLevelChanged(int)));
connect(ui_->opacity_slider, SIGNAL(valueChanged(int)), SLOT(OpacityLevelChanged(int)));
Load();
connect(ui_->select_foreground_color, SIGNAL(pressed()), SLOT(SelectForegroundColor()));
connect(ui_->select_background_color, SIGNAL(pressed()), SLOT(SelectBackgroundColor()));
connect(ui_->use_a_custom_color_set, SIGNAL(toggled(bool)), SLOT(UseCustomColorSetOptionChanged(bool)));
connect(ui_->blur_slider, SIGNAL(valueChanged(int)), SLOT(BlurLevelChanged(int)));
connect(ui_->opacity_slider, SIGNAL(valueChanged(int)), SLOT(OpacityLevelChanged(int)));
connect(ui_->select_background_image_filename_button, SIGNAL(pressed()), SLOT(SelectBackgroundImage()));
connect(ui_->use_custom_background_image, SIGNAL(toggled(bool)),
@ -128,10 +129,8 @@ void AppearanceSettingsPage::Load() {
DisableBlurSlider(true);
}
ui_->background_image_filename->setText(playlist_view_background_image_filename_);
/* There has to be a way to just simulate the change... */
ui_->blur_slider->setValue(s.value("blur_radius").toInt());
ui_->opacity_slider->setValue(s.value("opacity_level").toInt());
OpacityLevelChanged(s.value("opacity_level").toInt());
s.endGroup();
@ -254,12 +253,10 @@ void AppearanceSettingsPage::SelectBackgroundImage() {
}
void AppearanceSettingsPage::BlurLevelChanged(int value) {
background_blur_radius_ = value;
ui_->background_blur_radius_label->setText(QString("%1px").arg(value));
}
void AppearanceSettingsPage::OpacityLevelChanged(int percent) {
background_opacity_level_ = percent;
ui_->background_opacity_label->setText(QString("%1\%").arg(percent));
}

View File

@ -65,8 +65,6 @@ private:
QColor current_background_color_;
PlaylistView::BackgroundImageType playlist_view_background_image_type_;
QString playlist_view_background_image_filename_;
int background_blur_radius_;
int background_opacity_level_;
bool initialised_moodbar_previews_;
};