mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
pop up a warning if we can't find libftd2xx
This commit is contained in:
@@ -60,7 +60,7 @@ struct D2XXWrapper {
|
||||
const char *libname = "libftd2xx.dylib";
|
||||
handle = dlopen(libname, RTLD_NOW);
|
||||
if (!handle) {
|
||||
error = QString("couldn't load library ") + libname;
|
||||
error = QString("Couldn't load library ") + libname + ".";
|
||||
return false;
|
||||
}
|
||||
LOAD_SYM(FP_OpenEx, open_ex, "FT_OpenEx");
|
||||
|
||||
@@ -37,13 +37,10 @@ Device::listDevices(QString &err)
|
||||
QVector<DevicePtr> result;
|
||||
for (int i = 0; listFunctions && i < listFunctions->size(); ++i) {
|
||||
QVector<DevicePtr> tmp = (*listFunctions)[i](err);
|
||||
if (err == "") {
|
||||
for (int j = 0; j < tmp.size(); ++j)
|
||||
result.append(tmp[j]);
|
||||
}
|
||||
else {
|
||||
if (err == "")
|
||||
result << tmp;
|
||||
else
|
||||
err += "\n";
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -101,6 +101,12 @@ DownloadRideDialog::scanDevices()
|
||||
listWidget->clear();
|
||||
QString err;
|
||||
devList = Device::listDevices(err);
|
||||
if (err != "") {
|
||||
QString msg = "Warning:\n\n" + err + "You may need to (re)install "
|
||||
"the FTDI drivers before downloading.";
|
||||
QMessageBox::warning(0, "Error Loading Device Drivers", msg,
|
||||
QMessageBox::Ok, QMessageBox::NoButton);
|
||||
}
|
||||
for (int i = 0; i < devList.size(); ++i)
|
||||
new QListWidgetItem(devList[i]->name(), listWidget);
|
||||
if (listWidget->count() > 0) {
|
||||
|
||||
Reference in New Issue
Block a user