summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/modemconfigwidget.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/modemconfigwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/modemconfigwidget.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp
index 0f0ce7c..878b0cf 100644
--- a/noncore/apps/opie-console/modemconfigwidget.cpp
+++ b/noncore/apps/opie-console/modemconfigwidget.cpp
@@ -1,31 +1,31 @@
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 <qlineedit.h> 4#include <qlineedit.h>
5#include <qpushbutton.h> 5#include <qpushbutton.h>
6#include <qhbox.h> 6#include <qhbox.h>
7 7#include <qregexp.h>
8 8
9#include "modemconfigwidget.h" 9#include "modemconfigwidget.h"
10#include "dialdialog.h" 10#include "dialdialog.h"
11 11
12namespace { 12namespace {
13 void setCurrent( const QString& str, QComboBox* bo ) { 13 void setCurrent( const QString& str, QComboBox* bo ) {
14 uint b = bo->count(); 14 uint b = bo->count();
15 for (uint i = 0; i < bo->count(); i++ ) { 15 for (uint i = 0; i < bo->count(); i++ ) {
16 if ( bo->text(i) == str ) { 16 if ( bo->text(i) == str ) {
17 bo->setCurrentItem( i ); 17 bo->setCurrentItem( i );
18 return; 18 return;
19 } 19 }
20 } 20 }
21 bo->insertItem( str ); 21 bo->insertItem( str );
22 bo->setCurrentItem( b ); 22 bo->setCurrentItem( b );
23 } 23 }
24} 24}
25 25
26ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent, 26ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent,
27 const char* na ) 27 const char* na )
28 : ProfileDialogConnectionWidget( name, parent, na ) { 28 : ProfileDialogConnectionWidget( name, parent, na ) {
29 29
30 m_lay = new QVBoxLayout( this ); 30 m_lay = new QVBoxLayout( this );
31 m_device = new QLabel(tr( "Modem is attached to:" ), this ); 31 m_device = new QLabel(tr( "Modem is attached to:" ), this );
@@ -166,29 +166,32 @@ void ModemConfigWidget::save( Profile& prof ) {
166 case IOLayerBase::Baud_19200: 166 case IOLayerBase::Baud_19200:
167 speed = 19200; 167 speed = 19200;
168 break; 168 break;
169 case IOLayerBase::Baud_9600: 169 case IOLayerBase::Baud_9600:
170 speed = 9600; 170 speed = 9600;
171 break; 171 break;
172 } 172 }
173 173
174 prof.writeEntry( "Flow", flow ); 174 prof.writeEntry( "Flow", flow );
175 prof.writeEntry( "Parity", parity ); 175 prof.writeEntry( "Parity", parity );
176 prof.writeEntry( "Speed", speed ); 176 prof.writeEntry( "Speed", speed );
177 prof.writeEntry( "Number", m_telNumber->text() ); 177 prof.writeEntry( "Number", m_telNumber->text() );
178} 178}
179 179
180void ModemConfigWidget::slotAT() { 180void ModemConfigWidget::slotAT() {
181 // ATConfigDialog conf( this, "ATConfig", true ); 181 // ATConfigDialog conf( this, "ATConfig", true );
182 atConf->showMaximized(); 182 atConf->showMaximized();
183 if ( atConf->exec() == QDialog::Accepted ) { 183 if ( atConf->exec() == QDialog::Accepted ) {
184 // atConf->writeConfig(); 184 // atConf->writeConfig();
185 } 185 }
186} 186}
187 187
188void ModemConfigWidget::slotDial() { 188void ModemConfigWidget::slotDial() {
189 DialDialog dial( this, "DialConfig", true ); 189 DialDialog dial( this, "DialConfig", true );
190 if(!m_telNumber->text().isEmpty()) {
191 dial.setNumber(m_telNumber->text().replace(QRegExp("[\\-\\/\\ ]"), "").toInt());
192 }
190 dial.showMaximized(); 193 dial.showMaximized();
191 if ( dial.exec() == QDialog::Accepted ) { 194 if ( dial.exec() == QDialog::Accepted ) {
192 m_telNumber->setText( dial.number() ); 195 m_telNumber->setText( dial.number() );
193 } 196 }
194} 197}