2010-04-10 02:09:53 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
*
|
2010-04-14 23:23:13 +02:00
|
|
|
* @file uploadergadgetoptionspage.cpp
|
2010-04-10 02:09:53 +02:00
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
2010-04-14 23:23:13 +02:00
|
|
|
* @brief Uploader Plugin Gadget options page
|
2010-04-10 02:09:53 +02:00
|
|
|
* @see The GNU Public License (GPL) Version 3
|
|
|
|
* @defgroup Uploader
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* This program is free 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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "uploadergadgetoptionspage.h"
|
|
|
|
#include "uploadergadgetconfiguration.h"
|
|
|
|
#include <QtGui/QLabel>
|
|
|
|
#include <QtGui/QSpinBox>
|
|
|
|
#include <QtGui/QDoubleSpinBox>
|
|
|
|
#include <QtGui/QHBoxLayout>
|
|
|
|
#include <QtGui/QVBoxLayout>
|
|
|
|
#include <QtGui/QTextEdit>
|
|
|
|
#include <QtGui/QComboBox>
|
|
|
|
#include <QtAlgorithms>
|
|
|
|
#include <QStringList>
|
|
|
|
#include <qextserialport/src/qextserialenumerator.h>
|
2010-04-14 23:23:13 +02:00
|
|
|
|
2010-04-10 02:09:53 +02:00
|
|
|
UploaderGadgetOptionsPage::UploaderGadgetOptionsPage(UploaderGadgetConfiguration *config, QObject *parent) :
|
2010-04-10 04:10:17 +02:00
|
|
|
IOptionsPage(parent),
|
|
|
|
m_config(config)
|
2010-04-10 02:09:53 +02:00
|
|
|
{
|
2010-04-14 23:23:13 +02:00
|
|
|
//the begining of some ugly code
|
|
|
|
//diferent OS's have diferent serial port capabilities
|
2010-04-10 22:29:34 +02:00
|
|
|
#ifdef Q_OS_WIN
|
2010-04-14 23:23:13 +02:00
|
|
|
//load windows port capabilities
|
2010-04-10 22:29:34 +02:00
|
|
|
BaudRateTypeString
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"BAUD110"
|
|
|
|
<<"BAUD300"
|
|
|
|
<<"BAUD600"
|
|
|
|
<<"BAUD1200"
|
|
|
|
<<"BAUD2400"
|
|
|
|
<<"BAUD4800"
|
|
|
|
<<"BAUD9600"
|
2010-04-10 22:29:34 +02:00
|
|
|
<<"BAUD14400"
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"BAUD19200"
|
|
|
|
<<"BAUD38400"
|
2010-04-10 22:29:34 +02:00
|
|
|
<<"BAUD56000"
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"BAUD57600"
|
2010-04-10 22:29:34 +02:00
|
|
|
<<"BAUD115200"
|
|
|
|
<<"BAUD128000"
|
|
|
|
<<"BAUD256000";
|
2010-04-10 02:09:53 +02:00
|
|
|
DataBitsTypeString
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"DATA_5"
|
|
|
|
<<"DATA_6"
|
|
|
|
<<"DATA_7"
|
|
|
|
<<"DATA_8";
|
2010-04-10 02:09:53 +02:00
|
|
|
ParityTypeString
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"PAR_NONE"
|
|
|
|
<<"PAR_ODD"
|
|
|
|
<<"PAR_EVEN"
|
2010-04-10 22:29:34 +02:00
|
|
|
<<"PAR_MARK" //WINDOWS ONLY
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"PAR_SPACE";
|
2010-04-10 02:09:53 +02:00
|
|
|
StopBitsTypeString
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"STOP_1"
|
2010-04-10 22:29:34 +02:00
|
|
|
<<"STOP_1_5" //WINDOWS ONLY
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"STOP_2";
|
2010-04-10 02:09:53 +02:00
|
|
|
#else
|
2010-04-14 23:23:13 +02:00
|
|
|
//load POSIX port capabilities
|
2010-04-10 02:09:53 +02:00
|
|
|
BaudRateTypeString
|
2010-04-10 22:29:34 +02:00
|
|
|
|
|
|
|
<<"BAUD50" //POSIX ONLY
|
|
|
|
<<"BAUD75" //POSIX ONLY
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"BAUD110"
|
2010-04-10 22:29:34 +02:00
|
|
|
<<"BAUD134" //POSIX ONLY
|
|
|
|
<<"BAUD150" //POSIX ONLY
|
|
|
|
<<"BAUD200" //POSIX ONLY
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"BAUD300"
|
|
|
|
<<"BAUD600"
|
|
|
|
<<"BAUD1200"
|
2010-04-10 22:29:34 +02:00
|
|
|
<<"BAUD1800" //POSIX ONLY
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"BAUD2400"
|
|
|
|
<<"BAUD4800"
|
|
|
|
<<"BAUD9600"
|
|
|
|
<<"BAUD19200"
|
|
|
|
<<"BAUD38400"
|
|
|
|
<<"BAUD57600"
|
2010-04-10 22:29:34 +02:00
|
|
|
<<"BAUD76800" //POSIX ONLY
|
|
|
|
<<"BAUD115200";
|
2010-04-10 02:09:53 +02:00
|
|
|
DataBitsTypeString
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"DATA_5"
|
|
|
|
<<"DATA_6"
|
|
|
|
<<"DATA_7"
|
|
|
|
<<"DATA_8";
|
2010-04-10 02:09:53 +02:00
|
|
|
ParityTypeString
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"PAR_NONE"
|
|
|
|
<<"PAR_ODD"
|
|
|
|
<<"PAR_EVEN"
|
|
|
|
<<"PAR_SPACE";
|
2010-04-10 02:09:53 +02:00
|
|
|
StopBitsTypeString
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"STOP_1"
|
|
|
|
<<"STOP_2";
|
2010-04-10 02:09:53 +02:00
|
|
|
#endif
|
2010-04-14 23:23:13 +02:00
|
|
|
//load all OS's capabilities
|
2010-04-10 02:09:53 +02:00
|
|
|
BaudRateTypeStringALL
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"BAUD50" //POSIX ONLY
|
|
|
|
<<"BAUD75" //POSIX ONLY
|
|
|
|
<<"BAUD110"
|
|
|
|
<<"BAUD134" //POSIX ONLY
|
|
|
|
<<"BAUD150" //POSIX ONLY
|
|
|
|
<<"BAUD200" //POSIX ONLY
|
|
|
|
<<"BAUD300"
|
|
|
|
<<"BAUD600"
|
|
|
|
<<"BAUD1200"
|
|
|
|
<<"BAUD1800" //POSIX ONLY
|
|
|
|
<<"BAUD2400"
|
|
|
|
<<"BAUD4800"
|
|
|
|
<<"BAUD9600"
|
|
|
|
<<"BAUD14400"
|
|
|
|
<<"BAUD19200"
|
|
|
|
<<"BAUD38400"
|
|
|
|
<<"BAUD56000"
|
|
|
|
<<"BAUD57600"
|
|
|
|
<<"BAUD76800" //POSIX ONLY
|
|
|
|
<<"BAUD115200"
|
|
|
|
<<"BAUD128000"
|
|
|
|
<<"BAUD256000";
|
2010-04-10 02:09:53 +02:00
|
|
|
DataBitsTypeStringALL
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"DATA_5"
|
|
|
|
<<"DATA_6"
|
|
|
|
<<"DATA_7"
|
|
|
|
<<"DATA_8";
|
2010-04-10 02:09:53 +02:00
|
|
|
ParityTypeStringALL
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"PAR_NONE"
|
|
|
|
<<"PAR_ODD"
|
|
|
|
<<"PAR_EVEN"
|
|
|
|
<<"PAR_MARK" //WINDOWS ONLY
|
|
|
|
<<"PAR_SPACE";
|
2010-04-10 02:09:53 +02:00
|
|
|
StopBitsTypeStringALL
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"STOP_1"
|
|
|
|
<<"STOP_1_5" //WINDOWS ONLY
|
|
|
|
<<"STOP_2";
|
2010-04-10 02:09:53 +02:00
|
|
|
|
|
|
|
FlowTypeString
|
2010-04-10 04:10:17 +02:00
|
|
|
<<"FLOW_OFF"
|
|
|
|
<<"FLOW_HARDWARE"
|
|
|
|
<<"FLOW_XONXOFF";
|
2010-04-10 02:09:53 +02:00
|
|
|
}
|
|
|
|
|
2010-04-14 23:23:13 +02:00
|
|
|
//creates options page widget
|
2010-04-10 02:09:53 +02:00
|
|
|
QWidget *UploaderGadgetOptionsPage::createPage(QWidget *parent)
|
|
|
|
{
|
2010-04-14 23:23:13 +02:00
|
|
|
//main widget
|
2010-04-10 02:09:53 +02:00
|
|
|
QWidget *widget = new QWidget;
|
|
|
|
//main layout
|
|
|
|
QVBoxLayout *vl = new QVBoxLayout();
|
|
|
|
widget->setLayout(vl);
|
|
|
|
|
2010-04-14 23:23:13 +02:00
|
|
|
//port layout and widget
|
2010-04-10 02:09:53 +02:00
|
|
|
QHBoxLayout *portLayout = new QHBoxLayout();
|
|
|
|
QWidget *x = new QWidget;
|
|
|
|
x->setLayout(portLayout);
|
|
|
|
QWidget *label = new QLabel("Port:");
|
|
|
|
m_portCB = new QComboBox(parent);
|
2010-04-10 04:10:17 +02:00
|
|
|
m_portCB->setMinimumSize(200,22);
|
2010-04-10 02:09:53 +02:00
|
|
|
portLayout->addWidget(label);
|
|
|
|
portLayout->addWidget(m_portCB);
|
|
|
|
|
2010-04-14 23:23:13 +02:00
|
|
|
//port speed layout and widget
|
2010-04-10 02:09:53 +02:00
|
|
|
QHBoxLayout *speedLayout = new QHBoxLayout();
|
|
|
|
QWidget *y = new QWidget;
|
|
|
|
y->setLayout(speedLayout);
|
|
|
|
label = new QLabel("Port Speed:");
|
|
|
|
m_speedCB = new QComboBox();
|
2010-04-10 04:10:17 +02:00
|
|
|
m_speedCB->setMinimumSize(200,22);
|
2010-04-10 02:09:53 +02:00
|
|
|
speedLayout->addWidget(label);
|
|
|
|
speedLayout->addWidget(m_speedCB);
|
|
|
|
|
2010-04-14 23:23:13 +02:00
|
|
|
//flow control layout and widget
|
2010-04-10 02:09:53 +02:00
|
|
|
QHBoxLayout *flowLayout = new QHBoxLayout();
|
|
|
|
QWidget *z = new QWidget;
|
|
|
|
z->setLayout(flowLayout);
|
|
|
|
label = new QLabel("Flow Control:");
|
|
|
|
m_flowCB = new QComboBox();
|
2010-04-10 04:10:17 +02:00
|
|
|
m_flowCB->setMinimumSize(200,22);
|
2010-04-10 02:09:53 +02:00
|
|
|
flowLayout->addWidget(label);
|
|
|
|
flowLayout->addWidget(m_flowCB);
|
|
|
|
|
2010-04-14 23:23:13 +02:00
|
|
|
//databits layout and widget
|
2010-04-10 02:09:53 +02:00
|
|
|
QHBoxLayout *databitsLayout = new QHBoxLayout();
|
|
|
|
QWidget *a = new QWidget;
|
|
|
|
a->setLayout(databitsLayout);
|
|
|
|
label = new QLabel("Data Bits:");
|
|
|
|
m_databitsCB = new QComboBox();
|
2010-04-10 04:10:17 +02:00
|
|
|
m_databitsCB->setMinimumSize(200,22);
|
2010-04-10 02:09:53 +02:00
|
|
|
databitsLayout->addWidget(label);
|
|
|
|
databitsLayout->addWidget(m_databitsCB);
|
|
|
|
|
2010-04-14 23:23:13 +02:00
|
|
|
//stopbits layout and widget
|
2010-04-10 02:09:53 +02:00
|
|
|
QHBoxLayout *stopbitsLayout = new QHBoxLayout();
|
|
|
|
QWidget *b = new QWidget;
|
|
|
|
b->setLayout(stopbitsLayout);
|
|
|
|
label = new QLabel("Stop Bits:");
|
|
|
|
m_stopbitsCB = new QComboBox();
|
2010-04-10 04:10:17 +02:00
|
|
|
m_stopbitsCB->setMinimumSize(200,22);
|
2010-04-10 02:09:53 +02:00
|
|
|
stopbitsLayout->addWidget(label);
|
|
|
|
stopbitsLayout->addWidget(m_stopbitsCB);
|
|
|
|
|
2010-04-14 23:23:13 +02:00
|
|
|
//parity layout and widget
|
2010-04-10 02:09:53 +02:00
|
|
|
QHBoxLayout *parityLayout = new QHBoxLayout();
|
|
|
|
QWidget *c = new QWidget;
|
|
|
|
c->setLayout(parityLayout);
|
|
|
|
label = new QLabel("Parity:");
|
|
|
|
m_parityCB = new QComboBox();
|
2010-04-10 04:10:17 +02:00
|
|
|
m_parityCB->setMinimumSize(200,22);
|
2010-04-10 02:09:53 +02:00
|
|
|
parityLayout->addWidget(label);
|
|
|
|
parityLayout->addWidget(m_parityCB);
|
|
|
|
|
2010-04-14 23:23:13 +02:00
|
|
|
//timeout layout and widget
|
2010-04-10 02:09:53 +02:00
|
|
|
QHBoxLayout *timeoutLayout = new QHBoxLayout();
|
|
|
|
QWidget *d = new QWidget;
|
|
|
|
d->setLayout(timeoutLayout);
|
|
|
|
label = new QLabel("TimeOut(ms):");
|
|
|
|
m_timeoutSpin = new QSpinBox();
|
|
|
|
m_timeoutSpin->setMaximum(100000);
|
2010-04-10 22:29:34 +02:00
|
|
|
m_timeoutSpin->setMinimumSize(200,22);
|
2010-04-10 02:09:53 +02:00
|
|
|
timeoutLayout->addWidget(label);
|
|
|
|
timeoutLayout->addWidget(m_timeoutSpin);
|
|
|
|
|
|
|
|
|
|
|
|
QSpacerItem *spacer = new QSpacerItem(100, 100, QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
|
|
|
2010-04-14 23:23:13 +02:00
|
|
|
//add partial widget to main widget
|
2010-04-10 02:09:53 +02:00
|
|
|
vl->addWidget(x);
|
|
|
|
vl->addWidget(y);
|
|
|
|
vl->addWidget(z);
|
|
|
|
vl->addWidget(a);
|
|
|
|
vl->addWidget(b);
|
|
|
|
vl->addWidget(c);
|
|
|
|
vl->addWidget(d);
|
|
|
|
vl->addSpacerItem(spacer);
|
|
|
|
|
2010-04-14 23:23:13 +02:00
|
|
|
//clears comboboxes, if not every time the user enters options page the lists
|
|
|
|
//duplicate
|
2010-04-10 02:09:53 +02:00
|
|
|
m_portCB->clear();
|
|
|
|
m_speedCB->clear();
|
|
|
|
m_databitsCB->clear();
|
|
|
|
m_flowCB->clear();
|
|
|
|
m_parityCB->clear();
|
|
|
|
m_stopbitsCB->clear();
|
|
|
|
|
2010-04-14 23:23:13 +02:00
|
|
|
//gets available serial ports
|
2010-04-10 02:09:53 +02:00
|
|
|
QList<QextPortInfo> ports =QextSerialEnumerator ::getPorts();
|
|
|
|
qSort(ports.begin(), ports.end());
|
2010-04-11 17:38:21 +02:00
|
|
|
qDebug() << "List of ports:";
|
|
|
|
for (int i = 0; i < ports.size(); i++) {
|
|
|
|
qDebug() << "port name:" << ports.at(i).portName;
|
|
|
|
qDebug() << "friendly name:" << ports.at(i).friendName;
|
|
|
|
qDebug() << "physical name:" << ports.at(i).physName;
|
|
|
|
qDebug() << "enumerator name:" << ports.at(i).enumName;
|
|
|
|
qDebug() << "vendor ID:" << QString::number(ports.at(i).vendorID, 16);
|
|
|
|
qDebug() << "product ID:" << QString::number(ports.at(i).productID, 16);
|
|
|
|
qDebug() << "===================================";
|
|
|
|
}
|
2010-04-10 22:29:34 +02:00
|
|
|
#ifdef Q_OS_WIN
|
2010-04-14 23:23:13 +02:00
|
|
|
//on windows populate ports combobox with ports name
|
2010-04-10 22:29:34 +02:00
|
|
|
for (int i = 0; i < ports.size(); i++) {
|
|
|
|
m_portCB->addItem((QString)ports.at(i).portName.toLocal8Bit().constData());
|
|
|
|
}
|
|
|
|
#else
|
2010-04-14 23:23:13 +02:00
|
|
|
//on other OS's populate ports combobox with ports physical name
|
2010-04-10 02:09:53 +02:00
|
|
|
for (int i = 0; i < ports.size(); i++) {
|
2010-04-10 04:10:17 +02:00
|
|
|
m_portCB->addItem((QString)ports.at(i).physName.toLocal8Bit().constData());
|
2010-04-10 02:09:53 +02:00
|
|
|
}
|
2010-04-10 22:29:34 +02:00
|
|
|
#endif
|
2010-04-14 23:23:13 +02:00
|
|
|
//The next selections of comboboxe's saved value are ugly as hell
|
|
|
|
//There must be a better wat for doing this.
|
|
|
|
//select saved port
|
2010-04-10 02:09:53 +02:00
|
|
|
if(m_portCB->findText(m_config->Port())!=-1){
|
|
|
|
m_portCB->setCurrentIndex(m_portCB->findText(m_config->Port()));
|
|
|
|
}
|
2010-04-14 23:23:13 +02:00
|
|
|
//populate serial speed combobox
|
2010-04-10 02:09:53 +02:00
|
|
|
for (int i=0;i<BaudRateTypeString.size();i++){
|
|
|
|
m_speedCB->addItem(BaudRateTypeString.at(i).toLocal8Bit().constData() );
|
|
|
|
}
|
2010-04-14 23:23:13 +02:00
|
|
|
//select saved speed
|
2010-04-10 02:09:53 +02:00
|
|
|
if(m_speedCB->findText(BaudRateTypeStringALL.at((int)m_config->Speed()).toLocal8Bit().constData())!=-1){
|
2010-04-10 04:10:17 +02:00
|
|
|
m_speedCB->setCurrentIndex(m_speedCB->findText(BaudRateTypeStringALL.at((int)m_config->Speed()).toLocal8Bit().constData()));
|
2010-04-10 02:09:53 +02:00
|
|
|
}
|
2010-04-14 23:23:13 +02:00
|
|
|
//populate databits combobox
|
2010-04-10 02:09:53 +02:00
|
|
|
for (int i=0;i<DataBitsTypeString.size();i++){
|
|
|
|
m_databitsCB->addItem(DataBitsTypeString.at(i).toLocal8Bit().constData() );
|
|
|
|
}
|
2010-04-14 23:23:13 +02:00
|
|
|
//select saved databits
|
2010-04-10 02:09:53 +02:00
|
|
|
if(m_databitsCB->findText(DataBitsTypeStringALL.at((int)m_config->DataBits()).toLocal8Bit().constData())!=-1){
|
2010-04-10 04:10:17 +02:00
|
|
|
m_databitsCB->setCurrentIndex(m_databitsCB->findText(DataBitsTypeStringALL.at((int)m_config->DataBits()).toLocal8Bit().constData()));
|
2010-04-10 02:09:53 +02:00
|
|
|
}
|
2010-04-14 23:23:13 +02:00
|
|
|
//populate parity combobox
|
2010-04-10 02:09:53 +02:00
|
|
|
for (int i=0;i<ParityTypeString.size();i++){
|
|
|
|
m_parityCB->addItem(ParityTypeString.at(i).toLocal8Bit().constData() );
|
|
|
|
}
|
2010-04-14 23:23:13 +02:00
|
|
|
//select saved parity
|
2010-04-10 02:09:53 +02:00
|
|
|
if(m_parityCB->findText(ParityTypeStringALL.at((int)m_config->Parity()).toLocal8Bit().constData())!=-1){
|
2010-04-10 04:10:17 +02:00
|
|
|
m_parityCB->setCurrentIndex(m_parityCB->findText(ParityTypeStringALL.at((int)m_config->Parity()).toLocal8Bit().constData()));
|
2010-04-10 02:09:53 +02:00
|
|
|
}
|
2010-04-14 23:23:13 +02:00
|
|
|
//populate stopbits combobox
|
2010-04-10 02:09:53 +02:00
|
|
|
for (int i=0;i<StopBitsTypeString.size();i++){
|
|
|
|
m_stopbitsCB->addItem(StopBitsTypeString.at(i).toLocal8Bit().constData() );
|
|
|
|
}
|
2010-04-14 23:23:13 +02:00
|
|
|
//select saved stopbits
|
2010-04-10 02:09:53 +02:00
|
|
|
if(m_stopbitsCB->findText(StopBitsTypeStringALL.at((int)m_config->StopBits()).toLocal8Bit().constData())!=-1){
|
2010-04-10 04:10:17 +02:00
|
|
|
m_stopbitsCB->setCurrentIndex(m_stopbitsCB->findText(StopBitsTypeStringALL.at((int)m_config->StopBits()).toLocal8Bit().constData()));
|
2010-04-10 02:09:53 +02:00
|
|
|
}
|
2010-04-14 23:23:13 +02:00
|
|
|
//populate flow control combobox
|
2010-04-10 02:09:53 +02:00
|
|
|
for (int i=0;i<FlowTypeString.size();i++){
|
|
|
|
m_flowCB->addItem(FlowTypeString.at(i).toLocal8Bit().constData() );
|
|
|
|
}
|
2010-04-14 23:23:13 +02:00
|
|
|
//select saved flow control
|
2010-04-10 02:09:53 +02:00
|
|
|
if(m_flowCB->findText(FlowTypeString.at((int)m_config->Flow()).toLocal8Bit().constData())!=-1){
|
2010-04-10 04:10:17 +02:00
|
|
|
m_flowCB->setCurrentIndex(m_flowCB->findText(FlowTypeString.at((int)m_config->Flow()).toLocal8Bit().constData()));
|
2010-04-10 02:09:53 +02:00
|
|
|
}
|
2010-04-14 23:23:13 +02:00
|
|
|
//fill time out spinbox with saved value
|
2010-04-10 02:09:53 +02:00
|
|
|
m_timeoutSpin->setValue(m_config->TimeOut());
|
|
|
|
return widget;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Called when the user presses apply or OK.
|
|
|
|
*
|
|
|
|
* Saves the current values
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void UploaderGadgetOptionsPage::apply()
|
|
|
|
{
|
|
|
|
m_config->setPort(m_portCB->currentText());
|
|
|
|
m_config->setSpeed((BaudRateType)BaudRateTypeStringALL.indexOf(m_speedCB->currentText()));
|
|
|
|
m_config->setDataBits((DataBitsType)DataBitsTypeStringALL.indexOf(m_databitsCB->currentText()));
|
|
|
|
m_config->setStopBits((StopBitsType)StopBitsTypeStringALL.indexOf(m_stopbitsCB->currentText()));
|
|
|
|
m_config->setParity((ParityType)ParityTypeStringALL.indexOf(m_parityCB->currentText()));
|
|
|
|
m_config->setFlow((FlowType)FlowTypeString.indexOf(m_flowCB->currentText()));
|
|
|
|
m_config->setTimeOut( m_timeoutSpin->value());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void UploaderGadgetOptionsPage::finish()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|