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.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp
index 7010594..8883b83 100644
--- a/noncore/apps/opie-console/dialer.cpp
+++ b/noncore/apps/opie-console/dialer.cpp
@@ -1,10 +1,6 @@
1#include "dialer.h" 1#include "dialer.h"
2#include "io_modem.h" 2#include "io_modem.h"
3 3
4/* OPIE */
5#include <opie2/odebug.h>
6using namespace Opie::Core;
7
8/* QT */ 4/* QT */
9#include <qlayout.h> 5#include <qlayout.h>
10#include <qprogressbar.h> 6#include <qprogressbar.h>
@@ -109,7 +105,6 @@ void Dialer::slotCancel()
109 105
110void Dialer::reset() 106void Dialer::reset()
111{ 107{
112 owarn << "reset" << oendl;
113 switchState(state_cancel); 108 switchState(state_cancel);
114} 109}
115 110
@@ -141,18 +136,15 @@ void Dialer::dial(const QString& number)
141 136
142void Dialer::trydial(const QString& number) 137void Dialer::trydial(const QString& number)
143{ 138{
144 owarn << "TryDial:" << number.latin1() << "" << oendl;
145 if(state != state_cancel) switchState(state_preinit); 139 if(state != state_cancel) switchState(state_preinit);
146 if(cleanshutdown) 140 if(cleanshutdown)
147 { 141 {
148 owarn << "HangupString " << m_profile.readEntry("HangupString") << oendl;
149 send(m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) + "\r"); 142 send(m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) + "\r");
150 } 143 }
151 144
152 if(state != state_cancel) 145 if(state != state_cancel)
153 { 146 {
154 switchState(state_init); 147 switchState(state_init);
155// owarn << "Init String " + m_profile.readEntry("InitString") << oendl;
156 send(m_profile.readEntry("InitString",MODEM_DEFAULT_INIT_STRING ) + "\r"); 148 send(m_profile.readEntry("InitString",MODEM_DEFAULT_INIT_STRING ) + "\r");
157 QString response2 = receive(); 149 QString response2 = receive();
158 if(!response2.contains("\nOK\r")) 150 if(!response2.contains("\nOK\r"))
@@ -183,7 +175,6 @@ void Dialer::trydial(const QString& number)
183 175
184 if(state != state_cancel) 176 if(state != state_cancel)
185 { 177 {
186 owarn << "progress" << oendl;
187 switchState(state_dialing); 178 switchState(state_dialing);
188 179
189 // send(QString("ATDT %1\r").arg(number)); 180 // send(QString("ATDT %1\r").arg(number));
@@ -199,7 +190,7 @@ void Dialer::trydial(const QString& number)
199 { 190 {
200 QMessageBox::warning(this, 191 QMessageBox::warning(this,
201 QObject::tr("Failure"), 192 QObject::tr("Failure"),
202 QObject::tr("Dialing the number failed.")); 193 QObject::tr("<qt>Dialing the number failed.</qt>"));
203 slotCancel(); 194 slotCancel();
204 } 195 }
205 } 196 }
@@ -219,7 +210,6 @@ void Dialer::send(const QString& msg)
219 int bytes; 210 int bytes;
220 QString termination; 211 QString termination;
221 212
222 owarn << "Sending: " << m.latin1() << "" << oendl;
223 213
224 /*termination = "\r"; 214 /*termination = "\r";
225 //termination = m_profile.readEntry("Termination"); 215 //termination = m_profile.readEntry("Termination");
@@ -252,11 +242,9 @@ QString Dialer::receive()
252 for(int i = 0; i < ret; i++) 242 for(int i = 0; i < ret; i++)
253 buffer[i] = buffer[i] & 0x7F; 243 buffer[i] = buffer[i] & 0x7F;
254 buffer[ret] = 0; 244 buffer[ret] = 0;
255 owarn << "Got: " << buffer << "" << oendl;
256 buf.append(QString(buffer)); 245 buf.append(QString(buffer));
257 if(buf.contains("OK") || buf.contains("ERROR") || buf.contains("CONNECT") || (buf.contains("BUSY"))) 246 if(buf.contains("OK") || buf.contains("ERROR") || buf.contains("CONNECT") || (buf.contains("BUSY")))
258 { 247 {
259 //owarn << "Receiving: '" << buf.latin1() << "'" << oendl;
260 cleanshutdown = 1; 248 cleanshutdown = 1;
261 return buf; 249 return buf;
262 }else if (buf.contains("NO CARRIER") || buf.contains("NO DIALTONE") ) { 250 }else if (buf.contains("NO CARRIER") || buf.contains("NO DIALTONE") ) {