diff --git a/resources/images/printer_thumbnail_x1c.svg b/resources/images/printer_thumbnail_x1c.svg new file mode 100644 index 0000000000..2a2c5e0a56 --- /dev/null +++ b/resources/images/printer_thumbnail_x1c.svg @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/printer_thumbnail_x1c_dark.svg b/resources/images/printer_thumbnail_x1c_dark.svg new file mode 100644 index 0000000000..03c280357e --- /dev/null +++ b/resources/images/printer_thumbnail_x1c_dark.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/printer_thumbnail_x1e.svg b/resources/images/printer_thumbnail_x1e.svg new file mode 100644 index 0000000000..2a2c5e0a56 --- /dev/null +++ b/resources/images/printer_thumbnail_x1e.svg @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/printer_thumbnail_x1e_dark.svg b/resources/images/printer_thumbnail_x1e_dark.svg new file mode 100644 index 0000000000..03c280357e --- /dev/null +++ b/resources/images/printer_thumbnail_x1e_dark.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/printers/BL-P001.json b/resources/printers/BL-P001.json index 0ae1cffc03..a456526a04 100644 --- a/resources/printers/BL-P001.json +++ b/resources/printers/BL-P001.json @@ -55,7 +55,7 @@ "support_wrapping_detection": false, "auto_pa_cali_thumbnail_image": "fd_calibration_auto", "printer_type": "3DPrinter-X1-Carbon", - "printer_thumbnail_image": "printer_thumbnail", + "printer_thumbnail_image": "printer_thumbnail_x1c", "printer_connect_help_image": "input_access_code_x1", "printer_use_ams_image": "ams_icon", "printer_ext_image": ["ext_image_xp"], diff --git a/resources/printers/C13.json b/resources/printers/C13.json index 60bdce044e..95f368e3a9 100644 --- a/resources/printers/C13.json +++ b/resources/printers/C13.json @@ -59,7 +59,7 @@ "compatible_machine": [ "BL-P001", "BL-P002", "C11", "C12" ], "auto_cali_not_support_filaments": [ "GFU03", "GFU04" ], "printer_type": "C13", - "printer_thumbnail_image": "printer_thumbnail", + "printer_thumbnail_image": "printer_thumbnail_x1e", "printer_connect_help_image": "input_access_code_x1", "printer_use_ams_image": "ams_icon", "printer_ext_image": ["ext_image_xp"], diff --git a/src/slic3r/GUI/BindDialog.cpp b/src/slic3r/GUI/BindDialog.cpp index 52cdf7d8f1..2b09003e56 100644 --- a/src/slic3r/GUI/BindDialog.cpp +++ b/src/slic3r/GUI/BindDialog.cpp @@ -44,8 +44,8 @@ wxString get_fail_reason(int code) return _L("Failed to post ticket to server"); else if (code == BAMBU_NETWORK_ERR_BIND_PARSE_LOGIN_REPORT_FAILED) - return _L("Failed to parse login report reason"); - + return _L("Failed to parse login report reason"); + else if (code == BAMBU_NETWORK_ERR_BIND_ECODE_LOGIN_REPORT_FAILED) return _L("Failed to parse login report reason"); @@ -68,7 +68,7 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/) wxBoxSizer* m_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)); - + m_simplebook = new wxSimplebook(this); m_simplebook->SetSize(wxSize(FromDIP(460), FromDIP(240))); @@ -121,7 +121,7 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/) for (int i = 0; i < PING_CODE_LENGTH; i++) { m_text_input_single_code[i] = new TextInput(request_bind_panel, wxEmptyString, "", "", wxDefaultPosition, wxSize(FromDIP(38), FromDIP(38)), wxTE_PROCESS_ENTER | wxTE_CENTER); wxTextAttr textAttr; - textAttr.SetAlignment(wxTEXT_ALIGNMENT_CENTER); + textAttr.SetAlignment(wxTEXT_ALIGNMENT_CENTER); textAttr.SetTextColour(wxColour(34, 139, 34)); m_text_input_single_code[i]->GetTextCtrl()->SetDefaultStyle(textAttr); m_text_input_single_code[i]->SetFont(Label::Body_16); @@ -242,11 +242,11 @@ void PingCodeBindDialog::on_key_input(wxKeyEvent& evt) if (keyCode == WXK_BACK || (keyCode >= '0' && keyCode <= '9') || (keyCode >= 'a' && keyCode <= 'z') || (keyCode >= 'A' && keyCode <= 'Z')) { - evt.Skip(); + evt.Skip(); } else { - wxBell(); + wxBell(); return; } } @@ -264,7 +264,7 @@ void PingCodeBindDialog::on_text_changed(wxCommandEvent& event) { if (idx != -1 && text_input->GetValue().Length() == 1) { if (idx < PING_CODE_LENGTH-1) { - m_text_input_single_code[idx + 1]->SetFocus(); + m_text_input_single_code[idx + 1]->SetFocus(); } auto has_empty = false; @@ -298,7 +298,7 @@ void PingCodeBindDialog::on_key_backspace(wxKeyEvent& event) break; } } - + if (event.GetKeyCode() == WXK_BACK && idx >= 0) { CallAfter([this, idx]() { m_text_input_single_code[idx - 1]->SetFocus(); @@ -308,7 +308,7 @@ void PingCodeBindDialog::on_key_backspace(wxKeyEvent& event) event.Skip(); } -void PingCodeBindDialog::on_bind_printer(wxCommandEvent& event) +void PingCodeBindDialog::on_bind_printer(wxCommandEvent& event) { wxString ping_code; @@ -329,7 +329,7 @@ void PingCodeBindDialog::on_bind_printer(wxCommandEvent& event) } } -void PingCodeBindDialog::on_cancel(wxCommandEvent& event) +void PingCodeBindDialog::on_cancel(wxCommandEvent& event) { EndModal(wxCLOSE); } @@ -427,7 +427,7 @@ PingCodeBindDialog::~PingCodeBindDialog() { m_link_show_error = new wxStaticText(this, wxID_ANY, _L("Check the reason")); - m_link_show_error->SetForegroundColour(wxColour(0x6b6b6b)); + m_link_show_error->SetForegroundColour(wxColour("#6b6b6b")); m_link_show_error->SetFont(::Label::Head_13); m_bitmap_show_error_close = create_scaled_bitmap("link_more_error_close",nullptr, 7); @@ -463,8 +463,8 @@ PingCodeBindDialog::~PingCodeBindDialog() { m_panel_agreement->SetBackgroundColour(*wxWHITE); m_panel_agreement->SetMinSize(wxSize(FromDIP(450), -1)); m_panel_agreement->SetMaxSize(wxSize(FromDIP(450), -1)); - - + + wxWrapSizer* sizer_privacy_agreement = new wxWrapSizer( wxHORIZONTAL, wxWRAPSIZER_DEFAULT_FLAGS ); wxWrapSizer* sizere_notice_agreement= new wxWrapSizer( wxHORIZONTAL, wxWRAPSIZER_DEFAULT_FLAGS ); wxBoxSizer* sizer_privacy_body = new wxBoxSizer(wxHORIZONTAL); @@ -577,7 +577,7 @@ PingCodeBindDialog::~PingCodeBindDialog() { wxBoxSizer* sizer_agreement = new wxBoxSizer(wxVERTICAL); sizer_agreement->Add(sizer_privacy_body, 1, wxEXPAND, 0); sizer_agreement->Add(sizere_notice_body, 1, wxEXPAND, 0); - + m_checkbox_privacy->Bind(wxEVT_TOGGLEBUTTON, [this, m_checkbox_privacy](auto& e) { m_allow_privacy = m_checkbox_privacy->GetValue(); @@ -608,7 +608,7 @@ PingCodeBindDialog::~PingCodeBindDialog() { m_link_network_state->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {m_link_network_state->SetCursor(wxCURSOR_HAND); }); m_link_network_state->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {m_link_network_state->SetCursor(wxCURSOR_ARROW); }); - + wxBoxSizer* sizer_error_code = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* sizer_error_desc = new wxBoxSizer(wxHORIZONTAL); @@ -921,8 +921,12 @@ void BindMachineDialog::on_show(wxShowEvent &event) if (event.IsShown()) { auto img = m_machine_info->get_printer_thumbnail_img_str(); if (wxGetApp().dark_mode()) { img += "_dark"; } - auto bitmap = create_scaled_bitmap(img, this, FromDIP(80)); - m_printer_img->SetBitmap(bitmap); + try { + auto bitmap = create_scaled_bitmap(img, this, FromDIP(80)); + m_printer_img->SetBitmap(bitmap); + } + catch (...){} + m_printer_img->Refresh(); m_printer_img->Show(); @@ -969,7 +973,7 @@ UnBindMachineDialog::UnBindMachineDialog(Plater *plater /*= nullptr*/) SetBackgroundColour(*wxWHITE); wxBoxSizer *m_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)); + m_line_top->SetBackgroundColour(wxColour("#A6A9AA")); m_sizer_main->Add(m_line_top, 0, wxEXPAND, 0); m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(38)); @@ -1138,8 +1142,11 @@ void UnBindMachineDialog::on_show(wxShowEvent &event) if (event.IsShown()) { auto img = m_machine_info->get_printer_thumbnail_img_str(); if (wxGetApp().dark_mode()) { img += "_dark"; } - auto bitmap = create_scaled_bitmap(img, this, FromDIP(80)); - m_printer_img->SetBitmap(bitmap); + try { + auto bitmap = create_scaled_bitmap(img, this, FromDIP(80)); + m_printer_img->SetBitmap(bitmap); + } catch (...) {} + m_printer_img->Refresh(); m_printer_img->Show(); @@ -1149,7 +1156,7 @@ void UnBindMachineDialog::on_show(wxShowEvent &event) if (wxGetApp().is_user_login()) { wxString username_text = from_u8(wxGetApp().getAgent()->get_user_name()); m_user_name->SetLabelText(username_text); - + std::string avatar_url = wxGetApp().getAgent()->get_user_avatar(); Slic3r::Http http = Slic3r::Http::get(avatar_url); std::string suffix = avatar_url.substr(avatar_url.find_last_of(".") + 1);