mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-17 20:57:26 +00:00
Skip the LAN reconnect after a print to the selected printer (#16271)
After a print, `Plater::print_job_finished` selects the target printer again. When that printer was already the selected LAN printer, `set_selected_machine` disconnected, reset and reconnected it for no reason. Skip the call in that case. Selecting the printer by hand still reconnects it, and cloud printers are unchanged.
This commit is contained in:
1 parent
fd28f6c189
commit
8160f64cae
1 file changed
+6
-1
@@ -21178,7 +21178,12 @@ void Plater::print_job_finished(wxCommandEvent &evt)
|
||||
Slic3r::DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
if (!dev) return;
|
||||
|
||||
dev->set_selected_machine(evt.GetString().ToStdString());
|
||||
const std::string dev_id = evt.GetString().ToStdString();
|
||||
MachineObject* selected = dev->get_selected_machine();
|
||||
// After a LAN print, the completion event reselects the same printer.
|
||||
// Keep the active session while asynchronous status traffic may still be in flight.
|
||||
if (!selected || selected->get_dev_id() != dev_id || selected->connection_type() != "lan")
|
||||
dev->set_selected_machine(dev_id);
|
||||
p->main_frame->request_select_tab(TAB_ID_MONITOR);
|
||||
// Selects the status page on a built Device tab; one built by the switch starts there.
|
||||
MonitorPanel* curr_monitor = MonitorPanel::if_built();
|
||||
|
||||
Reference in new issue
Block a user