mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 01:55:59 +08:00
Follow-up 34848f0f : fixed non-MSW build
This commit is contained in:
parent
dd20cc5750
commit
dad1f2727c
@ -243,7 +243,7 @@ ErrorDialog::ErrorDialog(wxWindow *parent, const wxString &msg, bool monospaced_
|
|||||||
create(m_content, monospaced_font ? 48 : 84);
|
create(m_content, monospaced_font ? 48 : 84);
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorDialog::ErrorDialog(wxWindow *parent, const wxString &msg, const std::function<void(const std::string&)> &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),
|
: MsgDialog(parent, wxString::Format(_L("%s error"), SLIC3R_APP_NAME),
|
||||||
wxString::Format(_L("%s has encountered an error"), SLIC3R_APP_NAME), wxOK)
|
wxString::Format(_L("%s has encountered an error"), SLIC3R_APP_NAME), wxOK)
|
||||||
, m_content(HtmlContent{ msg, false, true, on_link_clicked })
|
, m_content(HtmlContent{ msg, false, true, on_link_clicked })
|
||||||
|
@ -24,12 +24,14 @@ namespace Slic3r {
|
|||||||
|
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
||||||
|
using t_link_clicked = std::function<void(const std::string&)>;
|
||||||
|
|
||||||
struct HtmlContent
|
struct HtmlContent
|
||||||
{
|
{
|
||||||
wxString msg{ wxEmptyString };
|
wxString msg{ wxEmptyString };
|
||||||
bool is_monospaced_font{ false };
|
bool is_monospaced_font{ false };
|
||||||
bool is_marked_msg{ false };
|
bool is_marked_msg{ false };
|
||||||
std::function<void(const std::string&)> on_link_clicked{ nullptr };
|
t_link_clicked on_link_clicked{ nullptr };
|
||||||
};
|
};
|
||||||
|
|
||||||
// A message / query dialog with a bitmap on the left and any content on the right
|
// 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 <code><pre></pre></code> tags,
|
// If monospaced_font is true, the error message is displayed using html <code><pre></pre></code> tags,
|
||||||
// so that the code formatting will be preserved. This is useful for reporting errors from the placeholder parser.
|
// 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, bool courier_font);
|
||||||
ErrorDialog(wxWindow *parent, const wxString &msg, const std::function<void(const std::string&)>& on_link_clicked);
|
ErrorDialog(wxWindow *parent, const wxString &msg, const t_link_clicked& on_link_clicked);
|
||||||
ErrorDialog(ErrorDialog &&) = delete;
|
ErrorDialog(ErrorDialog &&) = delete;
|
||||||
ErrorDialog(const ErrorDialog &) = delete;
|
ErrorDialog(const ErrorDialog &) = delete;
|
||||||
ErrorDialog &operator=(ErrorDialog &&) = delete;
|
ErrorDialog &operator=(ErrorDialog &&) = delete;
|
||||||
|
@ -5202,7 +5202,8 @@ void Plater::export_gcode(bool prefer_removable)
|
|||||||
|
|
||||||
wxString error_str;
|
wxString error_str;
|
||||||
if (check_for_error(output_path, 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();
|
output_path.clear();
|
||||||
} else {
|
} else {
|
||||||
alert_when_exporting_binary_gcode(wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_bool("gcode_binary"),
|
alert_when_exporting_binary_gcode(wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_bool("gcode_binary"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user