Diffstat (limited to 'noncore/apps/opie-console/serialconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/serialconfigwidget.cpp | 53 |
1 files changed, 51 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/serialconfigwidget.cpp b/noncore/apps/opie-console/serialconfigwidget.cpp index 5c6d975..3edf723 100644 --- a/noncore/apps/opie-console/serialconfigwidget.cpp +++ b/noncore/apps/opie-console/serialconfigwidget.cpp @@ -51,4 +51,6 @@ void SerialConfigWidget::load( const Profile& prof ) { int rad_parity = prof.readNumEntry("Parity"); int speed = prof.readNumEntry("Speed"); + int dbits = prof.readNumEntry("DataBits"); + int sbits = prof.readNumEntry("StopBits"); if (rad_flow == 1) { @@ -87,4 +89,22 @@ void SerialConfigWidget::load( const Profile& prof ) { } + if ( dbits == 5) { + m_base->setData( IOLayerBase::Data_Five ); + } else if (rad_flow == 6) { + m_base->setData( IOLayerBase::Data_Six ); + } else if (rad_flow == 7) { + m_base->setData( IOLayerBase::Data_Seven ); + } else { + m_base->setData( IOLayerBase::Data_Eight ); + } + + if ( sbits == 2) { + m_base->setStop( IOLayerBase::Stop_Two ); + } else if ( sbits == 15 ) { + m_base->setStop( IOLayerBase::Stop_OnePointFive ); + } else { + m_base->setStop( IOLayerBase::Stop_One ); + } + if ( prof.readEntry("Device").isEmpty() ) return; setCurrent( prof.readEntry("Device"), m_deviceCmb ); @@ -97,6 +117,6 @@ void SerialConfigWidget::load( const Profile& prof ) { */ void SerialConfigWidget::save( Profile& prof ) { - int flow, parity, speed ; - flow = parity = speed = 0; + int flow, parity, speed, data, stop; + flow = parity = speed = data = stop = 0; prof.writeEntry("Device", m_deviceCmb->currentText() ); @@ -144,6 +164,35 @@ void SerialConfigWidget::save( Profile& prof ) { } + switch( m_base->data() ) { + case IOLayerBase::Data_Five: + data = 5; + break; + case IOLayerBase::Data_Six: + data = 6; + break; + case IOLayerBase::Data_Seven: + data = 7; + break; + case IOLayerBase::Data_Eight: + data = 8; + break; + } + + switch( m_base->stop() ) { + case IOLayerBase::Stop_One: + stop = 1; + break; + case IOLayerBase::Stop_OnePointFive: + stop = 15; + break; + case IOLayerBase::Stop_Two: + stop = 2; + break; + } + prof.writeEntry("Flow", flow); prof.writeEntry("Parity", parity); prof.writeEntry("Speed", speed); + prof.writeEntry("DataBits", data); + prof.writeEntry("StopBits", stop); } |