Netfabb finished notification, fix of #7067
This commit is contained in:
parent
1cc7b4ba97
commit
d5d106fe61
3 changed files with 18 additions and 14 deletions
|
@ -4140,7 +4140,7 @@ void ObjectList::fix_through_netfabb()
|
||||||
// Close the progress dialog
|
// Close the progress dialog
|
||||||
progress_dlg.Update(100, "");
|
progress_dlg.Update(100, "");
|
||||||
|
|
||||||
// Show info message
|
// Show info notification
|
||||||
wxString msg;
|
wxString msg;
|
||||||
wxString bullet_suf = "\n - ";
|
wxString bullet_suf = "\n - ";
|
||||||
if (!succes_models.empty()) {
|
if (!succes_models.empty()) {
|
||||||
|
@ -4156,9 +4156,7 @@ void ObjectList::fix_through_netfabb()
|
||||||
}
|
}
|
||||||
if (msg.IsEmpty())
|
if (msg.IsEmpty())
|
||||||
msg = _L("Repairing was canceled");
|
msg = _L("Repairing was canceled");
|
||||||
// !!! Use wxMessageDialog instead of MessageDialog here
|
plater->get_notification_manager()->push_notification(NotificationType::NetfabbFinished, NotificationManager::NotificationLevel::PrintInfoShortNotificationLevel, boost::nowide::narrow(msg));
|
||||||
// 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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectList::simplify()
|
void ObjectList::simplify()
|
||||||
|
|
|
@ -278,7 +278,8 @@ void NotificationManager::PopNotification::count_spaces()
|
||||||
m_left_indentation = m_line_height;
|
m_left_indentation = m_line_height;
|
||||||
if (m_data.level == NotificationLevel::ErrorNotificationLevel
|
if (m_data.level == NotificationLevel::ErrorNotificationLevel
|
||||||
|| m_data.level == NotificationLevel::WarningNotificationLevel
|
|| m_data.level == NotificationLevel::WarningNotificationLevel
|
||||||
|| m_data.level == NotificationLevel::PrintInfoNotificationLevel) {
|
|| m_data.level == NotificationLevel::PrintInfoNotificationLevel
|
||||||
|
|| m_data.level == NotificationLevel::PrintInfoShortNotificationLevel) {
|
||||||
std::string text;
|
std::string text;
|
||||||
text = (m_data.level == NotificationLevel::ErrorNotificationLevel ? ImGui::ErrorMarker : ImGui::WarningMarker);
|
text = (m_data.level == NotificationLevel::ErrorNotificationLevel ? ImGui::ErrorMarker : ImGui::WarningMarker);
|
||||||
float picture_width = ImGui::CalcTextSize(text.c_str()).x;
|
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::SetCursorPosX(m_line_height / 3);
|
||||||
ImGui::SetCursorPosY(m_window_height / 2 - m_line_height);
|
ImGui::SetCursorPosY(m_window_height / 2 - m_line_height);
|
||||||
imgui.text(text.c_str());
|
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;
|
std::wstring text;
|
||||||
text = ImGui::InfoMarker;
|
text = ImGui::InfoMarker;
|
||||||
ImGui::SetCursorPosX(m_line_height / 3);
|
ImGui::SetCursorPosX(m_line_height / 3);
|
||||||
|
|
|
@ -105,7 +105,9 @@ enum class NotificationType
|
||||||
ProgressIndicator,
|
ProgressIndicator,
|
||||||
// Give user advice to simplify object with big amount of triangles
|
// Give user advice to simplify object with big amount of triangles
|
||||||
// Contains ObjectID for closing when object is deleted
|
// Contains ObjectID for closing when object is deleted
|
||||||
SimplifySuggestion
|
SimplifySuggestion,
|
||||||
|
// information about netfabb is finished repairing model (blocking proccess)
|
||||||
|
NetfabbFinished
|
||||||
};
|
};
|
||||||
|
|
||||||
class NotificationManager
|
class NotificationManager
|
||||||
|
@ -123,6 +125,8 @@ public:
|
||||||
RegularNotificationLevel,
|
RegularNotificationLevel,
|
||||||
// Regular level notifiaction containing info about objects or print. Has Icon.
|
// Regular level notifiaction containing info about objects or print. Has Icon.
|
||||||
PrintInfoNotificationLevel,
|
PrintInfoNotificationLevel,
|
||||||
|
// PrintInfoNotificationLevel with shorter time
|
||||||
|
PrintInfoShortNotificationLevel,
|
||||||
// Information notification without a fade-out or with a longer fade-out.
|
// Information notification without a fade-out or with a longer fade-out.
|
||||||
ImportantNotificationLevel,
|
ImportantNotificationLevel,
|
||||||
// Warning, no fade-out.
|
// Warning, no fade-out.
|
||||||
|
@ -706,13 +710,14 @@ private:
|
||||||
{
|
{
|
||||||
switch (level) {
|
switch (level) {
|
||||||
|
|
||||||
case NotificationLevel::ErrorNotificationLevel: return 0;
|
case NotificationLevel::ErrorNotificationLevel: return 0;
|
||||||
case NotificationLevel::WarningNotificationLevel: return 0;
|
case NotificationLevel::WarningNotificationLevel: return 0;
|
||||||
case NotificationLevel::ImportantNotificationLevel: return 0;
|
case NotificationLevel::ImportantNotificationLevel: return 0;
|
||||||
case NotificationLevel::ProgressBarNotificationLevel: return 2;
|
case NotificationLevel::ProgressBarNotificationLevel: return 2;
|
||||||
case NotificationLevel::RegularNotificationLevel: return 10;
|
case NotificationLevel::PrintInfoShortNotificationLevel: return 5;
|
||||||
case NotificationLevel::PrintInfoNotificationLevel: return 10;
|
case NotificationLevel::RegularNotificationLevel: return 10;
|
||||||
case NotificationLevel::HintNotificationLevel: return 300;
|
case NotificationLevel::PrintInfoNotificationLevel: return 10;
|
||||||
|
case NotificationLevel::HintNotificationLevel: return 300;
|
||||||
default: return 10;
|
default: return 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue