FIX: show message while enable multi-machine

jira: [STUDIO-11980]
Change-Id: I140d2d3f07c217465a2a5b6a0cec09f96135093c
(cherry picked from commit be241bcdcc5ca66d231b646b33dfa87a5ee129f3)
This commit is contained in:
xin.zhang
2025-05-06 15:07:42 +08:00
committed by Noisyfox
parent 32061b6772
commit 5d476c3e3d
3 changed files with 27 additions and 17 deletions

View File

@@ -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();
});
}
}
}