Make plate renames undoable and refresh G-code that uses {plate_name} (#16900)

Renaming a plate now creates an undo snapshot, so a rename is its own undo step and marks the project as modified. All four rename paths use the new `Plater::rename_plate()`.

When a G-code template uses `{plate_name}`, renaming a sliced plate invalidates only the G-code export step, so the next slice only re-exports the G-code. `filename_format` is excluded because the file name is built from the current plate name at export time.

The "Rename Plate" undo snapshot is from #16141.

Co-authored-by: cook0001 <79376116+cook0001@users.noreply.github.com>
This commit is contained in:
yw4zandcook0001 authored and GitHub committed 2026-10-26 13:25:16 -05:00
1 parent e00f4b7008
commit ab24043937
7 files changed
+95 -11

No files matched your search

+1 -4
View File
@@ -1202,10 +1202,7 @@ void ObjectList::update_name_in_model(const wxDataViewItem& item) const
int plate_idx = -1;
const ItemType type0 = m_objects_model->GetItemType(item, plate_idx);
if (plate_idx >= 0) {
auto plate = wxGetApp().plater()->get_partplate_list().get_plate(plate_idx);
if (plate->get_plate_name() != name) {
plate->set_plate_name(name);
}
wxGetApp().plater()->rename_plate(plate_idx, name);
m_objects_model->SetCurSelectedPlateFullName(plate_idx, name);
}
return;