diff --git a/src/slic3r/GUI/ParamsPanel.cpp b/src/slic3r/GUI/ParamsPanel.cpp index 9cf9dfe05..d57fed9b4 100644 --- a/src/slic3r/GUI/ParamsPanel.cpp +++ b/src/slic3r/GUI/ParamsPanel.cpp @@ -23,7 +23,7 @@ namespace Slic3r { namespace GUI { -TipsDialog::TipsDialog(wxWindow *parent, const wxString &title, const wxString &description, std::string app_key, long style) +TipsDialog::TipsDialog(wxWindow *parent, const wxString &title, const wxString &description, std::string app_key, long style,std::map option_map) : DPIDialog(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX), m_app_key(app_key) { @@ -61,19 +61,31 @@ TipsDialog::TipsDialog(wxWindow *parent, const wxString &title, const wxString & wxBoxSizer *m_sizer_right = new wxBoxSizer(wxHORIZONTAL); if (style & wxOK) { - Button* btn = add_button(wxID_OK, _L("OK"), true); + wxString str = _L("OK"); + if (auto iter = option_map.find(wxID_OK); iter != option_map.end()) + str = iter->second; + Button* btn = add_button(wxID_OK, str, true); m_sizer_right->Add(btn, 0, wxALL, FromDIP(5)); } if (style & wxYES) { - Button *btn = add_button(wxID_YES, _L("Yes"), true); + wxString str = _L("Yes"); + if (auto iter = option_map.find(wxID_YES); iter != option_map.end()) + str = iter->second; + Button *btn = add_button(wxID_YES, str, true); m_sizer_right->Add(btn, 0, wxALL, FromDIP(5)); } if (style & wxNO) { - Button *btn = add_button(wxID_NO, _L("No"), false); + wxString str = _L("No"); + if (auto iter = option_map.find(wxID_NO); iter != option_map.end()) + str = iter->second; + Button *btn = add_button(wxID_NO, str, false); m_sizer_right->Add(btn, 0, wxALL, FromDIP(5)); } if (style & wxCANCEL) { - Button *btn = add_button(wxID_CANCEL, _L("Cancel"), false); + wxString str = _L("Cancel"); + if (auto iter = option_map.find(wxID_CANCEL); iter != option_map.end()) + str = iter->second; + Button *btn = add_button(wxID_CANCEL, str, false); m_sizer_right->Add(btn, 0, wxALL, FromDIP(5)); } diff --git a/src/slic3r/GUI/ParamsPanel.hpp b/src/slic3r/GUI/ParamsPanel.hpp index 8bf08378f..24ee66f71 100644 --- a/src/slic3r/GUI/ParamsPanel.hpp +++ b/src/slic3r/GUI/ParamsPanel.hpp @@ -48,7 +48,7 @@ private: std::string m_app_key; public: - TipsDialog(wxWindow *parent, const wxString &title, const wxString &description, std::string app_key = "", long style = wxOK); + TipsDialog(wxWindow *parent, const wxString &title, const wxString &description, std::string app_key = "", long style = wxOK, std::map option_map={}); Button *m_confirm{nullptr}; Button *m_cancel{nullptr}; wxPanel *m_top_line{nullptr}; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 6bb2696c5..a081f57a2 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -10542,9 +10542,13 @@ bool Plater::try_sync_preset_with_connected_printer() } else { tips = from_u8((boost::format(_u8L("The currently connected printer, %s, is a %s model.\nTo use this printer for printing, please switch the printer model of project file to %s.")) % obj->dev_name % printer_model % printer_model).str()); - } - TipsDialog dlg(wxGetApp().mainframe, _L("Tips"), tips, "sync_after_load_file_show_flag", wxYES_NO); + + std::mapoption_map = { + {wxID_YES,_L("Sync now")}, + {wxID_NO, _L("Later")} + }; + TipsDialog dlg(wxGetApp().mainframe, _L("Tips"), tips, "sync_after_load_file_show_flag", wxYES_NO,option_map); if (dlg.ShowModal() == wxID_YES) { sync_printer_info = true; } } else {