update slic3r

This commit is contained in:
QIDI TECH
2024-11-28 15:19:12 +08:00
parent a26696f35e
commit 7eb6543991
196 changed files with 18701 additions and 3803 deletions

View File

@@ -303,10 +303,12 @@ static void add_msg_content(wxWindow* parent, wxBoxSizer* content_sizer, wxStrin
page_size = wxSize(68 * em, page_height);
}
else {
#ifdef __WINDOWS__
Label* wrapped_text = new Label(html, msg);
wrapped_text->Wrap(68 * em);
msg = wrapped_text->GetLabel();
wrapped_text->Destroy();
#endif //__WINDOWS__
wxClientDC dc(parent);
wxSize msg_sz = dc.GetMultiLineTextExtent(msg);
@@ -381,25 +383,27 @@ RichMessageDialog::RichMessageDialog(wxWindow* parent,
{
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();
}
int RichMessageDialog::ShowModal()
{
if (m_checkBoxText.IsEmpty())
m_checkBox->Hide();
else
m_checkBox->SetLabelText(m_checkBoxText);
if (!m_checkBoxText.IsEmpty()) {
show_dsa_button(m_checkBoxText);
m_checkbox_dsa->SetValue(m_checkBoxValue);
}
Layout();
return wxDialog::ShowModal();
}
bool RichMessageDialog::IsCheckBoxChecked() const
{
if (m_checkbox_dsa)
return m_checkbox_dsa->GetValue();
return m_checkBoxValue;
}
#endif
// InfoDialog
@@ -529,7 +533,7 @@ wxBoxSizer *Newer3mfVersionDialog::get_msg_sizer()
if (file_version_newer) {
text1 = new wxStaticText(this, wxID_ANY, _L("The 3mf file version is in Beta and it is newer than the current QIDI Studio version."));
wxStaticText * text2 = new wxStaticText(this, wxID_ANY, _L("If you would like to try QIDI Studio Beta, you may click to"));
wxHyperlinkCtrl *github_link = new wxHyperlinkCtrl(this, wxID_ANY, _L("Download Beta Version"), "https://github.com/qidilab/QIDIStudio/releases");
wxHyperlinkCtrl *github_link = new wxHyperlinkCtrl(this, wxID_ANY, _L("Download Beta Version"), "https://github.com/qidi3d/QIDIStudio/releases");
horizontal_sizer->Add(text2, 0, wxEXPAND, 0);
horizontal_sizer->Add(github_link, 0, wxEXPAND | wxLEFT, 5);
@@ -610,6 +614,109 @@ wxBoxSizer *Newer3mfVersionDialog::get_btn_sizer()
return horizontal_sizer;
}
NetworkErrorDialog::NetworkErrorDialog(wxWindow* parent)
: DPIDialog(parent ? parent : nullptr, wxID_ANY, _L("Server Exception"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
{
this->SetBackgroundColour(*wxWHITE);
std::string icon_path = (boost::format("%1%/images/QIDIStudioTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
wxBoxSizer* sizer_main = new wxBoxSizer(wxVERTICAL);
auto m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
m_line_top->SetBackgroundColour(wxColour(166, 169, 170));
wxBoxSizer* sizer_bacis_text = new wxBoxSizer(wxVERTICAL);
m_text_basic = new Label(this, _L("The server is unable to respond. Please click the link below to check the server status."));
m_text_basic->SetForegroundColour(0x323A3C);
m_text_basic->SetMinSize(wxSize(FromDIP(470), -1));
m_text_basic->SetMaxSize(wxSize(FromDIP(470), -1));
m_text_basic->Wrap(FromDIP(470));
m_text_basic->SetFont(::Label::Body_14);
sizer_bacis_text->Add(m_text_basic, 0, wxALL, 0);
wxBoxSizer* sizer_link = new wxBoxSizer(wxVERTICAL);
m_link_server_state = new wxHyperlinkCtrl(this, wxID_ANY, _L("Check the status of current system services"), "");
m_link_server_state->SetFont(::Label::Body_13);
m_link_server_state->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {wxGetApp().link_to_network_check(); });
m_link_server_state->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_HAND); });
m_link_server_state->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
sizer_link->Add(m_link_server_state, 0, wxALL, 0);
wxBoxSizer* sizer_help = new wxBoxSizer(wxVERTICAL);
m_text_proposal = new Label(this, _L("If the server is in a fault state, you can temporarily use offline printing or local network printing."));
m_text_proposal->SetMinSize(wxSize(FromDIP(470), -1));
m_text_proposal->SetMaxSize(wxSize(FromDIP(470), -1));
m_text_proposal->Wrap(FromDIP(470));
m_text_proposal->SetFont(::Label::Body_14);
m_text_proposal->SetForegroundColour(0x323A3C);
m_text_wiki = new wxHyperlinkCtrl(this, wxID_ANY, _L("How to use LAN only mode"), "");
m_text_wiki->SetFont(::Label::Body_13);
m_text_wiki->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {wxGetApp().link_to_lan_only_wiki(); });
m_text_wiki->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_HAND); });
m_text_wiki->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
sizer_help->Add(m_text_proposal, 0, wxEXPAND, 0);
sizer_help->Add(m_text_wiki, 0, wxALL, 0);
wxBoxSizer* sizer_button = new wxBoxSizer(wxHORIZONTAL);
/*dont show again*/
auto checkbox = new ::CheckBox(this);
checkbox->SetValue(false);
auto checkbox_title = new Label(this, _L("Don't show this dialog again"));
checkbox_title->SetForegroundColour(0x323A3C);
checkbox_title->SetFont(::Label::Body_14);
checkbox_title->Wrap(-1);
checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, checkbox](wxCommandEvent &e) {
m_show_again = checkbox->GetValue();
e.Skip();
});
auto bt_enable = StateColor(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
m_button_confirm = new Button(this, _L("Confirm"));
m_button_confirm->SetBackgroundColor(bt_enable);
m_button_confirm->SetBorderColor(bt_enable);
m_button_confirm->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_confirm->SetMinSize(wxSize(FromDIP(68), FromDIP(23)));
m_button_confirm->SetMinSize(wxSize(FromDIP(68), FromDIP(23)));
m_button_confirm->SetCornerRadius(12);
m_button_confirm->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {EndModal(wxCLOSE);});
sizer_button->Add(checkbox, 0, wxALL, 5);
sizer_button->Add(checkbox_title, 0, wxALL, 5);
sizer_button->Add(0, 0, 1, wxEXPAND, 5);
sizer_button->Add(m_button_confirm, 0, wxALL, 5);
sizer_main->Add(m_line_top, 0, wxEXPAND, 0);
sizer_main->Add(0, 0, 0, wxTOP, 20);
sizer_main->Add(sizer_bacis_text, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
sizer_main->Add(0, 0, 0, wxTOP, 6);
sizer_main->Add(sizer_link, 0, wxLEFT | wxRIGHT, 15);
sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(20));
sizer_main->Add(sizer_help, 1, wxLEFT | wxRIGHT, 15);
sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(20));
sizer_main->Add(sizer_button, 1, wxEXPAND | wxLEFT | wxRIGHT, 15);
sizer_main->Add(0, 0, 0, wxTOP, 18);
SetSizer(sizer_main);
Layout();
sizer_main->Fit(this);
Centre(wxBOTH);
}
} // namespace GUI
} // namespace Slic3r