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 -1
View File
@@ -475,7 +475,7 @@ std::vector<NativeCommand> build_command_catalog()
PlateNameEditDialog dlg((wxWindow*) wxGetApp().mainframe, wxID_ANY, _L("Edit Plate Name"));
dlg.set_plate_name(from_u8(curr->get_plate_name()));
if (dlg.ShowModal() == wxID_YES)
curr->set_plate_name(dlg.get_plate_name().ToUTF8().data());
plater->rename_plate(plater->get_partplate_list().get_curr_plate_index(), dlg.get_plate_name().ToUTF8().data());
return AppActionRunResult{AppActionRunResult::Level::Success};
});
add_with_icon("plate_toggle_lock", L("Toggle Plate Lock"), L("Plate"), "lock_normal", [](const std::string&) {