From 61cd0beaa9fc9d5926b07829e38e14ff1624dec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Tue, 14 May 2024 14:58:12 +0200 Subject: [PATCH] SPE-2186: Allow to show at the same time both warnings about that bed temperature difference and shrinkage compensation weren't used. --- src/slic3r/GUI/NotificationManager.hpp | 4 ++++ src/slic3r/GUI/Plater.cpp | 26 ++++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/slic3r/GUI/NotificationManager.hpp b/src/slic3r/GUI/NotificationManager.hpp index 05dd363dbc..f3a2aa08fe 100644 --- a/src/slic3r/GUI/NotificationManager.hpp +++ b/src/slic3r/GUI/NotificationManager.hpp @@ -136,6 +136,10 @@ enum class NotificationType SelectFilamentFromConnect, // Debug notification for connect communication PrusaConnectPrinters, + // Notification that bed temperatures for the used filaments differ significantly. + BedTemperaturesDiffer, + // Notification that shrinkage compensations for the used filaments differ. + ShrinkageCompensationsDiffer, }; class NotificationManager diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 53ae3677a0..b48edca87c 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1916,9 +1916,14 @@ void Plater::priv::process_validation_warning(const std::vector& wa if (warnings.empty()) notification_manager->close_notification_of_type(NotificationType::ValidateWarning); - for (std::string text : warnings) { - std::string hypertext = ""; - std::function action_fn = [](wxEvtHandler*){ return false; }; + // Always close warnings BedTemperaturesDiffer and ShrinkageCompensationsDiffer before next processing. + notification_manager->close_notification_of_type(NotificationType::BedTemperaturesDiffer); + notification_manager->close_notification_of_type(NotificationType::ShrinkageCompensationsDiffer); + + for (std::string text : warnings) { + std::string hypertext = ""; + NotificationType notification_type = NotificationType::ValidateWarning; + std::function action_fn = [](wxEvtHandler*){ return false; }; if (text == "_SUPPORTS_OFF") { text = _u8L("An object has custom support enforcers which will not be used " @@ -1934,16 +1939,17 @@ void Plater::priv::process_validation_warning(const std::vector& wa print_tab->on_value_change("support_material_auto", config.opt_bool("support_material_auto")); return true; }; + } else if (text == "_BED_TEMPS_DIFFER") { + text = _u8L("Bed temperatures for the used filaments differ significantly."); + notification_type = NotificationType::BedTemperaturesDiffer; + } else if (text == "_FILAMENT_SHRINKAGE_DIFFER") { + text = _u8L("Filament shrinkage will not be used because filament shrinkage " + "for the used filaments differs significantly."); + notification_type = NotificationType::ShrinkageCompensationsDiffer; } - if (text == "_BED_TEMPS_DIFFER") - text = _u8L("Bed temperatures for the used filaments differ significantly."); - - if (text == "_FILAMENT_SHRINKAGE_DIFFER") - text = _u8L("Filament shrinkage will not be used because filament shrinkage " - "for the used filaments differs significantly."); notification_manager->push_notification( - NotificationType::ValidateWarning, + notification_type, NotificationManager::NotificationLevel::WarningNotificationLevel, _u8L("WARNING:") + "\n" + text, hypertext, action_fn );