Reload from disk command enhanced to work with 3mf/amf files saved with PrusaSlicer 2.1.0 and earlier

This commit is contained in:
Enrico Turri 2020-01-21 14:07:13 +01:00
parent 5342ad8990
commit dd09077bba
4 changed files with 142 additions and 7 deletions
src/slic3r/GUI

View file

@ -1622,9 +1622,14 @@ void ObjectList::append_menu_item_export_stl(wxMenu* menu) const
void ObjectList::append_menu_item_reload_from_disk(wxMenu* menu) const
{
#if ENABLE_BACKWARD_COMPATIBLE_RELOAD_FROM_DISK
append_menu_item(menu, wxID_ANY, _(L("Reload from disk")), _(L("Reload the selected volumes from disk")),
[this](wxCommandEvent&) { wxGetApp().plater()->reload_from_disk(); }, "", menu);
#else
append_menu_item(menu, wxID_ANY, _(L("Reload from disk")), _(L("Reload the selected volumes from disk")),
[this](wxCommandEvent&) { wxGetApp().plater()->reload_from_disk(); }, "", menu,
[]() { return wxGetApp().plater()->can_reload_from_disk(); }, wxGetApp().plater());
#endif // ENABLE_BACKWARD_COMPATIBLE_RELOAD_FROM_DISK
}
void ObjectList::append_menu_item_change_extruder(wxMenu* menu) const
@ -3891,10 +3896,15 @@ void ObjectList::show_multi_selection_menu()
_(L("Select extruder number for selected objects and/or parts")),
[this](wxCommandEvent&) { extruder_selection(); }, "", menu);
#if ENABLE_BACKWARD_COMPATIBLE_RELOAD_FROM_DISK
append_menu_item(menu, wxID_ANY, _(L("Reload from disk")), _(L("Reload the selected volumes from disk")),
[this](wxCommandEvent&) { wxGetApp().plater()->reload_from_disk(); }, "", menu);
#else
append_menu_item(menu, wxID_ANY, _(L("Reload from disk")), _(L("Reload the selected volumes from disk")),
[this](wxCommandEvent&) { wxGetApp().plater()->reload_from_disk(); }, "", menu, []() {
return wxGetApp().plater()->can_reload_from_disk();
}, wxGetApp().plater());
#endif // ENABLE_BACKWARD_COMPATIBLE_RELOAD_FROM_DISK
wxGetApp().plater()->PopupMenu(menu);
}