mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-20 14:08:20 +00:00
Keep an offline Moonraker printer from freezing startup (#16668)
Moonraker discovery asked the printer for its name before announcing it, on the GUI thread, with a 5 s connect timeout. When the selected printer was off, the window ignored input for 5 s after every launch and the Home page stayed white. The request never produced a name. It read machine_name or hostname from /server/info, and Moonraker sends neither there. Discovery now announces the preset model name without asking the printer.
This commit is contained in:
1 parent
0585836550
commit
a2b1a2f3e7
2 files changed
+5
-12
No files matched your search
@@ -1415,16 +1415,8 @@ void MoonrakerPrinterAgent::announce_printhost_device()
|
||||
}
|
||||
}
|
||||
|
||||
// Try to fetch actual device name from Moonraker
|
||||
// Priority: 1) Moonraker hostname, 2) Preset model name, 3) Generic fallback
|
||||
std::string dev_name;
|
||||
MoonrakerDeviceInfo info;
|
||||
std::string fetch_error;
|
||||
if (fetch_device_info(device_info.base_url, device_info.api_key, info, fetch_error) && !info.dev_name.empty()) {
|
||||
dev_name = info.dev_name;
|
||||
} else {
|
||||
dev_name = device_info.model_name.empty() ? "Moonraker Printer" : device_info.model_name;
|
||||
}
|
||||
// Never asks the printer, since discovery runs on the GUI thread and an unreachable printer would freeze it
|
||||
const std::string dev_name = device_info.model_name.empty() ? "Moonraker Printer" : device_info.model_name;
|
||||
|
||||
const std::string model_id = device_info.model_id;
|
||||
|
||||
|
||||
Reference in new issue
Block a user