From dd8f0c4fa919c5eb899502b7ca0428bbc71b6aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Wed, 5 Jan 2022 12:13:57 +0100 Subject: [PATCH] attempt to connect at startup with empty devicelist (triggers udev info msg) --- Software/PC_Application/Device/device.cpp | 8 +++++--- Software/PC_Application/appwindow.cpp | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Software/PC_Application/Device/device.cpp b/Software/PC_Application/Device/device.cpp index 82b7f62..f97ff45 100644 --- a/Software/PC_Application/Device/device.cpp +++ b/Software/PC_Application/Device/device.cpp @@ -171,7 +171,10 @@ Device::Device(QString serial) if(!m_handle) { QString message = "No device found"; - InformationBox::ShowError("Error opening device", message); + if(!serial.isEmpty()) { + // only show error message if specific device was requested + InformationBox::ShowError("Error opening device", message); + } libusb_exit(m_context); throw std::runtime_error(message.toStdString()); return; @@ -356,8 +359,7 @@ void Device::SearchDevices(std::function message.append(libusb_strerror((libusb_error) ret)); message.append("\" On Linux this is most likely caused by a missing udev rule. " "On Windows this most likely means that you are already connected to " - "this device (is another instance of the application already runnning? " - "If that is not the case, you can try installing the WinUSB driver using Zadig (https://zadig.akeo.ie/)"); + "this device (is another instance of the application already runnning?)"); qWarning() << message; InformationBox::ShowError("Error opening device", message); } diff --git a/Software/PC_Application/appwindow.cpp b/Software/PC_Application/appwindow.cpp index dc01824..19b9e82 100644 --- a/Software/PC_Application/appwindow.cpp +++ b/Software/PC_Application/appwindow.cpp @@ -242,7 +242,8 @@ AppWindow::AppWindow(QWidget *parent) qRegisterMetaType("AmplitudeCorrection"); // List available devices - if(UpdateDeviceList() && Preferences::getInstance().Startup.ConnectToFirstDevice) { + UpdateDeviceList(); + if(Preferences::getInstance().Startup.ConnectToFirstDevice) { // at least one device available ConnectToDevice(); }