mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
Fix printer connection regression
This commit is contained in:
parent
1fdfc2fa45
commit
0feea859c5
1 changed files with 8 additions and 1 deletions
|
@ -406,7 +406,7 @@ void PhysicalPrinterDialog::update(bool printer_change)
|
||||||
// Only offer the host type selection for FFF, for SLA it's always the SL1 printer (at the moment)
|
// Only offer the host type selection for FFF, for SLA it's always the SL1 printer (at the moment)
|
||||||
bool supports_multiple_printers = false;
|
bool supports_multiple_printers = false;
|
||||||
if (tech == ptFFF) {
|
if (tech == ptFFF) {
|
||||||
update_host_type(printer_change);
|
update_host_type(printer_change);
|
||||||
const auto opt = m_config->option<ConfigOptionEnum<PrintHostType>>("host_type");
|
const auto opt = m_config->option<ConfigOptionEnum<PrintHostType>>("host_type");
|
||||||
m_optgroup->show_field("host_type");
|
m_optgroup->show_field("host_type");
|
||||||
|
|
||||||
|
@ -469,6 +469,13 @@ void PhysicalPrinterDialog::update_host_type(bool printer_change)
|
||||||
wxArrayString types;
|
wxArrayString types;
|
||||||
int last_in_conf = m_config->option("host_type")->getInt(); // this is real position in last choice
|
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* choice = dynamic_cast<Choice*>(ht);
|
||||||
choice->set_values(types);
|
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);
|
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