Support for 3DPrinterOS cloud integration (#10403)

This commit is contained in:
3DPrinterOS SDK
2026-06-03 21:31:57 +03:00
committed by GitHub
parent 757b6a5c46
commit c467990724
7 changed files with 776 additions and 5 deletions

View File

@@ -40,6 +40,7 @@
#include "MsgDialog.hpp"
#include "OAuthDialog.hpp"
#include "SimplyPrint.hpp"
#include "3DPrinterOS.hpp"
namespace Slic3r {
namespace GUI {
@@ -273,6 +274,12 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr
} else {
msg = r.error_message;
}
} else if (const auto h = dynamic_cast<C3DPrinterOS*>(host.get()); h) {
GUI::MessageDialog dlg(this, _L("Valid session not detected. Proceed with login to 3DPrinterOS?"), _L("Proceed"),
wxICON_INFORMATION | wxYES | wxNO);
if (dlg.ShowModal() == wxID_YES) {
result = h->login(msg);
}
} else {
PrinterCloudAuthDialog dlg(this->GetParent(), host.get());
dlg.ShowModal();
@@ -644,7 +651,8 @@ 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/panel") {
current_host == "https://simplyprint.io" || current_host == "https://simplyprint.io/panel" ||
current_host == C3DPrinterOS::default_host()) {
temp->SetValue(wxString());
m_config->opt_string("print_host") = "";
}
@@ -677,7 +685,7 @@ void PhysicalPrinterDialog::update(bool printer_change)
m_config->opt_string("print_host") = "https://app.obico.io";
}
}
} else if (opt->value == htSimplyPrint) {
} else if (opt->value == htSimplyPrint) {
// Set the host url
if (Field* printhost_field = m_optgroup->get_field("print_host"); printhost_field) {
printhost_field->disable();
@@ -714,7 +722,16 @@ void PhysicalPrinterDialog::update(bool printer_change)
m_optgroup->disable_field("printhost_ssl_ignore_revoke");
if (m_printhost_cafile_browse_btn)
m_printhost_cafile_browse_btn->Disable();
}
} else if (opt->value == ht3DPrinterOS) {
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(C3DPrinterOS::default_host());
m_config->opt_string("print_host") = C3DPrinterOS::default_host();
}
}
m_optgroup->hide_field("print_host_webui");
m_optgroup->hide_field("printhost_apikey");
}
}
if (opt->value == htFlashforge) {