Changeset - f06b56464889
[Not reviewed]
portlist
0 1 0
Hasan Yavuz Ă–ZDERYA - 10 years ago 2015-09-05 04:04:53
hy@ozderya.net
added "Port:" label to toolbar
1 file changed with 9 insertions and 8 deletions:
0 comments (0 inline, 0 general)
portcontrol.cpp
Show inline comments
 
@@ -22,6 +22,7 @@
 

	
 
#include <QSerialPortInfo>
 
#include <QKeySequence>
 
#include <QLabel>
 
#include <QtDebug>
 
#include "utils.h"
 

	
 
@@ -41,11 +42,13 @@ PortControl::PortControl(QSerialPort* po
 
    openAction.setToolTip("Open Port (F2)");
 
    QObject::connect(&openAction, &QAction::triggered,
 
                     this, &PortControl::openActionTriggered);
 

	
 
    portToolBar.addWidget(new QLabel("Port:"));
 
    portToolBar.addWidget(&tbPortList);
 
    portToolBar.addAction(&openAction);
 

	
 
    portToolBar.addWidget(&tbPortList);
 
    // setup port selection widgets
 
    tbPortList.setModel(&portList);
 

	
 
    ui->cbPortList->setModel(&portList);
 
    QObject::connect(ui->cbPortList,
 
                     SELECT<int>::OVERLOAD_OF(&QComboBox::activated),
 
@@ -53,6 +56,9 @@ PortControl::PortControl(QSerialPort* po
 
    QObject::connect(&tbPortList,
 
                     SELECT<int>::OVERLOAD_OF(&QComboBox::activated),
 
                     this, &PortControl::onTbPortListActivated);
 
    QObject::connect(ui->cbPortList,
 
                     SELECT<const QString&>::OVERLOAD_OF(&QComboBox::activated),
 
                     this, &PortControl::selectPort);
 

	
 
    // setup buttons
 
    QObject::connect(ui->pbReloadPorts, &QPushButton::clicked,
 
@@ -60,12 +66,7 @@ PortControl::PortControl(QSerialPort* po
 

	
 
    ui->pbOpenPort->setDefaultAction(&openAction);
 

	
 
    // TODO: port name coming from combobox is dirty, create a separate layer of signals
 
    //       that will sanitize this information
 
    QObject::connect(ui->cbPortList,
 
                     SELECT<const QString&>::OVERLOAD_OF(&QComboBox::activated),
 
                     this, &PortControl::selectPort);
 

	
 
    // setup baud rate selection widget
 
    QObject::connect(ui->cbBaudRate,
 
                     SELECT<const QString&>::OVERLOAD_OF(&QComboBox::activated),
 
                     this, &PortControl::selectBaudRate);
0 comments (0 inline, 0 general)