diff --git a/Software/src/LedDeviceAdalight.cpp b/Software/src/LedDeviceAdalight.cpp index ea3fa17c..0fb53a81 100644 --- a/Software/src/LedDeviceAdalight.cpp +++ b/Software/src/LedDeviceAdalight.cpp @@ -202,6 +202,13 @@ void LedDeviceAdalight::updateDeviceSettings() AbstractLedDevice::updateDeviceSettings(); } +void LedDeviceAdalight::setSerialPortSettings(const QString &portName, int baudRate) +{ + DEBUG_LOW_LEVEL << Q_FUNC_INFO << portName << baudRate; + m_portName = portName; + m_baudRate = baudRate; +} + void LedDeviceAdalight::open() { DEBUG_LOW_LEVEL << Q_FUNC_INFO << sender(); diff --git a/Software/src/LedDeviceAdalight.hpp b/Software/src/LedDeviceAdalight.hpp index 6ecb6d72..0faf1b44 100644 --- a/Software/src/LedDeviceAdalight.hpp +++ b/Software/src/LedDeviceAdalight.hpp @@ -42,6 +42,8 @@ class LedDeviceAdalight : public AbstractLedDevice public slots: void open(); + // Takes effect on the next open() + void setSerialPortSettings(const QString &portName, int baudRate); void close(); void setColors(const QList & /*colors*/); void switchOffLeds(); diff --git a/Software/src/LedDeviceArdulight.cpp b/Software/src/LedDeviceArdulight.cpp index bf480e02..c00f9b48 100644 --- a/Software/src/LedDeviceArdulight.cpp +++ b/Software/src/LedDeviceArdulight.cpp @@ -207,6 +207,13 @@ void LedDeviceArdulight::updateDeviceSettings() AbstractLedDevice::updateDeviceSettings(); } +void LedDeviceArdulight::setSerialPortSettings(const QString &portName, int baudRate) +{ + DEBUG_LOW_LEVEL << Q_FUNC_INFO << portName << baudRate; + m_portName = portName; + m_baudRate = baudRate; +} + void LedDeviceArdulight::open() { DEBUG_LOW_LEVEL << Q_FUNC_INFO; diff --git a/Software/src/LedDeviceArdulight.hpp b/Software/src/LedDeviceArdulight.hpp index a7f0e5a8..e8f5997f 100644 --- a/Software/src/LedDeviceArdulight.hpp +++ b/Software/src/LedDeviceArdulight.hpp @@ -42,6 +42,8 @@ class LedDeviceArdulight : public AbstractLedDevice public slots: void open(); + // Takes effect on the next open() + void setSerialPortSettings(const QString &portName, int baudRate); void close(); void setColors(const QList & /*colors*/); void switchOffLeds(); diff --git a/Software/src/LedDeviceManager.cpp b/Software/src/LedDeviceManager.cpp index ef1f922c..734ed8f4 100644 --- a/Software/src/LedDeviceManager.cpp +++ b/Software/src/LedDeviceManager.cpp @@ -132,6 +132,40 @@ void LedDeviceManager::recreateLedDevice() initLedDevice(); } +void LedDeviceManager::updateSerialPortSettings() +{ + DEBUG_LOW_LEVEL << Q_FUNC_INFO; + + if (m_isSerialPortUpdatePending) + return; + m_isSerialPortUpdatePending = true; + QMetaObject::invokeMethod(this, "applySerialPortSettings", Qt::QueuedConnection); +} + +void LedDeviceManager::applySerialPortSettings() +{ + DEBUG_LOW_LEVEL << Q_FUNC_INFO; + + m_isSerialPortUpdatePending = false; + + // Devices are cached per type and get their port when created, so update the + // cached instances. Queued to the device thread ahead of the close/open below. + if (AbstractLedDevice *adalight = m_ledDevices[SupportedDevices::DeviceTypeAdalight]) + QMetaObject::invokeMethod(adalight, "setSerialPortSettings", Qt::QueuedConnection, + Q_ARG(QString, Settings::getAdalightSerialPortName()), + Q_ARG(int, Settings::getAdalightSerialPortBaudRate())); + if (AbstractLedDevice *ardulight = m_ledDevices[SupportedDevices::DeviceTypeArdulight]) + QMetaObject::invokeMethod(ardulight, "setSerialPortSettings", Qt::QueuedConnection, + Q_ARG(QString, Settings::getArdulightSerialPortName()), + Q_ARG(int, Settings::getArdulightSerialPortBaudRate())); + + // While sleeping the device is reopened with the new settings on wake-up + if (Settings::isConnectedDeviceUsesSerialPort() && !m_isSleeping) { + m_failedCreationAttempts = 0; + recreateLedDevice(); + } +} + void LedDeviceManager::switchOnLeds() { DEBUG_LOW_LEVEL << Q_FUNC_INFO; diff --git a/Software/src/LedDeviceManager.hpp b/Software/src/LedDeviceManager.hpp index fafcb01f..9847c7dd 100644 --- a/Software/src/LedDeviceManager.hpp +++ b/Software/src/LedDeviceManager.hpp @@ -79,6 +79,9 @@ public slots: void init(); void recreateLedDevice(); + // Pushes the configured serial port / baud rate to the serial devices and reconnects. + // Several calls in a row are coalesced into one reconnect. + void updateSerialPortSettings(); // This slots are protected from the overflow of queries void setColors(const QList & colors); @@ -101,6 +104,7 @@ public slots: void onSessionChange(SystemSession::Status status); private slots: + void applySerialPortSettings(); void ledDeviceCommandCompleted(bool ok); void ledDeviceCommandTimedOut(); void ledDeviceOpenTimedOut(); @@ -140,6 +144,7 @@ private slots: QHash m_pendingOpens; int m_consecutiveOpenTimeouts{ 0 }; bool m_isSleeping{ false }; + bool m_isSerialPortUpdatePending{ false }; bool m_isLastCommandCompleted{ true }; bool m_isColorsSaved{ false }; bool m_firmwareVersionRequested{ false }; diff --git a/Software/src/LightpackApplication.cpp b/Software/src/LightpackApplication.cpp index a76bc6a8..00c1a6db 100644 --- a/Software/src/LightpackApplication.cpp +++ b/Software/src/LightpackApplication.cpp @@ -735,6 +735,10 @@ void LightpackApplication::startLedDeviceManager() connect(settings(), &Settings::ledCoefBlueChanged, m_ledDeviceManager, &LedDeviceManager::updateWBAdjustments, Qt::QueuedConnection); connect(settings(), &Settings::ledCoefRedChanged, m_ledDeviceManager, &LedDeviceManager::updateWBAdjustments, Qt::QueuedConnection); connect(settings(), &Settings::ledCoefGreenChanged, m_ledDeviceManager, &LedDeviceManager::updateWBAdjustments, Qt::QueuedConnection); + connect(settings(), &Settings::adalightSerialPortNameChanged, m_ledDeviceManager, &LedDeviceManager::updateSerialPortSettings, Qt::QueuedConnection); + connect(settings(), &Settings::adalightSerialPortBaudRateChanged, m_ledDeviceManager, &LedDeviceManager::updateSerialPortSettings, Qt::QueuedConnection); + connect(settings(), &Settings::ardulightSerialPortNameChanged, m_ledDeviceManager, &LedDeviceManager::updateSerialPortSettings, Qt::QueuedConnection); + connect(settings(), &Settings::ardulightSerialPortBaudRateChanged, m_ledDeviceManager, &LedDeviceManager::updateSerialPortSettings, Qt::QueuedConnection); if (!m_noGui) diff --git a/Software/src/SerialPortComboHelper.cpp b/Software/src/SerialPortComboHelper.cpp new file mode 100644 index 00000000..8e94d908 --- /dev/null +++ b/Software/src/SerialPortComboHelper.cpp @@ -0,0 +1,110 @@ +/* + * SerialPortComboHelper.cpp + * + * Project: Prismatik + * + * Prismatik is a free, open-source software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License as published + * by the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * Prismatik and Lightpack files is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "SerialPortComboHelper.hpp" + +#include +#include +#include +#include +#include +#include + +namespace SerialPortComboHelper +{ + +void populate(QComboBox *comboBox, const QString &preferredPort, const bool preferredIsDefault) +{ + QList ports = QSerialPortInfo::availablePorts(); + + // USB serial adapters (Arduino, CH340, FTDI, CP210x...) first, then by port name in natural order (COM2 < COM10) + QCollator collator; + collator.setNumericMode(true); + collator.setCaseSensitivity(Qt::CaseInsensitive); + std::sort(ports.begin(), ports.end(), [&collator](const QSerialPortInfo &a, const QSerialPortInfo &b) { + if (a.hasVendorIdentifier() != b.hasVendorIdentifier()) + return a.hasVendorIdentifier(); + return collator.compare(a.portName(), b.portName()) < 0; + }); + + const QSignalBlocker blocker(comboBox); + comboBox->clear(); + + int preferredIdx = -1; + int firstUsbIdx = -1; + for (const QSerialPortInfo &port : std::as_const(ports)) { + const QString description = port.description().isEmpty() ? port.manufacturer() : port.description(); + const QString label = description.isEmpty() ? port.portName() : port.portName() + QStringLiteral(" - ") + description; + + QStringList tooltip; + tooltip << port.systemLocation(); + if (!port.manufacturer().isEmpty()) + tooltip << port.manufacturer(); + if (port.hasVendorIdentifier() && port.hasProductIdentifier()) + tooltip << QStringLiteral("VID:PID %1:%2") + .arg(port.vendorIdentifier(), 4, 16, QLatin1Char('0')) + .arg(port.productIdentifier(), 4, 16, QLatin1Char('0')).toUpper(); + + const int idx = comboBox->count(); + comboBox->addItem(label, port.portName()); + comboBox->setItemData(idx, tooltip.join(QLatin1Char('\n')), Qt::ToolTipRole); + + if (preferredIdx < 0 && port.portName().compare(preferredPort, Qt::CaseInsensitive) == 0) + preferredIdx = idx; + if (firstUsbIdx < 0 && port.hasVendorIdentifier()) + firstUsbIdx = idx; + } + + // Keep the configured port if it is connected, unless it is just the built-in default + // and a USB serial adapter is present. If the configured port is gone (e.g. the device + // was re-plugged and got a new number), pick the first USB serial adapter instead. + if (preferredIdx >= 0 && !(preferredIsDefault && firstUsbIdx >= 0)) + comboBox->setCurrentIndex(preferredIdx); + else if (firstUsbIdx >= 0) + comboBox->setCurrentIndex(firstUsbIdx); + else if (!preferredPort.isEmpty()) + selectPortName(comboBox, preferredPort); + else if (comboBox->count() > 0) + comboBox->setCurrentIndex(0); +} + +QString selectedPortName(const QComboBox *comboBox) +{ + const QString text = comboBox->currentText().trimmed(); + // A detected port is shown as "COM5 - USB-SERIAL CH340"; its port name is in the item data. + // Anything else was typed by hand and is used as-is. + const int idx = comboBox->findText(text); + if (idx >= 0) + return comboBox->itemData(idx).toString(); + return text; +} + +void selectPortName(QComboBox *comboBox, const QString &portName) +{ + const int idx = comboBox->findData(portName); + if (idx >= 0) { + comboBox->setCurrentIndex(idx); + } else { + comboBox->setCurrentIndex(-1); + comboBox->setEditText(portName); + } +} + +} // namespace SerialPortComboHelper diff --git a/Software/src/SerialPortComboHelper.hpp b/Software/src/SerialPortComboHelper.hpp new file mode 100644 index 00000000..e650a8ca --- /dev/null +++ b/Software/src/SerialPortComboHelper.hpp @@ -0,0 +1,43 @@ +/* + * SerialPortComboHelper.hpp + * + * Project: Prismatik + * + * Prismatik is a free, open-source software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License as published + * by the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * Prismatik and Lightpack files is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include + +class QComboBox; + +// Fills an (editable) QComboBox with the detected serial ports, labelled with +// their description (e.g. "COM5 - USB-SERIAL CH340"), keeping the bare port +// name in the item data. A port name typed by hand is also accepted. +namespace SerialPortComboHelper +{ + // Rescans the ports and selects one: the preferred port if it is connected + // (unless it is only the built-in default and a USB serial adapter is present), + // otherwise the first USB serial adapter, otherwise the preferred port as text. + // Emits no signals from the combo box. + void populate(QComboBox *comboBox, const QString &preferredPort, bool preferredIsDefault); + + // The port name for the current selection or typed text. + QString selectedPortName(const QComboBox *comboBox); + + // Selects the item for portName, or shows it as typed text if not detected. + void selectPortName(QComboBox *comboBox, const QString &portName); +} diff --git a/Software/src/SettingsWindow.cpp b/Software/src/SettingsWindow.cpp index 84473eab..d6f95df7 100644 --- a/Software/src/SettingsWindow.cpp +++ b/Software/src/SettingsWindow.cpp @@ -33,6 +33,7 @@ #include "ui_SettingsWindow.h" #include "Settings.hpp" +#include "SerialPortComboHelper.hpp" #include "ColorButton.hpp" #include "LedDeviceManager.hpp" #include "enums.hpp" @@ -276,6 +277,10 @@ void SettingsWindow::connectSignalsSlots() connect(ui->checkBox_SendDataOnlyIfColorsChanges, &QCheckBox::toggled, this, &SettingsWindow::onDeviceSendDataOnlyIfColorsChanged_toggled); connect(ui->pbRunConfigurationWizard, &QPushButton::clicked, this, &SettingsWindow::onRunConfigurationWizard_clicked); + connect(ui->toolButton_RefreshSerialPorts, &QToolButton::clicked, this, &SettingsWindow::onRefreshSerialPorts_clicked); + connect(ui->comboBox_SerialPort, qOverload(&QComboBox::activated), this, &SettingsWindow::onSerialPort_changed); + connect(ui->comboBox_SerialPort->lineEdit(), &QLineEdit::editingFinished, this, &SettingsWindow::onSerialPort_changed); + connect(ui->comboBox_SerialBaudRate, qOverload(&QComboBox::activated), this, &SettingsWindow::onSerialBaudRate_changed); // Open Settings file connect(ui->commandLinkButton_OpenSettings, &QCommandLinkButton::clicked, this, &SettingsWindow::openCurrentProfile); @@ -463,7 +468,84 @@ void SettingsWindow::updateDeviceTabWidgetsVisibility() break; } setDeviceTabWidgetsVisibility(DeviceTab::Lightpack); + updateSerialPortWidgets(); +} +void SettingsWindow::updateSerialPortWidgets() +{ + DEBUG_LOW_LEVEL << Q_FUNC_INFO; + + const SupportedDevices::DeviceType connectedDevice = Settings::getConnectedDevice(); + const bool usesSerialPort = Settings::isConnectedDeviceUsesSerialPort(); + ui->groupBox_SerialPort->setVisible(usesSerialPort); + if (!usesSerialPort) + return; + + const bool isAdalight = connectedDevice == SupportedDevices::DeviceTypeAdalight; + const QString portName = isAdalight ? Settings::getAdalightSerialPortName() : Settings::getArdulightSerialPortName(); + const QString baudRate = QString::number(isAdalight ? Settings::getAdalightSerialPortBaudRate() : Settings::getArdulightSerialPortBaudRate()); + + // Show what is configured; don't auto-pick another port here, the user decides + SerialPortComboHelper::populate(ui->comboBox_SerialPort, portName, false); + if (SerialPortComboHelper::selectedPortName(ui->comboBox_SerialPort) != portName) + SerialPortComboHelper::selectPortName(ui->comboBox_SerialPort, portName); + + const QSignalBlocker blocker(ui->comboBox_SerialBaudRate); + ui->comboBox_SerialBaudRate->clear(); + ui->comboBox_SerialBaudRate->addItems(Settings::getSupportedSerialPortBaudRates()); + if (ui->comboBox_SerialBaudRate->findText(baudRate) < 0) + ui->comboBox_SerialBaudRate->addItem(baudRate); + ui->comboBox_SerialBaudRate->setCurrentText(baudRate); +} + +void SettingsWindow::onRefreshSerialPorts_clicked() +{ + DEBUG_LOW_LEVEL << Q_FUNC_INFO; + + // Keep the current choice if it is still there; otherwise this may pick a USB adapter, + // which is applied right away like a manual selection + SerialPortComboHelper::populate(ui->comboBox_SerialPort, SerialPortComboHelper::selectedPortName(ui->comboBox_SerialPort), false); + onSerialPort_changed(); +} + +void SettingsWindow::onSerialPort_changed() +{ + const QString portName = SerialPortComboHelper::selectedPortName(ui->comboBox_SerialPort); + if (portName.isEmpty()) + return; + + switch (Settings::getConnectedDevice()) { + case SupportedDevices::DeviceTypeAdalight: + if (portName != Settings::getAdalightSerialPortName()) + Settings::setAdalightSerialPortName(portName); + break; + case SupportedDevices::DeviceTypeArdulight: + if (portName != Settings::getArdulightSerialPortName()) + Settings::setArdulightSerialPortName(portName); + break; + default: + break; + } +} + +void SettingsWindow::onSerialBaudRate_changed(int index) +{ + const QString baudRate = ui->comboBox_SerialBaudRate->itemText(index); + if (baudRate.toInt() <= 0) + return; + + switch (Settings::getConnectedDevice()) { + case SupportedDevices::DeviceTypeAdalight: + if (baudRate.toInt() != Settings::getAdalightSerialPortBaudRate()) + Settings::setAdalightSerialPortBaudRate(baudRate); + break; + case SupportedDevices::DeviceTypeArdulight: + if (baudRate.toInt() != Settings::getArdulightSerialPortBaudRate()) + Settings::setArdulightSerialPortBaudRate(baudRate); + break; + default: + break; + } } void SettingsWindow::setDeviceTabWidgetsVisibility(DeviceTab::Options options) diff --git a/Software/src/SettingsWindow.hpp b/Software/src/SettingsWindow.hpp index a9023669..b8b5840b 100644 --- a/Software/src/SettingsWindow.hpp +++ b/Software/src/SettingsWindow.hpp @@ -239,6 +239,9 @@ private slots: void onKeepLightsAfterScreenOff_Toggled(bool isEnabled); void onRunConfigurationWizard_clicked(); + void onRefreshSerialPorts_clicked(); + void onSerialPort_changed(); + void onSerialBaudRate_changed(int index); void onCheckBox_checkForUpdates_Toggled(bool isEnabled); void onCheckBox_installUpdates_Toggled(bool isEnabled); @@ -247,6 +250,7 @@ private slots: private: void updateDeviceTabWidgetsVisibility(); + void updateSerialPortWidgets(); void setDeviceTabWidgetsVisibility(DeviceTab::Options options); void syncLedDeviceWithSettingsWindow(); int getLigtpackFirmwareVersionMajor(); diff --git a/Software/src/SettingsWindow.ui b/Software/src/SettingsWindow.ui index 49cd9e6e..1f5d2dc6 100644 --- a/Software/src/SettingsWindow.ui +++ b/Software/src/SettingsWindow.ui @@ -1494,6 +1494,65 @@ Internally emulates the effects of f.lux, redshift, Night Light, Night Shift...< + + + + Serial device + + + + + + Serial port: + + + + + + + + 0 + 0 + + + + Detected serial ports. You can also type a port name manually. Changes apply immediately. + + + true + + + QComboBox::NoInsert + + + + + + + Rescan serial ports + + + Refresh + + + + + + + Baud rate: + + + + + + + Must match the baud rate of your device's firmware. + + + + + + diff --git a/Software/src/src.pro b/Software/src/src.pro index 6f323aab..a0b1b2e5 100644 --- a/Software/src/src.pro +++ b/Software/src/src.pro @@ -265,6 +265,7 @@ SOURCES += \ LightpackApplication.cpp main.cpp SettingsWindow.cpp Settings.cpp \ GrabWidget.cpp GrabConfigWidget.cpp \ LogWriter.cpp \ + SerialPortComboHelper.cpp \ LedDeviceLightpack.cpp \ LedDeviceAdalight.cpp \ LedDeviceArdulight.cpp \ @@ -309,6 +310,7 @@ HEADERS += \ SettingsWindow.hpp \ Settings.hpp \ SettingsDefaults.hpp \ + SerialPortComboHelper.hpp \ version.h \ TimeEvaluations.hpp \ GrabManager.hpp \ diff --git a/Software/src/wizard/ConfigureDevicePage.cpp b/Software/src/wizard/ConfigureDevicePage.cpp index e92c575e..cde13dae 100644 --- a/Software/src/wizard/ConfigureDevicePage.cpp +++ b/Software/src/wizard/ConfigureDevicePage.cpp @@ -29,6 +29,7 @@ #include "ConfigureDevicePage.hpp" #include "ui_ConfigureDevicePage.h" #include "Settings.hpp" +#include "SerialPortComboHelper.hpp" #include "LedDeviceArdulight.hpp" #include "LedDeviceAdalight.hpp" #include "LedDeviceVirtual.hpp" @@ -42,6 +43,30 @@ ConfigureDevicePage::ConfigureDevicePage(bool isInitFromSettings, TransientSetti ui(new Ui::ConfigureDevicePage) { ui->setupUi(this); + + connect(ui->tbRefreshSerialPorts, &QToolButton::clicked, this, &ConfigureDevicePage::refreshSerialPorts); + connect(ui->cbSerialPortName, &QComboBox::currentTextChanged, this, &ConfigureDevicePage::serialPortNameChanged); +} + +QString ConfigureDevicePage::serialPortName() const +{ + return SerialPortComboHelper::selectedPortName(ui->cbSerialPortName); +} + +void ConfigureDevicePage::setSerialPortName(const QString &portName) +{ + SerialPortComboHelper::selectPortName(ui->cbSerialPortName, portName); +} + +void ConfigureDevicePage::refreshSerialPorts() +{ + populateSerialPorts(serialPortName(), false); +} + +void ConfigureDevicePage::populateSerialPorts(const QString &preferredPort, const bool preferredIsDefault) +{ + SerialPortComboHelper::populate(ui->cbSerialPortName, preferredPort, preferredIsDefault); + emit serialPortNameChanged(); } void ConfigureDevicePage::initializePage() @@ -67,12 +92,11 @@ void ConfigureDevicePage::initializePage() if (currentBaudRate > 0) ui->cbBaudRate->setCurrentText(QString::number(currentBaudRate)); - if (!currentSerialPort.isEmpty()) - ui->leSerialPortName->setText(currentSerialPort); + populateSerialPorts(currentSerialPort, currentSerialPort == QStringLiteral(SERIAL_PORT_DEFAULT)); if (!currentColorSequence.isEmpty()) ui->cbColorFormat->setCurrentText(currentColorSequence); - registerField(QStringLiteral("serialPort"), ui->leSerialPortName); + registerField(QStringLiteral("serialPort"), this, "serialPortName", SIGNAL(serialPortNameChanged())); registerField(QStringLiteral("baudRate"), ui->cbBaudRate, "currentText"); registerField(QStringLiteral("colorFormat"), ui->cbColorFormat, "currentText"); diff --git a/Software/src/wizard/ConfigureDevicePage.hpp b/Software/src/wizard/ConfigureDevicePage.hpp index 66b2ee1c..3683bd44 100644 --- a/Software/src/wizard/ConfigureDevicePage.hpp +++ b/Software/src/wizard/ConfigureDevicePage.hpp @@ -37,17 +37,30 @@ class ConfigureDevicePage; class ConfigureDevicePage : public QWizardPage, SettingsAwareTrait { Q_OBJECT + Q_PROPERTY(QString serialPortName READ serialPortName WRITE setSerialPortName NOTIFY serialPortNameChanged) public: explicit ConfigureDevicePage(bool isInitFromSettings, TransientSettings *ts, QWidget *parent = 0); ~ConfigureDevicePage(); int nextId() const; + + QString serialPortName() const; + void setSerialPortName(const QString &portName); + +signals: + void serialPortNameChanged(); + protected: void initializePage(); void cleanupPage(); bool validatePage(); +private slots: + void refreshSerialPorts(); + private: + void populateSerialPorts(const QString &preferredPort, bool preferredIsDefault); + Ui::ConfigureDevicePage *ui; }; diff --git a/Software/src/wizard/ConfigureDevicePage.ui b/Software/src/wizard/ConfigureDevicePage.ui index 344c760a..60be5534 100644 --- a/Software/src/wizard/ConfigureDevicePage.ui +++ b/Software/src/wizard/ConfigureDevicePage.ui @@ -71,7 +71,37 @@ - + + + + + + 0 + 0 + + + + true + + + QComboBox::NoInsert + + + Detected serial ports. You can also type a port name manually. + + + + + + + Rescan serial ports + + + Refresh + + + + diff --git a/Software/tests/TestsMain.cpp b/Software/tests/TestsMain.cpp index bfedb6bb..65abfc4a 100644 --- a/Software/tests/TestsMain.cpp +++ b/Software/tests/TestsMain.cpp @@ -20,7 +20,9 @@ unsigned g_debugLevel = Debug::LowLevel; int main(int argc, char *argv[]) { +#ifdef QTEST_DISABLE_KEYPAD_NAVIGATION // removed in Qt 6.12 QTEST_DISABLE_KEYPAD_NAVIGATION +#endif QApplication app(argc, argv); QList tests;