mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-06 22:47:32 -06:00
ENH: merge all error when multi obj have empty layer
Change-Id: Iff091babff67050fe512a3cffe6cb2af0e91efa5 STUDIO-2540 (cherry picked from commit e23781245e3a6ae9bffcff869aa8991eb0298243) Change-Id: Ia90ffa1244ef8a89c8d3007ca65b68439b09249b
This commit is contained in:
parent
81319b6a9e
commit
35d6b072d3
8 changed files with 73 additions and 26 deletions
|
@ -1630,19 +1630,33 @@ void NotificationManager::push_validate_error_notification(StringObjectException
|
|||
set_slicing_progress_hidden();
|
||||
}
|
||||
|
||||
void NotificationManager::push_slicing_error_notification(const std::string &text, ModelObject const *obj)
|
||||
void NotificationManager::push_slicing_error_notification(const std::string &text, std::vector<ModelObject const *> objs)
|
||||
{
|
||||
auto callback = obj ? [id = obj->id()](wxEvtHandler *) {
|
||||
std::vector<ObjectID> ids;
|
||||
for (auto optr : objs) { ids.push_back(optr->id()); }
|
||||
auto callback = !objs.empty() ? [ids](wxEvtHandler *) {
|
||||
auto & objects = wxGetApp().model().objects;
|
||||
auto iter = std::find_if(objects.begin(), objects.end(), [id](auto o) { return o->id() == id; });
|
||||
if (iter != objects.end()) {
|
||||
wxGetApp().obj_list()->select_items({{*iter, nullptr}});
|
||||
std::vector<ObjectVolumeID> ovs;
|
||||
for (auto id : ids) {
|
||||
auto iter = std::find_if(objects.begin(), objects.end(), [id](auto o) { return o->id() == id; });
|
||||
if (iter != objects.end()) { ovs.push_back({*iter, nullptr}); }
|
||||
}
|
||||
if (!ovs.empty()) {
|
||||
wxGetApp().obj_list()->select_items(ovs);
|
||||
wxGetApp().mainframe->select_tab(MainFrame::tp3DEditor);
|
||||
}
|
||||
return false;
|
||||
} : std::function<bool(wxEvtHandler *)>();
|
||||
auto link = callback ? _u8L("Jump to") : "";
|
||||
if (obj) link += std::string(" [") + obj->name + "]";
|
||||
if (!objs.empty()) {
|
||||
link += " [";
|
||||
for (auto obj : objs) { link += obj->name + ", "; }
|
||||
if (!objs.empty()) {
|
||||
link.pop_back();
|
||||
link.pop_back();
|
||||
}
|
||||
link += "] ";
|
||||
}
|
||||
set_all_slicing_errors_gray(false);
|
||||
push_notification_data({ NotificationType::SlicingError, NotificationLevel::ErrorNotificationLevel, 0, _u8L("Error:") + "\n" + text, link, callback }, 0);
|
||||
set_slicing_progress_hidden();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue