Various improvements to SimplyPrint integration (#4831)

* Allow using BBL's device tab when 3rd party print host is used

* Add option to open SimplyPrint panel in device tab after uploading

* Fix default print host for prusa connect

* Do not set api key in device view when SimplyPrint is used

* Sending 3mf file to SimplyPrint when using BBL printers

* Fix file extension when uploading 3mf

* Prepare for large file uploading

* Implement chunk upload

* Fix file uploading exceeding content size

* Fix wrong field type

* Add `temp=true` to all chunk upload calls

* Add macro to enable test api

* Merge branch 'main' into dev/simplyprint-improve

* Fix another missing `temp=true`

* Add delete token

* Try fixing build error on *nix systems

* Merge branch 'main' into dev/simplyprint-improve

* Merge branch 'main' into dev/simplyprint-improve

* Merge remote-tracking branch 'remote/main' into dev/simplyprint-improve

# Conflicts:
#	src/slic3r/GUI/BackgroundSlicingProcess.cpp

* Move the `bbl_use_print_host_webui` option to print host dialog. Also make it a derived option of `print_host_webui` instead.

* Merge branch 'main' into dev/simplyprint-improve

# Conflicts:
#	src/slic3r/GUI/MainFrame.cpp
#	src/slic3r/GUI/Plater.cpp

* Merge branch 'main' into dev/simplyprint-improve

# Conflicts:
#	src/slic3r/GUI/Plater.cpp

* Use a more generic option instead of SimplyPrint specific

* Merge branch 'main' into dev/simplyprint-improve

* Merge branch 'main' into dev/simplyprint-improve
This commit is contained in:
Noisyfox 2024-06-21 19:48:00 +08:00 committed by GitHub
parent b7a0b30578
commit cd6cd0786f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 505 additions and 110 deletions

View file

@ -901,23 +901,27 @@ void BackgroundSlicingProcess::prepare_upload()
/ boost::filesystem::unique_path("." SLIC3R_APP_KEY ".upload.%%%%-%%%%-%%%%-%%%%");
if (m_print == m_fff_print) {
m_print->set_status(95, _utf8(L("Running post-processing scripts")));
std::string error_message;
if (copy_file(m_temp_output_path, source_path.string(), error_message) != SUCCESS)
throw Slic3r::RuntimeError(_utf8(L("Copying of the temporary G-code to the output G-code failed")));
m_upload_job.upload_data.upload_path = m_fff_print->print_statistics().finalize_output_path(m_upload_job.upload_data.upload_path.string());
// Orca: skip post-processing scripts for BBL printers as we have run them already in finalize_gcode()
// todo: do we need to copy the file?
if (m_upload_job.upload_data.use_3mf) {
source_path = m_upload_job.upload_data.source_path;
} else {
m_print->set_status(95, _utf8(L("Running post-processing scripts")));
std::string error_message;
if (copy_file(m_temp_output_path, source_path.string(), error_message) != SUCCESS)
throw Slic3r::RuntimeError(_utf8(L("Copying of the temporary G-code to the output G-code failed")));
m_upload_job.upload_data.upload_path = m_fff_print->print_statistics().finalize_output_path(m_upload_job.upload_data.upload_path.string());
// Orca: skip post-processing scripts for BBL printers as we have run them already in finalize_gcode()
// todo: do we need to copy the file?
// Make a copy of the source path, as run_post_process_scripts() is allowed to change it when making a copy of the source file
// (not here, but when the final target is a file).
if (!m_fff_print->is_BBL_printer()) {
std::string source_path_str = source_path.string();
std::string output_name_str = m_upload_job.upload_data.upload_path.string();
if (run_post_process_scripts(source_path_str, false, m_upload_job.printhost->get_name(), output_name_str,
m_fff_print->full_print_config()))
m_upload_job.upload_data.upload_path = output_name_str;
}
// Make a copy of the source path, as run_post_process_scripts() is allowed to change it when making a copy of the source file
// (not here, but when the final target is a file).
if (!m_fff_print->is_BBL_printer()) {
std::string source_path_str = source_path.string();
std::string output_name_str = m_upload_job.upload_data.upload_path.string();
if (run_post_process_scripts(source_path_str, false, m_upload_job.printhost->get_name(), output_name_str,
m_fff_print->full_print_config()))
m_upload_job.upload_data.upload_path = output_name_str;
}
}
} else {
m_upload_job.upload_data.upload_path = m_sla_print->print_statistics().finalize_output_path(m_upload_job.upload_data.upload_path.string());

View file

@ -1615,7 +1615,7 @@ wxBoxSizer* MainFrame::create_side_tools()
SidePopup* p = new SidePopup(this);
if (wxGetApp().preset_bundle
&& !wxGetApp().preset_bundle->use_bbl_network()) {
&& !wxGetApp().preset_bundle->is_bbl_vendor()) {
// ThirdParty Buttons
SideButton* export_gcode_btn = new SideButton(p, _L("Export G-code file"), "");
export_gcode_btn->SetCornerRadius(0);
@ -1715,10 +1715,32 @@ wxBoxSizer* MainFrame::create_side_tools()
p->Dismiss();
});
bool support_send = true;
bool support_print_all = true;
const auto preset_bundle = wxGetApp().preset_bundle;
if (preset_bundle) {
if (preset_bundle->use_bbl_network()) {
// BBL network support everything
} else {
support_send = false; // All 3rd print hosts do not have the send options
auto cfg = preset_bundle->printers.get_edited_preset().config;
const auto host_type = cfg.option<ConfigOptionEnum<PrintHostType>>("host_type")->value;
// Only simply print support uploading all plates
support_print_all = host_type == PrintHostType::htSimplyPrint;
}
}
p->append_button(print_plate_btn);
p->append_button(print_all_btn);
p->append_button(send_to_printer_btn);
p->append_button(send_to_printer_all_btn);
if (support_print_all) {
p->append_button(print_all_btn);
}
if (support_send) {
p->append_button(send_to_printer_btn);
p->append_button(send_to_printer_all_btn);
}
if (enable_multi_machine) {
SideButton* print_multi_machine_btn = new SideButton(p, _L("Send to Multi-device"), "");
print_multi_machine_btn->SetCornerRadius(0);
@ -3636,14 +3658,14 @@ void MainFrame::load_printer_url(wxString url, wxString apikey)
void MainFrame::load_printer_url()
{
PresetBundle &preset_bundle = *wxGetApp().preset_bundle;
if (preset_bundle.use_bbl_network())
if (preset_bundle.use_bbl_device_tab())
return;
auto cfg = preset_bundle.printers.get_edited_preset().config;
wxString url = cfg.opt_string("print_host_webui").empty() ? cfg.opt_string("print_host") : cfg.opt_string("print_host_webui");
wxString apikey;
if (cfg.has("printhost_apikey") && (cfg.option<ConfigOptionEnum<PrintHostType>>("host_type")->value == htPrusaLink ||
cfg.option<ConfigOptionEnum<PrintHostType>>("host_type")->value == htPrusaConnect))
const auto host_type = cfg.option<ConfigOptionEnum<PrintHostType>>("host_type")->value;
if (cfg.has("printhost_apikey") && (host_type == htPrusaLink || host_type == htPrusaConnect))
apikey = cfg.opt_string("printhost_apikey");
if (!url.empty()) {
if (!url.Lower().starts_with("http"))

View file

@ -130,6 +130,8 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr
this->update_printhost_buttons();
if (opt_key == "printhost_port")
this->update_ports();
if (opt_key == "bbl_use_print_host_webui")
this->update_webui();
};
m_optgroup->append_single_option_line("host_type");
@ -253,6 +255,19 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr
option.opt.width = Field::def_width_wider();
m_optgroup->append_single_option_line(option);
{
// For bbl printers, we build a fake option to control whether the original device tab should be used
ConfigOptionDef def;
def.type = coBool;
def.width = Field::def_width();
def.label = L("View print host webui in Device tab");
def.tooltip = L("Replace the BambuLab's device tab with print host webui");
def.set_default_value(new ConfigOptionBool(false));
auto option = Option(def, "bbl_use_print_host_webui");
m_optgroup->append_single_option_line(option);
}
m_optgroup->append_single_option_line("printhost_authorization_type");
option = m_optgroup->get_option("printhost_apikey");
@ -402,6 +417,30 @@ void PhysicalPrinterDialog::update_ports() {
}
}
void PhysicalPrinterDialog::update_webui()
{
const PrinterTechnology tech = Preset::printer_technology(*m_config);
if (tech == ptFFF) {
const auto opt = m_config->option<ConfigOptionEnum<PrintHostType>>("host_type");
if (opt->value == htSimplyPrint) {
bool bbl_use_print_host_webui = false;
if (Field* printhost_webui_field = m_optgroup->get_field("bbl_use_print_host_webui"); printhost_webui_field) {
if (CheckBox* temp = dynamic_cast<CheckBox*>(printhost_webui_field); temp) {
bbl_use_print_host_webui = boost::any_cast<bool>(temp->get_value());
}
}
const std::string v = bbl_use_print_host_webui ? "https://simplyprint.io/panel" : "";
if (Field* printhost_webui_field = m_optgroup->get_field("print_host_webui"); printhost_webui_field) {
if (wxTextCtrl* temp = dynamic_cast<TextCtrl*>(printhost_webui_field)->text_ctrl(); temp) {
temp->SetValue(v);
}
}
m_config->opt_string("print_host_webui") = v;
}
}
}
void PhysicalPrinterDialog::update_printhost_buttons()
{
std::unique_ptr<PrintHost> host(PrintHost::get_print_host(m_config));
@ -504,7 +543,8 @@ void PhysicalPrinterDialog::update(bool printer_change)
m_optgroup->show_field("host_type");
m_optgroup->enable_field("print_host");
m_optgroup->enable_field("print_host_webui");
m_optgroup->show_field("print_host_webui");
m_optgroup->hide_field("bbl_use_print_host_webui");
m_optgroup->enable_field("printhost_cafile");
m_optgroup->enable_field("printhost_ssl_ignore_revoke");
if (m_printhost_cafile_browse_btn)
@ -516,21 +556,12 @@ void PhysicalPrinterDialog::update(bool printer_change)
const auto current_host = temp->GetValue();
if (current_host == L"https://connect.prusa3d.com" ||
current_host == L"https://app.obico.io" ||
current_host == "https://simplyprint.io") {
current_host == "https://simplyprint.io" || current_host == "https://simplyprint.io/panel") {
temp->SetValue(wxString());
m_config->opt_string("print_host") = "";
}
}
}
if (Field* printhost_webui_field = m_optgroup->get_field("print_host_webui"); printhost_webui_field) {
if (wxTextCtrl* temp = dynamic_cast<TextCtrl*>(printhost_webui_field)->text_ctrl(); temp) {
const auto current_host = temp->GetValue();
if (current_host == "https://simplyprint.io/panel") {
temp->SetValue(wxString());
m_config->opt_string("print_host_webui") = "";
}
}
}
if (opt->value == htPrusaLink) { // PrusaConnect does NOT allow http digest
m_optgroup->show_field("printhost_authorization_type");
AuthorizationType auth_type = m_config->option<ConfigOptionEnum<AuthorizationType>>("printhost_authorization_type")->value;
@ -548,6 +579,7 @@ void PhysicalPrinterDialog::update(bool printer_change)
if (Field* printhost_field = m_optgroup->get_field("print_host"); printhost_field) {
if (wxTextCtrl* temp = dynamic_cast<TextCtrl*>(printhost_field)->text_ctrl(); temp && temp->GetValue().IsEmpty()) {
temp->SetValue(L"https://connect.prusa3d.com");
m_config->opt_string("print_host") = "https://connect.prusa3d.com";
}
}
} else if (opt->value == htObico) { // automatically show default obico address
@ -562,17 +594,33 @@ void PhysicalPrinterDialog::update(bool printer_change)
if (Field* printhost_field = m_optgroup->get_field("print_host"); printhost_field) {
printhost_field->disable();
if (wxTextCtrl* temp = dynamic_cast<TextCtrl*>(printhost_field)->text_ctrl(); temp && temp->GetValue().IsEmpty()) {
temp->SetValue("https://simplyprint.io");
}
m_config->opt_string("print_host") = "https://simplyprint.io";
}
if (Field* printhost_webui_field = m_optgroup->get_field("print_host_webui"); printhost_webui_field) {
printhost_webui_field->disable();
if (wxTextCtrl* temp = dynamic_cast<TextCtrl*>(printhost_webui_field)->text_ctrl(); temp && temp->GetValue().IsEmpty()) {
temp->SetValue("https://simplyprint.io/panel");
}
m_config->opt_string("print_host") = "https://simplyprint.io/panel";
}
const auto current_webui = m_config->opt_string("print_host_webui");
if (!current_webui.empty()) {
if (Field* printhost_webui_field = m_optgroup->get_field("print_host_webui"); printhost_webui_field) {
if (wxTextCtrl* temp = dynamic_cast<TextCtrl*>(printhost_webui_field)->text_ctrl(); temp) {
temp->SetValue("https://simplyprint.io/panel");
}
}
m_config->opt_string("print_host_webui") = "https://simplyprint.io/panel";
}
// For bbl printers, show option to control the device tab
if (wxGetApp().preset_bundle->is_bbl_vendor()) {
m_optgroup->show_field("bbl_use_print_host_webui");
const bool use_print_host_webui = !current_webui.empty();
if (Field* printhost_webui_field = m_optgroup->get_field("bbl_use_print_host_webui"); printhost_webui_field) {
if (CheckBox* temp = dynamic_cast<CheckBox*>(printhost_webui_field); temp) {
temp->set_value(use_print_host_webui);
}
}
}
m_optgroup->hide_field("print_host_webui");
m_optgroup->hide_field("printhost_apikey");
m_optgroup->disable_field("printhost_cafile");
m_optgroup->disable_field("printhost_ssl_ignore_revoke");

View file

@ -63,6 +63,7 @@ public:
void update_printhost_buttons();
void update_printers();
void update_ports();
void update_webui();
protected:
void on_dpi_changed(const wxRect& suggested_rect) override;

View file

@ -1181,12 +1181,11 @@ void Sidebar::update_all_preset_comboboxes()
const auto print_tech = preset_bundle.printers.get_edited_preset().printer_technology();
bool is_bbl_vendor = preset_bundle.is_bbl_vendor();
const bool use_bbl_network = preset_bundle.use_bbl_network();
auto p_mainframe = wxGetApp().mainframe;
auto cfg = preset_bundle.printers.get_edited_preset().config;
if (use_bbl_network) {
if (preset_bundle.use_bbl_network()) {
//only show connection button for not-BBL printer
connection_btn->Hide();
//only show sync-ams button for BBL printer
@ -1204,9 +1203,10 @@ void Sidebar::update_all_preset_comboboxes()
else {
if (!url.Lower().starts_with("http"))
url = wxString::Format("http://%s", url);
if (cfg.has("printhost_apikey"))
const auto host_type = cfg.option<ConfigOptionEnum<PrintHostType>>("host_type")->value;
if (cfg.has("printhost_apikey") && (host_type != htSimplyPrint))
apikey = cfg.opt_string("printhost_apikey");
print_btn_type = MainFrame::PrintSelectType::eSendGcode;
print_btn_type = preset_bundle.is_bbl_vendor() ? MainFrame::PrintSelectType::ePrintPlate : MainFrame::PrintSelectType::eSendGcode;
}
p_mainframe->load_printer_url(url, apikey);
@ -1250,7 +1250,7 @@ void Sidebar::update_all_preset_comboboxes()
p->combo_printer->update();
// Orca:: show device tab based on vendor type
p_mainframe->show_device(use_bbl_network);
p_mainframe->show_device(preset_bundle.use_bbl_device_tab());
p_mainframe->m_tabpanel->SetSelection(p_mainframe->m_tabpanel->GetSelection());
}
@ -7069,12 +7069,18 @@ void Plater::priv::on_action_print_plate(SimpleEvent&)
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ":received print plate event\n" ;
}
//BBS
if (!m_select_machine_dlg) m_select_machine_dlg = new SelectMachineDialog(q);
m_select_machine_dlg->set_print_type(PrintFromType::FROM_NORMAL);
m_select_machine_dlg->prepare(partplate_list.get_curr_plate_index());
m_select_machine_dlg->ShowModal();
record_start_print_preset("print_plate");
PresetBundle& preset_bundle = *wxGetApp().preset_bundle;
if (preset_bundle.use_bbl_network()) {
// BBS
if (!m_select_machine_dlg)
m_select_machine_dlg = new SelectMachineDialog(q);
m_select_machine_dlg->set_print_type(PrintFromType::FROM_NORMAL);
m_select_machine_dlg->prepare(partplate_list.get_curr_plate_index());
m_select_machine_dlg->ShowModal();
record_start_print_preset("print_plate");
} else {
q->send_gcode_legacy(PLATE_CURRENT_IDX, nullptr, true);
}
}
void Plater::priv::on_action_send_to_multi_machine(SimpleEvent&)
@ -7104,7 +7110,7 @@ void Plater::priv::on_tab_selection_changing(wxBookCtrlEvent& e)
sidebar_layout.show = new_sel == MainFrame::tp3DEditor || new_sel == MainFrame::tpPreview;
update_sidebar();
int old_sel = e.GetOldSelection();
if (wxGetApp().preset_bundle && wxGetApp().preset_bundle->use_bbl_network() && new_sel == MainFrame::tpMonitor) {
if (wxGetApp().preset_bundle && wxGetApp().preset_bundle->use_bbl_device_tab() && new_sel == MainFrame::tpMonitor) {
if (!wxGetApp().getAgent()) {
e.Veto();
BOOST_LOG_TRIVIAL(info) << boost::format("skipped tab switch from %1% to %2%, lack of network plugins") % old_sel % new_sel;
@ -7159,12 +7165,18 @@ void Plater::priv::on_action_print_all(SimpleEvent&)
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ":received print all event\n" ;
}
//BBS
if (!m_select_machine_dlg) m_select_machine_dlg = new SelectMachineDialog(q);
m_select_machine_dlg->set_print_type(PrintFromType::FROM_NORMAL);
m_select_machine_dlg->prepare(PLATE_ALL_IDX);
m_select_machine_dlg->ShowModal();
record_start_print_preset("print_all");
PresetBundle& preset_bundle = *wxGetApp().preset_bundle;
if (preset_bundle.use_bbl_network()) {
// BBS
if (!m_select_machine_dlg)
m_select_machine_dlg = new SelectMachineDialog(q);
m_select_machine_dlg->set_print_type(PrintFromType::FROM_NORMAL);
m_select_machine_dlg->prepare(PLATE_ALL_IDX);
m_select_machine_dlg->ShowModal();
record_start_print_preset("print_all");
} else {
q->send_gcode_legacy(PLATE_ALL_IDX, nullptr, true);
}
}
void Plater::priv::on_action_export_gcode(SimpleEvent&)
@ -12332,7 +12344,7 @@ void Plater::reslice_SLA_until_step(SLAPrintObjectStep step, const ModelObject &
// and let the background processing start.
this->p->restart_background_process(state | priv::UPDATE_BACKGROUND_PROCESS_FORCE_RESTART);
}
void Plater::send_gcode_legacy(int plate_idx, Export3mfProgressFn proFn)
void Plater::send_gcode_legacy(int plate_idx, Export3mfProgressFn proFn, bool use_3mf)
{
// if physical_printer is selected, send gcode for this printer
// DynamicPrintConfig* physical_printer_config = wxGetApp().preset_bundle->physical_printers.get_selected_printer_config();
@ -12344,6 +12356,8 @@ void Plater::send_gcode_legacy(int plate_idx, Export3mfProgressFn proFn)
if (upload_job.empty())
return;
upload_job.upload_data.use_3mf = use_3mf;
// Obtain default output path
fs::path default_output_file;
try {
@ -12362,6 +12376,9 @@ void Plater::send_gcode_legacy(int plate_idx, Export3mfProgressFn proFn)
return;
}
default_output_file = fs::path(Slic3r::fold_utf8_to_ascii(default_output_file.string()));
if (use_3mf) {
default_output_file.replace_extension("3mf");
}
// Repetier specific: Query the server for the list of file groups.
wxArrayString groups;
@ -12383,8 +12400,11 @@ void Plater::send_gcode_legacy(int plate_idx, Export3mfProgressFn proFn)
}
}
PrintHostSendDialog dlg(default_output_file, upload_job.printhost->get_post_upload_actions(), groups, storage_paths, storage_names);
auto config = get_app_config();
PrintHostSendDialog dlg(default_output_file, upload_job.printhost->get_post_upload_actions(), groups, storage_paths, storage_names, config->get_bool("open_device_tab_post_upload"));
if (dlg.ShowModal() == wxID_OK) {
config->set_bool("open_device_tab_post_upload", dlg.switch_to_device_tab());
upload_job.switch_to_device_tab = dlg.switch_to_device_tab();
upload_job.upload_data.upload_path = dlg.filename();
upload_job.upload_data.post_action = dlg.post_action();
upload_job.upload_data.group = dlg.group();
@ -12397,6 +12417,19 @@ void Plater::send_gcode_legacy(int plate_idx, Export3mfProgressFn proFn)
return;
}
if (use_3mf) {
// Process gcode
const int result = send_gcode(plate_idx, nullptr);
if (result < 0) {
wxString msg = _L("Abnormal print file data. Please slice again");
show_error(this, msg, false);
return;
}
upload_job.upload_data.source_path = p->m_print_job_data._3mf_path;
}
p->export_gcode(fs::path(), false, std::move(upload_job));
}
}

