refactor: keep the gs_usb option out of non-Windows builds
The radio button was only disabled elsewhere, which advertised a connection type that platform can never offer. Hide it instead, and guard the gs_usb.h include so nothing outside Windows reaches for it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XZnuZJ7zc3e8hk6C8bGDZN
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
#include "lawicel_serial.h"
|
||||
#include "canserver.h"
|
||||
#include "canlogserver.h"
|
||||
#ifdef Q_OS_WIN
|
||||
#include "gs_usb.h"
|
||||
#endif
|
||||
|
||||
using namespace CANCon;
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ NewConnectionDialog::NewConnectionDialog(QVector<QString>* gvretips, QVector<QSt
|
||||
connect(ui->rbGSUSB, &QAbstractButton::clicked, this, &NewConnectionDialog::handleConnTypeChanged);
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
//on Linux and macOS the kernel gs_usb driver already exposes these devices as SocketCAN
|
||||
ui->rbGSUSB->setEnabled(false);
|
||||
ui->rbGSUSB->setToolTip("Connect gs_usb devices through SocketCAN on this platform");
|
||||
//on Linux and macOS the kernel gs_usb driver already exposes these devices as SocketCAN,
|
||||
//so there is nothing here to offer and the option is left out entirely
|
||||
ui->rbGSUSB->setVisible(false);
|
||||
#endif
|
||||
|
||||
connect(ui->cbDeviceType, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &NewConnectionDialog::handleDeviceTypeChanged);
|
||||
|
||||
Reference in New Issue
Block a user