Skip to content

Commit

Permalink
GUI_ObjectList: Get list of the loaded files before a taking of Undo/…
Browse files Browse the repository at this point in the history
…Redo snapshot

+ Fixed localization for the "Post processing" description line
  • Loading branch information
YuSanka committed Dec 17, 2021
1 parent 93c4b94 commit 1955baa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
29 changes: 14 additions & 15 deletions src/slic3r/GUI/GUI_ObjectList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,18 @@ void ObjectList::load_subobject(ModelVolumeType type, bool from_galery/* = false
if (m_objects_model->GetItemType(item)&itInstance)
item = m_objects_model->GetItemById(obj_idx);

wxArrayString input_files;
if (from_galery) {
GalleryDialog dlg(this);
if (dlg.ShowModal() != wxID_CLOSE)
dlg.get_input_files(input_files);
}
else
wxGetApp().import_model(wxGetApp().tab_panel()->GetPage(0), input_files);

if (input_files.IsEmpty())
return;

take_snapshot((type == ModelVolumeType::MODEL_PART) ? _L("Load Part") : _L("Load Modifier"));

std::vector<ModelVolume*> volumes;
Expand All @@ -1406,7 +1418,7 @@ void ObjectList::load_subobject(ModelVolumeType type, bool from_galery/* = false
if (type == ModelVolumeType::MODEL_PART)
load_part(*(*m_objects)[obj_idx], volumes, type, from_galery);
else*/
load_modifier(*(*m_objects)[obj_idx], volumes, type, from_galery);
load_modifier(input_files, *(*m_objects)[obj_idx], volumes, type, from_galery);

if (volumes.empty())
return;
Expand Down Expand Up @@ -1486,27 +1498,14 @@ void ObjectList::load_part(ModelObject& model_object, std::vector<ModelVolume*>&
}
}
*/
void ObjectList::load_modifier(ModelObject& model_object, std::vector<ModelVolume*>& added_volumes, ModelVolumeType type, bool from_galery)
void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& model_object, std::vector<ModelVolume*>& added_volumes, ModelVolumeType type, bool from_galery)
{
// ! ysFIXME - delete commented code after testing and rename "load_modifier" to something common
//if (type == ModelVolumeType::MODEL_PART)
// return;

wxWindow* parent = wxGetApp().tab_panel()->GetPage(0);

wxArrayString input_files;

if (from_galery) {
GalleryDialog dlg(this);
if (dlg.ShowModal() == wxID_CLOSE)
return;
dlg.get_input_files(input_files);
if (input_files.IsEmpty())
return;
}
else
wxGetApp().import_model(parent, input_files);

wxProgressDialog dlg(_L("Loading") + dots, "", 100, wxGetApp().mainframe, wxPD_AUTO_HIDE);
wxBusyCursor busy;

Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/GUI_ObjectList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class ObjectList : public wxDataViewCtrl
void load_subobject(ModelVolumeType type, bool from_galery = false);
// ! ysFIXME - delete commented code after testing and rename "load_modifier" to something common
//void load_part(ModelObject& model_object, std::vector<ModelVolume*>& added_volumes, ModelVolumeType type, bool from_galery = false);
void load_modifier(ModelObject& model_object, std::vector<ModelVolume*>& added_volumes, ModelVolumeType type, bool from_galery = false);
void load_modifier(const wxArrayString& input_files, ModelObject& model_object, std::vector<ModelVolume*>& added_volumes, ModelVolumeType type, bool from_galery = false);
void load_generic_subobject(const std::string& type_name, const ModelVolumeType type);
void load_shape_object(const std::string &type_name);
void load_shape_object_from_gallery();
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ void TabPrint::update_description_lines()

if (m_active_page && m_active_page->title() == "Output options" && m_post_process_explanation) {
m_post_process_explanation->SetText(
_u8L("Post processing scripts shall modify G-code file in place."));
_L("Post processing scripts shall modify G-code file in place."));
#ifndef __linux__
m_post_process_explanation->SetPathEnd("post-processing-scripts_283913");
#endif // __linux__
Expand Down

0 comments on commit 1955baa

Please sign in to comment.