diff --git a/src/slic3r/GUI/DoubleSlider.cpp b/src/slic3r/GUI/DoubleSlider.cpp index 48a7677cf..bdfb8b08a 100644 --- a/src/slic3r/GUI/DoubleSlider.cpp +++ b/src/slic3r/GUI/DoubleSlider.cpp @@ -24,6 +24,7 @@ #include #include "Field.hpp" #include "format.hpp" +#include "NotificationManager.hpp" namespace Slic3r { @@ -2006,6 +2007,9 @@ void Control::add_code_as_tick(Type type, int selected_extruder/* = -1*/) if ( !check_ticks_changed_event(type) ) return; + if (type == ColorChange && gcode(ColorChange).empty()) + GUI::wxGetApp().plater()->get_notification_manager()->push_notification(GUI::NotificationType::EmptyColorChangeCode); + const int extruder = selected_extruder > 0 ? selected_extruder : std::max(1, m_only_extruder); const auto it = m_ticks.ticks.find(TickCode{ tick }); diff --git a/src/slic3r/GUI/NotificationManager.hpp b/src/slic3r/GUI/NotificationManager.hpp index d60fc0b7d..9452a8da0 100644 --- a/src/slic3r/GUI/NotificationManager.hpp +++ b/src/slic3r/GUI/NotificationManager.hpp @@ -65,7 +65,9 @@ enum class NotificationType // Object fully outside the print volume, or extrusion outside the print volume. Slicing is not disabled. PlaterWarning, // Progress bar instead of text. - ProgressBar + ProgressBar, + // Notification, when Color Change G-code is empty and user try to add color change on DoubleSlider. + EmptyColorChangeCode }; class NotificationManager @@ -453,6 +455,9 @@ private: if (evnthndlr != nullptr) wxPostEvent(evnthndlr, PresetUpdateAvailableClickedEvent(EVT_PRESET_UPDATE_AVAILABLE_CLICKED)); return true; }}, {NotificationType::NewAppAvailable, NotificationLevel::ImportantNotification, 20, _u8L("New version is available."), _u8L("See Releases page."), [](wxEvtHandler* evnthndlr){ wxLaunchDefaultBrowser("https://github.com/prusa3d/PrusaSlicer/releases"); return true; }}, + {NotificationType::EmptyColorChangeCode, NotificationLevel::RegularNotification, 10, + _u8L("You have just added a G-code for color change, but its value is empty.\n" + "To export the G-code correctly, check the \"Color Change G-code\" in \"Printer Settings > Custom G-code\"") }, //{NotificationType::NewAppAvailable, NotificationLevel::ImportantNotification, 20, _u8L("New vesion of PrusaSlicer is available.", _u8L("Download page.") }, //{NotificationType::LoadingFailed, NotificationLevel::RegularNotification, 20, _u8L("Loading of model has Failed") }, //{NotificationType::DeviceEjected, NotificationLevel::RegularNotification, 10, _u8L("Removable device has been safely ejected")} // if we want changeble text (like here name of device), we need to do it as CustomNotification