notifications: changed some plater warnings into errors, fixed not showing plater warnings in preview.

This commit is contained in:
David Kocik 2020-09-21 13:47:18 +02:00
parent a47178557f
commit 661534042b
3 changed files with 11 additions and 9 deletions

View file

@ -56,8 +56,7 @@ NotificationManager::PopNotification::~PopNotification()
}
NotificationManager::PopNotification::RenderResult NotificationManager::PopNotification::render(GLCanvas3D& canvas, const float& initial_y)
{
if (!m_initialized)
{
if (!m_initialized) {
init();
}
if (m_finished)
@ -682,11 +681,13 @@ void NotificationManager::push_plater_error_notification(const std::string& text
void NotificationManager::push_plater_warning_notification(const std::string& text, GLCanvas3D& canvas)
{
push_notification_data({ NotificationType::PlaterWarning, NotificationLevel::WarningNotification, 0, _u8L("WARNING:") + "\n" + text }, canvas, 0);
// dissaper if in preview
set_in_preview(m_in_preview);
}
void NotificationManager::close_plater_error_notification()
void NotificationManager::close_plater_error_notification(const std::string& text)
{
for (PopNotification* notification : m_pop_notifications) {
if (notification->get_type() == NotificationType::PlaterError) {
if (notification->get_type() == NotificationType::PlaterError && notification->compare_text(_u8L("ERROR:") + "\n" + text)) {
notification->close();
}
}