mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-18 08:22:06 +00:00
Restart printer discovery after a network-plugin hot reload
restart_networking() rebuilds m_agent with a null printer agent, so the bare m_agent->start_discovery() no-oped (NetworkAgent::start_discovery returns false when m_printer_agent is null) and LAN discovery stayed dead until the user next changed a preset. Call switch_printer_agent() instead - it installs the printer agent for the active preset and then starts discovery, mirroring startup.
This commit is contained in:
@@ -1677,7 +1677,13 @@ void GUI_App::restart_networking()
|
||||
m_agent->set_on_http_error_fn([this](CloudEvent event, unsigned int status, std::string body) {
|
||||
this->handle_http_error(status, body, event.provider);
|
||||
});
|
||||
m_agent->start_discovery(true, false);
|
||||
// on_init_network() rebuilt m_agent with a null printer agent, so calling
|
||||
// m_agent->start_discovery() directly would no-op (NetworkAgent::start_discovery
|
||||
// returns false when m_printer_agent is null). Re-establish the printer agent for the
|
||||
// active preset first - switch_printer_agent() installs it and then starts discovery,
|
||||
// mirroring startup - otherwise LAN discovery stays dead after a plugin hot reload
|
||||
// until the user next changes a preset/tab.
|
||||
switch_printer_agent();
|
||||
if (mainframe)
|
||||
mainframe->refresh_plugin_tips();
|
||||
if (plater_)
|
||||
|
||||
Reference in New Issue
Block a user