mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-23 03:03:15 +08:00
ENH: Print when unnamed project, task named as object names
github: #2286 Change-Id: I9be3fd25d16a00b78326ec43db9afcf3645d90f1
This commit is contained in:
parent
0dcdf96d85
commit
18a90327fb
@ -3823,7 +3823,21 @@ void SelectMachineDialog::set_default()
|
|||||||
}
|
}
|
||||||
|
|
||||||
fs::path filename_path(filename.c_str());
|
fs::path filename_path(filename.c_str());
|
||||||
m_current_project_name = wxString::FromUTF8(filename_path.filename().string());
|
std::string file_name = filename_path.filename().string();
|
||||||
|
if (from_u8(file_name).find(_L("Untitled")) != wxString::npos) {
|
||||||
|
PartPlate *part_plate = m_plater->get_partplate_list().get_plate(m_print_plate_idx);
|
||||||
|
if (part_plate) {
|
||||||
|
if (std::vector<ModelObject *> objects = part_plate->get_objects(); objects.size() > 0) {
|
||||||
|
file_name = objects[0]->name;
|
||||||
|
for (int i = 1; i < objects.size(); i++) { file_name += (" + " + objects[i]->name); }
|
||||||
|
}
|
||||||
|
if (file_name.size() > 100) {
|
||||||
|
file_name = file_name.substr(0, 97) + "...";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_current_project_name = wxString::FromUTF8(file_name);
|
||||||
|
|
||||||
|
|
||||||
//unsupported character filter
|
//unsupported character filter
|
||||||
m_current_project_name = from_u8(filter_characters(m_current_project_name.ToUTF8().data(), "<>[]:/\\|?*\""));
|
m_current_project_name = from_u8(filter_characters(m_current_project_name.ToUTF8().data(), "<>[]:/\\|?*\""));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user