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:
Refuhr
2026-07-29 16:16:45 +02:00
co-authored by Claude Opus 5
parent cefe1f7211
commit 1f1861485d
2 changed files with 5 additions and 3 deletions
+2
View File
@@ -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;
+3 -3
View File
@@ -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);