View file

@ -431,7 +431,7 @@ public:
/* -1: send current gcode if not specified
* -2: send all gcode to target machine */
int send_gcode(int plate_idx = -1, Export3mfProgressFn proFn = nullptr);
void send_gcode_legacy(int plate_idx = -1, Export3mfProgressFn proFn = nullptr);
void send_gcode_legacy(int plate_idx = -1, Export3mfProgressFn proFn = nullptr, bool use_3mf = false);
int export_config_3mf(int plate_idx = -1, Export3mfProgressFn proFn = nullptr);
//BBS jump to nonitor after print job finished
void send_calibration_job_finished(wxCommandEvent &evt);

View file

@ -38,7 +38,7 @@ static const char *CONFIG_KEY_PATH = "printhost_path";
static const char *CONFIG_KEY_GROUP = "printhost_group";
static const char* CONFIG_KEY_STORAGE = "printhost_storage";
PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUploadActions post_actions, const wxArrayString &groups, const wxArrayString& storage_paths, const wxArrayString& storage_names)
PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUploadActions post_actions, const wxArrayString &groups, const wxArrayString& storage_paths, const wxArrayString& storage_names, bool switch_to_device_tab)
: MsgDialog(static_cast<wxWindow*>(wxGetApp().mainframe), _L("Send G-Code to printer host"), _L("Upload to Printer Host with the following filename:"), 0) // Set style = 0 to avoid default creation of the "OK" button.
// All buttons will be added later in this constructor
, txt_filename(new wxTextCtrl(this, wxID_ANY))
@ -46,6 +46,7 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
, combo_storage(storage_names.GetCount() > 1 ? new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, storage_names, wxCB_READONLY) : nullptr)
, post_upload_action(PrintHostPostUploadAction::None)
, m_paths(storage_paths)
, m_switch_to_device_tab(switch_to_device_tab)
{
#ifdef __APPLE__
txt_filename->OSXDisableAllSmartSubstitutions();
@ -97,6 +98,22 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
txt_filename->SetValue(recent_path);
auto checkbox_sizer = new wxBoxSizer(wxHORIZONTAL);
auto checkbox = new ::CheckBox(this, wxID_APPLY);
checkbox->SetValue(m_switch_to_device_tab);
checkbox->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& e) {
m_switch_to_device_tab = e.IsChecked();
e.Skip();
});
checkbox_sizer->Add(checkbox, 0, wxALL | wxALIGN_CENTER, FromDIP(2));
auto checkbox_text = new wxStaticText(this, wxID_ANY, _L("Switch to Device tab after upload."), wxDefaultPosition, wxDefaultSize, 0);
checkbox_sizer->Add(checkbox_text, 0, wxALL | wxALIGN_CENTER, FromDIP(2));
checkbox_text->SetFont(::Label::Body_13);
checkbox_text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#323A3D")));
content_sizer->Add(checkbox_sizer);
content_sizer->AddSpacer(VERT_SPACING);
if (size_t extension_start = recent_path.find_last_of('.'); extension_start != std::string::npos)
m_valid_suffix = recent_path.substr(extension_start);
// .gcode suffix control

View file

@ -26,11 +26,12 @@ namespace GUI {
class PrintHostSendDialog : public GUI::MsgDialog
{
public:
PrintHostSendDialog(const boost::filesystem::path &path, PrintHostPostUploadActions post_actions, const wxArrayString& groups, const wxArrayString& storage_paths, const wxArrayString& storage_names);
PrintHostSendDialog(const boost::filesystem::path &path, PrintHostPostUploadActions post_actions, const wxArrayString& groups, const wxArrayString& storage_paths, const wxArrayString& storage_names, bool switch_to_device_tab);
boost::filesystem::path filename() const;
PrintHostPostUploadAction post_action() const;
std::string group() const;
std::string storage() const;
bool switch_to_device_tab() const {return m_switch_to_device_tab;}
virtual void EndModal(int ret) override;
private:
@ -41,6 +42,7 @@ private:
wxString m_valid_suffix;
wxString m_preselected_storage;
wxArrayString m_paths;
bool m_switch_to_device_tab;
};