attempt to connect at startup with empty devicelist (triggers udev info msg)
This commit is contained in:
parent
1194894a12
commit
dd8f0c4fa9
@ -171,7 +171,10 @@ Device::Device(QString serial)
|
|||||||
|
|
||||||
if(!m_handle) {
|
if(!m_handle) {
|
||||||
QString message = "No device found";
|
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);
|
libusb_exit(m_context);
|
||||||
throw std::runtime_error(message.toStdString());
|
throw std::runtime_error(message.toStdString());
|
||||||
return;
|
return;
|
||||||
@ -356,8 +359,7 @@ void Device::SearchDevices(std::function<bool (libusb_device_handle *, QString)>
|
|||||||
message.append(libusb_strerror((libusb_error) ret));
|
message.append(libusb_strerror((libusb_error) ret));
|
||||||
message.append("\" On Linux this is most likely caused by a missing udev rule. "
|
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 "
|
"On Windows this most likely means that you are already connected to "
|
||||||
"this device (is another instance of the application already runnning? "
|
"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/)");
|
|
||||||
qWarning() << message;
|
qWarning() << message;
|
||||||
InformationBox::ShowError("Error opening device", message);
|
InformationBox::ShowError("Error opening device", message);
|
||||||
}
|
}
|
||||||
|
@ -242,7 +242,8 @@ AppWindow::AppWindow(QWidget *parent)
|
|||||||
qRegisterMetaType<Protocol::AmplitudeCorrectionPoint>("AmplitudeCorrection");
|
qRegisterMetaType<Protocol::AmplitudeCorrectionPoint>("AmplitudeCorrection");
|
||||||
|
|
||||||
// List available devices
|
// List available devices
|
||||||
if(UpdateDeviceList() && Preferences::getInstance().Startup.ConnectToFirstDevice) {
|
UpdateDeviceList();
|
||||||
|
if(Preferences::getInstance().Startup.ConnectToFirstDevice) {
|
||||||
// at least one device available
|
// at least one device available
|
||||||
ConnectToDevice();
|
ConnectToDevice();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user