diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 2b72e901a78..ff5dff3d24c 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -1031,6 +1031,20 @@ void ObjectList::key_event(wxKeyEvent& event) increase_instances(); else if (event.GetUnicodeKey() == '-') decrease_instances(); + else if (event.GetUnicodeKey() == 'p') + toggle_printable_state(); + else if (extruders_count() > 1) { + std::vector numbers = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; + wxChar key_char = event.GetUnicodeKey(); + if (std::find(numbers.begin(), numbers.end(), key_char) != numbers.end()) { + long extruder_number; + if (wxNumberFormatter::FromString(wxString(key_char), &extruder_number) && + extruders_count() >= extruder_number) + set_extruder_for_selected_items(int(extruder_number)); + } + else + event.Skip(); + } else event.Skip(); } @@ -3787,33 +3801,6 @@ void ObjectList::OnEditingDone(wxDataViewEvent &event) plater->set_current_canvas_as_dirty(); } -void ObjectList::extruder_selection() -{ - wxArrayString choices; - choices.Add(_(L("default"))); - for (int i = 1; i <= extruders_count(); ++i) - choices.Add(wxString::Format("%d", i)); - - const wxString& selected_extruder = wxGetSingleChoice(_(L("Select extruder number:")), - _(L("This extruder will be set for selected items")), - choices, 0, this); - if (selected_extruder.IsEmpty()) - return; - - const int extruder_num = selected_extruder == _(L("default")) ? 0 : atoi(selected_extruder.c_str()); - -// /* Another variant for an extruder selection */ -// extruder_num = wxGetNumberFromUser(_(L("Attention!!! \n" -// "It's a possibile to set an extruder number \n" -// "for whole Object(s) and/or object Part(s), \n" -// "not for an Instance. ")), -// _(L("Enter extruder number:")), -// _(L("This extruder will be set for selected items")), -// 1, 1, 5, this); - - set_extruder_for_selected_items(extruder_num); -} - void ObjectList::set_extruder_for_selected_items(const int extruder) const { wxDataViewItemArray sels; @@ -3918,10 +3905,10 @@ void ObjectList::toggle_printable_state() int inst_idx = type == itObject ? 0 : m_objects_model->GetInstanceIdByItem(frst_item); bool printable = !object(obj_idx)->instances[inst_idx]->printable; - const wxString snapshot_text = sels.Count() > 1 ? (printable ? _L("Set Printable group") : _L("Set Unprintable group")) : - object(obj_idx)->instances.size() == 1 ? from_u8((boost::format("%1% %2%") - % (printable ? _L("Set Printable") : _L("Set Unprintable")) - % object(obj_idx)->name).str()) : + const wxString snapshot_text = sels.Count() > 1 ? + (printable ? _L("Set Printable group") : _L("Set Unprintable group")) : + object(obj_idx)->instances.size() == 1 ? + format_wxstr("%1% %2%", (printable ? _L("Set Printable") : _L("Set Unprintable")), from_u8(object(obj_idx)->name)) : (printable ? _L("Set Printable Instance") : _L("Set Unprintable Instance")); take_snapshot(snapshot_text); diff --git a/src/slic3r/GUI/GUI_ObjectList.hpp b/src/slic3r/GUI/GUI_ObjectList.hpp index 8bcfec11c43..b378b00af2c 100644 --- a/src/slic3r/GUI/GUI_ObjectList.hpp +++ b/src/slic3r/GUI/GUI_ObjectList.hpp @@ -390,7 +390,6 @@ class ObjectList : public wxDataViewCtrl void OnEditingStarted(wxDataViewEvent &event); #endif /* __WXMSW__ */ void OnEditingDone(wxDataViewEvent &event); - void extruder_selection(); }; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index c0cda004250..03787e0a0b8 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2743,10 +2743,11 @@ void Plater::priv::split_object() Slic3r::GUI::warning_catcher(q, _L("The selected object couldn't be split because it contains only one solid part.")); else { - if (current_model_object->volumes.size() != new_objects.size()) + // If we splited object which is contain some parts/modifiers then all non-solid parts (modifiers) were deleted + if (current_model_object->volumes.size() > 1 && current_model_object->volumes.size() != new_objects.size()) notification_manager->push_notification(NotificationType::CustomNotification, NotificationManager::NotificationLevel::RegularNotification, - _u8L("All non-solid parts (modifiers) was deleted")); + _u8L("All non-solid parts (modifiers) were deleted")); Plater::TakeSnapshot snapshot(q, _L("Split to Objects"));