Fix crash on FreeBSD

On FreeBSD builds, if you try to change a printer/filament/setting
option while the dirty flag is set, it crashes.  This patch seems
to fix the crash, though I'm not sure what the id is actually used
for.

merill: added the #ifdef __WXGTK__ to not mess with other OSes
This commit is contained in:
Stephen Hurd 2021-12-13 16:43:21 -05:00 committed by supermerill
parent 0d5add8413
commit cef7c355a1

View File

@ -656,8 +656,11 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection* dependent_
add_btn(&m_transfer_btn, m_move_btn_id, "paste_menu", Action::Transfer, _L("Transfer"));
add_btn(&m_discard_btn, m_continue_btn_id, dependent_presets ? "switch_presets" : "exit", Action::Discard, _L("Discard"), false);
add_btn(&m_save_btn, m_save_btn_id, "save", Action::Save, _L("Save"));
#ifdef __WXGTK__
ScalableButton* cancel_btn = new ScalableButton(this, wxID_ANY, "cross", _L("Cancel"), wxDefaultSize, wxDefaultPosition, wxBORDER_DEFAULT, true, 24);
#else
ScalableButton* cancel_btn = new ScalableButton(this, wxID_CANCEL, "cross", _L("Cancel"), wxDefaultSize, wxDefaultPosition, wxBORDER_DEFAULT, true, 24);
#endif
buttons->Add(cancel_btn, 1, wxLEFT|wxRIGHT, 5);
cancel_btn->SetFont(btn_font);
cancel_btn->Bind(wxEVT_BUTTON, [this](wxEvent&) { this->EndModal(wxID_CANCEL); });