diff options
author | YuSanka <yusanka@gmail.com> | 2021-12-09 18:00:12 +0300 |
---|---|---|
committer | YuSanka <yusanka@gmail.com> | 2021-12-09 18:00:12 +0300 |
commit | f1429f026c04af53749cec547929cc1cb97de83b (patch) | |
tree | af0a99dc7052af4f609cbd88d992a1e714432e4b /src | |
parent | 27883caa08983f7c963cad8f185e3e45fc1432eb (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/slic3r/GUI/MsgDialog.hpp | 4 | ||||
-rw-r--r-- | src/slic3r/GUI/OptionsGroup.cpp | 2 |
2 files changed, 5 insertions, 1 deletions
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"); |