author | harlekin <harlekin> | 2002-10-09 16:33:36 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-09 16:33:36 (UTC) |
commit | 205926ec86ffd582f795b649179291626e504830 (patch) (unidiff) | |
tree | 3a5759b98a1a263ade37dfb35cfd529a7bcafde9 /noncore/apps/opie-console/iolayerbase.cpp | |
parent | f696c6248824166f3ac025d23ac66b46c93b440c (diff) | |
download | opie-205926ec86ffd582f795b649179291626e504830.zip opie-205926ec86ffd582f795b649179291626e504830.tar.gz opie-205926ec86ffd582f795b649179291626e504830.tar.bz2 |
flow now has mode none too .-), irda config widget and beginning of layer, first sweep, rest later
Diffstat (limited to 'noncore/apps/opie-console/iolayerbase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/iolayerbase.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/iolayerbase.cpp b/noncore/apps/opie-console/iolayerbase.cpp index 99b6cc1..ec88b49 100644 --- a/noncore/apps/opie-console/iolayerbase.cpp +++ b/noncore/apps/opie-console/iolayerbase.cpp | |||
@@ -12,13 +12,14 @@ namespace { | |||
12 | id_parity_odd, | 12 | id_parity_odd, |
13 | id_parity_even | 13 | id_parity_even |
14 | }; | 14 | }; |
15 | 15 | ||
16 | enum FlowIds { | 16 | enum FlowIds { |
17 | id_flow_hw, | 17 | id_flow_hw, |
18 | id_flow_sw | 18 | id_flow_sw, |
19 | id_flow_none, | ||
19 | }; | 20 | }; |
20 | 21 | ||
21 | enum SpeedIds { | 22 | enum SpeedIds { |
22 | id_baud_115200, | 23 | id_baud_115200, |
23 | id_baud_57600, | 24 | id_baud_57600, |
24 | id_baud_38400, | 25 | id_baud_38400, |
@@ -35,26 +36,28 @@ IOLayerBase::IOLayerBase( QWidget* par, const char* name ) | |||
35 | m_speedLabel = new QLabel(tr("Speed"), this ); | 36 | m_speedLabel = new QLabel(tr("Speed"), this ); |
36 | m_speedBox = new QComboBox(this ); | 37 | m_speedBox = new QComboBox(this ); |
37 | 38 | ||
38 | m_groupFlow = new QButtonGroup(tr("Flow control"),this ); | 39 | m_groupFlow = new QButtonGroup(tr("Flow control"),this ); |
39 | m_flowHw = new QRadioButton(tr("Hardware"), m_groupFlow ); | 40 | m_flowHw = new QRadioButton(tr("Hardware"), m_groupFlow ); |
40 | m_flowSw = new QRadioButton(tr("Software"), m_groupFlow ); | 41 | m_flowSw = new QRadioButton(tr("Software"), m_groupFlow ); |
42 | m_flowNone = new QRadioButton( tr("None"), m_groupFlow ); | ||
41 | 43 | ||
42 | m_groupParity = new QButtonGroup(tr("Parity"), this ); | 44 | m_groupParity = new QButtonGroup(tr("Parity"), this ); |
43 | m_parityOdd = new QRadioButton(tr("Odd"), m_groupParity ); | 45 | m_parityOdd = new QRadioButton(tr("Odd"), m_groupParity ); |
44 | m_parityEven = new QRadioButton(tr("Even"), m_groupParity ); | 46 | m_parityEven = new QRadioButton(tr("Even"), m_groupParity ); |
45 | 47 | ||
46 | m_lroot = new QVBoxLayout(this ); | 48 | m_lroot = new QVBoxLayout( this ); |
47 | m_lroot->add(m_speedLabel ); | 49 | m_lroot->add(m_speedLabel ); |
48 | m_lroot->add(m_speedBox ); | 50 | m_lroot->add(m_speedBox ); |
49 | m_lroot->setStretchFactor(m_speedLabel, 1); | 51 | m_lroot->setStretchFactor(m_speedLabel, 1); |
50 | m_lroot->setStretchFactor(m_speedBox, 1 ); | 52 | m_lroot->setStretchFactor(m_speedBox, 1 ); |
51 | 53 | ||
52 | m_hbox = new QHBoxLayout(m_groupFlow, 2 ); | 54 | m_hbox = new QHBoxLayout(m_groupFlow, 2 ); |
53 | m_hbox->add(m_flowHw ); | 55 | m_hbox->add(m_flowHw ); |
54 | m_hbox->add(m_flowSw ); | 56 | m_hbox->add(m_flowSw ); |
57 | m_hbox->add(m_flowNone ); | ||
55 | m_lroot->add(m_groupFlow ); | 58 | m_lroot->add(m_groupFlow ); |
56 | m_lroot->setStretchFactor(m_groupFlow, 2 ); | 59 | m_lroot->setStretchFactor(m_groupFlow, 2 ); |
57 | 60 | ||
58 | m_hboxPar = new QHBoxLayout( m_groupParity, 2 ); | 61 | m_hboxPar = new QHBoxLayout( m_groupParity, 2 ); |
59 | m_hboxPar->add(m_parityOdd ); | 62 | m_hboxPar->add(m_parityOdd ); |
60 | m_hboxPar->add(m_parityEven ); | 63 | m_hboxPar->add(m_parityEven ); |
@@ -76,14 +79,18 @@ void IOLayerBase::setFlow( Flow flo ) { | |||
76 | case Software: | 79 | case Software: |
77 | m_flowSw->setChecked( true ); | 80 | m_flowSw->setChecked( true ); |
78 | break; | 81 | break; |
79 | case Hardware: | 82 | case Hardware: |
80 | m_flowHw->setChecked( true ); | 83 | m_flowHw->setChecked( true ); |
81 | break; | 84 | break; |
85 | case None: | ||
86 | m_flowNone->setChecked( true ); | ||
87 | break; | ||
82 | } | 88 | } |
83 | } | 89 | } |
90 | |||
84 | void IOLayerBase::setParity( Parity par ) { | 91 | void IOLayerBase::setParity( Parity par ) { |
85 | switch( par ) { | 92 | switch( par ) { |
86 | case Odd: | 93 | case Odd: |
87 | m_parityOdd->setChecked( true ); | 94 | m_parityOdd->setChecked( true ); |
88 | break; | 95 | break; |
89 | case Even: | 96 | case Even: |
@@ -113,15 +120,18 @@ void IOLayerBase::setSpeed( Speed sp ) { | |||
113 | m_speedBox->setCurrentItem(index ); | 120 | m_speedBox->setCurrentItem(index ); |
114 | } | 121 | } |
115 | IOLayerBase::Flow IOLayerBase::flow()const { | 122 | IOLayerBase::Flow IOLayerBase::flow()const { |
116 | if (m_flowHw->isChecked() ) { | 123 | if (m_flowHw->isChecked() ) { |
117 | qWarning("Hardware flow"); | 124 | qWarning("Hardware flow"); |
118 | return Hardware; | 125 | return Hardware; |
119 | }else { | 126 | }else if( m_flowSw->isChecked() ) { |
120 | qWarning("Software"); | 127 | qWarning("Software"); |
121 | return Software; | 128 | return Software; |
129 | } else { | ||
130 | qWarning("None"); | ||
131 | return None; | ||
122 | } | 132 | } |
123 | } | 133 | } |
124 | IOLayerBase::Parity IOLayerBase::parity()const { | 134 | IOLayerBase::Parity IOLayerBase::parity()const { |
125 | if (m_parityOdd->isChecked() ) | 135 | if (m_parityOdd->isChecked() ) |
126 | return Odd; | 136 | return Odd; |
127 | else | 137 | else |