ENH:add notification when sending gcode finished

Change-Id: I9a2dac701053591a1c0bd4d8b376ef07b31262f0
This commit is contained in:
tao wang 2022-11-22 15:53:38 +08:00 committed by Lane.Wei
parent df260dd724
commit 00ab44f0a0
4 changed files with 12 additions and 4 deletions

View file

@ -799,7 +799,7 @@ void NotificationManager::ExportFinishedNotification::render_text(ImGuiWrapper&
ImGui::SetCursorPosY(starting_y + i * shift_y);
imgui.text(line.c_str());
//hyperlink text
if ( i == 0 && !m_eject_pending) {
if ( i == 0 && !m_eject_pending && !m_export_dir_path.empty()) {
render_hypertext(imgui, x_offset + ImGui::CalcTextSize(line.c_str()).x + ImGui::CalcTextSize(" ").x, starting_y, _u8L("Open Folder."));
}
}
@ -1783,7 +1783,7 @@ void NotificationManager::set_simplify_suggestion_multiline(const ObjectID oid,
void NotificationManager::push_exporting_finished_notification(const std::string& path, const std::string& dir_path, bool on_removable)
{
close_notification_of_type(NotificationType::ExportFinished);
NotificationData data{ NotificationType::ExportFinished, NotificationLevel::RegularNotificationLevel, on_removable ? 0 : 20, _u8L("Export ok.") + "\n" + path };
NotificationData data{ NotificationType::ExportFinished, NotificationLevel::RegularNotificationLevel, on_removable ? 0 : 20, _u8L("Export successfully.") + "\n" + path };
push_notification_data(std::make_unique<NotificationManager::ExportFinishedNotification>(data, m_id_provider, m_evt_handler, on_removable, path, dir_path), 0);
set_slicing_progress_hidden();
}