From 84eb6159aa70cfa19d8be4dac5e888aa5bb50499 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Tue, 30 May 2023 08:55:44 +0800 Subject: [PATCH] FIX: [STUDIO-2908] load files from command line Change-Id: Icd67714f684bf150c568956e0685e67dca9e2ca8 --- src/slic3r/GUI/GUI_App.cpp | 17 +++++------------ src/slic3r/GUI/Plater.cpp | 3 ++- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 830e373bf..9c5ec72d4 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1048,19 +1048,12 @@ void GUI_App::post_init() else { mainframe->select_tab(size_t(MainFrame::tp3DEditor)); plater_->select_view_3D("3D"); - Plater::TakeSnapshot snapshot(this->plater(), "Load Project", UndoRedo::SnapshotType::ProjectSeparator); - const std::vector res = this->plater()->load_files(this->init_params->input_files); - if (!res.empty()) { - if (this->init_params->input_files.size() == 1) { - // Update application titlebar when opening a project file - const std::string& filename = this->init_params->input_files.front(); - this->plater()->up_to_date(true, false); - this->plater()->up_to_date(true, true); - //BBS: remove amf logic as project - if (boost::algorithm::iends_with(filename, ".3mf")) - this->plater()->set_project_filename(from_u8(filename)); - } + wxArrayString input_files; + for (auto & file : this->init_params->input_files) { + input_files.push_back(file); } + this->plater()->set_project_filename(_L("Untitled")); + this->plater()->load_files(input_files); } } } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 08784b52a..17f7a1165 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -7696,6 +7696,7 @@ int Plater::new_project(bool skip_confirm, bool silent) //get_partplate_list().update_slice_context_to_current_plate(p->background_process); //p->preview->update_gcode_result(p->partplate_list.get_current_slice_result()); reset(transfer_preset_changes); + reset_project_dirty_after_save(); reset_project_dirty_initial_presets(); wxGetApp().update_saved_preset_from_current_preset(); update_project_dirty_from_presets(); @@ -7871,7 +7872,7 @@ int Plater::save_project(bool saveAs) up_to_date(true, true); wxGetApp().update_saved_preset_from_current_preset(); - p->dirty_state.reset_after_save(); + reset_project_dirty_after_save(); return wxID_YES; }