mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 01:37:53 -06:00
ENH:[STUDIO-3435]fixed crash after LAN mode printer connection
Change-Id: I12cb917895b428176e110c893acaaa6ad6de94fe
This commit is contained in:
parent
145d7a4f8e
commit
de45d83276
1 changed files with 10 additions and 5 deletions
|
@ -1409,8 +1409,11 @@ void SelectMachineDialog::init_bind()
|
||||||
if (e.GetInt() == 0) {
|
if (e.GetInt() == 0) {
|
||||||
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||||
if (!dev) return;
|
if (!dev) return;
|
||||||
if (dev->get_selected_machine()->dev_id == e.GetString()) {
|
MachineObject* obj = dev->get_selected_machine();
|
||||||
m_comboBox_printer->SetValue(dev->get_selected_machine()->dev_name + "(LAN)");
|
if (!obj) return;
|
||||||
|
|
||||||
|
if (obj->dev_id == e.GetString()) {
|
||||||
|
m_comboBox_printer->SetValue(obj->dev_name + "(LAN)");
|
||||||
}
|
}
|
||||||
}else if(e.GetInt() == 1){
|
}else if(e.GetInt() == 1){
|
||||||
on_send_print();
|
on_send_print();
|
||||||
|
@ -1429,11 +1432,13 @@ void SelectMachineDialog::init_bind()
|
||||||
if (!dev) return;
|
if (!dev) return;
|
||||||
ConnectPrinterDialog dlg(wxGetApp().mainframe, wxID_ANY, _L("Input access code"));
|
ConnectPrinterDialog dlg(wxGetApp().mainframe, wxID_ANY, _L("Input access code"));
|
||||||
dlg.go_connect_printer(false);
|
dlg.go_connect_printer(false);
|
||||||
|
if (dev->get_selected_machine()) {
|
||||||
dlg.set_machine_object(dev->get_selected_machine());
|
dlg.set_machine_object(dev->get_selected_machine());
|
||||||
if (dlg.ShowModal() == wxID_OK) {
|
if (dlg.ShowModal() == wxID_OK) {
|
||||||
this->connect_printer_mqtt();
|
this->connect_printer_mqtt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
m_bitmap_last_plate->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
|
m_bitmap_last_plate->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue