mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 10:32:20 +00:00
FIX: show message while enable multi-machine
jira: [STUDIO-11980] Change-Id: I140d2d3f07c217465a2a5b6a0cec09f96135093c (cherry picked from commit be241bcdcc5ca66d231b646b33dfa87a5ee129f3)
This commit is contained in:
@@ -4832,23 +4832,33 @@ void GUI_App::show_dialog(wxString msg)
|
||||
}
|
||||
}
|
||||
|
||||
void GUI_App::push_notification(wxString msg, wxString title, UserNotificationStyle style)
|
||||
void GUI_App::push_notification(const MachineObject* obj, wxString msg, wxString title, UserNotificationStyle style)
|
||||
{
|
||||
if (!this->is_enable_multi_machine()) {
|
||||
if (style == UserNotificationStyle::UNS_NORMAL) {
|
||||
if (m_info_dialog_content.empty()) {
|
||||
wxCommandEvent* evt = new wxCommandEvent(EVT_SHOW_DIALOG);
|
||||
evt->SetString(msg);
|
||||
GUI::wxGetApp().QueueEvent(evt);
|
||||
m_info_dialog_content = msg;
|
||||
}
|
||||
if (this->is_enable_multi_machine())
|
||||
{
|
||||
if (m_device_manager && (obj != m_device_manager->get_selected_machine()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (style == UserNotificationStyle::UNS_WARNING_CONFIRM) {
|
||||
GUI::wxGetApp().CallAfter([msg, title] {
|
||||
}
|
||||
|
||||
if (style == UserNotificationStyle::UNS_NORMAL)
|
||||
{
|
||||
if (m_info_dialog_content.empty())
|
||||
{
|
||||
wxCommandEvent* evt = new wxCommandEvent(EVT_SHOW_DIALOG);
|
||||
evt->SetString(msg);
|
||||
GUI::wxGetApp().QueueEvent(evt);
|
||||
m_info_dialog_content = msg;
|
||||
}
|
||||
}
|
||||
else if (style == UserNotificationStyle::UNS_WARNING_CONFIRM)
|
||||
{
|
||||
GUI::wxGetApp().CallAfter([msg, title]
|
||||
{
|
||||
GUI::MessageDialog msg_dlg(nullptr, msg, title, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user