mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-02-03 17:38:43 +03:00
continues to push notification when export gcode
This commit is contained in:
@@ -2841,15 +2841,41 @@ bool NotificationManager::update_notifications(GLCanvas3D& canvas)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update state of all notif and erase finished
|
// update state of all notif and erase finished
|
||||||
|
//Y9
|
||||||
|
bool export_on_going = false;
|
||||||
|
bool export_finished = false;
|
||||||
|
std::string message = "12";
|
||||||
for (auto it = m_pop_notifications.begin(); it != m_pop_notifications.end();) {
|
for (auto it = m_pop_notifications.begin(); it != m_pop_notifications.end();) {
|
||||||
std::unique_ptr<PopNotification>& notification = *it;
|
std::unique_ptr<PopNotification>& notification = *it;
|
||||||
request_render |= notification->update_state(hover, time_since_render);
|
request_render |= notification->update_state(hover, time_since_render);
|
||||||
next_render = std::min<int64_t>(next_render, notification->next_render());
|
next_render = std::min<int64_t>(next_render, notification->next_render());
|
||||||
|
//Y9
|
||||||
|
if (notification->get_data().type == NotificationType::ExportFinished)
|
||||||
|
{
|
||||||
|
export_finished = true;
|
||||||
|
export_on_going = false;
|
||||||
|
}
|
||||||
if (notification->get_state() == PopNotification::EState::Finished)
|
if (notification->get_state() == PopNotification::EState::Finished)
|
||||||
|
{
|
||||||
|
if (!export_finished)
|
||||||
|
{
|
||||||
|
if (notification->get_data().type == NotificationType::ExportOngoing)
|
||||||
|
{
|
||||||
|
message = notification->get_data().text1;
|
||||||
|
export_on_going = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
it = m_pop_notifications.erase(it);
|
it = m_pop_notifications.erase(it);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
//Y9
|
||||||
|
if (export_on_going)
|
||||||
|
{
|
||||||
|
message = message + ".";
|
||||||
|
push_notification(NotificationType::ExportOngoing, NotificationManager::NotificationLevel::ProgressBarNotificationLevel, message);
|
||||||
|
}
|
||||||
|
|
||||||
// delayed notifications
|
// delayed notifications
|
||||||
for (auto it = m_waiting_notifications.begin(); it != m_waiting_notifications.end();) {
|
for (auto it = m_waiting_notifications.begin(); it != m_waiting_notifications.end();) {
|
||||||
|
|||||||
@@ -3461,7 +3461,9 @@ void Plater::priv::export_gcode(fs::path output_path, bool output_path_on_remova
|
|||||||
show_warning_dialog = true;
|
show_warning_dialog = true;
|
||||||
if (! output_path.empty()) {
|
if (! output_path.empty()) {
|
||||||
background_process.schedule_export(output_path.string(), output_path_on_removable_media);
|
background_process.schedule_export(output_path.string(), output_path_on_removable_media);
|
||||||
notification_manager->push_delayed_notification(NotificationType::ExportOngoing, []() {return true; }, 1000, 0);
|
//Y9
|
||||||
|
//notification_manager->push_delayed_notification(NotificationType::ExportOngoing, []() {return true; }, 1000, 0);
|
||||||
|
notification_manager->push_notification(NotificationType::ExportOngoing, NotificationManager::NotificationLevel::ProgressBarNotificationLevel, "aaa");
|
||||||
} else {
|
} else {
|
||||||
background_process.schedule_upload(std::move(upload_job));
|
background_process.schedule_upload(std::move(upload_job));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user