-rw-r--r-- | noncore/apps/opie-console/btconfigwidget.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/iolayerbase.cpp | 10 | ||||
-rw-r--r-- | noncore/apps/opie-console/iolayerbase.h | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/irdaconfigwidget.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/modemconfigwidget.cpp | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/serialconfigwidget.cpp | 6 |
6 files changed, 34 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/btconfigwidget.cpp b/noncore/apps/opie-console/btconfigwidget.cpp index e1ff18a..7f82e06 100644 --- a/noncore/apps/opie-console/btconfigwidget.cpp +++ b/noncore/apps/opie-console/btconfigwidget.cpp | |||
@@ -60,143 +60,149 @@ BTConfigWidget::~BTConfigWidget() { | |||
60 | } | 60 | } |
61 | void BTConfigWidget::load( const Profile& prof ) { | 61 | void BTConfigWidget::load( const Profile& prof ) { |
62 | int rad_flow = prof.readNumEntry("Flow"); | 62 | int rad_flow = prof.readNumEntry("Flow"); |
63 | int rad_parity = prof.readNumEntry("Parity"); | 63 | int rad_parity = prof.readNumEntry("Parity"); |
64 | int speed = prof.readNumEntry("Speed"); | 64 | int speed = prof.readNumEntry("Speed"); |
65 | QString mac = prof.readEntry("Mac"); | 65 | QString mac = prof.readEntry("Mac"); |
66 | 66 | ||
67 | if (!mac.isEmpty() ) { | 67 | if (!mac.isEmpty() ) { |
68 | m_mac->setText( mac ); | 68 | m_mac->setText( mac ); |
69 | } else { | 69 | } else { |
70 | m_devRadio->setChecked( true ); | 70 | m_devRadio->setChecked( true ); |
71 | } | 71 | } |
72 | 72 | ||
73 | if (rad_flow == 1) { | 73 | if (rad_flow == 1) { |
74 | m_base->setFlow( IOLayerBase::Hardware ); | 74 | m_base->setFlow( IOLayerBase::Hardware ); |
75 | } else if (rad_flow == 2) { | 75 | } else if (rad_flow == 2) { |
76 | m_base->setFlow( IOLayerBase::Software ); | 76 | m_base->setFlow( IOLayerBase::Software ); |
77 | } else if (rad_flow == 0) { | 77 | } else if (rad_flow == 0) { |
78 | m_base->setFlow( IOLayerBase::None ); | 78 | m_base->setFlow( IOLayerBase::None ); |
79 | } | 79 | } |
80 | 80 | ||
81 | if (rad_parity == 1) { | 81 | if (rad_parity == 1) { |
82 | m_base->setParity( IOLayerBase::Even ); | 82 | m_base->setParity( IOLayerBase::Even ); |
83 | } else if ( rad_parity == 2 ) { | 83 | } else if ( rad_parity == 2 ) { |
84 | m_base->setParity( IOLayerBase::Odd ); | 84 | m_base->setParity( IOLayerBase::Odd ); |
85 | } else { | 85 | } else { |
86 | m_base->setParity( IOLayerBase::NonePar ); | 86 | m_base->setParity( IOLayerBase::NonePar ); |
87 | } | 87 | } |
88 | 88 | ||
89 | switch( speed ) { | 89 | switch( speed ) { |
90 | case 115200: | 90 | case 115200: |
91 | m_base->setSpeed(IOLayerBase::Baud_115200 ); | 91 | m_base->setSpeed(IOLayerBase::Baud_115200 ); |
92 | break; | 92 | break; |
93 | case 57600: | 93 | case 57600: |
94 | m_base->setSpeed( IOLayerBase::Baud_57600 ); | 94 | m_base->setSpeed( IOLayerBase::Baud_57600 ); |
95 | break; | 95 | break; |
96 | case 38400: | 96 | case 38400: |
97 | m_base->setSpeed(IOLayerBase::Baud_38400 ); | 97 | m_base->setSpeed(IOLayerBase::Baud_38400 ); |
98 | break; | 98 | break; |
99 | case 19200: | 99 | case 19200: |
100 | m_base->setSpeed( IOLayerBase::Baud_19200 ); | 100 | m_base->setSpeed( IOLayerBase::Baud_19200 ); |
101 | break; | 101 | break; |
102 | case 4800: | 102 | case 4800: |
103 | m_base->setSpeed( IOLayerBase::Baud_4800 ); | 103 | m_base->setSpeed( IOLayerBase::Baud_4800 ); |
104 | break; | 104 | break; |
105 | case 2400: | 105 | case 2400: |
106 | m_base->setSpeed( IOLayerBase::Baud_2400 ); | 106 | m_base->setSpeed( IOLayerBase::Baud_2400 ); |
107 | break; | 107 | break; |
108 | case 1200: | ||
109 | m_base->setSpeed( IOLayerBase::Baud_1200 ); | ||
110 | break; | ||
108 | case 9600: | 111 | case 9600: |
109 | default: | 112 | default: |
110 | m_base->setSpeed(IOLayerBase::Baud_9600 ); | 113 | m_base->setSpeed(IOLayerBase::Baud_9600 ); |
111 | break; | 114 | break; |
112 | } | 115 | } |
113 | 116 | ||
114 | if ( prof.readEntry("Device").isEmpty() ) return; | 117 | if ( prof.readEntry("Device").isEmpty() ) return; |
115 | setCurrent( prof.readEntry("Device"), m_deviceCmb ); | 118 | setCurrent( prof.readEntry("Device"), m_deviceCmb ); |
116 | 119 | ||
117 | } | 120 | } |
118 | /* | 121 | /* |
119 | * save speed, | 122 | * save speed, |
120 | * flow, | 123 | * flow, |
121 | * parity | 124 | * parity |
122 | */ | 125 | */ |
123 | void BTConfigWidget::save( Profile& prof ) { | 126 | void BTConfigWidget::save( Profile& prof ) { |
124 | int flow, parity, speed; | 127 | int flow, parity, speed; |
125 | flow = parity = speed = 0; | 128 | flow = parity = speed = 0; |
126 | prof.writeEntry("Device", m_deviceCmb->currentText() ); | 129 | prof.writeEntry("Device", m_deviceCmb->currentText() ); |
127 | 130 | ||
128 | 131 | ||
129 | switch( m_base->flow() ) { | 132 | switch( m_base->flow() ) { |
130 | case IOLayerBase::None: | 133 | case IOLayerBase::None: |
131 | flow = 0; | 134 | flow = 0; |
132 | break; | 135 | break; |
133 | case IOLayerBase::Software: | 136 | case IOLayerBase::Software: |
134 | flow = 2; | 137 | flow = 2; |
135 | break; | 138 | break; |
136 | case IOLayerBase::Hardware: | 139 | case IOLayerBase::Hardware: |
137 | flow = 1; | 140 | flow = 1; |
138 | break; | 141 | break; |
139 | } | 142 | } |
140 | 143 | ||
141 | switch( m_base->parity() ) { | 144 | switch( m_base->parity() ) { |
142 | case IOLayerBase::Odd: | 145 | case IOLayerBase::Odd: |
143 | parity = 2; | 146 | parity = 2; |
144 | break; | 147 | break; |
145 | case IOLayerBase::Even: | 148 | case IOLayerBase::Even: |
146 | parity = 1; | 149 | parity = 1; |
147 | break; | 150 | break; |
148 | case IOLayerBase::NonePar: | 151 | case IOLayerBase::NonePar: |
149 | parity = 0; | 152 | parity = 0; |
150 | break; | 153 | break; |
151 | } | 154 | } |
152 | 155 | ||
153 | switch( m_base->speed() ) { | 156 | switch( m_base->speed() ) { |
154 | case IOLayerBase::Baud_115200: | 157 | case IOLayerBase::Baud_115200: |
155 | speed = 115200; | 158 | speed = 115200; |
156 | break; | 159 | break; |
157 | case IOLayerBase::Baud_57600: | 160 | case IOLayerBase::Baud_57600: |
158 | speed = 57600; | 161 | speed = 57600; |
159 | break; | 162 | break; |
160 | case IOLayerBase::Baud_38400: | 163 | case IOLayerBase::Baud_38400: |
161 | speed = 38400; | 164 | speed = 38400; |
162 | break; | 165 | break; |
163 | case IOLayerBase::Baud_19200: | 166 | case IOLayerBase::Baud_19200: |
164 | speed = 19200; | 167 | speed = 19200; |
165 | break; | 168 | break; |
166 | case IOLayerBase::Baud_4800: | 169 | case IOLayerBase::Baud_4800: |
167 | speed = 4800; | 170 | speed = 4800; |
168 | break; | 171 | break; |
169 | case IOLayerBase::Baud_2400: | 172 | case IOLayerBase::Baud_2400: |
170 | speed = 2400; | 173 | speed = 2400; |
171 | break; | 174 | break; |
175 | case IOLayerBase::Baud_1200; | ||
176 | speed = 1200; | ||
177 | break; | ||
172 | default: | 178 | default: |
173 | case IOLayerBase::Baud_9600: | 179 | case IOLayerBase::Baud_9600: |
174 | speed = 9600; | 180 | speed = 9600; |
175 | break; | 181 | break; |
176 | } | 182 | } |
177 | 183 | ||
178 | prof.writeEntry("Flow", flow); | 184 | prof.writeEntry("Flow", flow); |
179 | prof.writeEntry("Parity", parity); | 185 | prof.writeEntry("Parity", parity); |
180 | prof.writeEntry("Speed", speed); | 186 | prof.writeEntry("Speed", speed); |
181 | prof.writeEntry("Mac", m_mac->text() ); | 187 | prof.writeEntry("Mac", m_mac->text() ); |
182 | } | 188 | } |
183 | 189 | ||
184 | void BTConfigWidget::slotMacRadio( bool on ) { | 190 | void BTConfigWidget::slotMacRadio( bool on ) { |
185 | if ( on ) { | 191 | if ( on ) { |
186 | m_devRadio->setChecked( false ); | 192 | m_devRadio->setChecked( false ); |
187 | m_deviceCmb->setEnabled( false ); | 193 | m_deviceCmb->setEnabled( false ); |
188 | m_mac->setEnabled( true ); | 194 | m_mac->setEnabled( true ); |
189 | } else { | 195 | } else { |
190 | m_devRadio->setChecked( true ); | 196 | m_devRadio->setChecked( true ); |
191 | } | 197 | } |
192 | } | 198 | } |
193 | 199 | ||
194 | void BTConfigWidget::slotDevRadio( bool on ) { | 200 | void BTConfigWidget::slotDevRadio( bool on ) { |
195 | if ( on ) { | 201 | if ( on ) { |
196 | m_macRadio->setChecked( false ); | 202 | m_macRadio->setChecked( false ); |
197 | m_deviceCmb->setEnabled( true ); | 203 | m_deviceCmb->setEnabled( true ); |
198 | m_mac->setEnabled( false ); | 204 | m_mac->setEnabled( false ); |
199 | } else { | 205 | } else { |
200 | m_macRadio->setChecked( true ); | 206 | m_macRadio->setChecked( true ); |
201 | } | 207 | } |
202 | } | 208 | } |
diff --git a/noncore/apps/opie-console/iolayerbase.cpp b/noncore/apps/opie-console/iolayerbase.cpp index 0f64d6a..95c291f 100644 --- a/noncore/apps/opie-console/iolayerbase.cpp +++ b/noncore/apps/opie-console/iolayerbase.cpp | |||
@@ -1,252 +1,260 @@ | |||
1 | #include <qlabel.h> | 1 | #include <qlabel.h> |
2 | #include <qlayout.h> | 2 | #include <qlayout.h> |
3 | #include <qcombobox.h> | 3 | #include <qcombobox.h> |
4 | #include <qhbuttongroup.h> | 4 | #include <qhbuttongroup.h> |
5 | #include <qradiobutton.h> | 5 | #include <qradiobutton.h> |
6 | 6 | ||
7 | #include "iolayerbase.h" | 7 | #include "iolayerbase.h" |
8 | 8 | ||
9 | namespace { | 9 | namespace { |
10 | enum ParityIds { | 10 | enum ParityIds { |
11 | id_parity_none, | 11 | id_parity_none, |
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 | id_flow_none, |
20 | }; | 20 | }; |
21 | 21 | ||
22 | enum SpeedIds { | 22 | enum SpeedIds { |
23 | id_baud_115200, | 23 | id_baud_115200, |
24 | id_baud_57600, | 24 | id_baud_57600, |
25 | id_baud_38400, | 25 | id_baud_38400, |
26 | id_baud_19200, | 26 | id_baud_19200, |
27 | id_baud_9600, | 27 | id_baud_9600, |
28 | id_baud_4800, | 28 | id_baud_4800, |
29 | id_baud_2400 | 29 | id_baud_2400, |
30 | id_baud_1200 | ||
30 | }; | 31 | }; |
31 | 32 | ||
32 | enum DataIds { | 33 | enum DataIds { |
33 | id_data_5, | 34 | id_data_5, |
34 | id_data_6, | 35 | id_data_6, |
35 | id_data_7, | 36 | id_data_7, |
36 | id_data_8 | 37 | id_data_8 |
37 | }; | 38 | }; |
38 | 39 | ||
39 | enum StopIds { | 40 | enum StopIds { |
40 | id_stop_1, | 41 | id_stop_1, |
41 | id_stop_1_5, | 42 | id_stop_1_5, |
42 | id_stop_2 | 43 | id_stop_2 |
43 | }; | 44 | }; |
44 | 45 | ||
45 | } | 46 | } |
46 | 47 | ||
47 | 48 | ||
48 | IOLayerBase::IOLayerBase( QWidget* par, const char* name ) | 49 | IOLayerBase::IOLayerBase( QWidget* par, const char* name ) |
49 | : QWidget( par, name ) | 50 | : QWidget( par, name ) |
50 | { | 51 | { |
51 | m_speedLabel = new QLabel(tr("Speed"), this ); | 52 | m_speedLabel = new QLabel(tr("Speed"), this ); |
52 | m_speedBox = new QComboBox(this ); | 53 | m_speedBox = new QComboBox(this ); |
53 | 54 | ||
54 | m_groupFlow = new QHButtonGroup(tr("Flow control"),this ); | 55 | m_groupFlow = new QHButtonGroup(tr("Flow control"),this ); |
55 | m_flowHw = new QRadioButton(tr("Hardware"), m_groupFlow ); | 56 | m_flowHw = new QRadioButton(tr("Hardware"), m_groupFlow ); |
56 | m_flowSw = new QRadioButton(tr("Software"), m_groupFlow ); | 57 | m_flowSw = new QRadioButton(tr("Software"), m_groupFlow ); |
57 | m_flowNone = new QRadioButton( tr("None"), m_groupFlow ); | 58 | m_flowNone = new QRadioButton( tr("None"), m_groupFlow ); |
58 | 59 | ||
59 | m_groupParity = new QHButtonGroup(tr("Parity"), this ); | 60 | m_groupParity = new QHButtonGroup(tr("Parity"), this ); |
60 | m_parityNone = new QRadioButton(tr("None"), m_groupParity ); | 61 | m_parityNone = new QRadioButton(tr("None"), m_groupParity ); |
61 | m_parityOdd = new QRadioButton(tr("Odd"), m_groupParity ); | 62 | m_parityOdd = new QRadioButton(tr("Odd"), m_groupParity ); |
62 | m_parityEven = new QRadioButton(tr("Even"), m_groupParity ); | 63 | m_parityEven = new QRadioButton(tr("Even"), m_groupParity ); |
63 | 64 | ||
64 | m_groupData = new QHButtonGroup(tr("Data Bits"), this); | 65 | m_groupData = new QHButtonGroup(tr("Data Bits"), this); |
65 | m_data5 = new QRadioButton(tr("5"), m_groupData ); | 66 | m_data5 = new QRadioButton(tr("5"), m_groupData ); |
66 | m_data6 = new QRadioButton(tr("6"), m_groupData ); | 67 | m_data6 = new QRadioButton(tr("6"), m_groupData ); |
67 | m_data7 = new QRadioButton(tr("7"), m_groupData ); | 68 | m_data7 = new QRadioButton(tr("7"), m_groupData ); |
68 | m_data8 = new QRadioButton(tr("8"), m_groupData ); | 69 | m_data8 = new QRadioButton(tr("8"), m_groupData ); |
69 | 70 | ||
70 | m_groupStop = new QHButtonGroup(tr("Stop Bits"), this ); | 71 | m_groupStop = new QHButtonGroup(tr("Stop Bits"), this ); |
71 | m_stop1 = new QRadioButton(tr("1"), m_groupStop ); | 72 | m_stop1 = new QRadioButton(tr("1"), m_groupStop ); |
72 | m_stop15 = new QRadioButton(tr("1.5"), m_groupStop ); | 73 | m_stop15 = new QRadioButton(tr("1.5"), m_groupStop ); |
73 | m_stop2 = new QRadioButton(tr("2"), m_groupStop ); | 74 | m_stop2 = new QRadioButton(tr("2"), m_groupStop ); |
74 | 75 | ||
75 | 76 | ||
76 | m_lroot = new QVBoxLayout( this ); | 77 | m_lroot = new QVBoxLayout( this ); |
77 | m_lroot->add(m_speedLabel ); | 78 | m_lroot->add(m_speedLabel ); |
78 | m_lroot->add(m_speedBox ); | 79 | m_lroot->add(m_speedBox ); |
79 | m_lroot->add(m_groupFlow ); | 80 | m_lroot->add(m_groupFlow ); |
80 | m_lroot->add(m_groupParity ); | 81 | m_lroot->add(m_groupParity ); |
81 | m_lroot->add( m_groupData ); | 82 | m_lroot->add( m_groupData ); |
82 | m_lroot->add( m_groupStop ); | 83 | m_lroot->add( m_groupStop ); |
83 | m_lroot->addStretch(2); | 84 | m_lroot->addStretch(2); |
84 | 85 | ||
85 | // profiles | 86 | // profiles |
86 | m_speedBox->insertItem(tr("115200 baud"), id_baud_115200 ); | 87 | m_speedBox->insertItem(tr("115200 baud"), id_baud_115200 ); |
87 | m_speedBox->insertItem(tr("57600 baud"), id_baud_57600 ); | 88 | m_speedBox->insertItem(tr("57600 baud"), id_baud_57600 ); |
88 | m_speedBox->insertItem(tr("38400 baud"), id_baud_38400 ); | 89 | m_speedBox->insertItem(tr("38400 baud"), id_baud_38400 ); |
89 | m_speedBox->insertItem(tr("19200 baud"), id_baud_19200 ); | 90 | m_speedBox->insertItem(tr("19200 baud"), id_baud_19200 ); |
90 | m_speedBox->insertItem(tr("9600 baud"), id_baud_9600 ); | 91 | m_speedBox->insertItem(tr("9600 baud"), id_baud_9600 ); |
91 | m_speedBox->insertItem(tr("4800 baud"), id_baud_4800 ); | 92 | m_speedBox->insertItem(tr("4800 baud"), id_baud_4800 ); |
92 | m_speedBox->insertItem(tr("2400 baud"), id_baud_2400 ); | 93 | m_speedBox->insertItem(tr("2400 baud"), id_baud_2400 ); |
94 | m_speedBox->insertItem(tr("1200 baud"), id_baud_1200); | ||
93 | }; | 95 | }; |
94 | IOLayerBase::~IOLayerBase() { | 96 | IOLayerBase::~IOLayerBase() { |
95 | 97 | ||
96 | } | 98 | } |
97 | void IOLayerBase::setFlow( Flow flo ) { | 99 | void IOLayerBase::setFlow( Flow flo ) { |
98 | switch ( flo ) { | 100 | switch ( flo ) { |
99 | case Software: | 101 | case Software: |
100 | m_flowSw->setChecked( true ); | 102 | m_flowSw->setChecked( true ); |
101 | break; | 103 | break; |
102 | case Hardware: | 104 | case Hardware: |
103 | m_flowHw->setChecked( true ); | 105 | m_flowHw->setChecked( true ); |
104 | break; | 106 | break; |
105 | case None: | 107 | case None: |
106 | m_flowNone->setChecked( true ); | 108 | m_flowNone->setChecked( true ); |
107 | break; | 109 | break; |
108 | } | 110 | } |
109 | } | 111 | } |
110 | 112 | ||
111 | void IOLayerBase::setParity( Parity par ) { | 113 | void IOLayerBase::setParity( Parity par ) { |
112 | switch( par ) { | 114 | switch( par ) { |
113 | case NonePar: | 115 | case NonePar: |
114 | m_parityNone->setChecked( true ); | 116 | m_parityNone->setChecked( true ); |
115 | break; | 117 | break; |
116 | case Odd: | 118 | case Odd: |
117 | m_parityOdd->setChecked( true ); | 119 | m_parityOdd->setChecked( true ); |
118 | break; | 120 | break; |
119 | case Even: | 121 | case Even: |
120 | m_parityEven->setChecked( true ); | 122 | m_parityEven->setChecked( true ); |
121 | break; | 123 | break; |
122 | } | 124 | } |
123 | } | 125 | } |
124 | void IOLayerBase::setSpeed( Speed sp ) { | 126 | void IOLayerBase::setSpeed( Speed sp ) { |
125 | int index = -1; | 127 | int index = -1; |
126 | switch( sp ) { | 128 | switch( sp ) { |
127 | case Baud_115200: | 129 | case Baud_115200: |
128 | index = id_baud_115200; | 130 | index = id_baud_115200; |
129 | break; | 131 | break; |
130 | case Baud_57600: | 132 | case Baud_57600: |
131 | index = id_baud_57600; | 133 | index = id_baud_57600; |
132 | break; | 134 | break; |
133 | case Baud_38400: | 135 | case Baud_38400: |
134 | index = id_baud_38400; | 136 | index = id_baud_38400; |
135 | break; | 137 | break; |
136 | case Baud_19200: | 138 | case Baud_19200: |
137 | index = id_baud_19200; | 139 | index = id_baud_19200; |
138 | break; | 140 | break; |
139 | case Baud_4800: | 141 | case Baud_4800: |
140 | index = id_baud_4800; | 142 | index = id_baud_4800; |
141 | break; | 143 | break; |
142 | case Baud_2400: | 144 | case Baud_2400: |
143 | index = id_baud_2400; | 145 | index = id_baud_2400; |
144 | break; | 146 | break; |
147 | case Baud_1200: | ||
148 | index = id_baud_1200; | ||
149 | break; | ||
145 | default: | 150 | default: |
146 | case Baud_9600: | 151 | case Baud_9600: |
147 | index = id_baud_9600; | 152 | index = id_baud_9600; |
148 | break; | 153 | break; |
149 | } | 154 | } |
150 | m_speedBox->setCurrentItem(index ); | 155 | m_speedBox->setCurrentItem(index ); |
151 | } | 156 | } |
152 | 157 | ||
153 | void IOLayerBase::setData( Data data ) { | 158 | void IOLayerBase::setData( Data data ) { |
154 | switch( data ) { | 159 | switch( data ) { |
155 | case Data_Five: | 160 | case Data_Five: |
156 | m_data5->setChecked( true ); | 161 | m_data5->setChecked( true ); |
157 | break; | 162 | break; |
158 | case Data_Six: | 163 | case Data_Six: |
159 | m_data6->setChecked( true ); | 164 | m_data6->setChecked( true ); |
160 | break; | 165 | break; |
161 | case Data_Seven: | 166 | case Data_Seven: |
162 | m_data7->setChecked( true ); | 167 | m_data7->setChecked( true ); |
163 | break; | 168 | break; |
164 | default: | 169 | default: |
165 | m_data8->setChecked( true ); | 170 | m_data8->setChecked( true ); |
166 | break; | 171 | break; |
167 | } | 172 | } |
168 | } | 173 | } |
169 | 174 | ||
170 | 175 | ||
171 | void IOLayerBase::setStop( Stop stop ) { | 176 | void IOLayerBase::setStop( Stop stop ) { |
172 | switch( stop ) { | 177 | switch( stop ) { |
173 | case Stop_Two: | 178 | case Stop_Two: |
174 | m_stop2->setChecked( true ); | 179 | m_stop2->setChecked( true ); |
175 | break; | 180 | break; |
176 | case Stop_OnePointFive: | 181 | case Stop_OnePointFive: |
177 | m_stop15->setChecked( true ); | 182 | m_stop15->setChecked( true ); |
178 | break; | 183 | break; |
179 | default: | 184 | default: |
180 | m_stop1->setChecked( true ); | 185 | m_stop1->setChecked( true ); |
181 | break; | 186 | break; |
182 | } | 187 | } |
183 | } | 188 | } |
184 | 189 | ||
185 | 190 | ||
186 | 191 | ||
187 | IOLayerBase::Flow IOLayerBase::flow()const { | 192 | IOLayerBase::Flow IOLayerBase::flow()const { |
188 | if (m_flowHw->isChecked() ) { | 193 | if (m_flowHw->isChecked() ) { |
189 | return Hardware; | 194 | return Hardware; |
190 | }else if( m_flowSw->isChecked() ) { | 195 | }else if( m_flowSw->isChecked() ) { |
191 | return Software; | 196 | return Software; |
192 | } else { | 197 | } else { |
193 | return None; | 198 | return None; |
194 | } | 199 | } |
195 | } | 200 | } |
196 | IOLayerBase::Parity IOLayerBase::parity()const { | 201 | IOLayerBase::Parity IOLayerBase::parity()const { |
197 | if ( m_parityOdd->isChecked() ) { | 202 | if ( m_parityOdd->isChecked() ) { |
198 | return Odd; | 203 | return Odd; |
199 | } else if ( m_parityEven->isChecked() ) { | 204 | } else if ( m_parityEven->isChecked() ) { |
200 | return Even; | 205 | return Even; |
201 | } else { | 206 | } else { |
202 | return NonePar; | 207 | return NonePar; |
203 | } | 208 | } |
204 | 209 | ||
205 | } | 210 | } |
206 | IOLayerBase::Speed IOLayerBase::speed()const{ | 211 | IOLayerBase::Speed IOLayerBase::speed()const{ |
207 | switch( m_speedBox->currentItem() ) { | 212 | switch( m_speedBox->currentItem() ) { |
208 | case id_baud_115200: | 213 | case id_baud_115200: |
209 | return Baud_115200; | 214 | return Baud_115200; |
210 | break; | 215 | break; |
211 | case id_baud_57600: | 216 | case id_baud_57600: |
212 | return Baud_57600; | 217 | return Baud_57600; |
213 | break; | 218 | break; |
214 | case id_baud_38400: | 219 | case id_baud_38400: |
215 | return Baud_38400; | 220 | return Baud_38400; |
216 | break; | 221 | break; |
217 | case id_baud_19200: | 222 | case id_baud_19200: |
218 | return Baud_19200; | 223 | return Baud_19200; |
219 | break; | 224 | break; |
220 | case id_baud_4800: | 225 | case id_baud_4800: |
221 | return Baud_4800; | 226 | return Baud_4800; |
222 | break; | 227 | break; |
223 | case id_baud_2400: | 228 | case id_baud_2400: |
224 | return Baud_2400; | 229 | return Baud_2400; |
225 | break; | 230 | break; |
231 | case id_baud_1200: | ||
232 | return Baud_1200; | ||
233 | break; | ||
226 | default: | 234 | default: |
227 | case id_baud_9600: | 235 | case id_baud_9600: |
228 | return Baud_9600; | 236 | return Baud_9600; |
229 | break; | 237 | break; |
230 | } | 238 | } |
231 | } | 239 | } |
232 | IOLayerBase::Data IOLayerBase::data()const { | 240 | IOLayerBase::Data IOLayerBase::data()const { |
233 | if ( m_data5->isChecked() ) { | 241 | if ( m_data5->isChecked() ) { |
234 | return Data_Five; | 242 | return Data_Five; |
235 | } else if ( m_data6->isChecked() ) { | 243 | } else if ( m_data6->isChecked() ) { |
236 | return Data_Six; | 244 | return Data_Six; |
237 | } else if ( m_data7->isChecked() ) { | 245 | } else if ( m_data7->isChecked() ) { |
238 | return Data_Seven; | 246 | return Data_Seven; |
239 | } else { | 247 | } else { |
240 | return Data_Eight; | 248 | return Data_Eight; |
241 | } | 249 | } |
242 | } | 250 | } |
243 | IOLayerBase::Stop IOLayerBase::stop()const { | 251 | IOLayerBase::Stop IOLayerBase::stop()const { |
244 | if ( m_stop2->isChecked() ) { | 252 | if ( m_stop2->isChecked() ) { |
245 | return Stop_Two; | 253 | return Stop_Two; |
246 | } else if ( m_stop15->isChecked() ) { | 254 | } else if ( m_stop15->isChecked() ) { |
247 | return Stop_OnePointFive; | 255 | return Stop_OnePointFive; |
248 | } else { | 256 | } else { |
249 | return Stop_One; | 257 | return Stop_One; |
250 | } | 258 | } |
251 | } | 259 | } |
252 | 260 | ||
diff --git a/noncore/apps/opie-console/iolayerbase.h b/noncore/apps/opie-console/iolayerbase.h index 214a35c..7d304a1 100644 --- a/noncore/apps/opie-console/iolayerbase.h +++ b/noncore/apps/opie-console/iolayerbase.h | |||
@@ -1,60 +1,61 @@ | |||
1 | #ifndef OPIE_IO_LAYER_BASE_H | 1 | #ifndef OPIE_IO_LAYER_BASE_H |
2 | #define OPIE_IO_LAYER_BASE_H | 2 | #define OPIE_IO_LAYER_BASE_H |
3 | 3 | ||
4 | 4 | ||
5 | #include <qwidget.h> | 5 | #include <qwidget.h> |
6 | 6 | ||
7 | class QLabel; | 7 | class QLabel; |
8 | class QComboBox; | 8 | class QComboBox; |
9 | class QVBoxLayout; | 9 | class QVBoxLayout; |
10 | class QButtonGroup; | 10 | class QButtonGroup; |
11 | class QRadioButton; | 11 | class QRadioButton; |
12 | class QHBoxLayout; | 12 | class QHBoxLayout; |
13 | class IOLayerBase : public QWidget { | 13 | class IOLayerBase : public QWidget { |
14 | 14 | ||
15 | Q_OBJECT | 15 | Q_OBJECT |
16 | 16 | ||
17 | public: | 17 | public: |
18 | enum Flow { Hardware, Software, None }; | 18 | enum Flow { Hardware, Software, None }; |
19 | enum Parity{ Odd =2 , Even =1, NonePar =0 }; | 19 | enum Parity{ Odd =2 , Even =1, NonePar =0 }; |
20 | enum Speed{ Baud_115200, | 20 | enum Speed{ Baud_115200, |
21 | Baud_57600, | 21 | Baud_57600, |
22 | Baud_38400, | 22 | Baud_38400, |
23 | Baud_19200, | 23 | Baud_19200, |
24 | Baud_9600, | 24 | Baud_9600, |
25 | Baud_4800, | 25 | Baud_4800, |
26 | Baud_2400 }; | 26 | Baud_2400, |
27 | Baud_1200 }; | ||
27 | enum Data { Data_Five =5, Data_Six =6, Data_Seven=7, Data_Eight=8 }; | 28 | enum Data { Data_Five =5, Data_Six =6, Data_Seven=7, Data_Eight=8 }; |
28 | enum Stop { Stop_One =1, Stop_OnePointFive=15, Stop_Two=2 }; | 29 | enum Stop { Stop_One =1, Stop_OnePointFive=15, Stop_Two=2 }; |
29 | 30 | ||
30 | IOLayerBase( QWidget* base, const char* name = 0l); | 31 | IOLayerBase( QWidget* base, const char* name = 0l); |
31 | ~IOLayerBase(); | 32 | ~IOLayerBase(); |
32 | 33 | ||
33 | void setFlow( Flow flo ); | 34 | void setFlow( Flow flo ); |
34 | void setParity( Parity par ); | 35 | void setParity( Parity par ); |
35 | void setSpeed( Speed speed ); | 36 | void setSpeed( Speed speed ); |
36 | void setData( Data data ); | 37 | void setData( Data data ); |
37 | void setStop( Stop stop ); | 38 | void setStop( Stop stop ); |
38 | 39 | ||
39 | Flow flow()const; | 40 | Flow flow()const; |
40 | Parity parity()const; | 41 | Parity parity()const; |
41 | Speed speed()const; | 42 | Speed speed()const; |
42 | Data data()const; | 43 | Data data()const; |
43 | Stop stop()const; | 44 | Stop stop()const; |
44 | private: | 45 | private: |
45 | QVBoxLayout* m_lroot; | 46 | QVBoxLayout* m_lroot; |
46 | QLabel* m_speedLabel; | 47 | QLabel* m_speedLabel; |
47 | QComboBox* m_speedBox; | 48 | QComboBox* m_speedBox; |
48 | QButtonGroup* m_groupFlow, *m_groupData, *m_groupStop ; | 49 | QButtonGroup* m_groupFlow, *m_groupData, *m_groupStop ; |
49 | QRadioButton *m_flowHw, *m_flowSw, *m_flowNone; | 50 | QRadioButton *m_flowHw, *m_flowSw, *m_flowNone; |
50 | 51 | ||
51 | QButtonGroup* m_groupParity; | 52 | QButtonGroup* m_groupParity; |
52 | QRadioButton *m_parityOdd, *m_parityEven, *m_parityNone; | 53 | QRadioButton *m_parityOdd, *m_parityEven, *m_parityNone; |
53 | QRadioButton *m_data5, *m_data6, *m_data7, *m_data8; | 54 | QRadioButton *m_data5, *m_data6, *m_data7, *m_data8; |
54 | QRadioButton *m_stop1, *m_stop15, *m_stop2; | 55 | QRadioButton *m_stop1, *m_stop15, *m_stop2; |
55 | QHBoxLayout* m_hbox; | 56 | QHBoxLayout* m_hbox; |
56 | QHBoxLayout* m_hboxPar; | 57 | QHBoxLayout* m_hboxPar; |
57 | }; | 58 | }; |
58 | 59 | ||
59 | 60 | ||
60 | #endif | 61 | #endif |
diff --git a/noncore/apps/opie-console/irdaconfigwidget.cpp b/noncore/apps/opie-console/irdaconfigwidget.cpp index 4ee770d..713862d 100644 --- a/noncore/apps/opie-console/irdaconfigwidget.cpp +++ b/noncore/apps/opie-console/irdaconfigwidget.cpp | |||
@@ -39,122 +39,128 @@ IrdaConfigWidget::IrdaConfigWidget( const QString& name, | |||
39 | 39 | ||
40 | m_deviceCmb->insertItem( "/dev/ircomm0" ); | 40 | m_deviceCmb->insertItem( "/dev/ircomm0" ); |
41 | m_deviceCmb->insertItem( "/dev/ircomm1" ); | 41 | m_deviceCmb->insertItem( "/dev/ircomm1" ); |
42 | } | 42 | } |
43 | 43 | ||
44 | IrdaConfigWidget::~IrdaConfigWidget() { | 44 | IrdaConfigWidget::~IrdaConfigWidget() { |
45 | 45 | ||
46 | } | 46 | } |
47 | void IrdaConfigWidget::load( const Profile& prof ) { | 47 | void IrdaConfigWidget::load( const Profile& prof ) { |
48 | int rad_flow = prof.readNumEntry("Flow"); | 48 | int rad_flow = prof.readNumEntry("Flow"); |
49 | int rad_parity = prof.readNumEntry("Parity"); | 49 | int rad_parity = prof.readNumEntry("Parity"); |
50 | int speed = prof.readNumEntry("Speed"); | 50 | int speed = prof.readNumEntry("Speed"); |
51 | 51 | ||
52 | if (rad_flow == 1) { | 52 | if (rad_flow == 1) { |
53 | m_base->setFlow( IOLayerBase::Hardware ); | 53 | m_base->setFlow( IOLayerBase::Hardware ); |
54 | } else if (rad_flow == 2) { | 54 | } else if (rad_flow == 2) { |
55 | m_base->setFlow( IOLayerBase::Software ); | 55 | m_base->setFlow( IOLayerBase::Software ); |
56 | } else { | 56 | } else { |
57 | m_base->setFlow( IOLayerBase::None ); | 57 | m_base->setFlow( IOLayerBase::None ); |
58 | } | 58 | } |
59 | 59 | ||
60 | if (rad_parity == 1) { | 60 | if (rad_parity == 1) { |
61 | m_base->setParity( IOLayerBase::Even ); | 61 | m_base->setParity( IOLayerBase::Even ); |
62 | } else if ( rad_parity == 2 ) { | 62 | } else if ( rad_parity == 2 ) { |
63 | m_base->setParity( IOLayerBase::Odd ); | 63 | m_base->setParity( IOLayerBase::Odd ); |
64 | } else { | 64 | } else { |
65 | m_base->setParity( IOLayerBase::NonePar ); | 65 | m_base->setParity( IOLayerBase::NonePar ); |
66 | } | 66 | } |
67 | 67 | ||
68 | switch( speed ) { | 68 | switch( speed ) { |
69 | case 115200: | 69 | case 115200: |
70 | m_base->setSpeed(IOLayerBase::Baud_115200 ); | 70 | m_base->setSpeed(IOLayerBase::Baud_115200 ); |
71 | break; | 71 | break; |
72 | case 57600: | 72 | case 57600: |
73 | m_base->setSpeed( IOLayerBase::Baud_57600 ); | 73 | m_base->setSpeed( IOLayerBase::Baud_57600 ); |
74 | break; | 74 | break; |
75 | case 38400: | 75 | case 38400: |
76 | m_base->setSpeed(IOLayerBase::Baud_38400 ); | 76 | m_base->setSpeed(IOLayerBase::Baud_38400 ); |
77 | break; | 77 | break; |
78 | case 19200: | 78 | case 19200: |
79 | m_base->setSpeed( IOLayerBase::Baud_19200 ); | 79 | m_base->setSpeed( IOLayerBase::Baud_19200 ); |
80 | break; | 80 | break; |
81 | case 4800: | 81 | case 4800: |
82 | m_base->setSpeed( IOLayerBase::Baud_4800 ); | 82 | m_base->setSpeed( IOLayerBase::Baud_4800 ); |
83 | break; | 83 | break; |
84 | case 2400: | 84 | case 2400: |
85 | m_base->setSpeed( IOLayerBase::Baud_2400 ); | 85 | m_base->setSpeed( IOLayerBase::Baud_2400 ); |
86 | break; | 86 | break; |
87 | case 1200: | ||
88 | m_base->setSpeed( IOLayerBase::Baud_1200); | ||
89 | break; | ||
87 | case 9600: | 90 | case 9600: |
88 | default: | 91 | default: |
89 | m_base->setSpeed(IOLayerBase::Baud_9600 ); | 92 | m_base->setSpeed(IOLayerBase::Baud_9600 ); |
90 | break; | 93 | break; |
91 | } | 94 | } |
92 | 95 | ||
93 | if ( prof.readEntry("Device").isEmpty() ) return; | 96 | if ( prof.readEntry("Device").isEmpty() ) return; |
94 | setCurrent( prof.readEntry("Device"), m_deviceCmb ); | 97 | setCurrent( prof.readEntry("Device"), m_deviceCmb ); |
95 | 98 | ||
96 | } | 99 | } |
97 | /* | 100 | /* |
98 | * save speed, | 101 | * save speed, |
99 | * flow, | 102 | * flow, |
100 | * parity | 103 | * parity |
101 | */ | 104 | */ |
102 | void IrdaConfigWidget::save( Profile& prof ) { | 105 | void IrdaConfigWidget::save( Profile& prof ) { |
103 | int flow, parity, speed; | 106 | int flow, parity, speed; |
104 | flow = parity = speed = 0; | 107 | flow = parity = speed = 0; |
105 | prof.writeEntry("Device", m_deviceCmb->currentText() ); | 108 | prof.writeEntry("Device", m_deviceCmb->currentText() ); |
106 | 109 | ||
107 | switch( m_base->flow() ) { | 110 | switch( m_base->flow() ) { |
108 | case IOLayerBase::None: | 111 | case IOLayerBase::None: |
109 | flow = 0; | 112 | flow = 0; |
110 | break; | 113 | break; |
111 | case IOLayerBase::Software: | 114 | case IOLayerBase::Software: |
112 | flow = 2; | 115 | flow = 2; |
113 | break; | 116 | break; |
114 | case IOLayerBase::Hardware: | 117 | case IOLayerBase::Hardware: |
115 | flow = 1; | 118 | flow = 1; |
116 | break; | 119 | break; |
117 | } | 120 | } |
118 | 121 | ||
119 | 122 | ||
120 | switch( m_base->parity() ) { | 123 | switch( m_base->parity() ) { |
121 | case IOLayerBase::Odd: | 124 | case IOLayerBase::Odd: |
122 | parity = 2; | 125 | parity = 2; |
123 | break; | 126 | break; |
124 | case IOLayerBase::Even: | 127 | case IOLayerBase::Even: |
125 | parity = 1; | 128 | parity = 1; |
126 | break; | 129 | break; |
127 | case IOLayerBase::NonePar: | 130 | case IOLayerBase::NonePar: |
128 | parity = 0; | 131 | parity = 0; |
129 | break; | 132 | break; |
130 | } | 133 | } |
131 | 134 | ||
132 | switch( m_base->speed() ) { | 135 | switch( m_base->speed() ) { |
133 | case IOLayerBase::Baud_115200: | 136 | case IOLayerBase::Baud_115200: |
134 | speed = 115200; | 137 | speed = 115200; |
135 | break; | 138 | break; |
136 | case IOLayerBase::Baud_57600: | 139 | case IOLayerBase::Baud_57600: |
137 | speed = 57600; | 140 | speed = 57600; |
138 | break; | 141 | break; |
139 | case IOLayerBase::Baud_38400: | 142 | case IOLayerBase::Baud_38400: |
140 | speed = 38400; | 143 | speed = 38400; |
141 | break; | 144 | break; |
142 | case IOLayerBase::Baud_19200: | 145 | case IOLayerBase::Baud_19200: |
143 | speed = 19200; | 146 | speed = 19200; |
144 | break; | 147 | break; |
145 | case IOLayerBase::Baud_4800: | 148 | case IOLayerBase::Baud_4800: |
146 | speed = 4800; | 149 | speed = 4800; |
147 | break; | 150 | break; |
148 | case IOLayerBase::Baud_2400: | 151 | case IOLayerBase::Baud_2400: |
149 | speed = 2400; | 152 | speed = 2400; |
150 | break; | 153 | break; |
154 | case IOLayerBase::Baud_1200: | ||
155 | speed = 2400; | ||
156 | break; | ||
151 | default: | 157 | default: |
152 | case IOLayerBase::Baud_9600: | 158 | case IOLayerBase::Baud_9600: |
153 | speed = 9600; | 159 | speed = 9600; |
154 | break; | 160 | break; |
155 | } | 161 | } |
156 | 162 | ||
157 | prof.writeEntry("Flow", flow); | 163 | prof.writeEntry("Flow", flow); |
158 | prof.writeEntry("Parity", parity); | 164 | prof.writeEntry("Parity", parity); |
159 | prof.writeEntry("Speed", speed); | 165 | prof.writeEntry("Speed", speed); |
160 | } | 166 | } |
diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp index 90d0b5b..b2f5c68 100644 --- a/noncore/apps/opie-console/modemconfigwidget.cpp +++ b/noncore/apps/opie-console/modemconfigwidget.cpp | |||
@@ -71,189 +71,194 @@ void ModemConfigWidget::load( const Profile& prof ) { | |||
71 | 71 | ||
72 | int rad_flow = prof.readNumEntry( "Flow" ); | 72 | int rad_flow = prof.readNumEntry( "Flow" ); |
73 | int rad_parity = prof.readNumEntry( "Parity" ); | 73 | int rad_parity = prof.readNumEntry( "Parity" ); |
74 | int speed = prof.readNumEntry( "Speed" ); | 74 | int speed = prof.readNumEntry( "Speed" ); |
75 | int dbits = prof.readNumEntry("DataBits"); | 75 | int dbits = prof.readNumEntry("DataBits"); |
76 | int sbits = prof.readNumEntry("StopBits"); | 76 | int sbits = prof.readNumEntry("StopBits"); |
77 | QString number = prof.readEntry( "Number" ); | 77 | QString number = prof.readEntry( "Number" ); |
78 | 78 | ||
79 | if ( !number.isEmpty() ) { | 79 | if ( !number.isEmpty() ) { |
80 | m_telNumber->setText( number ); | 80 | m_telNumber->setText( number ); |
81 | } | 81 | } |
82 | 82 | ||
83 | if ( rad_flow == 1 ) { | 83 | if ( rad_flow == 1 ) { |
84 | m_base->setFlow( IOLayerBase::Hardware ); | 84 | m_base->setFlow( IOLayerBase::Hardware ); |
85 | } else if (rad_flow == 2) { | 85 | } else if (rad_flow == 2) { |
86 | m_base->setFlow( IOLayerBase::Software ); | 86 | m_base->setFlow( IOLayerBase::Software ); |
87 | } else if (rad_flow == 0) { | 87 | } else if (rad_flow == 0) { |
88 | m_base->setFlow( IOLayerBase::None ); | 88 | m_base->setFlow( IOLayerBase::None ); |
89 | } | 89 | } |
90 | 90 | ||
91 | 91 | ||
92 | if ( rad_parity == 1 ) { | 92 | if ( rad_parity == 1 ) { |
93 | m_base->setParity( IOLayerBase::Even ); | 93 | m_base->setParity( IOLayerBase::Even ); |
94 | } else if ( rad_parity == 2 ){ | 94 | } else if ( rad_parity == 2 ){ |
95 | m_base->setParity( IOLayerBase::Odd ); | 95 | m_base->setParity( IOLayerBase::Odd ); |
96 | } else { | 96 | } else { |
97 | m_base->setParity( IOLayerBase::NonePar ); | 97 | m_base->setParity( IOLayerBase::NonePar ); |
98 | } | 98 | } |
99 | 99 | ||
100 | switch( speed ) { | 100 | switch( speed ) { |
101 | case 115200: | 101 | case 115200: |
102 | m_base->setSpeed( IOLayerBase::Baud_115200 ); | 102 | m_base->setSpeed( IOLayerBase::Baud_115200 ); |
103 | break; | 103 | break; |
104 | case 57600: | 104 | case 57600: |
105 | m_base->setSpeed( IOLayerBase::Baud_57600 ); | 105 | m_base->setSpeed( IOLayerBase::Baud_57600 ); |
106 | break; | 106 | break; |
107 | case 38400: | 107 | case 38400: |
108 | m_base->setSpeed( IOLayerBase::Baud_38400 ); | 108 | m_base->setSpeed( IOLayerBase::Baud_38400 ); |
109 | break; | 109 | break; |
110 | case 19200: | 110 | case 19200: |
111 | m_base->setSpeed( IOLayerBase::Baud_19200 ); | 111 | m_base->setSpeed( IOLayerBase::Baud_19200 ); |
112 | break; | 112 | break; |
113 | case 4800: | 113 | case 4800: |
114 | m_base->setSpeed( IOLayerBase::Baud_4800 ); | 114 | m_base->setSpeed( IOLayerBase::Baud_4800 ); |
115 | break; | 115 | break; |
116 | case 2400: | 116 | case 2400: |
117 | m_base->setSpeed( IOLayerBase::Baud_2400 ); | 117 | m_base->setSpeed( IOLayerBase::Baud_2400 ); |
118 | break; | 118 | break; |
119 | case 1200: | ||
120 | m_base->setSpeed( IOLayerBase::Baud_1200 ); | ||
119 | case 9600: | 121 | case 9600: |
120 | default: | 122 | default: |
121 | m_base->setSpeed( IOLayerBase::Baud_9600 ); | 123 | m_base->setSpeed( IOLayerBase::Baud_9600 ); |
122 | break; | 124 | break; |
123 | } | 125 | } |
124 | 126 | ||
125 | 127 | ||
126 | if ( dbits == 5) { | 128 | if ( dbits == 5) { |
127 | m_base->setData( IOLayerBase::Data_Five ); | 129 | m_base->setData( IOLayerBase::Data_Five ); |
128 | } else if (rad_flow == 6) { | 130 | } else if (rad_flow == 6) { |
129 | m_base->setData( IOLayerBase::Data_Six ); | 131 | m_base->setData( IOLayerBase::Data_Six ); |
130 | } else if (rad_flow == 7) { | 132 | } else if (rad_flow == 7) { |
131 | m_base->setData( IOLayerBase::Data_Seven ); | 133 | m_base->setData( IOLayerBase::Data_Seven ); |
132 | } else { | 134 | } else { |
133 | m_base->setData( IOLayerBase::Data_Eight ); | 135 | m_base->setData( IOLayerBase::Data_Eight ); |
134 | } | 136 | } |
135 | 137 | ||
136 | if ( sbits == 2) { | 138 | if ( sbits == 2) { |
137 | m_base->setStop( IOLayerBase::Stop_Two ); | 139 | m_base->setStop( IOLayerBase::Stop_Two ); |
138 | } else if ( sbits == 15 ) { | 140 | } else if ( sbits == 15 ) { |
139 | m_base->setStop( IOLayerBase::Stop_OnePointFive ); | 141 | m_base->setStop( IOLayerBase::Stop_OnePointFive ); |
140 | } else { | 142 | } else { |
141 | m_base->setStop( IOLayerBase::Stop_One ); | 143 | m_base->setStop( IOLayerBase::Stop_One ); |
142 | } | 144 | } |
143 | 145 | ||
144 | 146 | ||
145 | atConf->readConfig( prof ); | 147 | atConf->readConfig( prof ); |
146 | if ( prof.readEntry( "Device" ).isEmpty() ) { | 148 | if ( prof.readEntry( "Device" ).isEmpty() ) { |
147 | owarn << "device empty!" << oendl; | 149 | owarn << "device empty!" << oendl; |
148 | return; | 150 | return; |
149 | } | 151 | } |
150 | setCurrent( prof.readEntry( "Device" ), m_deviceCmb ); | 152 | setCurrent( prof.readEntry( "Device" ), m_deviceCmb ); |
151 | 153 | ||
152 | 154 | ||
153 | } | 155 | } |
154 | 156 | ||
155 | /* | 157 | /* |
156 | * save speed, | 158 | * save speed, |
157 | * flow, | 159 | * flow, |
158 | * parity | 160 | * parity |
159 | */ | 161 | */ |
160 | void ModemConfigWidget::save( Profile& prof ) { | 162 | void ModemConfigWidget::save( Profile& prof ) { |
161 | int flow, parity, speed, data, stop; | 163 | int flow, parity, speed, data, stop; |
162 | flow = parity = speed = data = stop = 0; | 164 | flow = parity = speed = data = stop = 0; |
163 | prof.writeEntry( "Device", m_deviceCmb->currentText() ); | 165 | prof.writeEntry( "Device", m_deviceCmb->currentText() ); |
164 | 166 | ||
165 | 167 | ||
166 | switch( m_base->flow() ) { | 168 | switch( m_base->flow() ) { |
167 | case IOLayerBase::None: | 169 | case IOLayerBase::None: |
168 | flow = 0; | 170 | flow = 0; |
169 | break; | 171 | break; |
170 | case IOLayerBase::Software: | 172 | case IOLayerBase::Software: |
171 | flow = 2; | 173 | flow = 2; |
172 | break; | 174 | break; |
173 | case IOLayerBase::Hardware: | 175 | case IOLayerBase::Hardware: |
174 | flow = 1; | 176 | flow = 1; |
175 | break; | 177 | break; |
176 | } | 178 | } |
177 | 179 | ||
178 | switch( m_base->parity() ) { | 180 | switch( m_base->parity() ) { |
179 | case IOLayerBase::Odd: | 181 | case IOLayerBase::Odd: |
180 | parity = 2; | 182 | parity = 2; |
181 | break; | 183 | break; |
182 | case IOLayerBase::Even: | 184 | case IOLayerBase::Even: |
183 | parity = 1; | 185 | parity = 1; |
184 | break; | 186 | break; |
185 | case IOLayerBase::NonePar: | 187 | case IOLayerBase::NonePar: |
186 | parity = 0; | 188 | parity = 0; |
187 | break; | 189 | break; |
188 | } | 190 | } |
189 | 191 | ||
190 | switch( m_base->speed() ) { | 192 | switch( m_base->speed() ) { |
191 | case IOLayerBase::Baud_115200: | 193 | case IOLayerBase::Baud_115200: |
192 | speed = 115200; | 194 | speed = 115200; |
193 | break; | 195 | break; |
194 | case IOLayerBase::Baud_57600: | 196 | case IOLayerBase::Baud_57600: |
195 | speed = 57600; | 197 | speed = 57600; |
196 | break; | 198 | break; |
197 | case IOLayerBase::Baud_38400: | 199 | case IOLayerBase::Baud_38400: |
198 | speed = 38400; | 200 | speed = 38400; |
199 | break; | 201 | break; |
200 | case IOLayerBase::Baud_19200: | 202 | case IOLayerBase::Baud_19200: |
201 | speed = 19200; | 203 | speed = 19200; |
202 | break; | 204 | break; |
203 | case IOLayerBase::Baud_9600: | 205 | case IOLayerBase::Baud_9600: |
204 | speed = 9600; | 206 | speed = 9600; |
205 | break; | 207 | break; |
206 | case IOLayerBase::Baud_4800: | 208 | case IOLayerBase::Baud_4800: |
207 | speed = 4800; | 209 | speed = 4800; |
208 | break; | 210 | break; |
209 | case IOLayerBase::Baud_2400: | 211 | case IOLayerBase::Baud_2400: |
210 | speed = 2400; | 212 | speed = 2400; |
211 | break; | 213 | break; |
214 | case IOLayerBase::Baud_1200: | ||
215 | speed = 1200; | ||
216 | break; | ||
212 | } | 217 | } |
213 | 218 | ||
214 | switch( m_base->data() ) { | 219 | switch( m_base->data() ) { |
215 | case IOLayerBase::Data_Five: | 220 | case IOLayerBase::Data_Five: |
216 | data = 5; | 221 | data = 5; |
217 | break; | 222 | break; |
218 | case IOLayerBase::Data_Six: | 223 | case IOLayerBase::Data_Six: |
219 | data = 6; | 224 | data = 6; |
220 | break; | 225 | break; |
221 | case IOLayerBase::Data_Seven: | 226 | case IOLayerBase::Data_Seven: |
222 | data = 7; | 227 | data = 7; |
223 | break; | 228 | break; |
224 | case IOLayerBase::Data_Eight: | 229 | case IOLayerBase::Data_Eight: |
225 | data = 8; | 230 | data = 8; |
226 | break; | 231 | break; |
227 | } | 232 | } |
228 | 233 | ||
229 | switch( m_base->stop() ) { | 234 | switch( m_base->stop() ) { |
230 | case IOLayerBase::Stop_One: | 235 | case IOLayerBase::Stop_One: |
231 | stop = 1; | 236 | stop = 1; |
232 | break; | 237 | break; |
233 | case IOLayerBase::Stop_OnePointFive: | 238 | case IOLayerBase::Stop_OnePointFive: |
234 | stop = 15; | 239 | stop = 15; |
235 | break; | 240 | break; |
236 | case IOLayerBase::Stop_Two: | 241 | case IOLayerBase::Stop_Two: |
237 | stop = 2; | 242 | stop = 2; |
238 | break; | 243 | break; |
239 | } | 244 | } |
240 | 245 | ||
241 | prof.writeEntry( "Flow", flow ); | 246 | prof.writeEntry( "Flow", flow ); |
242 | prof.writeEntry( "Parity", parity ); | 247 | prof.writeEntry( "Parity", parity ); |
243 | prof.writeEntry( "Speed", speed ); | 248 | prof.writeEntry( "Speed", speed ); |
244 | prof.writeEntry("DataBits", data); | 249 | prof.writeEntry("DataBits", data); |
245 | prof.writeEntry("StopBits", stop); | 250 | prof.writeEntry("StopBits", stop); |
246 | prof.writeEntry( "Number", m_telNumber->text() ); | 251 | prof.writeEntry( "Number", m_telNumber->text() ); |
247 | 252 | ||
248 | 253 | ||
249 | atConf->writeConfig(prof); | 254 | atConf->writeConfig(prof); |
250 | } | 255 | } |
251 | 256 | ||
252 | void ModemConfigWidget::slotAT() { | 257 | void ModemConfigWidget::slotAT() { |
253 | // ATConfigDialog conf( this, "ATConfig", true ); | 258 | // ATConfigDialog conf( this, "ATConfig", true ); |
254 | // josef/Max I know why don't you create the stuff on the stack | 259 | // josef/Max I know why don't you create the stuff on the stack |
255 | // but making it a TopLevel Dialog and ignoring | 260 | // but making it a TopLevel Dialog and ignoring |
256 | // cancel is not fun either... | 261 | // cancel is not fun either... |
257 | // what to do? FIXME!!! -zecke | 262 | // what to do? FIXME!!! -zecke |
258 | if ( QPEApplication::execDialog( atConf ) != QDialog::Accepted ) { | 263 | if ( QPEApplication::execDialog( atConf ) != QDialog::Accepted ) { |
259 | // reload old settings | 264 | // reload old settings |
diff --git a/noncore/apps/opie-console/serialconfigwidget.cpp b/noncore/apps/opie-console/serialconfigwidget.cpp index 5f3547a..c4c9c99 100644 --- a/noncore/apps/opie-console/serialconfigwidget.cpp +++ b/noncore/apps/opie-console/serialconfigwidget.cpp | |||
@@ -43,168 +43,174 @@ SerialConfigWidget::SerialConfigWidget( const QString& name, | |||
43 | m_deviceCmb->insertItem( "/dev/ttySA1"); | 43 | m_deviceCmb->insertItem( "/dev/ttySA1"); |
44 | 44 | ||
45 | } | 45 | } |
46 | SerialConfigWidget::~SerialConfigWidget() { | 46 | SerialConfigWidget::~SerialConfigWidget() { |
47 | 47 | ||
48 | } | 48 | } |
49 | void SerialConfigWidget::load( const Profile& prof ) { | 49 | void SerialConfigWidget::load( const Profile& prof ) { |
50 | int rad_flow = prof.readNumEntry("Flow"); | 50 | int rad_flow = prof.readNumEntry("Flow"); |
51 | int rad_parity = prof.readNumEntry("Parity"); | 51 | int rad_parity = prof.readNumEntry("Parity"); |
52 | int speed = prof.readNumEntry("Speed"); | 52 | int speed = prof.readNumEntry("Speed"); |
53 | int dbits = prof.readNumEntry("DataBits"); | 53 | int dbits = prof.readNumEntry("DataBits"); |
54 | int sbits = prof.readNumEntry("StopBits"); | 54 | int sbits = prof.readNumEntry("StopBits"); |
55 | 55 | ||
56 | if (rad_flow == 1) { | 56 | if (rad_flow == 1) { |
57 | m_base->setFlow( IOLayerBase::Hardware ); | 57 | m_base->setFlow( IOLayerBase::Hardware ); |
58 | } else if (rad_flow == 2) { | 58 | } else if (rad_flow == 2) { |
59 | m_base->setFlow( IOLayerBase::Software ); | 59 | m_base->setFlow( IOLayerBase::Software ); |
60 | } else { | 60 | } else { |
61 | m_base->setFlow( IOLayerBase::None ); | 61 | m_base->setFlow( IOLayerBase::None ); |
62 | } | 62 | } |
63 | 63 | ||
64 | if (rad_parity == 1) { | 64 | if (rad_parity == 1) { |
65 | m_base->setParity( IOLayerBase::Even ); | 65 | m_base->setParity( IOLayerBase::Even ); |
66 | } else if ( rad_parity == 2 ) { | 66 | } else if ( rad_parity == 2 ) { |
67 | m_base->setParity( IOLayerBase::Odd ); | 67 | m_base->setParity( IOLayerBase::Odd ); |
68 | } else { | 68 | } else { |
69 | m_base->setParity( IOLayerBase::NonePar ); | 69 | m_base->setParity( IOLayerBase::NonePar ); |
70 | } | 70 | } |
71 | 71 | ||
72 | switch( speed ) { | 72 | switch( speed ) { |
73 | case 115200: | 73 | case 115200: |
74 | m_base->setSpeed(IOLayerBase::Baud_115200 ); | 74 | m_base->setSpeed(IOLayerBase::Baud_115200 ); |
75 | break; | 75 | break; |
76 | case 57600: | 76 | case 57600: |
77 | m_base->setSpeed( IOLayerBase::Baud_57600 ); | 77 | m_base->setSpeed( IOLayerBase::Baud_57600 ); |
78 | break; | 78 | break; |
79 | case 38400: | 79 | case 38400: |
80 | m_base->setSpeed(IOLayerBase::Baud_38400 ); | 80 | m_base->setSpeed(IOLayerBase::Baud_38400 ); |
81 | break; | 81 | break; |
82 | case 19200: | 82 | case 19200: |
83 | m_base->setSpeed( IOLayerBase::Baud_19200 ); | 83 | m_base->setSpeed( IOLayerBase::Baud_19200 ); |
84 | break; | 84 | break; |
85 | case 4800: | 85 | case 4800: |
86 | m_base->setSpeed( IOLayerBase::Baud_4800 ); | 86 | m_base->setSpeed( IOLayerBase::Baud_4800 ); |
87 | break; | 87 | break; |
88 | case 2400: | 88 | case 2400: |
89 | m_base->setSpeed( IOLayerBase::Baud_2400 ); | 89 | m_base->setSpeed( IOLayerBase::Baud_2400 ); |
90 | break; | 90 | break; |
91 | case 1200: | ||
92 | m_base->setSpeed( IOLayerBase::Baud_1200 ); | ||
93 | break; | ||
91 | case 9600: | 94 | case 9600: |
92 | default: | 95 | default: |
93 | m_base->setSpeed(IOLayerBase::Baud_9600 ); | 96 | m_base->setSpeed(IOLayerBase::Baud_9600 ); |
94 | break; | 97 | break; |
95 | } | 98 | } |
96 | 99 | ||
97 | if ( dbits == 5) { | 100 | if ( dbits == 5) { |
98 | m_base->setData( IOLayerBase::Data_Five ); | 101 | m_base->setData( IOLayerBase::Data_Five ); |
99 | } else if (rad_flow == 6) { | 102 | } else if (rad_flow == 6) { |
100 | m_base->setData( IOLayerBase::Data_Six ); | 103 | m_base->setData( IOLayerBase::Data_Six ); |
101 | } else if (rad_flow == 7) { | 104 | } else if (rad_flow == 7) { |
102 | m_base->setData( IOLayerBase::Data_Seven ); | 105 | m_base->setData( IOLayerBase::Data_Seven ); |
103 | } else { | 106 | } else { |
104 | m_base->setData( IOLayerBase::Data_Eight ); | 107 | m_base->setData( IOLayerBase::Data_Eight ); |
105 | } | 108 | } |
106 | 109 | ||
107 | if ( sbits == 2) { | 110 | if ( sbits == 2) { |
108 | m_base->setStop( IOLayerBase::Stop_Two ); | 111 | m_base->setStop( IOLayerBase::Stop_Two ); |
109 | } else if ( sbits == 15 ) { | 112 | } else if ( sbits == 15 ) { |
110 | m_base->setStop( IOLayerBase::Stop_OnePointFive ); | 113 | m_base->setStop( IOLayerBase::Stop_OnePointFive ); |
111 | } else { | 114 | } else { |
112 | m_base->setStop( IOLayerBase::Stop_One ); | 115 | m_base->setStop( IOLayerBase::Stop_One ); |
113 | } | 116 | } |
114 | 117 | ||
115 | if ( prof.readEntry("Device").isEmpty() ) return; | 118 | if ( prof.readEntry("Device").isEmpty() ) return; |
116 | setCurrent( prof.readEntry("Device"), m_deviceCmb ); | 119 | setCurrent( prof.readEntry("Device"), m_deviceCmb ); |
117 | 120 | ||
118 | } | 121 | } |
119 | /* | 122 | /* |
120 | * save speed, | 123 | * save speed, |
121 | * flow, | 124 | * flow, |
122 | * parity | 125 | * parity |
123 | */ | 126 | */ |
124 | void SerialConfigWidget::save( Profile& prof ) { | 127 | void SerialConfigWidget::save( Profile& prof ) { |
125 | int flow, parity, speed, data, stop; | 128 | int flow, parity, speed, data, stop; |
126 | flow = parity = speed = data = stop = 0; | 129 | flow = parity = speed = data = stop = 0; |
127 | prof.writeEntry("Device", m_deviceCmb->currentText() ); | 130 | prof.writeEntry("Device", m_deviceCmb->currentText() ); |
128 | 131 | ||
129 | switch( m_base->flow() ) { | 132 | switch( m_base->flow() ) { |
130 | case IOLayerBase::None: | 133 | case IOLayerBase::None: |
131 | flow = 0; | 134 | flow = 0; |
132 | break; | 135 | break; |
133 | case IOLayerBase::Software: | 136 | case IOLayerBase::Software: |
134 | flow = 2; | 137 | flow = 2; |
135 | break; | 138 | break; |
136 | case IOLayerBase::Hardware: | 139 | case IOLayerBase::Hardware: |
137 | flow = 1; | 140 | flow = 1; |
138 | break; | 141 | break; |
139 | } | 142 | } |
140 | 143 | ||
141 | switch( m_base->parity() ) { | 144 | switch( m_base->parity() ) { |
142 | case IOLayerBase::Odd: | 145 | case IOLayerBase::Odd: |
143 | parity = 2; | 146 | parity = 2; |
144 | break; | 147 | break; |
145 | case IOLayerBase::Even: | 148 | case IOLayerBase::Even: |
146 | parity = 1; | 149 | parity = 1; |
147 | break; | 150 | break; |
148 | case IOLayerBase::NonePar: | 151 | case IOLayerBase::NonePar: |
149 | parity = 0; | 152 | parity = 0; |
150 | break; | 153 | break; |
151 | } | 154 | } |
152 | 155 | ||
153 | switch( m_base->speed() ) { | 156 | switch( m_base->speed() ) { |
154 | case IOLayerBase::Baud_115200: | 157 | case IOLayerBase::Baud_115200: |
155 | speed = 115200; | 158 | speed = 115200; |
156 | break; | 159 | break; |
157 | case IOLayerBase::Baud_57600: | 160 | case IOLayerBase::Baud_57600: |
158 | speed = 57600; | 161 | speed = 57600; |
159 | break; | 162 | break; |
160 | case IOLayerBase::Baud_38400: | 163 | case IOLayerBase::Baud_38400: |
161 | speed = 38400; | 164 | speed = 38400; |
162 | break; | 165 | break; |
163 | case IOLayerBase::Baud_19200: | 166 | case IOLayerBase::Baud_19200: |
164 | speed = 19200; | 167 | speed = 19200; |
165 | break; | 168 | break; |
166 | case IOLayerBase::Baud_4800: | 169 | case IOLayerBase::Baud_4800: |
167 | speed = 4800; | 170 | speed = 4800; |
168 | break; | 171 | break; |
169 | case IOLayerBase::Baud_2400: | 172 | case IOLayerBase::Baud_2400: |
170 | speed = 2400; | 173 | speed = 2400; |
171 | break; | 174 | break; |
175 | case IOLayerBase::Baud_1200: | ||
176 | speed = 1200; | ||
177 | break; | ||
172 | default: | 178 | default: |
173 | case IOLayerBase::Baud_9600: | 179 | case IOLayerBase::Baud_9600: |
174 | speed = 9600; | 180 | speed = 9600; |
175 | break; | 181 | break; |
176 | } | 182 | } |
177 | 183 | ||
178 | switch( m_base->data() ) { | 184 | switch( m_base->data() ) { |
179 | case IOLayerBase::Data_Five: | 185 | case IOLayerBase::Data_Five: |
180 | data = 5; | 186 | data = 5; |
181 | break; | 187 | break; |
182 | case IOLayerBase::Data_Six: | 188 | case IOLayerBase::Data_Six: |
183 | data = 6; | 189 | data = 6; |
184 | break; | 190 | break; |
185 | case IOLayerBase::Data_Seven: | 191 | case IOLayerBase::Data_Seven: |
186 | data = 7; | 192 | data = 7; |
187 | break; | 193 | break; |
188 | case IOLayerBase::Data_Eight: | 194 | case IOLayerBase::Data_Eight: |
189 | data = 8; | 195 | data = 8; |
190 | break; | 196 | break; |
191 | } | 197 | } |
192 | 198 | ||
193 | switch( m_base->stop() ) { | 199 | switch( m_base->stop() ) { |
194 | case IOLayerBase::Stop_One: | 200 | case IOLayerBase::Stop_One: |
195 | stop = 1; | 201 | stop = 1; |
196 | break; | 202 | break; |
197 | case IOLayerBase::Stop_OnePointFive: | 203 | case IOLayerBase::Stop_OnePointFive: |
198 | stop = 15; | 204 | stop = 15; |
199 | break; | 205 | break; |
200 | case IOLayerBase::Stop_Two: | 206 | case IOLayerBase::Stop_Two: |
201 | stop = 2; | 207 | stop = 2; |
202 | break; | 208 | break; |
203 | } | 209 | } |
204 | 210 | ||
205 | prof.writeEntry("Flow", flow); | 211 | prof.writeEntry("Flow", flow); |
206 | prof.writeEntry("Parity", parity); | 212 | prof.writeEntry("Parity", parity); |
207 | prof.writeEntry("Speed", speed); | 213 | prof.writeEntry("Speed", speed); |
208 | prof.writeEntry("DataBits", data); | 214 | prof.writeEntry("DataBits", data); |
209 | prof.writeEntry("StopBits", stop); | 215 | prof.writeEntry("StopBits", stop); |
210 | } | 216 | } |