36 |
37 |
37 void SettingsEditor::handleAccepted() |
38 void SettingsEditor::handleAccepted() |
38 { |
39 { |
39 this->settings->setValue("locale", this->ui.language->currentData().toString()); |
40 this->settings->setValue("locale", this->ui.language->currentData().toString()); |
40 this->settings->setValue("Render/MainColor", this->ui.mainColorButton->selectedColor().name()); |
41 this->settings->setValue("Render/MainColor", this->ui.mainColorButton->selectedColor().name()); |
|
42 this->settings->setValue("Render/BackgroundColor", this->ui.backgroundColorButton->selectedColor().name()); |
41 this->librariesEditor.saveSettings(this->settings); |
43 this->librariesEditor.saveSettings(this->settings); |
42 } |
44 } |
43 |
45 |
44 void SettingsEditor::loadLocales() |
46 void SettingsEditor::loadLocales() |
45 { |
47 { |
64 } |
66 } |
65 |
67 |
66 void SettingsEditor::setDefaults() |
68 void SettingsEditor::setDefaults() |
67 { |
69 { |
68 this->setCurrentLanguage(this->settings->value("locale", QLocale::system().name()).toString()); |
70 this->setCurrentLanguage(this->settings->value("locale", QLocale::system().name()).toString()); |
69 this->ui.mainColorButton->setSelectedColor(this->settings->value("Render/MainColor").toString()); |
71 this->ui.mainColorButton->setSelectedColor(this->settings->value( |
|
72 "Render/MainColor", |
|
73 gl::RenderPreferences{}.mainColor).toString()); |
|
74 this->ui.backgroundColorButton->setSelectedColor(this->settings->value( |
|
75 "Render/BackgroundColor", |
|
76 gl::RenderPreferences{}.backgroundColor).toString()); |
70 } |
77 } |
71 |
78 |
72 void SettingsEditor::setCurrentLanguage(const QString& localeCode) |
79 void SettingsEditor::setCurrentLanguage(const QString& localeCode) |
73 { |
80 { |
74 for (int i = 0; i < this->ui.language->count(); i += 1) |
81 for (int i = 0; i < this->ui.language->count(); i += 1) |