mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-04 12:34:05 -06:00
Fix build warnings on windows, fix various bugs/logic errors/missing returns/etc, update boost::bind (#2229)
Fix build warnings on windows, fix various bugs/logic errors/missing returns/etc, update boost::bind.
This commit is contained in:
parent
cba9e79e06
commit
3433e7bfa0
12 changed files with 33 additions and 23 deletions
|
@ -1112,7 +1112,7 @@ void IMSlider::render_input_custom_gcode(std::string custom_gcode)
|
|||
}
|
||||
|
||||
void IMSlider::do_go_to_layer(size_t layer_number) {
|
||||
clamp((int)layer_number, m_min_value, m_max_value);
|
||||
layer_number = clamp((int)layer_number, m_min_value, m_max_value);
|
||||
GetSelection() == ssLower ? SetLowerValue(layer_number) : SetHigherValue(layer_number);
|
||||
}
|
||||
|
||||
|
@ -1431,7 +1431,7 @@ std::string IMSlider::get_label(int tick, LabelType label_type)
|
|||
const size_t value = tick;
|
||||
|
||||
if (m_label_koef == 1.0 && m_values.empty()) {
|
||||
std::to_string(value);
|
||||
return std::to_string(value);
|
||||
}
|
||||
if (value >= m_values.size()) return "error";
|
||||
|
||||
|
|
|
@ -1009,7 +1009,7 @@ int GuideFrame::LoadProfile()
|
|||
//cout << iter->path().string() << endl;
|
||||
wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
|
||||
strVendor = strVendor.AfterLast( '\\');
|
||||
strVendor = strVendor.AfterLast('\/');
|
||||
strVendor = strVendor.AfterLast('/');
|
||||
wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower();
|
||||
|
||||
if (w2s(strVendor) == PresetBundle::BBL_BUNDLE && strExtension.CmpNoCase("json") == 0)
|
||||
|
@ -1028,7 +1028,7 @@ int GuideFrame::LoadProfile()
|
|||
//cout << iter->path().string() << endl;
|
||||
wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
|
||||
strVendor = strVendor.AfterLast( '\\');
|
||||
strVendor = strVendor.AfterLast('\/');
|
||||
strVendor = strVendor.AfterLast('/');
|
||||
wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower();
|
||||
|
||||
if (w2s(strVendor) != PresetBundle::BBL_BUNDLE && strExtension.CmpNoCase("json")==0)
|
||||
|
@ -1516,7 +1516,7 @@ std::string GuideFrame::w2s(wxString sSrc)
|
|||
|
||||
void GuideFrame::GetStardardFilePath(std::string &FilePath) {
|
||||
StrReplace(FilePath, "\\", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator)));
|
||||
StrReplace(FilePath, "\/", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator)));
|
||||
StrReplace(FilePath, "/", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator)));
|
||||
}
|
||||
|
||||
bool GuideFrame::LoadFile(std::string jPath, std::string &sContent)
|
||||
|
|
|
@ -501,7 +501,7 @@ void MaxVolumetricSpeed_Test_Dlg::on_start(wxCommandEvent& event) {
|
|||
read_double = read_double && m_tiStep->GetTextCtrl()->GetValue().ToDouble(&m_params.step);
|
||||
|
||||
if (!read_double || m_params.start <= 0 || m_params.step <= 0 || m_params.end < (m_params.start + m_params.step)) {
|
||||
MessageDialog msg_dlg(nullptr, _L("Please input valid values:\nstart > 0 \step >= 0\nend > start + step)"), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
MessageDialog msg_dlg(nullptr, _L("Please input valid values:\nstart > 0 \nstep >= 0\nend > start + step)"), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
|
@ -608,7 +608,7 @@ void VFA_Test_Dlg::on_start(wxCommandEvent& event)
|
|||
read_double = read_double && m_tiStep->GetTextCtrl()->GetValue().ToDouble(&m_params.step);
|
||||
|
||||
if (!read_double || m_params.start <= 10 || m_params.step <= 0 || m_params.end < (m_params.start + m_params.step)) {
|
||||
MessageDialog msg_dlg(nullptr, _L("Please input valid values:\nstart > 10 \step >= 0\nend > start + step)"), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
MessageDialog msg_dlg(nullptr, _L("Please input valid values:\nstart > 10 \nstep >= 0\nend > start + step)"), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
|
@ -712,7 +712,7 @@ void Retraction_Test_Dlg::on_start(wxCommandEvent& event) {
|
|||
read_double = read_double && m_tiStep->GetTextCtrl()->GetValue().ToDouble(&m_params.step);
|
||||
|
||||
if (!read_double || m_params.start < 0 || m_params.step <= 0 || m_params.end < (m_params.start + m_params.step)) {
|
||||
MessageDialog msg_dlg(nullptr, _L("Please input valid values:\nstart > 0 \step >= 0\nend > start + step)"), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
MessageDialog msg_dlg(nullptr, _L("Please input valid values:\nstart > 0 \nstep >= 0\nend > start + step)"), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -113,8 +113,8 @@ void wxMediaCtrl2::Load(wxURI url)
|
|||
SHELLEXECUTEINFO info{sizeof(info), 0, NULL, L"runas", L"regsvr32", quoted_dll_path.c_str(), SW_HIDE };
|
||||
::ShellExecuteEx(&info);
|
||||
fs::remove(reg_path);
|
||||
|
||||
}
|
||||
return true;
|
||||
});
|
||||
} else {
|
||||
CallAfter([] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue