Disable filament delete option if not SEMM

This commit is contained in:
Noisyfox
2025-10-24 14:36:22 +08:00
parent b2047ba563
commit 497ff94e09
3 changed files with 17 additions and 2 deletions

View File

@@ -1488,7 +1488,12 @@ void MenuFactory::create_filament_action_menu(bool init, int active_filament_men
append_menu_item(
menu, wxID_ANY, _L("Delete"), _L("Delete this filament"), [](wxCommandEvent&) {
plater()->sidebar().delete_filament(-2); }, "", nullptr,
[]() { return plater()->sidebar().combos_filament().size() > 1; }, m_parent);
[]() {
auto& sidebar = plater()->sidebar();
return sidebar.combos_filament().size() > 1
// Orca: only show delete filament option for SEMM machines unless is BBL
&& sidebar.should_show_SEMM_buttons();
}, m_parent);
}
const int item_id = menu->FindItem(_L("Merge with"));

View File

@@ -2254,7 +2254,7 @@ void Sidebar::update_all_preset_comboboxes()
p->m_filament_icon->SetBitmap_("filament");
}
show_SEMM_buttons(cfg.opt_bool("single_extruder_multi_material") || is_bbl_vendor);
show_SEMM_buttons(should_show_SEMM_buttons());
//p->m_staticText_filament_settings->Update();
@@ -3281,6 +3281,15 @@ void Sidebar::sync_ams_list(bool is_from_big_sync_btn)
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "finish pop_finsish_sync_ams_dialog";
}
bool Sidebar::should_show_SEMM_buttons()
{
PresetBundle &preset_bundle = *wxGetApp().preset_bundle;
bool is_bbl_vendor = preset_bundle.is_bbl_vendor();
auto cfg = preset_bundle.printers.get_edited_preset().config;
return cfg.opt_bool("single_extruder_multi_material") || is_bbl_vendor;
}
void Sidebar::show_SEMM_buttons(bool bshow)
{
if(p->m_bpButton_add_filament)

View File

@@ -198,6 +198,7 @@ public:
void get_big_btn_sync_pos_size(wxPoint &pt, wxSize &size);
void get_small_btn_sync_pos_size(wxPoint &pt, wxSize &size);
// Orca
bool should_show_SEMM_buttons();
void show_SEMM_buttons(bool bshow);
void update_dynamic_filament_list();