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 | |||
@@ -50,6 +50,8 @@ 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"); | ||
54 | int sbits = prof.readNumEntry("StopBits"); | ||
53 | 55 | ||
54 | if (rad_flow == 1) { | 56 | if (rad_flow == 1) { |
55 | m_base->setFlow( IOLayerBase::Hardware ); | 57 | m_base->setFlow( IOLayerBase::Hardware ); |
@@ -86,6 +88,24 @@ void SerialConfigWidget::load( const Profile& prof ) { | |||
86 | break; | 88 | break; |
87 | } | 89 | } |
88 | 90 | ||
91 | if ( dbits == 5) { | ||
92 | m_base->setData( IOLayerBase::Data_Five ); | ||
93 | } else if (rad_flow == 6) { | ||
94 | m_base->setData( IOLayerBase::Data_Six ); | ||
95 | } else if (rad_flow == 7) { | ||
96 | m_base->setData( IOLayerBase::Data_Seven ); | ||
97 | } else { | ||
98 | m_base->setData( IOLayerBase::Data_Eight ); | ||
99 | } | ||
100 | |||
101 | if ( sbits == 2) { | ||
102 | m_base->setStop( IOLayerBase::Stop_Two ); | ||
103 | } else if ( sbits == 15 ) { | ||
104 | m_base->setStop( IOLayerBase::Stop_OnePointFive ); | ||
105 | } else { | ||
106 | m_base->setStop( IOLayerBase::Stop_One ); | ||
107 | } | ||
108 | |||
89 | if ( prof.readEntry("Device").isEmpty() ) return; | 109 | if ( prof.readEntry("Device").isEmpty() ) return; |
90 | setCurrent( prof.readEntry("Device"), m_deviceCmb ); | 110 | setCurrent( prof.readEntry("Device"), m_deviceCmb ); |
91 | 111 | ||
@@ -96,8 +116,8 @@ void SerialConfigWidget::load( const Profile& prof ) { | |||
96 | * parity | 116 | * parity |
97 | */ | 117 | */ |
98 | void SerialConfigWidget::save( Profile& prof ) { | 118 | void SerialConfigWidget::save( Profile& prof ) { |
99 | int flow, parity, speed ; | 119 | int flow, parity, speed, data, stop; |
100 | flow = parity = speed = 0; | 120 | flow = parity = speed = data = stop = 0; |
101 | prof.writeEntry("Device", m_deviceCmb->currentText() ); | 121 | prof.writeEntry("Device", m_deviceCmb->currentText() ); |
102 | 122 | ||
103 | switch( m_base->flow() ) { | 123 | switch( m_base->flow() ) { |
@@ -143,7 +163,36 @@ void SerialConfigWidget::save( Profile& prof ) { | |||
143 | break; | 163 | break; |
144 | } | 164 | } |
145 | 165 | ||
166 | switch( m_base->data() ) { | ||
167 | case IOLayerBase::Data_Five: | ||
168 | data = 5; | ||
169 | break; | ||
170 | case IOLayerBase::Data_Six: | ||
171 | data = 6; | ||
172 | break; | ||
173 | case IOLayerBase::Data_Seven: | ||
174 | data = 7; | ||
175 | break; | ||
176 | case IOLayerBase::Data_Eight: | ||
177 | data = 8; | ||
178 | break; | ||
179 | } | ||
180 | |||
181 | switch( m_base->stop() ) { | ||
182 | case IOLayerBase::Stop_One: | ||
183 | stop = 1; | ||
184 | break; | ||
185 | case IOLayerBase::Stop_OnePointFive: | ||
186 | stop = 15; | ||
187 | break; | ||
188 | case IOLayerBase::Stop_Two: | ||
189 | stop = 2; | ||
190 | break; | ||
191 | } | ||
192 | |||
146 | prof.writeEntry("Flow", flow); | 193 | prof.writeEntry("Flow", flow); |
147 | prof.writeEntry("Parity", parity); | 194 | prof.writeEntry("Parity", parity); |
148 | prof.writeEntry("Speed", speed); | 195 | prof.writeEntry("Speed", speed); |
196 | prof.writeEntry("DataBits", data); | ||
197 | prof.writeEntry("StopBits", stop); | ||
149 | } | 198 | } |