Merge remote-tracking branch 'upstream/main' into libvgcode

# Conflicts:
#	src/libslic3r/GCode/GCodeProcessor.cpp
#	src/libslic3r/GCode/GCodeProcessor.hpp
#	src/slic3r/CMakeLists.txt
#	src/slic3r/GUI/GCodeViewer.cpp
#	src/slic3r/GUI/GCodeViewer.hpp
#	src/slic3r/GUI/GLCanvas3D.cpp
#	src/slic3r/GUI/GLCanvas3D.hpp
#	src/slic3r/GUI/GUI_Preview.cpp
This commit is contained in:
Andrew Sun
2025-11-09 18:48:04 -05:00
2978 changed files with 1208720 additions and 66304 deletions

View File

@@ -62,6 +62,9 @@
#include "ConfigWizard.hpp"
#include "Widgets/WebView.hpp"
#include "DailyTips.hpp"
#include "FilamentMapDialog.hpp"
#include "DeviceCore/DevManager.h"
#ifdef _WIN32
#include <dbt.h>
@@ -245,7 +248,12 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
m_reset_title_text_colour_timer->Stop();
m_reset_title_text_colour_timer->Start(500);
}
}
m_mac_fullscreen = false;
} else {
m_mac_fullscreen = true;
}
auto int_event = new IntEvent(EVT_NOTICE_FULL_SCREEN_CHANGED, e.IsFullScreen() ? 1 : 0);
wxQueueEvent(wxGetApp().plater(), int_event);
e.Skip();
});
#endif
@@ -345,6 +353,7 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
#endif
Refresh();
Layout();
wxQueueEvent(wxGetApp().plater(), new SimpleEvent(EVT_NOTICE_CHILDE_SIZE_CHANGED));
});
//BBS
@@ -597,6 +606,13 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
evt.Skip();
});
Bind(wxEVT_SHOW, [this](wxShowEvent &evt) {
DeviceManager *manger = wxGetApp().getDeviceManager();
if (manger) {
evt.IsShown() ? manger->start_refresher() : manger->stop_refresher();
}
});
#ifdef _MSW_DARK_MODE
wxGetApp().UpdateDarkUIWin(this);
#endif // _MSW_DARK_MODE
@@ -739,6 +755,36 @@ WXLRESULT MainFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam
}
break;
case WM_NCHITTEST: {
if (IsMaximized()) {
// When maximized, no resize border
return HTCAPTION;
}
// Allow resizing from top of the title bar
wxPoint mouse_pos = ::wxGetMousePosition();
if (m_topbar->GetScreenRect().GetBottom() >= mouse_pos.y) {
RECT borderThickness;
SetRectEmpty(&borderThickness);
AdjustWindowRectEx(&borderThickness, GetWindowLongPtr(hWnd, GWL_STYLE) & ~WS_CAPTION, FALSE, NULL);
borderThickness.left *= -1;
borderThickness.top *= -1;
wxPoint client_pos = this->ScreenToClient(mouse_pos);
bool on_top_border = client_pos.y <= borderThickness.top;
// And to allow diagonally resizing, we check if mouse is at window corner
if (client_pos.x <= borderThickness.left) {
return on_top_border ? HTTOPLEFT : HTLEFT;
} else if (client_pos.x >= GetClientSize().x - borderThickness.right) {
return on_top_border ? HTTOPRIGHT : HTRIGHT;
}
return on_top_border ? HTTOP : HTCAPTION;
}
break;
}
case WM_GETMINMAXINFO: {
auto mmi = (MINMAXINFO*) lParam;
HandleGetMinMaxInfo(mmi);
@@ -832,6 +878,12 @@ void MainFrame::update_layout()
{
// jump to 3deditor under preview_only mode
if (evt.GetId() == tp3DEditor){
Sidebar& sidebar = GUI::wxGetApp().sidebar();
if (sidebar.need_auto_sync_after_connect_printer()) {
sidebar.set_need_auto_sync_after_connect_printer(false);
sidebar.sync_extruder_list();
}
m_plater->update(true);
if (!preview_only_hint())
@@ -849,7 +901,7 @@ void MainFrame::update_layout()
{
m_main_sizer->Add(m_plater, 1, wxEXPAND);
//BBS: add bed exclude area
m_plater->set_bed_shape({ { 0.0, 0.0 }, { 200.0, 0.0 }, { 200.0, 200.0 }, { 0.0, 200.0 } }, {}, 0.0, {}, {}, true);
m_plater->set_bed_shape({{0.0, 0.0}, {200.0, 0.0}, {200.0, 200.0}, {0.0, 200.0}}, {}, {}, 0.0, {}, {}, {}, {}, true);
m_plater->get_collapse_toolbar().set_enabled(false);
m_plater->enable_sidebar(false);
m_plater->Show();
@@ -1131,7 +1183,7 @@ void MainFrame::init_tabpanel() {
// nozzle_diameter is undefined when SLA printer is selected
// BBS
if (full_config.has("filament_colour")) {
m_plater->on_filaments_change(full_config.option<ConfigOptionStrings>("filament_colour")->values.size());
m_plater->on_filament_count_change(full_config.option<ConfigOptionStrings>("filament_colour")->values.size());
}
}
}
@@ -1463,8 +1515,7 @@ bool MainFrame::can_export_all_gcode() const
bool MainFrame::can_print_3mf() const
{
if (m_plater && !m_plater->model().objects.empty()) {
if (wxGetApp().preset_bundle->printers.get_edited_preset().is_custom_defined())
return false;
//
}
return true;
}
@@ -1474,8 +1525,10 @@ bool MainFrame::can_send_gcode() const
if (m_plater && !m_plater->model().objects.empty())
{
auto cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config;
if (const auto *print_host_opt = cfg.option<ConfigOptionString>("print_host"); print_host_opt)
return !print_host_opt->value.empty();
const auto *print_host_opt = cfg.option<ConfigOptionString>("print_host");
if (! print_host_opt) return false;
else return !print_host_opt->value.empty();
}
return true;
}
@@ -1563,51 +1616,99 @@ wxBoxSizer* MainFrame::create_side_tools()
m_slice_select = eSlicePlate;
m_print_select = ePrintPlate;
// m_publish_btn = new Button(this, _L("Upload"), "bar_publish", 0, FromDIP(16));
m_slice_btn = new SideButton(this, _L("Slice plate"), "");
m_slice_option_btn = new SideButton(this, "", "sidebutton_dropdown", 0, 14);
m_print_btn = new SideButton(this, _L("Print plate"), "");
m_print_option_btn = new SideButton(this, "", "sidebutton_dropdown", 0, 14);
auto slice_panel = new wxPanel(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxTRANSPARENT_WINDOW);
auto print_panel = new wxPanel(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxTRANSPARENT_WINDOW);
m_slice_btn = new SideButton(slice_panel, _L("Slice plate"), "");
m_slice_option_btn = new SideButton(slice_panel, "", "sidebutton_dropdown", 0, 14);
m_print_btn = new SideButton(print_panel, _L("Print plate"), "");
m_print_option_btn = new SideButton(print_panel, "", "sidebutton_dropdown", 0, 14);
auto slice_sizer = new wxBoxSizer(wxHORIZONTAL);
slice_sizer->Add(m_slice_option_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
slice_sizer->Add(m_slice_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
slice_panel->SetSizer(slice_sizer);
auto print_sizer = new wxBoxSizer(wxHORIZONTAL);
print_sizer->Add(m_print_option_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
print_sizer->Add(m_print_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
print_panel->SetSizer(print_sizer);
update_side_button_style();
// m_publish_btn->Hide();
m_slice_option_btn->Enable();
m_print_option_btn->Enable();
// sizer->Add(m_publish_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
// sizer->Add(FromDIP(15), 0, 0, 0, 0);
sizer->Add(m_slice_option_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(2));
sizer->Add(m_slice_btn , 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(15));
sizer->Add(m_print_option_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(2));
sizer->Add(m_print_btn , 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(19));
sizer->Add(FromDIP(15), 0, 0, 0, 0);
sizer->Add(slice_panel);
sizer->Add(FromDIP(15), 0, 0, 0, 0);
sizer->Add(print_panel);
sizer->Add(FromDIP(19), 0, 0, 0, 0);
sizer->Layout();
// m_publish_btn->Bind(wxEVT_BUTTON, [this](auto& e) {
// CallAfter([this] {
// wxGetApp().open_publish_page_dialog();
m_filament_group_popup = new FilamentGroupPopup(m_slice_btn);
// if (!wxGetApp().getAgent()) {
// BOOST_LOG_TRIVIAL(info) << "publish: no agent";
// return;
// }
auto try_hover_pop_up = [this]() {
#ifdef __APPLE__
if (!IsActive()) {
return;
}
#endif
wxPoint pos = m_slice_btn->ClientToScreen(wxPoint(0, 0));
pos.y += m_slice_btn->GetRect().height * 1.25;
pos.x -= (m_slice_option_btn->GetRect().width + FromDIP(380) * 0.6);
auto curr_plate = this->m_plater->get_partplate_list().get_curr_plate();
m_filament_group_popup->SetPosition(pos);
m_filament_group_popup->tryPopup(m_plater, curr_plate, m_slice_select == eSliceAll);
};
// // record
// json j;
// NetworkAgent* agent = GUI::wxGetApp().getAgent();
// });
// });
#ifndef __linux__
// in linux plateform, the pop up will taker over the mouse event and make the slice button cannot handle click event
// this pannel is used to trigger hover when button is disabled
slice_panel->Bind(wxEVT_ENTER_WINDOW, [this,try_hover_pop_up](auto& event) {
if(!m_slice_option_pop_up || !m_slice_option_pop_up->IsShown())
try_hover_pop_up();
});
slice_panel->Bind(wxEVT_LEAVE_WINDOW, [this](auto& event) {
m_filament_group_popup->tryClose();
});
m_slice_btn->Bind(wxEVT_ENTER_WINDOW, [this, try_hover_pop_up](auto& event) {
if (!m_slice_option_pop_up || !m_slice_option_pop_up->IsShown())
try_hover_pop_up();
});
m_slice_btn->Bind(wxEVT_LEAVE_WINDOW, [this](auto& event) {
m_filament_group_popup->tryClose();
});
#endif
m_slice_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
{
m_plater->reset_check_status();
if (!m_plater->check_ams_status(m_slice_select == eSliceAll))
return;
//this->m_plater->select_view_3D("Preview");
m_plater->exit_gizmo();
m_plater->update(true, true);
if (m_slice_select == eSliceAll)
wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_SLICE_ALL));
else
wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_SLICE_PLATE));
this->m_tabpanel->SetSelection(tpPreview);
bool slice = true;
auto curr_plate = m_plater->get_partplate_list().get_curr_plate();
#ifdef __linux__
slice = try_pop_up_before_slice(m_slice_select == eSliceAll, m_plater, curr_plate, true);
#else
slice = try_pop_up_before_slice(m_slice_select == eSliceAll, m_plater, curr_plate, false);
#endif
if (slice) {
if (m_slice_select == eSliceAll)
wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_SLICE_ALL));
else
wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_SLICE_PLATE));
this->m_tabpanel->SetSelection(tpPreview);
}
});
m_print_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
@@ -1648,32 +1749,36 @@ wxBoxSizer* MainFrame::create_side_tools()
m_slice_option_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
{
SidePopup* p = new SidePopup(this);
SideButton* slice_all_btn = new SideButton(p, _L("Slice all"), "");
if(m_slice_option_pop_up)
delete m_slice_option_pop_up;
m_slice_option_pop_up = new SidePopup(this);
SideButton* slice_all_btn = new SideButton(m_slice_option_pop_up, _L("Slice all"), "");
slice_all_btn->SetCornerRadius(0);
SideButton* slice_plate_btn = new SideButton(p, _L("Slice plate"), "");
SideButton* slice_plate_btn = new SideButton(m_slice_option_pop_up, _L("Slice plate"), "");
slice_plate_btn->SetCornerRadius(0);
slice_all_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
slice_all_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) {
m_slice_btn->SetLabel(_L("Slice all"));
m_slice_select = eSliceAll;
m_slice_enable = get_enable_slice_status();
m_slice_btn->Enable(m_slice_enable);
this->Layout();
p->Dismiss();
if(m_slice_option_pop_up)
m_slice_option_pop_up->Dismiss();
});
slice_plate_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
slice_plate_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) {
m_slice_btn->SetLabel(_L("Slice plate"));
m_slice_select = eSlicePlate;
m_slice_enable = get_enable_slice_status();
m_slice_btn->Enable(m_slice_enable);
this->Layout();
p->Dismiss();
if(m_slice_option_pop_up)
m_slice_option_pop_up->Dismiss();
});
p->append_button(slice_all_btn);
p->append_button(slice_plate_btn);
p->Popup(m_slice_btn);
m_slice_option_pop_up->append_button(slice_all_btn);
m_slice_option_pop_up->append_button(slice_plate_btn);
m_slice_option_pop_up->Popup(m_slice_btn);
}
);
@@ -2061,12 +2166,17 @@ void MainFrame::update_slice_print_status(SlicePrintEventType event, bool can_sl
enable_slice = get_enable_slice_status();
}
bool old_slice_status = m_slice_btn->IsEnabled();
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" m_slice_select %1%: can_slice= %2%, can_print %3%, enable_slice %4%, enable_print %5% ")%m_slice_select % can_slice %can_print %enable_slice %enable_print;
m_print_btn->Enable(enable_print);
m_slice_btn->Enable(enable_slice);
m_slice_enable = enable_slice;
m_print_enable = enable_print;
if (!old_slice_status && enable_slice)
m_plater->reset_check_status();
if (wxGetApp().mainframe)
wxGetApp().plater()->update_title_dirty_status();
}
@@ -2293,9 +2403,9 @@ static void add_common_view_menu_items(wxMenu* view_menu, MainFrame* mainFrame,
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
append_menu_item(view_menu, wxID_ANY, _L("Rear") + "\t" + ctrl + "4", _L("Rear View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("rear"); },
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
append_menu_item(view_menu, wxID_ANY, _L("Left") + "\t" + ctrl + "5", _L("Left View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("left"); },
append_menu_item(view_menu, wxID_ANY, _CTX(L_CONTEXT("Left", "Camera"), "Camera") + "\t" + ctrl + "5", _L("Left View"),[mainFrame](wxCommandEvent &) {mainFrame->select_view("left"); },
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
append_menu_item(view_menu, wxID_ANY, _L("Right") + "\t" + ctrl + "6", _L("Right View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("right"); },
append_menu_item(view_menu, wxID_ANY, _CTX(L_CONTEXT("Right", "Camera"), "Camera") + "\t" + ctrl + "6", _L("Right View"),[mainFrame](wxCommandEvent &) { mainFrame->select_view("right"); },
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
}
@@ -2405,7 +2515,7 @@ void MainFrame::init_menubar_as_editor()
append_menu_item(export_menu, wxID_ANY, _L("Export all objects as STLs") + dots, _L("Export all objects as STLs"),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_stl(false, false, true); }, "menu_export_stl", nullptr,
[this](){return can_export_model(); }, this);
append_menu_item(export_menu, wxID_ANY, _L("Export Generic 3MF") + dots/* + "\t" + ctrl + "G"*/, _L("Export 3mf file without using some 3mf-extensions"),
append_menu_item(export_menu, wxID_ANY, _L("Export Generic 3MF") + dots/* + "\t" + ctrl + "G"*/, _L("Export 3MF file without using some 3mf-extensions."),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_core_3mf(); }, "menu_export_sliced_file", nullptr,
[this](){return can_export_model(); }, this);
// BBS export .gcode.3mf
@@ -2420,6 +2530,11 @@ void MainFrame::init_menubar_as_editor()
append_menu_item(export_menu, wxID_ANY, _L("Export G-code") + dots/* + "\t" + ctrl + "G"*/, _L("Export current plate as G-code"),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_gcode(false); }, "menu_export_gcode", nullptr,
[this]() {return can_export_gcode(); }, this);
append_menu_item(export_menu, wxID_ANY, _L("Export toolpaths as OBJ") + dots, _L("Export toolpaths as OBJ"),
[this](wxCommandEvent&) { if (m_plater != nullptr) m_plater->export_toolpaths_to_obj(); }, "menu_export_toolpaths", nullptr,
[this]() {return can_export_toolpaths(); }, this);
append_menu_item(
export_menu, wxID_ANY, _L("Export Preset Bundle") + dots /* + "\t" + ctrl + "E"*/, _L("Export current configuration to files"),
[this](wxCommandEvent &) { export_config(); },
@@ -2956,36 +3071,32 @@ void MainFrame::init_menubar_as_editor()
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Cornering (with submenu)
auto cornering_menu = new wxMenu();
append_menu_item(
cornering_menu, wxID_ANY, _L("Junction Deviation"), _L("Junction Deviation calibration"),
// Cornering
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Cornering"), _L("Cornering calibration"),
[this](wxCommandEvent&) {
if (!m_junction_deviation_calib_dlg)
m_junction_deviation_calib_dlg = new Junction_Deviation_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_junction_deviation_calib_dlg->ShowModal();
},
"", nullptr,
auto dlg = new Cornering_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
dlg->ShowModal();
dlg->Destroy();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
m_topbar->GetCalibMenu()->AppendSubMenu(cornering_menu, _L("Cornering"));
// Input Shaping (with submenu)
auto input_shaping_menu = new wxMenu();
append_menu_item(
input_shaping_menu, wxID_ANY, _L("Input Shaping Frequency"), _L("Input Shaping Frequency"),
[this](wxCommandEvent&) {
if (!m_IS_freq_calib_dlg)
m_IS_freq_calib_dlg = new Input_Shaping_Freq_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_IS_freq_calib_dlg->ShowModal();
auto dlg = new Input_Shaping_Freq_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
dlg->ShowModal();
dlg->Destroy();
},
"", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
append_menu_item(
input_shaping_menu, wxID_ANY, _L("Input Shaping Damping/zeta factor"), _L("Input Shaping Damping/zeta factor"),
[this](wxCommandEvent&) {
if (!m_IS_damp_calib_dlg)
m_IS_damp_calib_dlg = new Input_Shaping_Damp_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_IS_damp_calib_dlg->ShowModal();
auto dlg = new Input_Shaping_Damp_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
dlg->ShowModal();
dlg->Destroy();
},
"", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
@@ -3078,36 +3189,32 @@ void MainFrame::init_menubar_as_editor()
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Cornering (with submenu)
auto cornering_menu = new wxMenu();
append_menu_item(
cornering_menu, wxID_ANY, _L("Junction Deviation"), _L("Junction Deviation calibration"),
// Cornering
append_menu_item(calib_menu, wxID_ANY, _L("Cornering"), _L("Cornering calibration"),
[this](wxCommandEvent&) {
if (!m_junction_deviation_calib_dlg)
m_junction_deviation_calib_dlg = new Junction_Deviation_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_junction_deviation_calib_dlg->ShowModal();
},
"", nullptr,
auto dlg = new Cornering_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
dlg->ShowModal();
dlg->Destroy();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
calib_menu->AppendSubMenu(cornering_menu, _L("Cornering"));
// Input Shaping (with submenu)
auto input_shaping_menu = new wxMenu();
append_menu_item(
input_shaping_menu, wxID_ANY, _L("Input Shaping Frequency"), _L("Input Shaping Frequency"),
[this](wxCommandEvent&) {
if (!m_IS_freq_calib_dlg)
m_IS_freq_calib_dlg = new Input_Shaping_Freq_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_IS_freq_calib_dlg->ShowModal();
auto dlg = new Input_Shaping_Freq_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
dlg->ShowModal();
dlg->Destroy();
},
"", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
append_menu_item(
input_shaping_menu, wxID_ANY, _L("Input Shaping Damping/zeta factor"), _L("Input Shaping Damping/zeta factor"),
[this](wxCommandEvent&) {
if (!m_IS_damp_calib_dlg)
m_IS_damp_calib_dlg = new Input_Shaping_Damp_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_IS_damp_calib_dlg->ShowModal();
auto dlg = new Input_Shaping_Damp_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
dlg->ShowModal();
dlg->Destroy();
},
"", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
@@ -3152,7 +3259,7 @@ void MainFrame::init_menubar_as_editor()
void MainFrame::set_max_recent_count(int max)
{
max = max < 0 ? 0 : max > 10000 ? 10000 : max;
max = max < 0 ? 0 : max > 999 ? 999 : max;
size_t count = m_recent_projects.GetCount();
m_recent_projects.SetMaxFiles(max);
if (count != m_recent_projects.GetCount()) {
@@ -3509,7 +3616,9 @@ void MainFrame::jump_to_monitor(std::string dev_id)
if(!m_monitor)
return;
m_tabpanel->SetSelection(tpMonitor);
((MonitorPanel*)m_monitor)->select_machine(dev_id);
if (!dev_id.empty()) {
((MonitorPanel*)m_monitor)->select_machine(dev_id);
}
}
void MainFrame::jump_to_multipage()
@@ -3615,7 +3724,7 @@ void MainFrame::on_value_changed(wxCommandEvent& event)
m_plater->on_config_change(*tab->get_config()); // propagate config change events to the plater
if (opt_key == "extruders_count") {
auto value = event.GetInt();
m_plater->on_filaments_change(value);
m_plater->on_filament_count_change(value);
}
}
}
@@ -3858,6 +3967,7 @@ void MainFrame::technology_changed()
m_menubar->SetMenuLabel(id, pt == ptSLA ? _omitL("Material Settings") : _L("Filament Settings"));
}
//
// Called after the Preferences dialog is closed and the program settings are saved.
// Update the UI based on the current preferences.