From 0fb87f05b146aea4124c4b4941fc9960472625f7 Mon Sep 17 00:00:00 2001 From: Lam Wei Lun Date: Wed, 9 Sep 2026 18:05:49 +0800 Subject: [PATCH] Remove printer connect/disconnect for now --- src/slic3r/GUI/NativeCommands.cpp | 16 ---------------- src/slic3r/GUI/Plater.cpp | 19 ------------------- src/slic3r/GUI/Plater.hpp | 3 --- 3 files changed, 38 deletions(-) diff --git a/src/slic3r/GUI/NativeCommands.cpp b/src/slic3r/GUI/NativeCommands.cpp index 94edd4898e..d0dfc78086 100644 --- a/src/slic3r/GUI/NativeCommands.cpp +++ b/src/slic3r/GUI/NativeCommands.cpp @@ -389,22 +389,6 @@ std::vector build_command_catalog() }); // ---- Printer / device connection ---- - add("connect_printer", _u8L("Connect Printer"), _u8L("Printer"), [](const std::string&) { - if (Plater* plater = wxGetApp().plater()) - plater->connect_to_printer(); - return AppActionRunResult{AppActionRunResult::Level::Success}; - }); - add("disconnect_printer", _u8L("Disconnect Printer"), _u8L("Printer"), [](const std::string&) { - DeviceManager* dev = wxGetApp().getDeviceManager(); - if (!dev) - return AppActionRunResult{AppActionRunResult::Level::Info, _L("Printer connection is unavailable.")}; - if (MachineObject* machine = dev->get_selected_machine()) { - machine->disconnect(); - dev->set_selected_machine(""); - return AppActionRunResult{AppActionRunResult::Level::Success}; - } - return AppActionRunResult{AppActionRunResult::Level::Info, _L("Printer is not connected.")}; - }); add("sync_ams", _u8L("Synchronize Filament List from AMS"), _u8L("Printer"), [](const std::string&) { Plater* plater = wxGetApp().plater(); DeviceManager* dev = wxGetApp().getDeviceManager(); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index a6478097f7..c525896d0b 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -7138,7 +7138,6 @@ struct Plater::priv void on_action_publish(wxCommandEvent &evt); void on_action_print_plate(SimpleEvent&); void open_machine_select_dialog(int plate_idx, PrintFromType print_type = PrintFromType::FROM_NORMAL); - void connect_to_printer(); void on_action_print_all(SimpleEvent&); void on_action_export_gcode(SimpleEvent&); void on_action_send_gcode(SimpleEvent&); @@ -12729,22 +12728,6 @@ void Plater::priv::open_machine_select_dialog(int plate_idx, PrintFromType print m_select_machine_dlg->ShowModal(); } -void Plater::priv::connect_to_printer() -{ - // BBL network (vendor BBL, not print-host) and printer-agents mode surface the real - // machine picker (lists discovered printers, connects on selection). Everything else - // is a print-host printer: the Connection button's dialog (host/API-key config). - PresetBundle* pb = wxGetApp().preset_bundle; - const bool bbl_or_agent = (pb && pb->use_bbl_network()) || - wxGetApp().app_config->get_bool("use_printer_agents"); - if (bbl_or_agent) - open_machine_select_dialog(q->get_partplate_list().get_curr_plate_index()); - else { - PhysicalPrinterDialog dlg(q->GetParent()); - dlg.ShowModal(); - } -} - void Plater::priv::on_action_send_to_multi_machine(SimpleEvent&) { if (!m_send_multi_dlg) @@ -17528,8 +17511,6 @@ Sidebar::DockingState Plater::get_sidebar_docking_state() const { return p->get_ void Plater::reset_window_layout() { p->reset_window_layout(); } -void Plater::connect_to_printer() { p->connect_to_printer(); } - //BBS void Plater::select_curr_plate_all() { p->select_curr_plate_all(); } void Plater::remove_curr_plate_all() { p->remove_curr_plate_all(); } diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index e8264cf417..fd190d3832 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -354,9 +354,6 @@ public: void add_file(); // Returns false when no object was added (e.g. the user cancelled the load dialog). bool add_model(bool imperial_units = false, std::string fname = ""); - // Opens the connection/management dialog appropriate for the current printer's - // technology: the machine picker for BBL/printer-agents, the print-host dialog otherwise. - void connect_to_printer(); void import_zip_archive(); void import_sl1_archive(); void extract_config_from_project();