author | josef <josef> | 2002-10-15 21:10:29 (UTC) |
---|---|---|
committer | josef <josef> | 2002-10-15 21:10:29 (UTC) |
commit | fb99aec5215da635abfa28288d170f110114bba3 (patch) (side-by-side diff) | |
tree | 68c1f662e126f578f467ccfc2c3164bc354a6790 /noncore/apps/opie-console/modemconfigwidget.cpp | |
parent | 6b5ccd66a36280a601d09ea0295df86c4fce1a65 (diff) | |
download | opie-fb99aec5215da635abfa28288d170f110114bba3.zip opie-fb99aec5215da635abfa28288d170f110114bba3.tar.gz opie-fb99aec5215da635abfa28288d170f110114bba3.tar.bz2 |
- io_modem must keep copy of profile, otherwise it crashes (now it works -
doh!)
- try to use key/value pairs for dialing where currently possible (init string
and dial sequence)
- when editing telephone number, try to read in, including special chars
stripping (-, /, whitespace) using QRegExp
Diffstat (limited to 'noncore/apps/opie-console/modemconfigwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/modemconfigwidget.cpp | 5 |
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 @@ #include <qlabel.h> #include <qlayout.h> #include <qcombobox.h> #include <qlineedit.h> #include <qpushbutton.h> #include <qhbox.h> - +#include <qregexp.h> #include "modemconfigwidget.h" #include "dialdialog.h" namespace { void setCurrent( const QString& str, QComboBox* bo ) { uint b = bo->count(); for (uint i = 0; i < bo->count(); i++ ) { if ( bo->text(i) == str ) { bo->setCurrentItem( i ); return; } } bo->insertItem( str ); bo->setCurrentItem( b ); } } ModemConfigWidget::ModemConfigWidget( const QString& name, QWidget* parent, const char* na ) : ProfileDialogConnectionWidget( name, parent, na ) { m_lay = new QVBoxLayout( this ); m_device = new QLabel(tr( "Modem is attached to:" ), this ); @@ -166,29 +166,32 @@ void ModemConfigWidget::save( Profile& prof ) { case IOLayerBase::Baud_19200: speed = 19200; break; case IOLayerBase::Baud_9600: speed = 9600; break; } prof.writeEntry( "Flow", flow ); prof.writeEntry( "Parity", parity ); prof.writeEntry( "Speed", speed ); prof.writeEntry( "Number", m_telNumber->text() ); } void ModemConfigWidget::slotAT() { // ATConfigDialog conf( this, "ATConfig", true ); atConf->showMaximized(); if ( atConf->exec() == QDialog::Accepted ) { // atConf->writeConfig(); } } void ModemConfigWidget::slotDial() { DialDialog dial( this, "DialConfig", true ); + if(!m_telNumber->text().isEmpty()) { + dial.setNumber(m_telNumber->text().replace(QRegExp("[\\-\\/\\ ]"), "").toInt()); + } dial.showMaximized(); if ( dial.exec() == QDialog::Accepted ) { m_telNumber->setText( dial.number() ); } } |