Don't auto-connect LAN printers on Device tab entry (#14851)

Adopt BambuStudio's load_last_machine (cloud machines only, remembered
machine preferred) and port record_user_last_machine /
get_user_last_machine. Orca's version auto-connected an arbitrary LAN
printer, starting an unrequested connection that the user's first
printer switch tore down mid-flight, which the 02.08 plugin's connect
worker does not survive. This also caused the 100% crash-on-relaunch
loop: the crashed-on printer was auto-connected at startup, so
re-selecting it always hit the same-machine disconnect+reconnect path.
This commit is contained in:
SoftFever
2026-07-21 13:15:56 +08:00
parent 8d528b2a8f
commit a5be8075e9
2 changed files with 34 additions and 12 deletions

View File

@@ -48,6 +48,9 @@ public:
MachineObject* get_selected_machine();
bool set_selected_machine(std::string dev_id);
void record_user_last_machine(const std::string& dev_id);
std::string get_user_last_machine() const;
// local machine
void set_local_selected_machine(std::string dev_id) { local_selected_machine = dev_id; };
MachineObject* get_local_selected_machine() const { return get_local_machine(local_selected_machine); }