ConfigWizard: Fix reset checkbox

This commit is contained in:
Vojtech Kral 2018-04-19 16:49:22 +02:00
parent c3c9ebdd12
commit bdaf1b01be
2 changed files with 3 additions and 2 deletions

View file

@ -205,7 +205,7 @@ PageWelcome::PageWelcome(ConfigWizard *parent) :
ConfigWizardPage(parent, wxString::Format(_(L("Welcome to the Slic3r %s")), ConfigWizard::name()), _(L("Welcome"))),
printer_picker(nullptr),
others_buttons(new wxPanel(parent)),
cbox_reset(new wxCheckBox(this, wxID_ANY, _(L("Remove user profiles - install from scratch (a snapshot will be taken beforehand)"))))
cbox_reset(nullptr)
{
if (wizard_p()->flag_startup && wizard_p()->flag_empty_datadir) {
wxString::Format(_(L("Run %s")), ConfigWizard::name());
@ -214,6 +214,7 @@ PageWelcome::PageWelcome(ConfigWizard *parent) :
ConfigWizard::name())
);
} else {
cbox_reset = new wxCheckBox(this, wxID_ANY, _(L("Remove user profiles - install from scratch (a snapshot will be taken beforehand)")));
append(cbox_reset);
}

View file

@ -107,7 +107,7 @@ struct PageWelcome: ConfigWizardPage
virtual wxPanel* extra_buttons() { return others_buttons; }
virtual void on_page_set();
bool reset_user_profile() const { return cbox_reset->GetValue(); }
bool reset_user_profile() const { return cbox_reset != nullptr ? cbox_reset->GetValue() : false; }
void on_variant_checked();
};