FIX: [STUDIO-1586] take new project snapshot after reset

Change-Id: Iad3be50d5c783d0114eaea8c0a5b03f45a45aa36
This commit is contained in:
chunmao.guo 2022-12-05 15:39:15 +08:00 committed by Lane.Wei
parent 5276528e04
commit c3398a089c
2 changed files with 21 additions and 3 deletions

View file

@ -7284,8 +7284,6 @@ int Plater::new_project(bool skip_confirm, bool silent)
if (!silent)
wxGetApp().mainframe->select_tab(MainFrame::tp3DEditor);
Plater::TakeSnapshot snapshot(this, "New Project", UndoRedo::SnapshotType::ProjectSeparator);
//get_partplate_list().reinit();
//get_partplate_list().update_slice_context_to_current_plate(p->background_process);
//p->preview->update_gcode_result(p->partplate_list.get_current_slice_result());
@ -7299,6 +7297,8 @@ int Plater::new_project(bool skip_confirm, bool silent)
//set project name
p->set_project_name(_L("Untitled"));
Plater::TakeSnapshot snapshot(this, "New Project", UndoRedo::SnapshotType::ProjectSeparator);
Model m;
model().load_from(m); // new id avoid same path name
get_partplate_list().select_plate(0);
@ -7360,9 +7360,10 @@ void Plater::load_project(wxString const& filename2,
bool load_restore = strategy & LoadStrategy::Restore;
// Take the Undo / Redo snapshot.
Plater::TakeSnapshot snapshot(this, "Load Project", UndoRedo::SnapshotType::ProjectSeparator);
reset();
Plater::TakeSnapshot snapshot(this, "Load Project", UndoRedo::SnapshotType::ProjectSeparator);
std::vector<fs::path> input_paths;
input_paths.push_back(path);
if (strategy & LoadStrategy::Restore)