From c8a8d9f19758a33d713054eb93cd5084b38ac26a Mon Sep 17 00:00:00 2001 From: tao wang Date: Wed, 6 Nov 2024 11:39:41 +0800 Subject: [PATCH] FIX:fixed that macOS will hang up as direct connected device jira:[STUDIO-8630] Change-Id: I96562bd11de807435fc6a2d81501800b0cf110b1 --- src/slic3r/GUI/ReleaseNote.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/ReleaseNote.cpp b/src/slic3r/GUI/ReleaseNote.cpp index 5fc809bb8..888ba35f6 100644 --- a/src/slic3r/GUI/ReleaseNote.cpp +++ b/src/slic3r/GUI/ReleaseNote.cpp @@ -1874,8 +1874,7 @@ void InputIpAddressDialog::on_ok(wxMouseEvent& evt) Refresh(); Layout(); Fit(); - - m_thread = new boost::thread(boost::bind(&InputIpAddressDialog::workerThreadFunc, this, str_ip, str_access_code, str_sn, str_model_id)); + m_thread = new boost::thread(boost::bind(&InputIpAddressDialog::workerThreadFunc, this, str_ip, str_access_code, str_sn, str_model_id)); } void InputIpAddressDialog::update_test_msg_event(wxCommandEvent& evt) @@ -1903,7 +1902,13 @@ void InputIpAddressDialog::workerThreadFunc(std::string str_ip, std::string str_ detectResult detectData; auto result = -1; if (current_input_index == 0) { + +#ifdef __APPLE__ + result = -3; +#else result = wxGetApp().getAgent()->bind_detect(str_ip, "secure", detectData); +#endif + } else { result = 0; detectData.dev_name = sn; @@ -1955,8 +1960,13 @@ void InputIpAddressDialog::workerThreadFunc(std::string str_ip, std::string str_ post_update_test_msg(wxEmptyString, true); post_update_test_msg(wxString::Format(_L("Connecting to printer... The dialog will close later"), closeCount), true); - + +#ifdef __APPLE__ + wxCommandEvent event(EVT_CLOSE_IPADDRESS_DLG); + wxPostEvent(this, event); +#else closeTimer->Start(1000); +#endif } void InputIpAddressDialog::OnTimer(wxTimerEvent& event) {