ENH: [STUDIO-2773] block notification

Change-Id: I97b556b5ad1f25d8c4118e1f271c0756084d83cc
This commit is contained in:
manch1n 2023-05-06 16:53:06 +08:00 committed by Lane.Wei
parent 2e0a8dcf30
commit 7ba1ac9d15
9 changed files with 356 additions and 16 deletions

View file

@ -8905,8 +8905,9 @@ std::vector<std::array<float, 4>> GLCanvas3D::_parse_colors(const std::vector<st
void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
{
enum ErrorType{
PLATER_WARNING,
PLATER_ERROR,
PLATER_WARNING,
PLATER_ERROR,
SLICING_SERIOUS_WARNING,
SLICING_ERROR
};
std::string text;
@ -8916,7 +8917,7 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
case EWarning::GCodeConflict: {
static std::string prevConflictText;
text = prevConflictText;
error = ErrorType::SLICING_ERROR;
error = ErrorType::SLICING_SERIOUS_WARNING;
if (!m_gcode_viewer.m_conflict_result) { break; }
std::string objName1 = m_gcode_viewer.m_conflict_result.value()._objName1;
std::string objName2 = m_gcode_viewer.m_conflict_result.value()._objName2;
@ -8960,6 +8961,12 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
else
notification_manager.close_plater_error_notification(text);
break;
case SLICING_SERIOUS_WARNING:
if (state)
notification_manager.push_slicing_serious_warning_notification(text, {conflictObj});
else
notification_manager.close_slicing_serious_warning_notification(text);
break;
case SLICING_ERROR:
if (state)
notification_manager.push_slicing_error_notification(text, {conflictObj});