ENH:do not popup msg dialog when the connection mode changes

Change-Id: Ib5b5c5255bf8feff8395d9adce554d228c0523a2
This commit is contained in:
tao wang 2023-06-12 15:52:56 +08:00 committed by Lane.Wei
parent d140b572ff
commit f7d33fd855

View file

@ -1618,8 +1618,8 @@ void StatusPanel::update(MachineObject *obj)
//lan = > cloud
if (iter_connect_type->second == "lan" && obj->dev_connection_type == "cloud") {
wxString txt = _L("Disconnected from printer [%s] due to LAN mode disabled.Please reconnect the printer by logging in with your user account.");
wxString msg = wxString::Format(txt,obj->dev_name);
/*wxString txt = _L("Disconnected from printer [%s] due to LAN mode disabled.Please reconnect the printer by logging in with your user account.");
wxString msg = wxString::Format(txt, obj->dev_name);
if (!m_show_mode_changed) {
m_show_mode_changed = true;
MessageDialog msg_wingow(nullptr, msg, wxEmptyString, wxICON_WARNING | wxOK);
@ -1627,26 +1627,23 @@ void StatusPanel::update(MachineObject *obj)
if (msg_wingow.ShowModal() == wxID_OK || msg_wingow.ShowModal() == wxID_CLOSE) {
m_show_mode_changed = false;
}
}
}*/
m_print_connect_types[obj->dev_id] = obj->dev_connection_type;
}
//cloud = > lan
if (iter_connect_type->second == "cloud" && obj->dev_connection_type == "lan") {
if (!obj->is_connected()) {
wxString txt = _L("Disconnected from printer [%s] due to LAN mode enabled.Please reconnect the printer by inputting Access Code which can be gotten from printer screen.");
wxString msg = wxString::Format(txt, obj->dev_name);
if (!m_show_mode_changed) {
m_show_mode_changed = true;
MessageDialog msg_wingow(nullptr, msg, wxEmptyString, wxICON_WARNING | wxOK);
msg_wingow.SetSize(wxSize(FromDIP(600), FromDIP(200)));
if (msg_wingow.ShowModal() == wxID_OK || msg_wingow.ShowModal() == wxID_CLOSE) {
m_show_mode_changed = false;
}
/*wxString txt = _L("Disconnected from printer [%s] due to LAN mode enabled.Please reconnect the printer by inputting Access Code which can be gotten from printer screen.");
wxString msg = wxString::Format(txt, obj->dev_name);
if (!m_show_mode_changed) {
m_show_mode_changed = true;
MessageDialog msg_wingow(nullptr, msg, wxEmptyString, wxICON_WARNING | wxOK);
msg_wingow.SetSize(wxSize(FromDIP(600), FromDIP(200)));
if (msg_wingow.ShowModal() == wxID_OK || msg_wingow.ShowModal() == wxID_CLOSE) {
m_show_mode_changed = false;
}
m_print_connect_types[obj->dev_id] = obj->dev_connection_type;
}
}*/
m_print_connect_types[obj->dev_id] = obj->dev_connection_type;
}
}
}