mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 15:37:30 -06:00
Fix printer connection regression
This commit is contained in:
parent
1fdfc2fa45
commit
0feea859c5
1 changed files with 8 additions and 1 deletions
|
@ -469,6 +469,13 @@ void PhysicalPrinterDialog::update_host_type(bool printer_change)
|
|||
wxArrayString types;
|
||||
int last_in_conf = m_config->option("host_type")->getInt(); // this is real position in last choice
|
||||
|
||||
// Append localized enum_labels
|
||||
assert(ht->m_opt.enum_labels.size() == ht->m_opt.enum_values.size());
|
||||
for (size_t i = 0; i < ht->m_opt.enum_labels.size(); ++ i) {
|
||||
wxString label = _(ht->m_opt.enum_labels[i]);
|
||||
types.Add(label);
|
||||
}
|
||||
|
||||
Choice* choice = dynamic_cast<Choice*>(ht);
|
||||
choice->set_values(types);
|
||||
int index_in_choice = (printer_change ? std::clamp(last_in_conf - ((int)ht->m_opt.enum_values.size() - (int)types.size()), 0, (int)ht->m_opt.enum_values.size() - 1) : last_in_conf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue