diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 587846bf7..6c416c475 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -4140,7 +4140,7 @@ void ObjectList::fix_through_netfabb() // Close the progress dialog progress_dlg.Update(100, ""); - // Show info message + // Show info notification wxString msg; wxString bullet_suf = "\n - "; if (!succes_models.empty()) { @@ -4156,9 +4156,7 @@ void ObjectList::fix_through_netfabb() } if (msg.IsEmpty()) msg = _L("Repairing was canceled"); - // !!! Use wxMessageDialog instead of MessageDialog here - // It will not be "dark moded" but the Application will not lose a focus after model repairing - wxMessageDialog(nullptr, msg, _L("Model Repair by the Netfabb service"), wxICON_INFORMATION | wxOK).ShowModal(); + plater->get_notification_manager()->push_notification(NotificationType::NetfabbFinished, NotificationManager::NotificationLevel::PrintInfoShortNotificationLevel, boost::nowide::narrow(msg)); } void ObjectList::simplify() diff --git a/src/slic3r/GUI/NotificationManager.cpp b/src/slic3r/GUI/NotificationManager.cpp index 3f98bd903..ed6f11ddb 100644 --- a/src/slic3r/GUI/NotificationManager.cpp +++ b/src/slic3r/GUI/NotificationManager.cpp @@ -278,7 +278,8 @@ void NotificationManager::PopNotification::count_spaces() m_left_indentation = m_line_height; if (m_data.level == NotificationLevel::ErrorNotificationLevel || m_data.level == NotificationLevel::WarningNotificationLevel - || m_data.level == NotificationLevel::PrintInfoNotificationLevel) { + || m_data.level == NotificationLevel::PrintInfoNotificationLevel + || m_data.level == NotificationLevel::PrintInfoShortNotificationLevel) { std::string text; text = (m_data.level == NotificationLevel::ErrorNotificationLevel ? ImGui::ErrorMarker : ImGui::WarningMarker); float picture_width = ImGui::CalcTextSize(text.c_str()).x; @@ -513,7 +514,7 @@ void NotificationManager::PopNotification::render_left_sign(ImGuiWrapper& imgui) ImGui::SetCursorPosX(m_line_height / 3); ImGui::SetCursorPosY(m_window_height / 2 - m_line_height); imgui.text(text.c_str()); - } else if (m_data.level == NotificationLevel::PrintInfoNotificationLevel) { + } else if (m_data.level == NotificationLevel::PrintInfoNotificationLevel || m_data.level == NotificationLevel::PrintInfoShortNotificationLevel) { std::wstring text; text = ImGui::InfoMarker; ImGui::SetCursorPosX(m_line_height / 3); diff --git a/src/slic3r/GUI/NotificationManager.hpp b/src/slic3r/GUI/NotificationManager.hpp index 73f6a6340..ad2e315b7 100644 --- a/src/slic3r/GUI/NotificationManager.hpp +++ b/src/slic3r/GUI/NotificationManager.hpp @@ -105,7 +105,9 @@ enum class NotificationType ProgressIndicator, // Give user advice to simplify object with big amount of triangles // Contains ObjectID for closing when object is deleted - SimplifySuggestion + SimplifySuggestion, + // information about netfabb is finished repairing model (blocking proccess) + NetfabbFinished }; class NotificationManager @@ -123,6 +125,8 @@ public: RegularNotificationLevel, // Regular level notifiaction containing info about objects or print. Has Icon. PrintInfoNotificationLevel, + // PrintInfoNotificationLevel with shorter time + PrintInfoShortNotificationLevel, // Information notification without a fade-out or with a longer fade-out. ImportantNotificationLevel, // Warning, no fade-out. @@ -706,13 +710,14 @@ private: { switch (level) { - case NotificationLevel::ErrorNotificationLevel: return 0; - case NotificationLevel::WarningNotificationLevel: return 0; - case NotificationLevel::ImportantNotificationLevel: return 0; - case NotificationLevel::ProgressBarNotificationLevel: return 2; - case NotificationLevel::RegularNotificationLevel: return 10; - case NotificationLevel::PrintInfoNotificationLevel: return 10; - case NotificationLevel::HintNotificationLevel: return 300; + case NotificationLevel::ErrorNotificationLevel: return 0; + case NotificationLevel::WarningNotificationLevel: return 0; + case NotificationLevel::ImportantNotificationLevel: return 0; + case NotificationLevel::ProgressBarNotificationLevel: return 2; + case NotificationLevel::PrintInfoShortNotificationLevel: return 5; + case NotificationLevel::RegularNotificationLevel: return 10; + case NotificationLevel::PrintInfoNotificationLevel: return 10; + case NotificationLevel::HintNotificationLevel: return 300; default: return 10; } }