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
1 changed files with 13 additions and 16 deletions

View File

@ -1618,8 +1618,8 @@ void StatusPanel::update(MachineObject *obj)
//lan = > cloud //lan = > cloud
if (iter_connect_type->second == "lan" && obj->dev_connection_type == "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 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 msg = wxString::Format(txt, obj->dev_name);
if (!m_show_mode_changed) { if (!m_show_mode_changed) {
m_show_mode_changed = true; m_show_mode_changed = true;
MessageDialog msg_wingow(nullptr, msg, wxEmptyString, wxICON_WARNING | wxOK); 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) { if (msg_wingow.ShowModal() == wxID_OK || msg_wingow.ShowModal() == wxID_CLOSE) {
m_show_mode_changed = false; 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;
} }
//cloud = > lan //cloud = > lan
if (iter_connect_type->second == "cloud" && obj->dev_connection_type == "lan") { if (iter_connect_type->second == "cloud" && obj->dev_connection_type == "lan") {
/*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.");
if (!obj->is_connected()) { wxString msg = wxString::Format(txt, obj->dev_name);
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."); if (!m_show_mode_changed) {
wxString msg = wxString::Format(txt, obj->dev_name); m_show_mode_changed = true;
if (!m_show_mode_changed) { MessageDialog msg_wingow(nullptr, msg, wxEmptyString, wxICON_WARNING | wxOK);
m_show_mode_changed = true; msg_wingow.SetSize(wxSize(FromDIP(600), FromDIP(200)));
MessageDialog msg_wingow(nullptr, msg, wxEmptyString, wxICON_WARNING | wxOK); if (msg_wingow.ShowModal() == wxID_OK || msg_wingow.ShowModal() == wxID_CLOSE) {
msg_wingow.SetSize(wxSize(FromDIP(600), FromDIP(200))); m_show_mode_changed = false;
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;
} }
} }
} }