fix: Make scan button enabled when dms disconnected.

This commit is contained in:
sunwen
2025-03-24 16:16:45 +08:00
parent 503663a621
commit 014fb8383b
2 changed files with 14 additions and 13 deletions

View File

@@ -336,6 +336,7 @@ void DeviceManager::startScan(const QString& json, bool empty)
DeviceStatus inf = getDeviceStatus(); DeviceStatus inf = getDeviceStatus();
if(inf == DeviceStatus::Unkonw) if(inf == DeviceStatus::Unkonw)
{ {
TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
return; return;
} }
if (inf != DeviceStatus::Rready) if (inf != DeviceStatus::Rready)

View File

@@ -86,19 +86,19 @@ MainWindow::MainWindow(QWidget* aParent)
} }
}); });
connect(DeviceManager::Default(), &DeviceManager::startAutoLocateResult, [this](bool aIsSucceed) // connect(DeviceManager::Default(), &DeviceManager::startAutoLocateResult, [this](bool aIsSucceed)
{ // {
if(aIsSucceed) // if(aIsSucceed)
{ // {
for(int i=0; i<mTabWidget->count(); ++i) // for(int i=0; i<mTabWidget->count(); ++i)
{ // {
if(i != mTabWidget->currentIndex()) // if(i != mTabWidget->currentIndex())
{ // {
mTabWidget->setTabEnabled(i, false); // mTabWidget->setTabEnabled(i, false);
} // }
} // }
} // }
}); // });
connect(EventCenter::Default(), &EventCenter::StopScanProcess, this, [this]() connect(EventCenter::Default(), &EventCenter::StopScanProcess, this, [this]()
{ {