Support for SimplyPrint cloud integration (#4525)

* Make httpserver more generic and reusable

* Add OAuthJob

* Fix issue caused by the fact that the backing widget of the `TextCtrl` is no longer `wxTextCtrl`

* Implement login and token refresh

* Implement file upload

* Try fix build error

* Support BBL printers

* Show error message if user hasn't done OAuth

* Fix typo

* Update error message

* Disable unsupported options when SimplyPrint is selected
This commit is contained in:
Noisyfox 2024-03-23 10:08:48 +08:00 committed by GitHub
parent f3b3e92782
commit e29bbac193
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 1075 additions and 228 deletions

View file

@ -1132,13 +1132,14 @@ 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();
// Orca:: show device tab based on vendor type
auto p_mainframe = wxGetApp().mainframe;
p_mainframe->show_device(is_bbl_vendor);
p_mainframe->show_device(use_bbl_network);
auto cfg = preset_bundle.printers.get_edited_preset().config;
if (is_bbl_vendor) {
if (use_bbl_network) {
//only show connection button for not-BBL printer
connection_btn->Hide();
//only show sync-ams button for BBL printer
@ -1270,7 +1271,7 @@ void Sidebar::update_presets(Preset::Type preset_type)
}
Preset& printer_preset = wxGetApp().preset_bundle->printers.get_edited_preset();
bool isBBL = preset_bundle.is_bbl_vendor();
bool isBBL = preset_bundle.use_bbl_network();
wxGetApp().mainframe->show_calibration_button(!isBBL);
if (auto printer_structure_opt = printer_preset.config.option<ConfigOptionEnum<PrinterStructure>>("printer_structure")) {
@ -6836,7 +6837,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->is_bbl_vendor() && new_sel == MainFrame::tpMonitor) {
if (wxGetApp().preset_bundle && wxGetApp().preset_bundle->use_bbl_network() && 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;