summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/btconfigwidget.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/btconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/btconfigwidget.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/btconfigwidget.cpp b/noncore/apps/opie-console/btconfigwidget.cpp
index eac6a79..7673d0b 100644
--- a/noncore/apps/opie-console/btconfigwidget.cpp
+++ b/noncore/apps/opie-console/btconfigwidget.cpp
@@ -48,50 +48,52 @@ BTConfigWidget::BTConfigWidget( const QString& name,
BTConfigWidget::~BTConfigWidget() {
}
void BTConfigWidget::load( const Profile& prof ) {
int rad_flow = prof.readNumEntry("Flow");
int rad_parity = prof.readNumEntry("Parity");
int speed = prof.readNumEntry("Speed");
QString mac = prof.readEntry("Mac");
if (!mac.isEmpty() ) {
m_mac->setText( mac );
}
if (rad_flow == 1) {
m_base->setFlow( IOLayerBase::Hardware );
} else if (rad_flow == 2) {
m_base->setFlow( IOLayerBase::Software );
} else if (rad_flow == 0) {
m_base->setFlow( IOLayerBase::None );
}
if (rad_parity == 1) {
m_base->setParity( IOLayerBase::Even );
- } else {
+ } else if ( rad_parity == 2 ) {
m_base->setParity( IOLayerBase::Odd );
+ } else {
+ m_base->setParity( IOLayerBase::NonePar );
}
switch( speed ) {
case 115200:
m_base->setSpeed(IOLayerBase::Baud_115200 );
break;
case 57600:
m_base->setSpeed( IOLayerBase::Baud_57600 );
break;
case 38400:
m_base->setSpeed(IOLayerBase::Baud_38400 );
break;
case 19200:
m_base->setSpeed( IOLayerBase::Baud_19200 );
break;
case 9600:
default:
m_base->setSpeed(IOLayerBase::Baud_9600 );
break;
}
if ( prof.readEntry("Device").isEmpty() ) return;
setCurrent( prof.readEntry("Device"), m_deviceCmb );
@@ -104,48 +106,51 @@ void BTConfigWidget::load( const Profile& prof ) {
void BTConfigWidget::save( Profile& prof ) {
int flow, parity, speed;
prof.writeEntry("Device", m_deviceCmb->currentText() );
switch( m_base->flow() ) {
case IOLayerBase::None:
flow = 0;
break;
case IOLayerBase::Software:
flow = 2;
break;
case IOLayerBase::Hardware:
flow = 1;
break;
}
switch( m_base->parity() ) {
case IOLayerBase::Odd:
parity = 2;
break;
case IOLayerBase::Even:
parity = 1;
break;
+ case IOLayerBase::NonePar:
+ parity = 0;
+ break;
}
switch( m_base->speed() ) {
case IOLayerBase::Baud_115200:
speed = 115200;
break;
case IOLayerBase::Baud_57600:
speed = 57600;
break;
case IOLayerBase::Baud_38400:
speed = 38400;
break;
case IOLayerBase::Baud_19200:
speed = 19200;
break;
case IOLayerBase::Baud_9600:
speed = 9600;
break;
}
prof.writeEntry("Flow", flow);
prof.writeEntry("Parity", parity);
prof.writeEntry("Speed", speed);
prof.writeEntry("Mac", m_mac->text() );