diff --git a/src/slic3r/GUI/NotificationManager.cpp b/src/slic3r/GUI/NotificationManager.cpp index 062ee9d83..27daaf0c3 100644 --- a/src/slic3r/GUI/NotificationManager.cpp +++ b/src/slic3r/GUI/NotificationManager.cpp @@ -1906,7 +1906,7 @@ void NotificationManager::push_slicing_error_notification(const std::string &tex push_notification_data({ NotificationType::SlicingError, NotificationLevel::ErrorNotificationLevel, 0, _u8L("Error:") + "\n" + text, link, callback }, 0); set_slicing_progress_hidden(); } -void NotificationManager::push_slicing_warning_notification(const std::string& text, bool gray, ModelObject const * obj, ObjectID oid, int warning_step, int warning_msg_id) +void NotificationManager::push_slicing_warning_notification(const std::string& text, bool gray, ModelObject const * obj, ObjectID oid, int warning_step, int warning_msg_id, NotificationLevel level/* = NotificationLevel::WarningNotificationLevel*/) { auto callback = obj ? [id = obj->id()](wxEvtHandler *) { auto & objects = wxGetApp().model().objects; @@ -1919,7 +1919,7 @@ void NotificationManager::push_slicing_warning_notification(const std::string& t } : std::function(); auto link = callback ? _u8L("Jump to") : ""; if (obj) link += std::string(" [") + obj->name + "]"; - NotificationData data { NotificationType::SlicingWarning, NotificationLevel::WarningNotificationLevel, 0, _u8L("Warning:") + "\n" + text, link, callback }; + NotificationData data { NotificationType::SlicingWarning, level, 0, _u8L("Warning:") + "\n" + text, link, callback }; data.sub_msg_id = warning_msg_id; data.ori_text = text; diff --git a/src/slic3r/GUI/NotificationManager.hpp b/src/slic3r/GUI/NotificationManager.hpp index 9aa53c1e0..51b6011ce 100644 --- a/src/slic3r/GUI/NotificationManager.hpp +++ b/src/slic3r/GUI/NotificationManager.hpp @@ -203,7 +203,7 @@ public: // Creates Slicing Error notification with a custom text and no fade out. void push_slicing_error_notification(const std::string &text, std::vector objs); // Creates Slicing Warning notification with a custom text and no fade out. - void push_slicing_warning_notification(const std::string &text, bool gray, ModelObject const *obj, ObjectID oid, int warning_step, int warning_msg_id); + void push_slicing_warning_notification(const std::string &text, bool gray, ModelObject const *obj, ObjectID oid, int warning_step, int warning_msg_id, NotificationLevel level = NotificationLevel::WarningNotificationLevel); // marks slicing errors as gray void set_all_slicing_errors_gray(bool g); // marks slicing warings as gray diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index c7e45629f..5f443875a 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -6017,7 +6017,11 @@ void Plater::priv::on_slicing_update(SlicingStatusEvent &evt) // Now process state.warnings. for (auto const& warning : state.warnings) { if (warning.current) { - notification_manager->push_slicing_warning_notification(warning.message, false, model_object, object_id, warning_step, warning.message_id); + NotificationManager::NotificationLevel notif_level = NotificationManager::NotificationLevel::WarningNotificationLevel; + if (evt.status.message_type == PrintStateBase::SlicingNotificationType::SlicingReplaceInitEmptyLayers | PrintStateBase::SlicingNotificationType::SlicingEmptyGcodeLayers) { + notif_level = NotificationManager::NotificationLevel::SeriousWarningNotificationLevel; + } + notification_manager->push_slicing_warning_notification(warning.message, false, model_object, object_id, warning_step, warning.message_id, notif_level); add_warning(warning, object_id.id); } }