From 014fb8383b25fadafb5af2dd3e1ba24617a32adb Mon Sep 17 00:00:00 2001 From: sunwen Date: Mon, 24 Mar 2025 16:16:45 +0800 Subject: [PATCH] fix: Make scan button enabled when dms disconnected. --- src/device/DeviceManager.cpp | 1 + src/windows/MainWindow.cpp | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/device/DeviceManager.cpp b/src/device/DeviceManager.cpp index 9ad74e3..5f0fbfb 100644 --- a/src/device/DeviceManager.cpp +++ b/src/device/DeviceManager.cpp @@ -336,6 +336,7 @@ void DeviceManager::startScan(const QString& json, bool empty) DeviceStatus inf = getDeviceStatus(); if(inf == DeviceStatus::Unkonw) { + TRIGGER_EVENT(StopScanProcess, nullptr, nullptr); return; } if (inf != DeviceStatus::Rready) diff --git a/src/windows/MainWindow.cpp b/src/windows/MainWindow.cpp index 7a04b88..70b9225 100644 --- a/src/windows/MainWindow.cpp +++ b/src/windows/MainWindow.cpp @@ -86,19 +86,19 @@ MainWindow::MainWindow(QWidget* aParent) } }); - connect(DeviceManager::Default(), &DeviceManager::startAutoLocateResult, [this](bool aIsSucceed) - { - if(aIsSucceed) - { - for(int i=0; icount(); ++i) - { - if(i != mTabWidget->currentIndex()) - { - mTabWidget->setTabEnabled(i, false); - } - } - } - }); +// connect(DeviceManager::Default(), &DeviceManager::startAutoLocateResult, [this](bool aIsSucceed) +// { +// if(aIsSucceed) +// { +// for(int i=0; icount(); ++i) +// { +// if(i != mTabWidget->currentIndex()) +// { +// mTabWidget->setTabEnabled(i, false); +// } +// } +// } +// }); connect(EventCenter::Default(), &EventCenter::StopScanProcess, this, [this]() {