cleaned up the checkboxes
This commit is contained in:
parent
6f29111c40
commit
4a68eba106
12
src/main.cpp
12
src/main.cpp
|
@ -265,8 +265,8 @@ public:
|
||||||
|
|
||||||
auto anyOtherCheckbox = new wxCheckBox(this, wxID_ANY, _("Any other"), wxDefaultPosition, wxDefaultSize, 0);
|
auto anyOtherCheckbox = new wxCheckBox(this, wxID_ANY, _("Any other"), wxDefaultPosition, wxDefaultSize, 0);
|
||||||
anyOtherCheckbox->SetValue(settings.anyOtherEnabled);
|
anyOtherCheckbox->SetValue(settings.anyOtherEnabled);
|
||||||
anyOtherCheckbox->Bind(wxEVT_CHECKBOX, [&](wxCommandEvent& event) {
|
anyOtherCheckbox->Bind(wxEVT_CHECKBOX, [](wxCommandEvent& event) {
|
||||||
bool isChecked = anyOtherCheckbox->IsChecked();
|
bool isChecked = event.IsChecked();
|
||||||
auto settings = utils::getSettings();
|
auto settings = utils::getSettings();
|
||||||
settings.anyOtherEnabled = isChecked;
|
settings.anyOtherEnabled = isChecked;
|
||||||
utils::saveSettings(settings);
|
utils::saveSettings(settings);
|
||||||
|
@ -295,8 +295,8 @@ public:
|
||||||
|
|
||||||
auto lastfmEnabledCheckbox = new wxCheckBox(this, wxID_ANY, _("Enabled"), wxDefaultPosition, wxDefaultSize, 0);
|
auto lastfmEnabledCheckbox = new wxCheckBox(this, wxID_ANY, _("Enabled"), wxDefaultPosition, wxDefaultSize, 0);
|
||||||
lastfmEnabledCheckbox->SetValue(settings.lastfm.enabled);
|
lastfmEnabledCheckbox->SetValue(settings.lastfm.enabled);
|
||||||
lastfmEnabledCheckbox->Bind(wxEVT_CHECKBOX, [&](wxCommandEvent& event) {
|
lastfmEnabledCheckbox->Bind(wxEVT_CHECKBOX, [](wxCommandEvent& event) {
|
||||||
bool isChecked = lastfmEnabledCheckbox->IsChecked();
|
bool isChecked = event.IsChecked();
|
||||||
auto settings = utils::getSettings();
|
auto settings = utils::getSettings();
|
||||||
settings.lastfm.enabled = isChecked;
|
settings.lastfm.enabled = isChecked;
|
||||||
utils::saveSettings(settings);
|
utils::saveSettings(settings);
|
||||||
|
@ -371,8 +371,8 @@ public:
|
||||||
auto autostartCheckbox =
|
auto autostartCheckbox =
|
||||||
new wxCheckBox(this, wxID_ANY, _("Launch at login"), wxDefaultPosition, wxDefaultSize, 0);
|
new wxCheckBox(this, wxID_ANY, _("Launch at login"), wxDefaultPosition, wxDefaultSize, 0);
|
||||||
autostartCheckbox->SetValue(settings.autoStart);
|
autostartCheckbox->SetValue(settings.autoStart);
|
||||||
autostartCheckbox->Bind(wxEVT_CHECKBOX, [&](wxCommandEvent& event) {
|
autostartCheckbox->Bind(wxEVT_CHECKBOX, [](wxCommandEvent& event) {
|
||||||
bool isChecked = autostartCheckbox->IsChecked();
|
bool isChecked = event.IsChecked();
|
||||||
auto settings = utils::getSettings();
|
auto settings = utils::getSettings();
|
||||||
settings.autoStart = isChecked;
|
settings.autoStart = isChecked;
|
||||||
backend::toggleAutostart(isChecked);
|
backend::toggleAutostart(isChecked);
|
||||||
|
|
Loading…
Reference in New Issue