print_host

This commit is contained in:
sunsets
2024-03-20 11:16:37 +08:00
parent c31585e5ba
commit 759c6732b8

View File

@@ -2143,13 +2143,15 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
bool isValidIPAddress = true; bool isValidIPAddress = true;
DynamicPrintConfig *cfg_t = &(printer->config); DynamicPrintConfig *cfg_t = &(printer->config);
const auto opt = cfg_t->option<ConfigOptionEnum<PrintHostType>>("host_type");
const auto host_type = opt != nullptr ? opt->value : htOctoPrint;
wxStringTokenizer tokenizer3((data->lower_name), wxT("*"), wxTOKEN_RET_EMPTY_ALL); wxStringTokenizer tokenizer3((data->lower_name), wxT("*"), wxTOKEN_RET_EMPTY_ALL);
wxString printer_name = tokenizer3.GetNextToken(); wxString printer_name = tokenizer3.GetNextToken();
if (isValidIPAddress) { if (isValidIPAddress) {
m_printer_view->AddButton( m_printer_view->AddButton(
printer_name, host, (data->model_id), (data->fullname), printer_name, host, (data->model_id), (data->fullname), (data->selected),
(data->selected), cfg_t); (host_type == htMoonraker), cfg_t);
} }
} }
} }