author | harlekin <harlekin> | 2002-10-25 18:48:25 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-25 18:48:25 (UTC) |
commit | 4151cc12a6c37cbec4bb6883204703eec2fb8648 (patch) (unidiff) | |
tree | f7e81dc7de747628225ae4627c7cf3028183441a /noncore/apps/opie-console/modemconfigwidget.cpp | |
parent | e8c4383915db7ed6f47899945404247b1fd5c3c4 (diff) | |
download | opie-4151cc12a6c37cbec4bb6883204703eec2fb8648.zip opie-4151cc12a6c37cbec4bb6883204703eec2fb8648.tar.gz opie-4151cc12a6c37cbec4bb6883204703eec2fb8648.tar.bz2 |
added data bits and stop bits
Diffstat (limited to 'noncore/apps/opie-console/modemconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/modemconfigwidget.cpp | 62 |
1 files changed, 57 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp index ec83b9f..ce44dab 100644 --- a/noncore/apps/opie-console/modemconfigwidget.cpp +++ b/noncore/apps/opie-console/modemconfigwidget.cpp | |||
@@ -36,4 +36,5 @@ ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent, | |||
36 | telLabel->setText( tr( "Enter telefon number here:" ) ); | 36 | telLabel->setText( tr( "Enter telefon number here:" ) ); |
37 | m_telNumber = new QLineEdit( this ); | 37 | // m_telNumber = new QLineEdit( this ); |
38 | QHBox *buttonBox = new QHBox( this ); | 38 | QHBox *buttonBox = new QHBox( this ); |
39 | m_telNumber = new QLineEdit( buttonBox ); | ||
39 | QPushButton *atButton = new QPushButton( buttonBox ); | 40 | QPushButton *atButton = new QPushButton( buttonBox ); |
@@ -48,3 +49,2 @@ ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent, | |||
48 | 49 | ||
49 | |||
50 | m_base = new IOLayerBase( this, "base" ); | 50 | m_base = new IOLayerBase( this, "base" ); |
@@ -54,5 +54,5 @@ ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent, | |||
54 | m_lay->addWidget( telLabel ); | 54 | m_lay->addWidget( telLabel ); |
55 | m_lay->addWidget( m_telNumber ); | ||
56 | m_lay->addWidget( buttonBox ); | 55 | m_lay->addWidget( buttonBox ); |
57 | m_lay->addWidget( m_base ); | 56 | m_lay->addWidget( m_base ); |
57 | m_lay->addStretch( 0 ); | ||
58 | 58 | ||
@@ -73,2 +73,4 @@ void ModemConfigWidget::load( const Profile& prof ) { | |||
73 | int speed = prof.readNumEntry( "Speed" ); | 73 | int speed = prof.readNumEntry( "Speed" ); |
74 | int dbits = prof.readNumEntry("DataBits"); | ||
75 | int sbits = prof.readNumEntry("StopBits"); | ||
74 | QString number = prof.readEntry( "Number" ); | 76 | QString number = prof.readEntry( "Number" ); |
@@ -115,2 +117,23 @@ void ModemConfigWidget::load( const Profile& prof ) { | |||
115 | 117 | ||
118 | |||
119 | if ( dbits == 5) { | ||
120 | m_base->setData( IOLayerBase::Data_Five ); | ||
121 | } else if (rad_flow == 6) { | ||
122 | m_base->setData( IOLayerBase::Data_Six ); | ||
123 | } else if (rad_flow == 7) { | ||
124 | m_base->setData( IOLayerBase::Data_Seven ); | ||
125 | } else { | ||
126 | m_base->setData( IOLayerBase::Data_Eight ); | ||
127 | } | ||
128 | |||
129 | if ( sbits == 2) { | ||
130 | m_base->setStop( IOLayerBase::Stop_Two ); | ||
131 | } else if ( sbits == 15 ) { | ||
132 | m_base->setStop( IOLayerBase::Stop_OnePointFive ); | ||
133 | } else { | ||
134 | m_base->setStop( IOLayerBase::Stop_One ); | ||
135 | } | ||
136 | |||
137 | |||
138 | |||
116 | if ( prof.readEntry( "Device" ).isEmpty() ) { | 139 | if ( prof.readEntry( "Device" ).isEmpty() ) { |
@@ -129,4 +152,4 @@ void ModemConfigWidget::load( const Profile& prof ) { | |||
129 | void ModemConfigWidget::save( Profile& prof ) { | 152 | void ModemConfigWidget::save( Profile& prof ) { |
130 | int flow, parity, speed; | 153 | int flow, parity, speed, data, stop; |
131 | flow = parity = speed = 0; | 154 | flow = parity = speed = data = stop = 0; |
132 | prof.writeEntry( "Device", m_deviceCmb->currentText() ); | 155 | prof.writeEntry( "Device", m_deviceCmb->currentText() ); |
@@ -176,2 +199,29 @@ void ModemConfigWidget::save( Profile& prof ) { | |||
176 | 199 | ||
200 | switch( m_base->data() ) { | ||
201 | case IOLayerBase::Data_Five: | ||
202 | data = 5; | ||
203 | break; | ||
204 | case IOLayerBase::Data_Six: | ||
205 | data = 6; | ||
206 | break; | ||
207 | case IOLayerBase::Data_Seven: | ||
208 | data = 7; | ||
209 | break; | ||
210 | case IOLayerBase::Data_Eight: | ||
211 | data = 8; | ||
212 | break; | ||
213 | } | ||
214 | |||
215 | switch( m_base->stop() ) { | ||
216 | case IOLayerBase::Stop_One: | ||
217 | stop = 1; | ||
218 | break; | ||
219 | case IOLayerBase::Stop_OnePointFive: | ||
220 | stop = 15; | ||
221 | break; | ||
222 | case IOLayerBase::Stop_Two: | ||
223 | stop = 2; | ||
224 | break; | ||
225 | } | ||
226 | |||
177 | prof.writeEntry( "Flow", flow ); | 227 | prof.writeEntry( "Flow", flow ); |
@@ -179,2 +229,4 @@ void ModemConfigWidget::save( Profile& prof ) { | |||
179 | prof.writeEntry( "Speed", speed ); | 229 | prof.writeEntry( "Speed", speed ); |
230 | prof.writeEntry("DataBits", data); | ||
231 | prof.writeEntry("StopBits", stop); | ||
180 | prof.writeEntry( "Number", m_telNumber->text() ); | 232 | prof.writeEntry( "Number", m_telNumber->text() ); |