diff --git a/src/slic3r/GUI/AMSMaterialsSetting.cpp b/src/slic3r/GUI/AMSMaterialsSetting.cpp index 6b9c27398..82eeb44d6 100644 --- a/src/slic3r/GUI/AMSMaterialsSetting.cpp +++ b/src/slic3r/GUI/AMSMaterialsSetting.cpp @@ -382,7 +382,7 @@ void AMSMaterialsSetting::paintEvent(wxPaintEvent &evt) { auto size = GetSize(); wxPaintDC dc(this); - dc.SetPen(wxPen(StateColor::darkModeColorFor(wxColour("#000000")), 1, wxSOLID)); + dc.SetPen(wxPen(StateColor::darkModeColorFor(wxColour("#000000")), 1, wxPENSTYLE_SOLID)); dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); dc.DrawRectangle(0, 0, size.x, size.y); } diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 163d5f5fd..9d36e6e04 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1113,7 +1113,7 @@ void GUI_App::post_init() download_url = std::regex_replace(download_url, pattern, ""); } catch (...){} - + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", download_url %1%") % download_url; if (!download_url.empty()) { @@ -1360,7 +1360,7 @@ void GUI_App::post_init() std::time_t lw_t = boost::filesystem::last_write_time(temp_path) ; files_vec.push_back({ lw_t, temp_path.filename().string() }); } - } catch (const std::exception &ex) { + } catch (const std::exception &) { } } std::sort(files_vec.begin(), files_vec.end(), []( @@ -2135,7 +2135,7 @@ void GUI_App::init_networking_callbacks() else { obj->parse_json(msg, true); } - + if (!this->is_enable_multi_machine()) { if ((sel == obj || sel == nullptr) && obj->is_ams_need_update) { @@ -2311,8 +2311,12 @@ void GUI_App::init_app_config() if (!boost::filesystem::exists(data_dir_path)) boost::filesystem::create_directory(data_dir_path); set_data_dir(data_dir); +#if defined(__WINDOWS__) // Change current dirtory of application + _chdir(encode_path((data_dir + "/log").c_str()).c_str()); +#else chdir(encode_path((data_dir + "/log").c_str()).c_str()); +#endif } else { m_datadir_redefined = true; } @@ -3701,7 +3705,7 @@ void GUI_App::ShowUserGuide() { mainframe->refresh_plugin_tips(); // BBS: remove SLA related message } - } catch (std::exception &e) { + } catch (std::exception &) { // wxMessageBox(e.what(), "", MB_OK); } } @@ -3716,7 +3720,7 @@ void GUI_App::ShowDownNetPluginDlg(bool post_login) return; DownloadProgressDialog dlg(_L("Downloading Bambu Network Plug-in"), post_login); dlg.ShowModal(); - } catch (std::exception &e) { + } catch (std::exception &) { ; } } @@ -3733,7 +3737,7 @@ void GUI_App::ShowUserLogin(bool show) login_dlg = new ZUserLogin(); } login_dlg->ShowModal(); - } catch (std::exception &e) { + } catch (std::exception &) { ; } } else { @@ -3755,7 +3759,7 @@ void GUI_App::ShowOnlyFilament() { // BBS: remove SLA related message } - } catch (std::exception &e) { + } catch (std::exception &) { // wxMessageBox(e.what(), "", MB_OK); } } @@ -4104,7 +4108,7 @@ std::string GUI_App::handle_web_request(std::string cmd) else if (command_str.compare("modelmall_model_advise_get") == 0) { if (mainframe && this->app_config->get("staff_pick_switch") == "true") { if (mainframe->m_webview) { - mainframe->m_webview->SendDesignStaffpick(has_model_mall()); + mainframe->m_webview->SendDesignStaffpick(has_model_mall()); } } } @@ -4215,21 +4219,21 @@ std::string GUI_App::handle_web_request(std::string cmd) if (path.has_value()) { wxLaunchDefaultBrowser(path.value()); } - } + } else if (command_str.compare("homepage_leftmenu_clicked") == 0) { - if (root.get_child_optional("menu") != boost::none) { + if (root.get_child_optional("menu") != boost::none) { std::string strMenu = root.get_optional("menu").value(); int nRefresh = root.get_child_optional("refresh") == boost::none ? 0 : root.get_optional("refresh").value(); - + CallAfter([this,strMenu, nRefresh] { - if (mainframe && mainframe->m_webview) - { - mainframe->m_webview->SwitchWebContent(strMenu, nRefresh); + if (mainframe && mainframe->m_webview) + { + mainframe->m_webview->SwitchWebContent(strMenu, nRefresh); } } ); } - } + } else if (command_str.compare("homepage_leftmenu_switch") == 0) { if (root.get_child_optional("menu") != boost::none) { std::string strMenu = root.get_optional("menu").value(); @@ -4274,8 +4278,8 @@ std::string GUI_App::handle_web_request(std::string cmd) if (root.get_child_optional("model") != boost::none) { pt::ptree data_node = root.get_child("model"); boost::optional path = data_node.get_optional("url"); - if (path.has_value()) - { + if (path.has_value()) + { wxString realurl = from_u8(url_decode(path.value())); wxGetApp().request_model_download(realurl); } @@ -4410,7 +4414,7 @@ void GUI_App::on_http_error(wxCommandEvent &evt) return; } } - + } // request login @@ -6531,9 +6535,9 @@ void GUI_App::run_script(wxString js) return mainframe->RunScript(js); } -void GUI_App::run_script_left(wxString js) +void GUI_App::run_script_left(wxString js) { - if (mainframe) + if (mainframe) return mainframe->RunScriptLeft(js); } @@ -6947,8 +6951,6 @@ static bool del_win_registry(HKEY hkeyHive, const wchar_t *pszVar, const wchar_t return false; if (!bDidntExist) { - DWORD dwDisposition; - HKEY hkey; iRC = ::RegDeleteKeyExW(hkeyHive, pszVar, KEY_ALL_ACCESS, 0); if (iRC == ERROR_SUCCESS) { return true; diff --git a/src/slic3r/GUI/WipeTowerDialog.cpp b/src/slic3r/GUI/WipeTowerDialog.cpp index eb2c6be1f..d6b1a62cd 100644 --- a/src/slic3r/GUI/WipeTowerDialog.cpp +++ b/src/slic3r/GUI/WipeTowerDialog.cpp @@ -21,7 +21,7 @@ int scale(const int val) { return val * Slic3r::GUI::wxGetApp().em_unit() / 10; int ITEM_WIDTH() { return scale(30); } static const wxColour g_text_color = wxColour(107, 107, 107, 255); -#define ICON_SIZE wxSize(FromDIP(16), FromDIP(16)) +#define WIPE_TOWER_ICON_SIZE wxSize(FromDIP(16), FromDIP(16)) #define TABLE_BORDER FromDIP(28) #define HEADER_VERT_PADDING FromDIP(12) #define HEADER_BEG_PADDING FromDIP(30) @@ -270,7 +270,7 @@ void WipingPanel::create_panels(wxWindow* parent, const int num) { auto sizer = new wxBoxSizer(wxHORIZONTAL); panel->SetSizer(sizer); - wxButton* icon = new wxButton(panel, wxID_ANY, {}, wxDefaultPosition, ICON_SIZE, wxBORDER_NONE | wxBU_AUTODRAW); + wxButton* icon = new wxButton(panel, wxID_ANY, {}, wxDefaultPosition, WIPE_TOWER_ICON_SIZE, wxBORDER_NONE | wxBU_AUTODRAW); icon->SetBitmap(*get_extruder_color_icon(m_colours[i].GetAsString(wxC2S_HTML_SYNTAX).ToStdString(), std::to_string(i + 1), FromDIP(16), FromDIP(16))); icon->SetCanFocus(false); icon_list2.push_back(icon); @@ -278,7 +278,7 @@ void WipingPanel::create_panels(wxWindow* parent, const int num) { sizer->AddSpacer(ROW_BEG_PADDING); sizer->Add(icon, 0, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM, ROW_VERT_PADDING); - for (unsigned int j = 0; j < num; ++j) { + for (unsigned int j = 0; j < (unsigned int)num; ++j) { edit_boxes[j][i]->Reparent(panel); edit_boxes[j][i]->SetBackgroundColour(panel->GetBackgroundColour()); edit_boxes[j][i]->SetFont(::Label::Body_13); @@ -401,7 +401,7 @@ WipingPanel::WipingPanel(wxWindow* parent, const std::vector& matrix, con header_line_sizer->AddSpacer(HEADER_BEG_PADDING); for (unsigned int i = 0; i < m_number_of_extruders; ++i) { - wxButton* icon = new wxButton(header_line_panel, wxID_ANY, {}, wxDefaultPosition, ICON_SIZE, wxBORDER_NONE | wxBU_AUTODRAW); + wxButton* icon = new wxButton(header_line_panel, wxID_ANY, {}, wxDefaultPosition, WIPE_TOWER_ICON_SIZE, wxBORDER_NONE | wxBU_AUTODRAW); icon->SetBitmap(*get_extruder_color_icon(m_colours[i].GetAsString(wxC2S_HTML_SYNTAX).ToStdString(), std::to_string(i + 1), FromDIP(16), FromDIP(16))); icon->SetCanFocus(false); icon_list1.push_back(icon); @@ -524,7 +524,7 @@ WipingPanel::WipingPanel(wxWindow* parent, const std::vector& matrix, con add_spin_ctrl(m_new, extruders[2 * i+1]); auto hsizer = new wxBoxSizer(wxHORIZONTAL); - wxWindow* w = new wxWindow(m_page_simple, wxID_ANY, wxDefaultPosition, ICON_SIZE, wxBORDER_SIMPLE); + wxWindow* w = new wxWindow(m_page_simple, wxID_ANY, wxDefaultPosition, WIPE_TOWER_ICON_SIZE, wxBORDER_SIMPLE); w->SetCanFocus(false); w->SetBackgroundColour(m_colours[i]); hsizer->Add(w, wxALIGN_CENTER_VERTICAL); @@ -554,7 +554,7 @@ WipingPanel::WipingPanel(wxWindow* parent, const std::vector& matrix, con wxSize to_text_size = dc.GetTextExtent(to_text); int base_y = (header_line_panel->GetSize().y - from_text_size.y - to_text_size.y) / 2; - int vol_width = ROW_BEG_PADDING + EDIT_BOXES_GAP / 2 + ICON_SIZE.x; + int vol_width = ROW_BEG_PADDING + EDIT_BOXES_GAP / 2 + WIPE_TOWER_ICON_SIZE.x; int base_x = (vol_width - from_text_size.x - to_text_size.x) / 2; // draw from text