mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-06 22:47:32 -06:00
FIX: [STUDIO-1193] jump to object in slice object warnings
Change-Id: Ic6445d81a31e3ecaa069c5fd49b177dc454dc1b9
This commit is contained in:
parent
ba1cb7820a
commit
0da5585582
4 changed files with 22 additions and 9 deletions
|
@ -1598,9 +1598,18 @@ void NotificationManager::push_slicing_error_notification(const std::string& tex
|
|||
push_notification_data({ NotificationType::SlicingError, NotificationLevel::ErrorNotificationLevel, 0, _u8L("Error:") + "\n" + text }, 0);
|
||||
set_slicing_progress_hidden();
|
||||
}
|
||||
void NotificationManager::push_slicing_warning_notification(const std::string& text, bool gray, ObjectID oid, int warning_step, int warning_msg_id)
|
||||
void NotificationManager::push_slicing_warning_notification(const std::string& text, bool gray, ModelObject const * obj, ObjectID oid, int warning_step, int warning_msg_id)
|
||||
{
|
||||
NotificationData data { NotificationType::SlicingWarning, NotificationLevel::WarningNotificationLevel, 0, _u8L("Warning:") + "\n" + text };
|
||||
auto callback = obj ? [id = obj->id()](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}});
|
||||
return false;
|
||||
} : std::function<bool(wxEvtHandler *)>();
|
||||
auto link = callback ? _u8L("Jump to") : "";
|
||||
if (obj) link += std::string(" [") + obj->name + "]";
|
||||
NotificationData data { NotificationType::SlicingWarning, NotificationLevel::WarningNotificationLevel, 0, _u8L("Warning:") + "\n" + text, link, callback };
|
||||
|
||||
data.sub_msg_id = warning_msg_id;
|
||||
data.ori_text = text;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue