fix an issue the bbl printer not working

This commit is contained in:
SoftFever
2026-02-02 23:48:22 +08:00
parent 431943408b
commit 84faac2dd4
3 changed files with 24 additions and 20 deletions

View File

@@ -3482,12 +3482,16 @@ void GUI_App::switch_printer_agent()
}
// Read printer_agent from config, falling back to default
const DynamicPrintConfig& config = preset_bundle->printers.get_edited_preset().config;
std::string effective_agent_id = ORCA_PRINTER_AGENT_ID;
if (config.has("printer_agent")) {
const std::string& value = config.option<ConfigOptionString>("printer_agent")->value;
if (!value.empty())
effective_agent_id = value;
if (preset_bundle->is_bbl_vendor()) {
effective_agent_id = BBL_PRINTER_AGENT_ID;
} else {
const DynamicPrintConfig& config = preset_bundle->printers.get_edited_preset().config;
if (config.has("printer_agent")) {
const std::string& value = config.option<ConfigOptionString>("printer_agent")->value;
if (!value.empty())
effective_agent_id = value;
}
}
// Check if agent is registered