Revert "Fix Compile Warnings (#5963)"

This reverts commit b83e16dbdd.

Found regressions like auto orientation didn't work anymore after this change, revert it
This commit is contained in:
SoftFever 2024-08-12 00:00:20 +08:00
parent 0286c36f42
commit 7082e945b1
184 changed files with 1091 additions and 461 deletions

View file

@ -1222,7 +1222,7 @@ void Tab::msw_rescale()
// recreate and set new ImageList for tree_ctrl
m_icons->RemoveAll();
m_icons = new wxImageList(m_scaled_icons_list.front().bmp().GetWidth(), m_scaled_icons_list.front().bmp().GetHeight(), false);
// for (ScalableBitmap& bmp : m_scaled_icons_list)
for (ScalableBitmap& bmp : m_scaled_icons_list)
//m_icons->Add(bmp.bmp());
m_tabctrl->AssignImageList(m_icons);
@ -1256,7 +1256,7 @@ void Tab::sys_color_changed()
// recreate and set new ImageList for tree_ctrl
m_icons->RemoveAll();
m_icons = new wxImageList(m_scaled_icons_list.front().bmp().GetWidth(), m_scaled_icons_list.front().bmp().GetHeight(), false);
// for (ScalableBitmap& bmp : m_scaled_icons_list)
for (ScalableBitmap& bmp : m_scaled_icons_list)
//m_icons->Add(bmp.bmp());
m_tabctrl->AssignImageList(m_icons);
@ -1617,6 +1617,19 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
}
}
// -1 means caculate all
auto update_flush_volume = [](int idx = -1) {
if (idx < 0) {
size_t filament_size = wxGetApp().plater()->get_extruder_colors_from_plater_config().size();
for (size_t i = 0; i < filament_size; ++i)
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(i);
}
else
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(idx);
};
string opt_key_without_idx = opt_key.substr(0, opt_key.find('#'));
if (opt_key_without_idx == "long_retractions_when_cut") {
@ -2601,6 +2614,8 @@ void TabPrintModel::update_model_config()
// Reset m_config manually because there's no corresponding config in m_parent_tab->m_config
for (auto plate_item : m_object_configs) {
const DynamicPrintConfig& plate_config = plate_item.second->get();
BedType plate_bed_type = (BedType)0;
PrintSequence plate_print_seq = (PrintSequence)0;
if (!plate_config.has("curr_bed_type")) {
// same as global
DynamicConfig& global_cfg = wxGetApp().preset_bundle->project_config;
@ -2911,6 +2926,7 @@ void TabPrintPlate::on_value_change(const std::string& opt_key, const boost::any
void TabPrintPlate::notify_changed(ObjectBase* object)
{
auto plate = dynamic_cast<PartPlate*>(object);
auto objects_list = wxGetApp().obj_list();
wxDataViewItemArray items;
objects_list->GetSelections(items);
@ -4754,14 +4770,14 @@ void Tab::rebuild_page_tree()
if (sel_item == m_last_select_item)
m_last_select_item = item;
else
m_last_select_item = 0;
m_last_select_item = NULL;
// allow activate page before selection of a page_tree item
m_disable_tree_sel_changed_event = false;
//BBS: GUI refactor
if (item >= 0)
{
update_current_page_in_background(item);
bool ret = update_current_page_in_background(item);
//if m_active_page is changed in update_current_page_in_background
//will just update the selected item of the treectrl
if (m_parent->is_active_and_shown_tab(this)) // FIX: modify state not update
@ -5581,6 +5597,7 @@ void Tab::delete_preset()
if (m_presets->get_preset_base(current_preset) == &current_preset) { //root preset
is_base_preset = true;
if (current_preset.type == Preset::Type::TYPE_PRINTER && !current_preset.is_system) { //Customize third-party printers
Preset &current_preset = m_presets->get_selected_preset();
int filament_preset_num = 0;
int process_preset_num = 0;
for (const Preset &preset : m_preset_bundle->filaments.get_presets()) {
@ -5844,6 +5861,7 @@ wxSizer* TabPrinter::create_bed_shape_widget(wxWindow* parent)
sizer->Add(btn, 0, wxALIGN_CENTER_VERTICAL);
btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e) {
bool is_configed_by_BBL = PresetUtils::system_printer_bed_model(m_preset_bundle->printers.get_edited_preset()).size() > 0;
BedShapeDialog dlg(this);
dlg.build_dialog(*m_config->option<ConfigOptionPoints>("printable_area"),
*m_config->option<ConfigOptionString>("bed_custom_texture"),