diff --git a/resources/images/printer_host_browser.svg b/resources/images/printer_host_browser.svg new file mode 100644 index 0000000000..f212e0123d --- /dev/null +++ b/resources/images/printer_host_browser.svg @@ -0,0 +1,3 @@ + + + diff --git a/resources/images/printer_host_test.svg b/resources/images/printer_host_test.svg new file mode 100644 index 0000000000..9f75c015a9 --- /dev/null +++ b/resources/images/printer_host_test.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index d35456c98b..6cef34a026 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -252,6 +252,10 @@ PresetsConfigSubstitutions PresetBundle::load_presets(AppConfig &config, Forward else { dir_user_presets = data_dir() + "/" + PRESET_USER_DIR + "/default"; } + fs::path user_folder(data_dir() + "/" + PRESET_USER_DIR); + if (!fs::exists(user_folder)) + fs::create_directory(user_folder); + fs::path folder(dir_user_presets); if (!fs::exists(folder)) fs::create_directory(folder); @@ -700,6 +704,11 @@ void PresetBundle::save_user_presets(AppConfig& config, std::vector const std::string dir_user_presets = data_dir() + "/" + PRESET_USER_DIR + "/"+ config.get("preset_folder"); BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(" enter, save to %1%")%dir_user_presets; + + fs::path user_folder(data_dir() + "/" + PRESET_USER_DIR); + if (!fs::exists(user_folder)) + fs::create_directory(user_folder); + fs::path folder(dir_user_presets); if (!fs::exists(folder)) fs::create_directory(folder); diff --git a/src/slic3r/GUI/Jobs/BindJob.cpp b/src/slic3r/GUI/Jobs/BindJob.cpp index 74d8ecf19a..12bdb1b6f9 100644 --- a/src/slic3r/GUI/Jobs/BindJob.cpp +++ b/src/slic3r/GUI/Jobs/BindJob.cpp @@ -103,7 +103,10 @@ void BindJob::process() msg = _L("Logging in"); } if (code != 0) { - msg = _L("Login failed") + wxString::Format("(code=%d,info=%s)", code, info); + msg = _L("Login failed") + wxString::Format("(code=%d,info=%s). ", code, info); + if (code == BAMBU_NETWORK_ERR_TIMEOUT) { + msg += _L("Please check the printer network connection."); + } } update_status(curr_percent, msg); } diff --git a/src/slic3r/GUI/Jobs/PrintJob.cpp b/src/slic3r/GUI/Jobs/PrintJob.cpp index 969ffff38c..7db397c196 100644 --- a/src/slic3r/GUI/Jobs/PrintJob.cpp +++ b/src/slic3r/GUI/Jobs/PrintJob.cpp @@ -85,6 +85,7 @@ wxString PrintJob::get_http_error_msg(unsigned int status, std::string body) else { wxString unkown_text = _L("Unkown Error."); unkown_text += wxString::Format("status=%u, body=%s", status, body); + BOOST_LOG_TRIVIAL(error) << "http_error: status=" << status << ", code=" << code << ", error=" << error; return unkown_text; } diff --git a/src/slic3r/GUI/PhysicalPrinterDialog.cpp b/src/slic3r/GUI/PhysicalPrinterDialog.cpp index 5a8ffc4d03..b0106a6a65 100644 --- a/src/slic3r/GUI/PhysicalPrinterDialog.cpp +++ b/src/slic3r/GUI/PhysicalPrinterDialog.cpp @@ -138,7 +138,7 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr auto printhost_browse = [=](wxWindow* parent) { - auto sizer = create_sizer_with_btn(parent, &m_printhost_browse_btn, "monitor_signal_strong", _L("Browse") + " " + dots); + auto sizer = create_sizer_with_btn(parent, &m_printhost_browse_btn, "printer_host_browser", _L("Browse") + " " + dots); m_printhost_browse_btn->Bind(wxEVT_BUTTON, [=](wxCommandEvent& e) { BonjourDialog dialog(this, Preset::printer_technology(*m_config)); if (dialog.show_and_lookup()) { @@ -151,7 +151,7 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr }; auto print_host_test = [=](wxWindow* parent) { - auto sizer = create_sizer_with_btn(parent, &m_printhost_test_btn, "test", _L("Test")); + auto sizer = create_sizer_with_btn(parent, &m_printhost_test_btn, "printer_host_test", _L("Test")); m_printhost_test_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) { std::unique_ptr host(PrintHost::get_print_host(m_config)); diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 95bcca0f5f..66cf408901 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -39,6 +39,8 @@ wxDEFINE_EVENT(EVT_EDIT_PRINT_NAME, wxCommandEvent); #define LIST_REFRESH_INTERVAL 200 #define MACHINE_LIST_REFRESH_INTERVAL 2000 +#define WRAP_GAP FromDIP(30) + static wxString task_canceled_text = _L("Task canceled"); @@ -1017,16 +1019,17 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater) m_statictext_printer_msg->SetFont(::Label::Body_13); m_statictext_printer_msg->Hide(); - m_sizer_select = new wxGridSizer(0, 2, 0, 0); + //m_sizer_select = new wxGridSizer(0, 2, 0, 0); + m_sizer_select = new wxWrapSizer(); select_bed = create_item_checkbox(_L("Bed Leveling"), this, _L("Bed Leveling"), "bed_leveling"); select_flow = create_item_checkbox(_L("Flow Calibration"), this, _L("Flow Calibration"), "flow_cali"); select_timelapse = create_item_checkbox(_L("Timelapse"), this, _L("Timelapse"), "timelapse"); select_use_ams = create_ams_checkbox(_L("Enable AMS"), this, _L("Enable AMS")); - m_sizer_select->Add(select_bed); - m_sizer_select->Add(select_flow); - m_sizer_select->Add(select_timelapse); - m_sizer_select->Add(select_use_ams); + m_sizer_select->Add(select_bed, 0, wxLEFT | wxRIGHT, WRAP_GAP); + m_sizer_select->Add(select_flow, 0, wxLEFT | wxRIGHT, WRAP_GAP); + m_sizer_select->Add(select_timelapse, 0, wxLEFT | wxRIGHT, WRAP_GAP); + m_sizer_select->Add(select_use_ams, 0, wxLEFT | wxRIGHT, WRAP_GAP); select_bed->Show(true); select_flow->Show(true); @@ -1052,10 +1055,10 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater) auto hyperlink_sizer = new wxBoxSizer( wxHORIZONTAL ); auto m_hyperlink = new wxHyperlinkCtrl(m_panel_prepare, wxID_ANY, _L("Can't connect to the printer"), wxT("https://wiki.bambulab.com/en/software/bambu-studio/failed-to-connect-printer"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); - auto linkimg = new wxStaticBitmap(m_panel_prepare, wxID_ANY, create_scaled_bitmap("link_wiki_img", this, 18), wxDefaultPosition, wxSize(FromDIP(18), FromDIP(18)), 0); + //auto linkimg = new wxStaticBitmap(m_panel_prepare, wxID_ANY, create_scaled_bitmap("link_wiki_img", this, 18), wxDefaultPosition, wxSize(FromDIP(18), FromDIP(18)), 0); hyperlink_sizer->Add(m_hyperlink, 0, wxALIGN_CENTER | wxALL, 5); - hyperlink_sizer->Add(linkimg, 0, wxALIGN_CENTER | wxALL, FromDIP(5)); + //hyperlink_sizer->Add(linkimg, 0, wxALIGN_CENTER | wxALL, FromDIP(5)); m_sizer_prepare->Add(hyperlink_sizer, 0, wxALIGN_CENTER | wxALL, 5); @@ -1263,7 +1266,6 @@ void SelectMachineDialog::update_select_layout(MachineObject *obj) } else { select_timelapse->Hide(); } - Fit(); } @@ -2258,7 +2260,7 @@ void SelectMachineDialog::update_show_status() show_status(PrintDialogStatus::PrintStatusInPrinting); return; } - else if (!obj_->is_function_supported(PrinterFunction::FUNC_PRINT_WITHOUT_SD)) { + else if (!obj_->is_function_supported(PrinterFunction::FUNC_PRINT_WITHOUT_SD) && !obj_->has_sdcard()) { show_status(PrintDialogStatus::PrintStatusNoSdcard); return; } diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index 08d6029ad5..fe83a1cc6c 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -313,7 +313,8 @@ protected: int m_current_filament_id; bool m_is_in_sending_mode { false }; - wxGridSizer *m_sizer_select; + //wxGridSizer *m_sizer_select; + wxWrapSizer *m_sizer_select; wxBoxSizer * sizer_thumbnail; wxGridSizer *m_sizer_material; wxBoxSizer * m_sizer_main;