ENH:Modify the sending logic to ensure that in public network mode, the fallback route is FTP

jira:[none]

Change-Id: I88c3f89960dfc9492e305f7cff0692590078f62c
(cherry picked from commit fe5814e81f7d0248a101fada0b03ecb039bbb88b)
This commit is contained in:
milk
2025-05-19 14:55:04 +08:00
committed by Noisyfox
parent 9be6e5deec
commit 766c1aa9d7

View File

@@ -880,10 +880,12 @@ void SendToPrinterDialog::on_ok(wxCommandEvent &event)
file_name = default_output_file_path.filename().string();
}*/
if ((!obj_->is_lan_mode_printer() && obj_->is_support_brtc) || m_tcp_try_connect) {
if ( ( (!obj_->is_lan_mode_printer() && obj_->is_support_brtc) || m_tcp_try_connect) && (!m_ftp_try_connect) ) {
update_print_status_msg(wxEmptyString, false, false);
if (m_file_sys) {
PrintPrepareData print_data;
m_plater->get_print_job_data(&print_data);
std::string project_name = m_current_project_name.utf8_string() + ".3mf";
@@ -941,7 +943,7 @@ void SendToPrinterDialog::on_ok(wxCommandEvent &event)
m_connect_try_times++;
},
m_task_timer->GetId());
m_task_timer->StartOnce(timeout_period);
m_task_timer->StartOnce(timeout_period);
}
else {
BOOST_LOG_TRIVIAL(error) << "SendToPrinter::send job: The printer media capability set is incorrect.";
@@ -1300,7 +1302,7 @@ void SendToPrinterDialog::update_show_status()
m_file_sys->Stop(true);
m_file_sys.reset();
}
BOOST_LOG_TRIVIAL(info) << "m_ftp_try_connect is " << m_ftp_try_connect;
BOOST_LOG_TRIVIAL(info) << "m_ftp_try_connect is" << m_ftp_try_connect;
// add log
show_status(PrintDialogStatus::PrintStatusReadingFinished);