summaryrefslogtreecommitdiff
authorjosef <josef>2002-10-15 21:10:29 (UTC)
committer josef <josef>2002-10-15 21:10:29 (UTC)
commitfb99aec5215da635abfa28288d170f110114bba3 (patch) (side-by-side diff)
tree68c1f662e126f578f467ccfc2c3164bc354a6790
parent6b5ccd66a36280a601d09ea0295df86c4fce1a65 (diff)
downloadopie-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 (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/dialdialog.cpp8
-rw-r--r--noncore/apps/opie-console/dialdialog.h2
-rw-r--r--noncore/apps/opie-console/dialer.cpp5
-rw-r--r--noncore/apps/opie-console/io_modem.cpp8
-rw-r--r--noncore/apps/opie-console/io_modem.h2
-rw-r--r--noncore/apps/opie-console/modemconfigwidget.cpp5
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
@@ -94,2 +94,10 @@ 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
@@ -19,2 +19,4 @@ public:
+ void setNumber( int );
+
private:
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
@@ -127,3 +127,4 @@ void Dialer::trydial(const QString& number)
switchState(state_init);
- send("ATZ");
+ //send("ATZ");
+ send(m_profile.readEntry("InitString"));
QString response2 = receive();
@@ -151,3 +152,3 @@ void Dialer::trydial(const QString& number)
- send(QString("ATDT %1").arg(number));
+ send(QString("%1 %2").arg(m_profile.readEntry("DialPrefix1")).arg(number));
QString response5 = receive();
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
@@ -6,3 +6,4 @@
IOModem::IOModem( const Profile &profile )
- : IOSerial( profile ), m_profile( profile ) {
+ : IOSerial( profile ) {
+ m_profile = profile;
}
@@ -16,5 +17,5 @@ IOModem::~IOModem() {
void IOModem::close() {
+ // maybe do a hangup here just in case...?
IOSerial::close();
-
}
@@ -25,6 +26,3 @@ bool IOModem::open() {
- qWarning("IOModem::open continues...");
-
Dialer d(m_profile);
- qWarning("dialer created");
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
@@ -63,3 +63,3 @@ private:
m_bpsDetect, m_dcdLines, m_multiLineUntag;
- const Profile& m_profile;
+ Profile m_profile;
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
@@ -6,3 +6,3 @@
#include <qhbox.h>
-
+#include <qregexp.h>
@@ -189,2 +189,5 @@ void ModemConfigWidget::slotDial() {
DialDialog dial( this, "DialConfig", true );
+ if(!m_telNumber->text().isEmpty()) {
+ dial.setNumber(m_telNumber->text().replace(QRegExp("[\\-\\/\\ ]"), "").toInt());
+ }
dial.showMaximized();