mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-16 21:42:43 +00:00
Harden send flow and separate upload failure recovery (#111)
* fix(send): harden FT send path + IP pre-flight UX * Remove early returns
This commit is contained in:
@@ -3695,10 +3695,32 @@ void SelectMachineDialog::on_send_print()
|
||||
m_print_job->on_success([this]() { finish_mode(); });
|
||||
|
||||
m_print_job->on_check_ip_address_fail([this]() {
|
||||
wxCommandEvent* evt = new wxCommandEvent(EVT_CLEAR_IPADDRESS);
|
||||
wxQueueEvent(this, evt);
|
||||
wxGetApp().show_ip_address_enter_dialog();
|
||||
});
|
||||
// Invoked from the PrintJob worker thread when the LAN pre-flight (file upload
|
||||
// verification) fails. Marshal device/UI access to the main thread.
|
||||
CallAfter([this]()
|
||||
{
|
||||
// Reset the dialog out of sending mode so the user can retry.
|
||||
wxCommandEvent* evt = new wxCommandEvent(EVT_CLEAR_IPADDRESS);
|
||||
wxQueueEvent(this, evt);
|
||||
|
||||
DeviceManager* dev = wxGetApp().getDeviceManager();
|
||||
MachineObject* obj = dev ? dev->get_selected_machine() : nullptr;
|
||||
|
||||
if (obj && obj->is_connected())
|
||||
{
|
||||
// Connected: failed on file upload
|
||||
MessageDialog dlg(this,
|
||||
_L("Failed to upload the file to the printer's storage. Please try again."),
|
||||
_L("Send Failed"), wxOK | wxICON_ERROR);
|
||||
dlg.ShowModal();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not connected: reenter ip and access code
|
||||
wxGetApp().show_ip_address_enter_dialog();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// update ota version
|
||||
NetworkAgent* agent = wxGetApp().getAgent();
|
||||
|
||||
Reference in New Issue
Block a user