From cef7c355a16e12440c1ab3b2dd17ee0670b7442e Mon Sep 17 00:00:00 2001 From: Stephen Hurd Date: Mon, 13 Dec 2021 16:43:21 -0500 Subject: [PATCH] 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 --- src/slic3r/GUI/UnsavedChangesDialog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index c3b1071ee..de23e9c27 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -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); });