FIX: .gcode file shall disable preview menu (STUDIO-2320)

https://jira.bambooolab.com/browse/STUDIO-2320

Change-Id: I54cd49a49a8b08916872eae75534ef4c1d915cb5
This commit is contained in:
liz.li 2023-03-06 18:39:23 +08:00 committed by Lane.Wei
parent ede8a2dc30
commit 1beee1eebf
3 changed files with 14 additions and 1 deletions

View file

@ -1086,6 +1086,14 @@ void GCodeViewer::load(const GCodeProcessorResult& gcode_result, const Print& pr
}
m_fold = false;
bool only_gcode_3mf = false;
PartPlate* current_plate = wxGetApp().plater()->get_partplate_list().get_curr_plate();
bool current_has_print_instances = current_plate->has_printable_instances();
if (current_plate->is_slice_result_valid() && wxGetApp().model().objects.empty() && !current_has_print_instances)
only_gcode_3mf = true;
m_layers_slider->set_menu_enable(!(only_gcode || only_gcode_3mf));
m_layers_slider->set_as_dirty();
m_moves_slider->set_as_dirty();