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) (show 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 | |||
@@ -34,8 +34,9 @@ ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent, | |||
34 | 34 | ||
35 | QLabel* telLabel = new QLabel( this ); | 35 | QLabel* telLabel = new QLabel( this ); |
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 ); |
40 | atButton->setText( tr( "AT commands" ) ); | 41 | atButton->setText( tr( "AT commands" ) ); |
41 | // disabled for now | 42 | // disabled for now |
@@ -46,15 +47,14 @@ ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent, | |||
46 | dialButton->setText( tr( "Enter number" ) ); | 47 | dialButton->setText( tr( "Enter number" ) ); |
47 | connect( dialButton, SIGNAL( clicked() ), this, SLOT( slotDial() ) ); | 48 | connect( dialButton, SIGNAL( clicked() ), this, SLOT( slotDial() ) ); |
48 | 49 | ||
49 | |||
50 | m_base = new IOLayerBase( this, "base" ); | 50 | m_base = new IOLayerBase( this, "base" ); |
51 | 51 | ||
52 | m_lay->addWidget( m_device ); | 52 | m_lay->addWidget( m_device ); |
53 | m_lay->addWidget( m_deviceCmb ); | 53 | m_lay->addWidget( m_deviceCmb ); |
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 | ||
59 | m_deviceCmb->insertItem( "/dev/ttyS0" ); | 59 | m_deviceCmb->insertItem( "/dev/ttyS0" ); |
60 | m_deviceCmb->insertItem( "/dev/ttyS1" ); | 60 | m_deviceCmb->insertItem( "/dev/ttyS1" ); |
@@ -71,6 +71,8 @@ void ModemConfigWidget::load( const Profile& prof ) { | |||
71 | int rad_flow = prof.readNumEntry( "Flow" ); | 71 | int rad_flow = prof.readNumEntry( "Flow" ); |
72 | int rad_parity = prof.readNumEntry( "Parity" ); | 72 | int rad_parity = prof.readNumEntry( "Parity" ); |
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" ); |
75 | 77 | ||
76 | if ( !number.isEmpty() ) { | 78 | if ( !number.isEmpty() ) { |
@@ -113,6 +115,27 @@ void ModemConfigWidget::load( const Profile& prof ) { | |||
113 | break; | 115 | break; |
114 | } | 116 | } |
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() ) { |
117 | return; | 140 | return; |
118 | } | 141 | } |
@@ -127,8 +150,8 @@ void ModemConfigWidget::load( const Profile& prof ) { | |||
127 | * parity | 150 | * parity |
128 | */ | 151 | */ |
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() ); |
133 | 156 | ||
134 | 157 | ||
@@ -174,9 +197,38 @@ void ModemConfigWidget::save( Profile& prof ) { | |||
174 | break; | 197 | break; |
175 | } | 198 | } |
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 ); |
178 | prof.writeEntry( "Parity", parity ); | 228 | prof.writeEntry( "Parity", parity ); |
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() ); |
181 | 233 | ||
182 | 234 | ||