mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
Fix issue that connection failed dialog keeps popping up if lan device is offline
This commit is contained in:
@@ -1767,20 +1767,19 @@ void GUI_App::init_networking_callbacks()
|
|||||||
event.SetString(obj->get_dev_id());
|
event.SetString(obj->get_dev_id());
|
||||||
GUI::wxGetApp().sidebar().load_ams_list(obj->get_dev_id(), obj);
|
GUI::wxGetApp().sidebar().load_ams_list(obj->get_dev_id(), obj);
|
||||||
} else if (state == ConnectStatus::ConnectStatusFailed) {
|
} else if (state == ConnectStatus::ConnectStatusFailed) {
|
||||||
// Orca: avoid showing same error message multiple times until next connection attempt.
|
// Orca: only update status if same device id
|
||||||
const auto already_disconnected = m_device_manager->selected_machine.empty();
|
if (m_device_manager->selected_machine != dev_id) return;
|
||||||
|
|
||||||
m_device_manager->set_selected_machine("");
|
m_device_manager->set_selected_machine("");
|
||||||
if (!already_disconnected) {
|
wxString text;
|
||||||
wxString text;
|
if (msg == "5") {
|
||||||
if (msg == "5") {
|
obj->set_access_code("");
|
||||||
obj->set_access_code("");
|
obj->erase_user_access_code();
|
||||||
obj->erase_user_access_code();
|
text = wxString::Format(_L("Incorrect password"));
|
||||||
text = wxString::Format(_L("Incorrect password"));
|
wxGetApp().show_dialog(text);
|
||||||
wxGetApp().show_dialog(text);
|
} else {
|
||||||
} else {
|
text = wxString::Format(_L("Connect %s failed! [SN:%s, code=%s]"), from_u8(obj->get_dev_name()), obj->get_dev_id(), msg);
|
||||||
text = wxString::Format(_L("Connect %s failed! [SN:%s, code=%s]"), from_u8(obj->get_dev_name()), obj->get_dev_id(), msg);
|
wxGetApp().show_dialog(text);
|
||||||
wxGetApp().show_dialog(text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
event.SetInt(-1);
|
event.SetInt(-1);
|
||||||
} else if (state == ConnectStatus::ConnectStatusLost) {
|
} else if (state == ConnectStatus::ConnectStatusLost) {
|
||||||
|
|||||||
Reference in New Issue
Block a user