mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-06 22:47:32 -06:00
Fix Compile Warnings (#5963)
* Fix calls to depreciated wxPen constructor * Fix use of wxTimerEvent * Fix unrecognized character escape sequence * Fix signed/unsigned mismatch At least as much as possible without significantly altering parts of the application * Clean unreferenced variables * fix mistyped namespace selector * Update deprecated calls * Fix preprocessor statement * Remove empty switch statements * Change int vector used as bool to bool vector * Remove empty control statements and related unused code * Change multi character constant to string constant * Fix discarded return value json::parse was being called on the object, rather than statically like it should be. Also, the value was not being captured. * Rename ICON_SIZE def used by MultiMachine By having the definition in the header, it causes issues when other files define ICON_SIZE. By renaming it to MM_ICON_SIZE, this lessens the issue. It would probably be ideal to have the definitions in the respective .cpp that use them, but it would make it less convenient to update the values if needed in the future. * Remove unused includes * Fix linux/macOS compilation * Hide unused-function errors on non-Windows systems * Disable signed/unsigned comparison mismatch error * Remove/Disable more unused variables Still TODO: check double for loop in Print.cpp * Remove unused variable that was missed * Remove unused variables in libraries in the src folder * Apply temporary fix for subobject linkage error * Remove/Disable last set of unused variables reported by GCC * remove redundant for loop * fix misspelled ifdef check * Update message on dialog * Fix hard-coded platform specific modifier keys * Remove duplicate for loop * Disable -Wmisleading-indentation warning * disable -Wswitch warning * Remove unused local typedefs * Fix -Wunused-value * Fix pragma error on Windows from subobject linkage fix * Fix -Waddress * Fix null conversions (-Wconversion-null) --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
parent
b40853af94
commit
b83e16dbdd
187 changed files with 494 additions and 1101 deletions
|
@ -743,7 +743,6 @@ void MainFrame::update_layout()
|
|||
if (m_layout != ESettingsLayout::Unknown)
|
||||
restore_to_creation();
|
||||
|
||||
ESettingsLayout old_layout = m_layout;
|
||||
m_layout = layout;
|
||||
|
||||
// From the very beginning the Print settings should be selected
|
||||
|
@ -1488,7 +1487,6 @@ bool MainFrame::can_reslice() const
|
|||
wxBoxSizer* MainFrame::create_side_tools()
|
||||
{
|
||||
enable_multi_machine = wxGetApp().is_enable_multi_machine();
|
||||
int em = em_unit();
|
||||
wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
m_slice_select = eSlicePlate;
|
||||
|
@ -1779,7 +1777,7 @@ wxBoxSizer* MainFrame::create_side_tools()
|
|||
aux_btn->Bind(wxEVT_BUTTON, [](auto e) {
|
||||
wxGetApp().sidebar().show_auxiliary_dialog();
|
||||
});
|
||||
sizer->Add(aux_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 1 * em / 10);
|
||||
sizer->Add(aux_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 1 * em_unit() / 10);
|
||||
*/
|
||||
sizer->Add(FromDIP(19), 0, 0, 0, 0);
|
||||
|
||||
|
@ -1924,9 +1922,6 @@ bool MainFrame::get_enable_print_status()
|
|||
|
||||
void MainFrame::update_side_button_style()
|
||||
{
|
||||
// BBS
|
||||
int em = em_unit();
|
||||
|
||||
/*m_slice_btn->SetLayoutStyle(1);
|
||||
m_slice_btn->SetTextLayout(SideButton::EHorizontalOrientation::HO_Center, FromDIP(15));
|
||||
m_slice_btn->SetMinSize(wxSize(-1, FromDIP(24)));
|
||||
|
@ -2188,9 +2183,6 @@ static void add_common_publish_menu_items(wxMenu* publish_menu, MainFrame* mainF
|
|||
return;
|
||||
}
|
||||
|
||||
json j;
|
||||
NetworkAgent* agent = GUI::wxGetApp().getAgent();
|
||||
|
||||
//if (GUI::wxGetApp().plater()->model().objects.empty()) return;
|
||||
wxGetApp().open_publish_page_dialog();
|
||||
});
|
||||
|
@ -2588,13 +2580,13 @@ void MainFrame::init_menubar_as_editor()
|
|||
|
||||
//BBS perspective view
|
||||
wxWindowID camera_id_base = wxWindow::NewControlId(int(wxID_CAMERA_COUNT));
|
||||
auto perspective_item = append_menu_radio_item(viewMenu, wxID_CAMERA_PERSPECTIVE + camera_id_base, _L("Use Perspective View"), _L("Use Perspective View"),
|
||||
append_menu_radio_item(viewMenu, wxID_CAMERA_PERSPECTIVE + camera_id_base, _L("Use Perspective View"), _L("Use Perspective View"),
|
||||
[this](wxCommandEvent&) {
|
||||
wxGetApp().app_config->set_bool("use_perspective_camera", true);
|
||||
wxGetApp().update_ui_from_settings();
|
||||
}, nullptr);
|
||||
//BBS orthogonal view
|
||||
auto orthogonal_item = append_menu_radio_item(viewMenu, wxID_CAMERA_ORTHOGONAL + camera_id_base, _L("Use Orthogonal View"), _L("Use Orthogonal View"),
|
||||
append_menu_radio_item(viewMenu, wxID_CAMERA_ORTHOGONAL + camera_id_base, _L("Use Orthogonal View"), _L("Use Orthogonal View"),
|
||||
[this](wxCommandEvent&) {
|
||||
wxGetApp().app_config->set_bool("use_perspective_camera", false);
|
||||
wxGetApp().update_ui_from_settings();
|
||||
|
@ -2669,7 +2661,8 @@ void MainFrame::init_menubar_as_editor()
|
|||
//auto preference_item = new wxMenuItem(parent_menu, OrcaSlicerMenuPreferences + bambu_studio_id_base, _L("Preferences") + "\tCtrl+,", "");
|
||||
#else
|
||||
wxMenu* parent_menu = m_topbar->GetTopMenu();
|
||||
auto preference_item = new wxMenuItem(parent_menu, ConfigMenuPreferences + config_id_base, _L("Preferences") + "\t" + ctrl + "P", "");
|
||||
// auto preference_item =
|
||||
new wxMenuItem(parent_menu, ConfigMenuPreferences + config_id_base, _L("Preferences") + "\t" + ctrl + "P", "");
|
||||
|
||||
#endif
|
||||
//auto printer_item = new wxMenuItem(parent_menu, ConfigMenuPrinter + config_id_base, _L("Printer"), "");
|
||||
|
@ -3100,10 +3093,6 @@ void MainFrame::init_menubar_as_gcodeviewer()
|
|||
|
||||
void MainFrame::update_menubar()
|
||||
{
|
||||
if (wxGetApp().is_gcode_viewer())
|
||||
return;
|
||||
|
||||
const bool is_fff = plater()->printer_technology() == ptFFF;
|
||||
}
|
||||
|
||||
void MainFrame::reslice_now()
|
||||
|
@ -3179,7 +3168,6 @@ void MainFrame::load_config_file()
|
|||
cfiles.push_back(into_u8(file));
|
||||
m_last_config = file;
|
||||
}
|
||||
bool update = false;
|
||||
wxGetApp().preset_bundle->import_presets(cfiles, [this](std::string const & name) {
|
||||
ConfigsOverwriteConfirmDialog dlg(this, from_u8(name), false);
|
||||
int res = dlg.ShowModal();
|
||||
|
@ -3749,7 +3737,6 @@ void MainFrame::on_select_default_preset(SimpleEvent& evt)
|
|||
wxICON_INFORMATION);
|
||||
|
||||
/* get setting list */
|
||||
NetworkAgent* agent = wxGetApp().getAgent();
|
||||
switch ( dialog.ShowModal() )
|
||||
{
|
||||
case wxID_YES: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue