Diffstat (limited to 'noncore/apps/opie-console/modemconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/modemconfigwidget.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp index e552990..3466e3a 100644 --- a/noncore/apps/opie-console/modemconfigwidget.cpp +++ b/noncore/apps/opie-console/modemconfigwidget.cpp | |||
@@ -1,24 +1,27 @@ | |||
1 | |||
2 | #include <qpe/qpeapplication.h> | ||
3 | |||
1 | #include <qlabel.h> | 4 | #include <qlabel.h> |
2 | #include <qlayout.h> | 5 | #include <qlayout.h> |
3 | #include <qcombobox.h> | 6 | #include <qcombobox.h> |
4 | #include <qpushbutton.h> | 7 | #include <qpushbutton.h> |
5 | #include <qhbox.h> | 8 | #include <qhbox.h> |
6 | 9 | ||
7 | #include "modemconfigwidget.h" | 10 | #include "modemconfigwidget.h" |
8 | #include "dialdialog.h" | 11 | #include "dialdialog.h" |
9 | 12 | ||
10 | namespace { | 13 | namespace { |
11 | void setCurrent( const QString& str, QComboBox* bo ) { | 14 | void setCurrent( const QString& str, QComboBox* bo ) { |
12 | uint b = bo->count(); | 15 | uint b = bo->count(); |
13 | for (int i = 0; i < bo->count(); i++ ) { | 16 | for (int i = 0; i < bo->count(); i++ ) { |
14 | if ( bo->text(i) == str ) { | 17 | if ( bo->text(i) == str ) { |
15 | bo->setCurrentItem( i ); | 18 | bo->setCurrentItem( i ); |
16 | return; | 19 | return; |
17 | } | 20 | } |
18 | } | 21 | } |
19 | bo->insertItem( str ); | 22 | bo->insertItem( str ); |
20 | bo->setCurrentItem( b ); | 23 | bo->setCurrentItem( b ); |
21 | } | 24 | } |
22 | } | 25 | } |
23 | 26 | ||
24 | ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent, | 27 | ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent, |
@@ -216,40 +219,38 @@ void ModemConfigWidget::save( Profile& prof ) { | |||
216 | stop = 15; | 219 | stop = 15; |
217 | break; | 220 | break; |
218 | case IOLayerBase::Stop_Two: | 221 | case IOLayerBase::Stop_Two: |
219 | stop = 2; | 222 | stop = 2; |
220 | break; | 223 | break; |
221 | } | 224 | } |
222 | 225 | ||
223 | prof.writeEntry( "Flow", flow ); | 226 | prof.writeEntry( "Flow", flow ); |
224 | prof.writeEntry( "Parity", parity ); | 227 | prof.writeEntry( "Parity", parity ); |
225 | prof.writeEntry( "Speed", speed ); | 228 | prof.writeEntry( "Speed", speed ); |
226 | prof.writeEntry("DataBits", data); | 229 | prof.writeEntry("DataBits", data); |
227 | prof.writeEntry("StopBits", stop); | 230 | prof.writeEntry("StopBits", stop); |
228 | prof.writeEntry( "Number", m_telNumber->text() ); | 231 | prof.writeEntry( "Number", m_telNumber->text() ); |
229 | 232 | ||
230 | 233 | ||
231 | atConf->writeConfig(prof); | 234 | atConf->writeConfig(prof); |
232 | } | 235 | } |
233 | 236 | ||
234 | void ModemConfigWidget::slotAT() { | 237 | void ModemConfigWidget::slotAT() { |
235 | // ATConfigDialog conf( this, "ATConfig", true ); | 238 | // ATConfigDialog conf( this, "ATConfig", true ); |
236 | // josef/Max I know why don't you create the stuff on the stack | 239 | // josef/Max I know why don't you create the stuff on the stack |
237 | // but making it a TopLevel Dialog and ignoring | 240 | // but making it a TopLevel Dialog and ignoring |
238 | // cancel is not fun either... | 241 | // cancel is not fun either... |
239 | // what to do? FIXME!!! -zecke | 242 | // what to do? FIXME!!! -zecke |
240 | atConf->showMaximized(); | 243 | if ( QPEApplication::execDialog( atConf ) != QDialog::Accepted ) { |
241 | if ( atConf->exec() != QDialog::Accepted ) { | ||
242 | // reload old settings | 244 | // reload old settings |
243 | } | 245 | } |
244 | } | 246 | } |
245 | 247 | ||
246 | void ModemConfigWidget::slotDial() { | 248 | void ModemConfigWidget::slotDial() { |
247 | DialDialog dial( this, "DialConfig", true ); | 249 | DialDialog dial( this, "DialConfig", true ); |
248 | if(!m_telNumber->text().isEmpty()) { | 250 | if(!m_telNumber->text().isEmpty()) { |
249 | dial.setNumber(m_telNumber->text().replace(QRegExp("[\\-\\/\\ \\.\\,]"), "")); | 251 | dial.setNumber(m_telNumber->text().replace(QRegExp("[\\-\\/\\ \\.\\,]"), "")); |
250 | } | 252 | } |
251 | dial.showMaximized(); | 253 | if ( QPEApplication::execDialog( &dial ) == QDialog::Accepted ) { |
252 | if ( dial.exec() == QDialog::Accepted ) { | ||
253 | m_telNumber->setText( dial.number() ); | 254 | m_telNumber->setText( dial.number() ); |
254 | } | 255 | } |
255 | } | 256 | } |