Changed app title when the current project is modified and non yet named

This commit is contained in:
enricoturri1966 2021-08-23 12:40:28 +02:00
parent fb1334af85
commit 1f8b134a77

View File

@ -618,9 +618,12 @@ void MainFrame::update_title()
// Don't try to remove the extension, it would remove part of the file name after the last dot! // Don't try to remove the extension, it would remove part of the file name after the last dot!
wxString project = from_path(into_path(m_plater->get_project_filename()).filename()); wxString project = from_path(into_path(m_plater->get_project_filename()).filename());
wxString dirty_marker = (!m_plater->model().objects.empty() && m_plater->is_project_dirty()) ? "*" : ""; wxString dirty_marker = (!m_plater->model().objects.empty() && m_plater->is_project_dirty()) ? "*" : "";
if (!dirty_marker.empty() || !project.empty()) if (!dirty_marker.empty() || !project.empty()) {
if (!dirty_marker.empty() && project.empty())
project = _("Untitled");
title = dirty_marker + project + " - "; title = dirty_marker + project + " - ";
} }
}
std::string build_id = wxGetApp().is_editor() ? SLIC3R_BUILD_ID : GCODEVIEWER_BUILD_ID; std::string build_id = wxGetApp().is_editor() ? SLIC3R_BUILD_ID : GCODEVIEWER_BUILD_ID;
size_t idx_plus = build_id.find('+'); size_t idx_plus = build_id.find('+');