FIX:the checkbox in MsgDislog displays error on linux

GITHUB: #2711
Change-Id: Ie0bb6325aa064d7ed05e25240a6e1b351712fb0b
This commit is contained in:
MackBambu 2024-10-23 14:57:20 +08:00 committed by Lane.Wei
parent 7697eb3dc8
commit ec8d3ebaf9
4 changed files with 33 additions and 26 deletions

View File

@ -2345,6 +2345,8 @@ void GUI_App::init_app_config()
std::string error = app_config->load(); std::string error = app_config->load();
if (!error.empty()) { if (!error.empty()) {
// Error while parsing config file. We'll customize the error message and rethrow to be displayed. // Error while parsing config file. We'll customize the error message and rethrow to be displayed.
BOOST_LOG_TRIVIAL(error) << __FUNCTION__
<< "Configuration file may be corrupted and is not able to be parsed.Please delete the file and try again.";
throw Slic3r::RuntimeError( throw Slic3r::RuntimeError(
_u8L("BambuStudio configuration file may be corrupted and is not able to be parsed." _u8L("BambuStudio configuration file may be corrupted and is not able to be parsed."
"Please delete the file and try again.") + "Please delete the file and try again.") +

View File

@ -297,10 +297,12 @@ static void add_msg_content(wxWindow* parent, wxBoxSizer* content_sizer, wxStrin
page_size = wxSize(68 * em, page_height); page_size = wxSize(68 * em, page_height);
} }
else { else {
#ifdef __WINDOWS__
Label* wrapped_text = new Label(html, msg); Label* wrapped_text = new Label(html, msg);
wrapped_text->Wrap(68 * em); wrapped_text->Wrap(68 * em);
msg = wrapped_text->GetLabel(); msg = wrapped_text->GetLabel();
wrapped_text->Destroy(); wrapped_text->Destroy();
#endif //__WINDOWS__
wxClientDC dc(parent); wxClientDC dc(parent);
wxSize msg_sz = dc.GetMultiLineTextExtent(msg); wxSize msg_sz = dc.GetMultiLineTextExtent(msg);
@ -375,25 +377,28 @@ RichMessageDialog::RichMessageDialog(wxWindow* parent,
{ {
add_msg_content(this, content_sizer, message); add_msg_content(this, content_sizer, message);
m_checkBox = new wxCheckBox(this, wxID_ANY, m_checkBoxText);
wxGetApp().UpdateDarkUI(m_checkBox);
m_checkBox->Bind(wxEVT_CHECKBOX, [this](wxCommandEvent&) { m_checkBoxValue = m_checkBox->GetValue(); });
btn_sizer->Insert(0, m_checkBox, wxALIGN_CENTER_VERTICAL);
finalize(); finalize();
} }
int RichMessageDialog::ShowModal() int RichMessageDialog::ShowModal()
{ {
if (m_checkBoxText.IsEmpty()) if (!m_checkBoxText.IsEmpty()) {
m_checkBox->Hide(); show_dsa_button(m_checkBoxText);
else m_checkbox_dsa->SetValue(m_checkBoxValue);
m_checkBox->SetLabelText(m_checkBoxText); }
Layout(); Layout();
return wxDialog::ShowModal(); return wxDialog::ShowModal();
} }
bool RichMessageDialog::IsCheckBoxChecked() const
{
if (m_checkbox_dsa)
return m_checkbox_dsa->GetValue();
return m_checkBoxValue;
}
#endif #endif
// InfoDialog // InfoDialog

View File

@ -190,7 +190,7 @@ public:
} }
wxString GetCheckBoxText() const { return m_checkBoxText; } wxString GetCheckBoxText() const { return m_checkBoxText; }
bool IsCheckBoxChecked() const { return m_checkBoxValue; } bool IsCheckBoxChecked() const;
// This part o fcode isported from the "wx\msgdlg.h" // This part o fcode isported from the "wx\msgdlg.h"
using wxMD = wxMessageDialogBase; using wxMD = wxMessageDialogBase;

View File

@ -68,8 +68,8 @@ struct CurlGlobalInit
else else
message = (boost::format("use system SSL certificate: %1%") % bundle).str(); message = (boost::format("use system SSL certificate: %1%") % bundle).str();
message += "\n" + (boost::format("To manually specify the system certificate store, " message += "\n" + (boost::format("To manually specify the system certificate store, "
"set the %1% environment variable to the correct CA and restart the application") % SSL_CA_FILE).str(); "set the %1% environment variable to the correct CA and restart the application.") % SSL_CA_FILE).str();
} }
#endif // OPENSSL_CERT_OVERRIDE #endif // OPENSSL_CERT_OVERRIDE