mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 10:32:20 +00:00
Fix three regressions in the multi-tool extruder tab system: (#12680)
1. Dirty flags not showing for extruder options: 2. Crash when switching to non-first extruder tabs: 3. Modifying one extruder's parameter affects other extruders:
This commit is contained in:
@@ -903,9 +903,21 @@ void Tab::filter_diff_option(std::vector<std::string> &options)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) opt = opt.substr(0, hash_pos);
|
||||
if (found) continue;
|
||||
|
||||
// Keep key#index if that exact option is tracked.
|
||||
if (m_options_list.find(opt) != m_options_list.end())
|
||||
continue;
|
||||
|
||||
const std::string base = opt.substr(0, hash_pos);
|
||||
const std::string idx0 = base + "#0";
|
||||
if (m_options_list.find(idx0) != m_options_list.end()) {
|
||||
opt = idx0;
|
||||
continue;
|
||||
}
|
||||
if (m_options_list.find(base) != m_options_list.end())
|
||||
opt = base;
|
||||
}
|
||||
options.erase(std::remove(options.begin(), options.end(), ""), options.end());
|
||||
}
|
||||
|
||||
// Update UI according to changes
|
||||
@@ -988,10 +1000,15 @@ void TabPrinter::init_options_list()
|
||||
if (m_printer_technology == ptFFF)
|
||||
m_options_list.emplace("extruders_count", m_opt_status_value);
|
||||
for (size_t i = 1; i < m_extruders_count; ++i) {
|
||||
auto extruder_page = m_pages[3 + i];
|
||||
for (auto group : extruder_page->m_optgroups) {
|
||||
for (auto & opt : group->opt_map())
|
||||
m_options_list.emplace(opt.first, m_opt_status_value);
|
||||
wxString target_title = wxString::Format("Extruder %d", int(i + 1));
|
||||
for (auto &page : m_pages) {
|
||||
if (page->title() == target_title) {
|
||||
for (auto group : page->m_optgroups) {
|
||||
for (auto &opt : group->opt_map())
|
||||
m_options_list.emplace(opt.first, m_opt_status_value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user