Add url to documentation for template filament warning
followup 45ba32d29a
This commit is contained in:
parent
c4de398d30
commit
23a72cec1f
@ -2108,9 +2108,9 @@ void NotificationManager::push_slicing_error_notification(const std::string& tex
|
|||||||
push_notification_data({ NotificationType::SlicingError, NotificationLevel::ErrorNotificationLevel, 0, _u8L("ERROR:") + "\n" + text }, 0);
|
push_notification_data({ NotificationType::SlicingError, NotificationLevel::ErrorNotificationLevel, 0, _u8L("ERROR:") + "\n" + text }, 0);
|
||||||
set_slicing_progress_hidden();
|
set_slicing_progress_hidden();
|
||||||
}
|
}
|
||||||
void NotificationManager::push_slicing_warning_notification(const std::string& text, bool gray, ObjectID oid, int warning_step)
|
void NotificationManager::push_slicing_warning_notification(const std::string& text, bool gray, ObjectID oid, int warning_step, const std::string& hypertext, std::function<bool(wxEvtHandler*)> callback)
|
||||||
{
|
{
|
||||||
NotificationData data { NotificationType::SlicingWarning, NotificationLevel::WarningNotificationLevel, 0, _u8L("WARNING:") + "\n" + text };
|
NotificationData data { NotificationType::SlicingWarning, NotificationLevel::WarningNotificationLevel, 0, _u8L("WARNING:") + "\n" + text , hypertext, callback};
|
||||||
|
|
||||||
auto notification = std::make_unique<NotificationManager::ObjectIDNotification>(data, m_id_provider, m_evt_handler);
|
auto notification = std::make_unique<NotificationManager::ObjectIDNotification>(data, m_id_provider, m_evt_handler);
|
||||||
notification->object_id = oid;
|
notification->object_id = oid;
|
||||||
|
@ -172,7 +172,7 @@ public:
|
|||||||
// Creates Slicing Error notification with a custom text and no fade out.
|
// Creates Slicing Error notification with a custom text and no fade out.
|
||||||
void push_slicing_error_notification(const std::string& text);
|
void push_slicing_error_notification(const std::string& text);
|
||||||
// Creates Slicing Warning notification with a custom text and no fade out.
|
// Creates Slicing Warning notification with a custom text and no fade out.
|
||||||
void push_slicing_warning_notification(const std::string& text, bool gray, ObjectID oid, int warning_step);
|
void push_slicing_warning_notification(const std::string& text, bool gray, ObjectID oid, int warning_step, const std::string& hypertext = "", std::function<bool(wxEvtHandler*)> callback = std::function<bool(wxEvtHandler*)>());
|
||||||
// marks slicing errors as gray
|
// marks slicing errors as gray
|
||||||
void set_all_slicing_errors_gray(bool g);
|
void set_all_slicing_errors_gray(bool g);
|
||||||
// marks slicing warings as gray
|
// marks slicing warings as gray
|
||||||
|
@ -4099,16 +4099,21 @@ void Plater::priv::on_slicing_update(SlicingStatusEvent &evt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (templ_cnt > 0) {
|
if (templ_cnt > 0) {
|
||||||
const std::string message_notif = GUI::format("%1%\n%2%\n%3%"
|
const std::string message_notif = GUI::format("%1%\n%2%\n%3%\n\n%4% "
|
||||||
, _L_PLURAL("You are using template filament preset.", "You are using template filament presets.", templ_cnt)
|
, _L_PLURAL("You are using template filament preset.", "You are using template filament presets.", templ_cnt)
|
||||||
, _u8L("Please note that template presets are not customized for specific printer and should only be used as a starting point for creating your own user presets.")
|
, _u8L("Please note that template presets are not customized for specific printer and should only be used as a starting point for creating your own user presets.")
|
||||||
, names);
|
, names
|
||||||
|
,_u8L("More info at"));
|
||||||
// warning dialog proccessing cuts text at first '/n' - pass the text without new lines (and without filament names).
|
// warning dialog proccessing cuts text at first '/n' - pass the text without new lines (and without filament names).
|
||||||
const std::string message_dial = GUI::format("%1% %2%"
|
const std::string message_dial = GUI::format("%1% %2% %3%"
|
||||||
, _L_PLURAL("You are using template filament preset.", "You are using template filament presets.", templ_cnt)
|
, _L_PLURAL("You are using template filament preset.", "You are using template filament presets.", templ_cnt)
|
||||||
, _u8L("Please note that template presets are not customized for specific printer and should only be used as a starting point for creating your own user presets."));
|
, _u8L("Please note that template presets are not customized for specific printer and should only be used as a starting point for creating your own user presets.")
|
||||||
|
, "<a href=https://help.prusa3d.com/article/template-filaments_467599>https://help.prusa3d.com/</a>"
|
||||||
|
);
|
||||||
BOOST_LOG_TRIVIAL(warning) << message_notif;
|
BOOST_LOG_TRIVIAL(warning) << message_notif;
|
||||||
notification_manager->push_slicing_warning_notification(message_notif, false, 0, 0);
|
notification_manager->push_slicing_warning_notification(message_notif, false, 0, 0, "https://help.prusa3d.com/",
|
||||||
|
[](wxEvtHandler* evnthndlr) { wxGetApp().open_browser_with_warning_dialog("https://help.prusa3d.com/article/template-filaments_467599"); return false; }
|
||||||
|
);
|
||||||
add_warning({ PrintStateBase::WarningLevel::CRITICAL, true, message_dial, 0}, 0);
|
add_warning({ PrintStateBase::WarningLevel::CRITICAL, true, message_dial, 0}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4248,9 +4253,9 @@ bool Plater::priv::warnings_dialog()
|
|||||||
else
|
else
|
||||||
text += it.first.message;
|
text += it.first.message;
|
||||||
}
|
}
|
||||||
//text += "\n\nDo you still wish to export?";
|
//MessageDialog msg_wingow(this->q, from_u8(text), wxString(SLIC3R_APP_NAME " ") + _L("generated warnings"), wxOK);
|
||||||
//wxMessageDialog msg_wingow(this->q, from_u8(text), wxString(SLIC3R_APP_NAME " ") + _L("generated warnings"), wxOK);
|
// Changed ti InfoDialog so it can show hyperlinks
|
||||||
MessageDialog msg_wingow(this->q, from_u8(text), wxString(SLIC3R_APP_NAME " ") + _L("generated warnings"), wxOK);
|
InfoDialog msg_wingow(this->q, wxString(SLIC3R_APP_NAME " ") + _L("generated warnings"), from_u8(text), wxOK);
|
||||||
const auto res = msg_wingow.ShowModal();
|
const auto res = msg_wingow.ShowModal();
|
||||||
return res == wxID_OK;
|
return res == wxID_OK;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user