summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/dialer.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/dialer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/dialer.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp
index 8524422..67ad10e 100644
--- a/noncore/apps/opie-console/dialer.cpp
+++ b/noncore/apps/opie-console/dialer.cpp
@@ -13,6 +13,8 @@
13#include <fcntl.h> 13#include <fcntl.h>
14#include <errno.h> 14#include <errno.h>
15 15
16#include "io_modem.h"
17
16// State machine: | When an error occurs, we don't have to 18// State machine: | When an error occurs, we don't have to
17// | reset everything. 19// | reset everything.
18// (init) <------+ | But if the user wants to reset, 20// (init) <------+ | But if the user wants to reset,
@@ -53,14 +55,10 @@ Dialer::Dialer(const Profile& profile, int fd, QWidget *parent, const char *name
53 QVBoxLayout *vbox; 55 QVBoxLayout *vbox;
54 QLabel *desc; 56 QLabel *desc;
55 57
56 //m_profile.writeEntry("InitString", "ATZ");
57 //m_profile.writeEntry("DialPrefix1", "ATDT");
58 //m_profile.writeEntry("Termination", "\n");
59 58
60 usercancel = 0; 59 usercancel = 0;
61 cleanshutdown = 0; 60 cleanshutdown = 0;
62 61
63 //fcntl(m_fd, F_SETFL, O_NONBLOCK);
64 62
65 desc = new QLabel(QObject::tr("Dialing number: %1").arg(m_profile.readEntry("Number")), this); 63 desc = new QLabel(QObject::tr("Dialing number: %1").arg(m_profile.readEntry("Number")), this);
66 progress = new QProgressBar(this); 64 progress = new QProgressBar(this);
@@ -89,7 +87,7 @@ void Dialer::setHangupOnly()
89{ 87{
90 state = state_cancel; 88 state = state_cancel;
91 usercancel = 1; 89 usercancel = 1;
92 send("+++ATH\r"); 90 send( m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING )+"\r" );
93} 91}
94 92
95void Dialer::slotCancel() 93void Dialer::slotCancel()
@@ -142,19 +140,15 @@ void Dialer::trydial(const QString& number)
142 if(state != state_cancel) switchState(state_preinit); 140 if(state != state_cancel) switchState(state_preinit);
143 if(cleanshutdown) 141 if(cleanshutdown)
144 { 142 {
145 qWarning("HangupString " + m_profile.readEntry("HangupString")); 143 qWarning("HangupString " + m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING));
146 //send(m_profile.readEntry("HangupString")); 144 send(m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) + "\r");
147 send("+++ATH\r");
148 //send("");
149 } 145 }
150 146
151 if(state != state_cancel) 147 if(state != state_cancel)
152 { 148 {
153 switchState(state_init); 149 switchState(state_init);
154 //send("ATZ"); 150// qWarning("Init String " + m_profile.readEntry("InitString") );
155 qWarning("Init String " + m_profile.readEntry("InitString") ); 151 send(m_profile.readEntry("InitString",MODEM_DEFAULT_INIT_STRING ) + "\r");
156 // send(m_profile.readEntry("InitString", "AT"));
157 send("AT\r");
158 QString response2 = receive(); 152 QString response2 = receive();
159 if(!response2.contains("\nOK\r")) 153 if(!response2.contains("\nOK\r"))
160 reset(); 154 reset();
@@ -187,8 +181,10 @@ void Dialer::trydial(const QString& number)
187 qWarning("progress"); 181 qWarning("progress");
188 switchState(state_dialing); 182 switchState(state_dialing);
189 183
190 send(QString("ATDT %1\r").arg(number)); 184 // send(QString("ATDT %1\r").arg(number));
191 // send(QString("%1 %2").arg(m_profile.readEntry("DialPrefix1")).arg(number)); 185 send(QString("%1 %2\r").arg(m_profile.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ))
186 .arg(number));
187
192 QString response5 = receive(); 188 QString response5 = receive();
193 if(!response5.contains("CONNECT") ) 189 if(!response5.contains("CONNECT") )
194 { 190 {