diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index bb25f15f27..b311b258ab 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -802,7 +802,8 @@ static std::vector s_Preset_printer_options { "scan_first_layer", "machine_load_filament_time", "machine_unload_filament_time", "machine_pause_gcode", "template_custom_gcode", "nozzle_type", "nozzle_hrc","auxiliary_fan", "nozzle_volume","upward_compatible_machine", "z_hop_types", //SoftFever - "host_type", "print_host", "printhost_apikey", + "host_type", "print_host", "printhost_apikey", + "print_host_webui", "printhost_cafile","printhost_port","printhost_authorization_type", "printhost_user", "printhost_password", "printhost_ssl_ignore_revoke", "z_lift_type", "thumbnails", @@ -1697,6 +1698,7 @@ std::pair PresetCollection::load_external_preset( DynamicPrintConfig cfg(this->default_preset_for(combined_config).config); // SoftFever: ignore print connection info from project cfg.erase("print_host"); + cfg.erase("print_host_webui"); cfg.erase("printhost_apikey"); cfg.erase("printhost_cafile"); const auto &keys = cfg.keys(); @@ -2633,6 +2635,7 @@ static std::vector s_PhysicalPrinter_opts { "printer_technology", "host_type", "print_host", + "print_host_webui", "printhost_apikey", "printhost_cafile", "printhost_port", diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index 05a77e673b..446d7ecde4 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -1507,6 +1507,7 @@ DynamicPrintConfig PresetBundle::full_config_secure() const DynamicPrintConfig config = this->full_config(); //FIXME legacy, the keys should not be there after conversion to a Physical Printer profile. config.erase("print_host"); + config.erase("print_host_webui"); config.erase("printhost_apikey"); config.erase("printhost_cafile"); return config; } diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index b1788618bc..1b19d4d3d0 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -412,6 +412,14 @@ void PrintConfigDef::init_common_params() def->cli = ConfigOptionDef::nocli; def->set_default_value(new ConfigOptionString("")); + def = this->add("print_host_webui", coString); + def->label = L("Device UI"); + def->tooltip = L("Specify the URL of your device user interface if it's not same as print_host"); + def->mode = comAdvanced; + def->cli = ConfigOptionDef::nocli; + def->set_default_value(new ConfigOptionString("")); + + def = this->add("printhost_apikey", coString); def->label = L("API Key / Password"); def->tooltip = L("Slic3r can upload G-code files to a printer host. This field should contain " diff --git a/src/slic3r/GUI/PhysicalPrinterDialog.cpp b/src/slic3r/GUI/PhysicalPrinterDialog.cpp index c4ffead8c1..015df7f463 100644 --- a/src/slic3r/GUI/PhysicalPrinterDialog.cpp +++ b/src/slic3r/GUI/PhysicalPrinterDialog.cpp @@ -194,6 +194,10 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr host_line.append_widget(print_host_test); m_optgroup->append_line(host_line); + option = m_optgroup->get_option("print_host_webui"); + option.opt.width = Field::def_width_wider(); + m_optgroup->append_single_option_line(option); + m_optgroup->append_single_option_line("printhost_authorization_type"); option = m_optgroup->get_option("printhost_apikey"); @@ -254,7 +258,7 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr auto txt = new wxStaticText(parent, wxID_ANY, from_u8((boost::format("%1%\n\t%2%") % info % ca_file_hint).str())); txt->SetFont(wxGetApp().normal_font()); auto sizer = new wxBoxSizer(wxHORIZONTAL); - sizer->Add(txt, 1, wxEXPAND); + sizer->Add(txt, 1, wxEXPAND|wxALIGN_LEFT); return sizer; }; m_optgroup->append_line(line); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 3876caa422..4a57fa09e0 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1035,13 +1035,14 @@ void Sidebar::update_all_preset_comboboxes() connection_btn->Show(); ams_btn->Hide(); p_mainframe->set_print_button_to_default(MainFrame::PrintSelectType::eSendGcode); - wxString host_url = preset_bundle.printers.get_edited_preset().config.opt_string("print_host"); - if(!host_url.empty()) + 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"); + if(!url.empty()) { - if(!host_url.Lower().starts_with("http")) - host_url = wxString::Format("http://%s",host_url); + if(!url.Lower().starts_with("http")) + url = wxString::Format("http://%s",url); - p_mainframe->load_printer_url(host_url); + p_mainframe->load_printer_url(url); } m_bed_type_list->SelectAndNotify(btPEI-1);