-rw-r--r-- | noncore/apps/opie-console/dialdialog.cpp | 8 | ||||
-rw-r--r-- | noncore/apps/opie-console/dialdialog.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/dialer.cpp | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_modem.cpp | 8 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_modem.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/modemconfigwidget.cpp | 5 |
6 files changed, 21 insertions, 9 deletions
diff --git a/noncore/apps/opie-console/dialdialog.cpp b/noncore/apps/opie-console/dialdialog.cpp index 8bf32f9..0ace8f7 100644 --- a/noncore/apps/opie-console/dialdialog.cpp +++ b/noncore/apps/opie-console/dialdialog.cpp @@ -83,13 +83,21 @@ void DialDialog::slotEnterNumber( int number ) { m_number = ( m_number * 10 ) + number; qDebug( QString("%1").arg( m_number ) ); LCD->display( m_number ); } DialDialog::~DialDialog() { } QString DialDialog::number() { return QString( "%1").arg( m_number ); + } + +void DialDialog::setNumber( int number ) +{ + m_number = number; + LCD->display( m_number ); +} + diff --git a/noncore/apps/opie-console/dialdialog.h b/noncore/apps/opie-console/dialdialog.h index 5c5b948..bec7b81 100644 --- a/noncore/apps/opie-console/dialdialog.h +++ b/noncore/apps/opie-console/dialdialog.h @@ -8,22 +8,24 @@ class DialDialog : public QDialog { Q_OBJECT public: DialDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~DialDialog(); QString number(); + void setNumber( int ); + private: float m_number; QLCDNumber *LCD; private slots: void slotEnterNumber( int ); }; #endif diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp index 90e2b6c..89a0e8d 100644 --- a/noncore/apps/opie-console/dialer.cpp +++ b/noncore/apps/opie-console/dialer.cpp @@ -116,49 +116,50 @@ void Dialer::dial(const QString& number) void Dialer::trydial(const QString& number) { if(state != state_cancel) { switchState(state_preinit); // ... QString response = receive(); } if(state != state_cancel) { switchState(state_init); - send("ATZ"); + //send("ATZ"); + send(m_profile.readEntry("InitString")); QString response2 = receive(); } if(state != state_cancel) { switchState(state_options); send("ATM0L0"); QString response3 = receive(); } if(state != state_cancel) { switchState(state_dialtone); send("ATX1"); QString response4 = receive(); } if(state != state_cancel) { switchState(state_dialing); - send(QString("ATDT %1").arg(number)); + send(QString("%1 %2").arg(m_profile.readEntry("DialPrefix1")).arg(number)); QString response5 = receive(); } if(state != state_cancel) { switchState(state_online); } } void Dialer::send(const QString& msg) { QString m = msg; diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index d93dc5a..22a3673 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp @@ -1,41 +1,39 @@ #include "io_modem.h" #include "dialer.h" IOModem::IOModem( const Profile &profile ) - : IOSerial( profile ), m_profile( profile ) { + : IOSerial( profile ) { + m_profile = profile; } IOModem::~IOModem() { } void IOModem::close() { + // maybe do a hangup here just in case...? IOSerial::close(); - } bool IOModem::open() { bool ret = IOSerial::open(); if(!ret) return false; - qWarning("IOModem::open continues..."); - Dialer d(m_profile); - qWarning("dialer created"); int result = d.exec(); if(result == QDialog::Accepted) { return true; } else return false; } void IOModem::reload( const Profile &config ) { m_device = config.readEntry("Device", MODEM_DEFAULT_DEVICE); diff --git a/noncore/apps/opie-console/io_modem.h b/noncore/apps/opie-console/io_modem.h index d681f66..8453b95 100644 --- a/noncore/apps/opie-console/io_modem.h +++ b/noncore/apps/opie-console/io_modem.h @@ -52,20 +52,20 @@ signals: public slots: bool open(); void close(); void reload(const Profile &); private: QString m_initString, m_resetString, m_dialPref1, m_dialSuf1, m_dialPref2, m_dialSuf2, m_dialPref3, m_dialSuf3, m_connect, m_hangup, m_cancel; int m_dialTime, m_delayRedial, m_numberTries, m_dtrDropTime, m_bpsDetect, m_dcdLines, m_multiLineUntag; - const Profile& m_profile; + Profile m_profile; private slots: void slotExited(OProcess* proc); }; #endif 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,19 +1,19 @@ #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; } @@ -178,17 +178,20 @@ void ModemConfigWidget::save( Profile& prof ) { } 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() ); } } |