From 4c0d18b5f4b2ada416d75efb61e125a7df30022d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Tue, 31 Oct 2023 13:28:59 +0100 Subject: [PATCH] ignore other devices on startup when device serial specified --- Software/PC_Application/LibreVNA-GUI/appwindow.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Software/PC_Application/LibreVNA-GUI/appwindow.cpp b/Software/PC_Application/LibreVNA-GUI/appwindow.cpp index 720ceef..a358019 100644 --- a/Software/PC_Application/LibreVNA-GUI/appwindow.cpp +++ b/Software/PC_Application/LibreVNA-GUI/appwindow.cpp @@ -354,6 +354,7 @@ bool AppWindow::ConnectToDevice(QString serial, DeviceDriver *driver) device = d; } else { disconnect(d, nullptr, this, nullptr); + UpdateDeviceList(); break; } } @@ -999,6 +1000,10 @@ int AppWindow::UpdateDeviceList() DeviceEntry e; e.driver = driver; e.serial = serial; + if(!parser.value("device").isEmpty() && parser.value("device") != e.serial) { + // specified device does not match, ignore + continue; + } deviceList.push_back(e); } } @@ -1014,10 +1019,6 @@ int AppWindow::UpdateDeviceList() int available = 0; bool found = false; for(auto d : deviceList) { - if(!parser.value("device").isEmpty() && parser.value("device") != d.serial) { - // specified device does not match, ignore - continue; - } auto connectAction = ui->menuConnect_to->addAction(d.toString()); connectAction->setCheckable(true); connectAction->setActionGroup(deviceActionGroup);