Diffstat (limited to 'noncore/apps/opie-console/iolayerbase.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/iolayerbase.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/iolayerbase.cpp b/noncore/apps/opie-console/iolayerbase.cpp index ec88b49..08acb75 100644 --- a/noncore/apps/opie-console/iolayerbase.cpp +++ b/noncore/apps/opie-console/iolayerbase.cpp @@ -8,8 +8,9 @@ #include "iolayerbase.h" namespace { enum ParityIds { + id_parity_none, id_parity_odd, id_parity_even }; @@ -41,8 +42,9 @@ IOLayerBase::IOLayerBase( QWidget* par, const char* name ) m_flowSw = new QRadioButton(tr("Software"), m_groupFlow ); m_flowNone = new QRadioButton( tr("None"), m_groupFlow ); m_groupParity = new QButtonGroup(tr("Parity"), this ); + m_parityNone = new QRadioButton(tr("None"), m_groupParity ); m_parityOdd = new QRadioButton(tr("Odd"), m_groupParity ); m_parityEven = new QRadioButton(tr("Even"), m_groupParity ); m_lroot = new QVBoxLayout( this ); @@ -60,8 +62,9 @@ IOLayerBase::IOLayerBase( QWidget* par, const char* name ) m_hboxPar = new QHBoxLayout( m_groupParity, 2 ); m_hboxPar->add(m_parityOdd ); m_hboxPar->add(m_parityEven ); + m_hboxPar->add(m_parityNone ); m_lroot->add(m_groupParity ); m_lroot->setStretchFactor(m_groupParity, 2 ); // profiles @@ -89,8 +92,11 @@ void IOLayerBase::setFlow( Flow flo ) { } void IOLayerBase::setParity( Parity par ) { switch( par ) { + case NonePar: + m_parityNone->setChecked( true ); + break; case Odd: m_parityOdd->setChecked( true ); break; case Even: @@ -131,12 +137,15 @@ IOLayerBase::Flow IOLayerBase::flow()const { return None; } } IOLayerBase::Parity IOLayerBase::parity()const { - if (m_parityOdd->isChecked() ) + if ( m_parityOdd->isChecked() ) { return Odd; - else + } else if ( m_parityEven->isChecked() ) { return Even; + } else { + return NonePar; + } } IOLayerBase::Speed IOLayerBase::speed()const{ switch( m_speedBox->currentItem() ) { |