Skip to content

Commit

Permalink
Quick fix attempt for issue #4076.
Browse files Browse the repository at this point in the history
This patch attempts to keep the printer access code from being cleared
erroneously on a lost or failed connection.  This only applies to LAN
mode.

Notes:
  - The setting is 'access_code'.  There is also a setting named
    'user_access_code', but it's function is unclear and may be
    vestigal.
  - Some parts of the network connection behavior are handled by the
    networking plugin.  I can't seem to make the machine list refresh
    from outside.
  • Loading branch information
Billiam Crashkopf committed Jan 2, 2025
1 parent c1b3cc0 commit ac26070
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/slic3r/GUI/GUI_App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2072,11 +2072,12 @@ void GUI_App::init_networking_callbacks()
event.SetString(obj->dev_id);
GUI::wxGetApp().sidebar().load_ams_list(obj->dev_id, obj);
} else if (state == ConnectStatus::ConnectStatusFailed) {
obj->set_access_code("");
obj->erase_user_access_code();
m_device_manager->localMachineList.erase(obj->dev_id);
m_device_manager->set_selected_machine("", true);
wxString text;
if (msg == "5") {
obj->set_access_code("");
obj->erase_user_access_code();
text = wxString::Format(_L("Incorrect password"));
wxGetApp().show_dialog(text);
} else {
Expand All @@ -2085,9 +2086,9 @@ void GUI_App::init_networking_callbacks()
}
event.SetInt(-1);
} else if (state == ConnectStatus::ConnectStatusLost) {
obj->set_access_code("");
obj->erase_user_access_code();
m_device_manager->localMachineList.erase(obj->dev_id);
//obj->set_access_code("");
//obj->erase_user_access_code();
//m_device_manager->localMachineList.erase(obj->dev_id);
m_device_manager->set_selected_machine("", true);
event.SetInt(-1);
BOOST_LOG_TRIVIAL(info) << "set_on_local_connect_fn: state = lost";
Expand Down

0 comments on commit ac26070

Please sign in to comment.