From 807f380d3f0e9ba1c87ffc0720d18150a3f66bec Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 31 Mar 2022 14:34:53 +0200 Subject: [PATCH] Fix for #8091 - Design bug: Yes/No response to save dialogue --- src/slic3r/GUI/MsgDialog.hpp | 21 +++++++++++---------- src/slic3r/GUI/Plater.cpp | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/slic3r/GUI/MsgDialog.hpp b/src/slic3r/GUI/MsgDialog.hpp index 874629343..4ccc90792 100644 --- a/src/slic3r/GUI/MsgDialog.hpp +++ b/src/slic3r/GUI/MsgDialog.hpp @@ -160,8 +160,8 @@ public: // customization of the message box buttons virtual bool SetYesNoLabels(const wxMD::ButtonLabel& yes, const wxMD::ButtonLabel& no) { - DoSetCustomLabel(m_yes, yes); - DoSetCustomLabel(m_no, no); + DoSetCustomLabel(m_yes, yes, wxID_YES); + DoSetCustomLabel(m_no, no, wxID_NO); return true; } @@ -169,29 +169,29 @@ public: const wxMD::ButtonLabel& no, const wxMD::ButtonLabel& cancel) { - DoSetCustomLabel(m_yes, yes); - DoSetCustomLabel(m_no, no); - DoSetCustomLabel(m_cancel, cancel); + DoSetCustomLabel(m_yes, yes, wxID_YES); + DoSetCustomLabel(m_no, no, wxID_NO); + DoSetCustomLabel(m_cancel, cancel, wxID_CANCEL); return true; } virtual bool SetOKLabel(const wxMD::ButtonLabel& ok) { - DoSetCustomLabel(m_ok, ok); + DoSetCustomLabel(m_ok, ok, wxID_OK); return true; } virtual bool SetOKCancelLabels(const wxMD::ButtonLabel& ok, const wxMD::ButtonLabel& cancel) { - DoSetCustomLabel(m_ok, ok); - DoSetCustomLabel(m_cancel, cancel); + DoSetCustomLabel(m_ok, ok, wxID_OK); + DoSetCustomLabel(m_cancel, cancel, wxID_CANCEL); return true; } virtual bool SetHelpLabel(const wxMD::ButtonLabel& help) { - DoSetCustomLabel(m_help, help); + DoSetCustomLabel(m_help, help, wxID_HELP); return true; } // test if any custom labels were set @@ -230,9 +230,10 @@ protected: // the value to var with possibly some transformation (e.g. Cocoa version // currently uses this to remove any accelerators from the button strings // while GTK+ one handles stock items specifically here) - void DoSetCustomLabel(wxString& var, const wxMD::ButtonLabel& label) + void DoSetCustomLabel(wxString& var, const wxMD::ButtonLabel& label, wxWindowID btn_id) { var = label.GetAsString(); + SetButtonLabel(btn_id, var); } // these functions return the custom label or empty string and should be diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 59a90d4c4..4218c9393 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1692,6 +1692,7 @@ struct Plater::priv std::string act = wxGetApp().app_config->get(act_key); if (act.empty()) { RichMessageDialog dialog(mainframe, reason + "\n" + format_wxstr(_L("Do you want to save the changes to \"%1%\"?"), suggested_project_name), wxString(SLIC3R_APP_NAME), wxYES_NO | wxCANCEL); + dialog.SetYesNoLabels(_L("Save"), _L("Discard")); dialog.ShowCheckBox(_L("Remember my choice")); res = dialog.ShowModal(); if (res != wxID_CANCEL)