diff --git a/src/slic3r/GUI/MsgDialog.cpp b/src/slic3r/GUI/MsgDialog.cpp index 00d31ca600..630a60046e 100644 --- a/src/slic3r/GUI/MsgDialog.cpp +++ b/src/slic3r/GUI/MsgDialog.cpp @@ -243,7 +243,7 @@ ErrorDialog::ErrorDialog(wxWindow *parent, const wxString &msg, bool monospaced_ create(m_content, monospaced_font ? 48 : 84); } -ErrorDialog::ErrorDialog(wxWindow *parent, const wxString &msg, const std::function &on_link_clicked) +ErrorDialog::ErrorDialog(wxWindow *parent, const wxString &msg, const t_link_clicked& on_link_clicked) : MsgDialog(parent, wxString::Format(_L("%s error"), SLIC3R_APP_NAME), wxString::Format(_L("%s has encountered an error"), SLIC3R_APP_NAME), wxOK) , m_content(HtmlContent{ msg, false, true, on_link_clicked }) diff --git a/src/slic3r/GUI/MsgDialog.hpp b/src/slic3r/GUI/MsgDialog.hpp index 66ee97f911..46fbb298e0 100644 --- a/src/slic3r/GUI/MsgDialog.hpp +++ b/src/slic3r/GUI/MsgDialog.hpp @@ -24,12 +24,14 @@ namespace Slic3r { namespace GUI { +using t_link_clicked = std::function; + struct HtmlContent { - wxString msg{ wxEmptyString }; - bool is_monospaced_font{ false }; - bool is_marked_msg{ false }; - std::function on_link_clicked{ nullptr }; + wxString msg{ wxEmptyString }; + bool is_monospaced_font{ false }; + bool is_marked_msg{ false }; + t_link_clicked on_link_clicked{ nullptr }; }; // A message / query dialog with a bitmap on the left and any content on the right @@ -75,7 +77,7 @@ public: // If monospaced_font is true, the error message is displayed using html
tags, // so that the code formatting will be preserved. This is useful for reporting errors from the placeholder parser. ErrorDialog(wxWindow *parent, const wxString &msg, bool courier_font); - ErrorDialog(wxWindow *parent, const wxString &msg, const std::function& on_link_clicked); + ErrorDialog(wxWindow *parent, const wxString &msg, const t_link_clicked& on_link_clicked); ErrorDialog(ErrorDialog &&) = delete; ErrorDialog(const ErrorDialog &) = delete; ErrorDialog &operator=(ErrorDialog &&) = delete; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index a1c8634121..3e876bdfd7 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -5202,7 +5202,8 @@ void Plater::export_gcode(bool prefer_removable) wxString error_str; if (check_for_error(output_path, error_str)) { - ErrorDialog(this, error_str, [](const std::string& key) -> void { wxGetApp().jump_to_option(key); }).ShowModal(); + const t_link_clicked on_link_clicked = [](const std::string& key) -> void { wxGetApp().jump_to_option(key); }; + ErrorDialog(this, error_str, on_link_clicked).ShowModal(); output_path.clear(); } else { alert_when_exporting_binary_gcode(wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_bool("gcode_binary"),