From f1429f026c04af53749cec547929cc1cb97de83b Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 9 Dec 2021 16:00:12 +0100 Subject: [PATCH] RichMessageDialog on non-MSW platforms: Set escape ID to wxID_CANCEL + Fixed behavior of the "Open hyperlink" dialog when "cross"(close window button) is clicked. --- src/slic3r/GUI/MsgDialog.hpp | 4 +++- src/slic3r/GUI/OptionsGroup.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/MsgDialog.hpp b/src/slic3r/GUI/MsgDialog.hpp index 9fde187a6..ea424c176 100644 --- a/src/slic3r/GUI/MsgDialog.hpp +++ b/src/slic3r/GUI/MsgDialog.hpp @@ -293,7 +293,9 @@ public: const wxString& message, const wxString& caption = wxEmptyString, long style = wxOK) - : wxRichMessageDialog(parent, message, caption, style) {} + : wxRichMessageDialog(parent, message, caption, style) { + this->SetEscapeId(wxID_CANCEL); + } ~RichMessageDialog() {} }; #endif diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index 6039dcbcb..64fc4b8c8 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -984,6 +984,8 @@ bool OptionsGroup::launch_browser(const std::string& path_end) RichMessageDialog dialog(parent, _L("Open hyperlink in default browser?"), _L("PrusaSlicer: Open hyperlink"), wxYES_NO); dialog.ShowCheckBox(_L("Remember my choice")); int answer = dialog.ShowModal(); + if (answer == wxID_CANCEL) + return false; if (dialog.IsCheckBoxChecked()) { wxString preferences_item = _L("Suppress to open hyperlink in browser");