mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-03-08 20:38:41 -05:00
Populate serial port lists with available actual devices
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4976 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
fc22351e02
commit
531c3753a1
@ -805,7 +805,7 @@ set_target_properties (wsjtx PROPERTIES
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries (wsjtx wsjt_fort wsjt_cxx wsjt_qt ${hamlib_LIBRARIES} ${FFTW3_LIBRARIES})
|
target_link_libraries (wsjtx wsjt_fort wsjt_cxx wsjt_qt ${hamlib_LIBRARIES} ${FFTW3_LIBRARIES})
|
||||||
qt5_use_modules (wsjtx Widgets OpenGL Network Multimedia)
|
qt5_use_modules (wsjtx Widgets OpenGL Network Multimedia SerialPort)
|
||||||
|
|
||||||
set (SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
|
set (SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
@ -154,6 +154,7 @@
|
|||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QFontDialog>
|
#include <QFontDialog>
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
|
#include <QSerialPortInfo>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include "qt_helpers.hpp"
|
#include "qt_helpers.hpp"
|
||||||
@ -2375,38 +2376,15 @@ void Configuration::impl::enumerate_rigs ()
|
|||||||
void Configuration::impl::fill_port_combo_box (QComboBox * cb)
|
void Configuration::impl::fill_port_combo_box (QComboBox * cb)
|
||||||
{
|
{
|
||||||
auto current_text = cb->currentText ();
|
auto current_text = cb->currentText ();
|
||||||
|
|
||||||
cb->clear ();
|
cb->clear ();
|
||||||
|
Q_FOREACH (auto const& p, QSerialPortInfo::availablePorts ())
|
||||||
#ifdef WIN32
|
|
||||||
|
|
||||||
for (int i {1}; i < 100; ++i)
|
|
||||||
{
|
{
|
||||||
auto item = "COM" + QString::number (i);
|
if (!p.isBusy ())
|
||||||
cb->addItem (item);
|
{
|
||||||
|
cb->addItem (p.portName ());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cb->addItem("USB");
|
cb->addItem("USB");
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
QStringList ports = {
|
|
||||||
"/dev/ttyS0"
|
|
||||||
, "/dev/ttyS1"
|
|
||||||
, "/dev/ttyS2"
|
|
||||||
, "/dev/ttyS3"
|
|
||||||
, "/dev/ttyS4"
|
|
||||||
, "/dev/ttyS5"
|
|
||||||
, "/dev/ttyS6"
|
|
||||||
, "/dev/ttyS7"
|
|
||||||
, "/dev/ttyUSB0"
|
|
||||||
, "/dev/ttyUSB1"
|
|
||||||
, "/dev/ttyUSB2"
|
|
||||||
, "/dev/ttyUSB3"
|
|
||||||
};
|
|
||||||
cb->addItems (ports);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cb->setEditText (current_text);
|
cb->setEditText (current_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user