mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 06:57:36 -06:00
FIX: [STUDIO-3329] show/hide thirdparty calibrate button
Change-Id: Ie5a7cd454b50617af8c8bf9c78fecc60386e4e9d (cherry picked from commit 1a98981f8b0a854f431d9430355b4fc5d2bb4fb1)
This commit is contained in:
parent
1b0cd88899
commit
2a24eb55b8
5 changed files with 38 additions and 10 deletions
|
@ -868,6 +868,18 @@ void MainFrame::show_publish_button(bool show)
|
|||
Layout();
|
||||
}
|
||||
|
||||
void MainFrame::show_calibration_button(bool show)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
bool shown = m_menubar->FindMenu(_L("Calibration"));
|
||||
if (shown == show) return;
|
||||
if (show) m_menubar->Insert(3, m_calib_menu, wxString::Format("&%s", _L("Calibration")));
|
||||
else m_menubar->Remove(3);
|
||||
#else
|
||||
topbar()->ShowCalibrationButton(show);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainFrame::update_title_colour_after_set_title()
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
|
@ -2753,11 +2765,11 @@ void MainFrame::init_menubar_as_editor()
|
|||
// m_menubar->Append(publishMenu, wxString::Format("&%s", _L("3D Models")));
|
||||
|
||||
// SoftFever calibrations
|
||||
auto calib_menu = new wxMenu();
|
||||
m_calib_menu = new wxMenu();
|
||||
|
||||
// Temp
|
||||
append_menu_item(
|
||||
calib_menu, wxID_ANY, _L("Temperature"), _L("Temperature"),
|
||||
m_calib_menu, wxID_ANY, _L("Temperature"), _L("Temperature"),
|
||||
[this](wxCommandEvent &) {
|
||||
if (!m_temp_calib_dlg)
|
||||
m_temp_calib_dlg = new Temp_Calibration_Dlg((wxWindow *) this, wxID_ANY, m_plater);
|
||||
|
@ -2794,14 +2806,14 @@ void MainFrame::init_menubar_as_editor()
|
|||
;
|
||||
},
|
||||
this);
|
||||
append_submenu(calib_menu, flowrate_menu, wxID_ANY, _L("Flow rate"), _L("Flow rate"), "", [this]() {
|
||||
append_submenu(m_calib_menu, flowrate_menu, wxID_ANY, _L("Flow rate"), _L("Flow rate"), "", [this]() {
|
||||
return m_plater->is_view3D_shown();
|
||||
;
|
||||
});
|
||||
|
||||
// PA
|
||||
append_menu_item(
|
||||
calib_menu, wxID_ANY, _L("Pressure advance"), _L("Pressure advance"),
|
||||
m_calib_menu, wxID_ANY, _L("Pressure advance"), _L("Pressure advance"),
|
||||
[this](wxCommandEvent &) {
|
||||
m_pa_calib_dlg = new PA_Calibration_Dlg((wxWindow *) this, wxID_ANY, m_plater);
|
||||
m_pa_calib_dlg->ShowModal();
|
||||
|
@ -2815,7 +2827,7 @@ void MainFrame::init_menubar_as_editor()
|
|||
|
||||
// Retraction
|
||||
append_menu_item(
|
||||
calib_menu, wxID_ANY, _L("Retraction test"), _L("Retraction test"),
|
||||
m_calib_menu, wxID_ANY, _L("Retraction test"), _L("Retraction test"),
|
||||
[this](wxCommandEvent &) {
|
||||
if (!m_retraction_calib_dlg) m_retraction_calib_dlg = new Retraction_Test_Dlg((wxWindow *) this, wxID_ANY, m_plater);
|
||||
m_retraction_calib_dlg->ShowModal();
|
||||
|
@ -2829,7 +2841,7 @@ void MainFrame::init_menubar_as_editor()
|
|||
|
||||
// Tolerance Test
|
||||
append_menu_item(
|
||||
calib_menu, wxID_ANY, _L("Orca Tolerance Test"), _L("Orca Tolerance Test"),
|
||||
m_calib_menu, wxID_ANY, _L("Orca Tolerance Test"), _L("Orca Tolerance Test"),
|
||||
[this](wxCommandEvent &) {
|
||||
m_plater->new_project();
|
||||
m_plater->add_model(false, Slic3r::resources_dir() + "/calib/tolerance_test/OrcaToleranceTest.stl");
|
||||
|
@ -2868,13 +2880,13 @@ void MainFrame::init_menubar_as_editor()
|
|||
},
|
||||
this);
|
||||
|
||||
append_submenu(calib_menu, advance_menu, wxID_ANY, _L("More..."), _L("More calibrations"), "", [this]() {
|
||||
append_submenu(m_calib_menu, advance_menu, wxID_ANY, _L("More..."), _L("More calibrations"), "", [this]() {
|
||||
return m_plater->is_view3D_shown();
|
||||
;
|
||||
});
|
||||
// help
|
||||
append_menu_item(
|
||||
calib_menu, wxID_ANY, _L("Tutorial"), _L("Calibration help"),
|
||||
m_calib_menu, wxID_ANY, _L("Tutorial"), _L("Calibration help"),
|
||||
[this](wxCommandEvent &) { wxLaunchDefaultBrowser("https://github.com/SoftFever/OrcaSlicer/wiki/Calibration", wxBROWSER_NEW_WINDOW); }, "", nullptr,
|
||||
[this]() {
|
||||
return m_plater->is_view3D_shown();
|
||||
|
@ -2882,8 +2894,6 @@ void MainFrame::init_menubar_as_editor()
|
|||
},
|
||||
this);
|
||||
|
||||
m_menubar->Append(calib_menu, wxString::Format("&%s", _L("Calibration")));
|
||||
|
||||
if (helpMenu)
|
||||
m_menubar->Append(helpMenu, wxString::Format("&%s", _L("Help")));
|
||||
SetMenuBar(m_menubar);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue