summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/modeminfo.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/ppp/modeminfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/modeminfo.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/noncore/settings/networksettings/ppp/modeminfo.cpp b/noncore/settings/networksettings/ppp/modeminfo.cpp
index 4dbbcf5..0bec186 100644
--- a/noncore/settings/networksettings/ppp/modeminfo.cpp
+++ b/noncore/settings/networksettings/ppp/modeminfo.cpp
@@ -37,8 +37,9 @@
37//#include <klocale.h> 37//#include <klocale.h>
38#define i18n QObject::tr 38#define i18n QObject::tr
39 39
40ModemTransfer::ModemTransfer(QWidget *parent, const char *name) 40ModemTransfer::ModemTransfer(Modem *mo, QWidget *parent, const char *name)
41 : QDialog(parent, name,TRUE, WStyle_Customize|WStyle_NormalBorder) 41 : QDialog(parent, name,TRUE, WStyle_Customize|WStyle_NormalBorder),
42 _modem(mo)
42{ 43{
43 setCaption(i18n("ATI Query")); 44 setCaption(i18n("ATI Query"));
44// KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); 45// KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon());
@@ -97,8 +98,8 @@ ModemTransfer::ModemTransfer(QWidget *parent, const char *name)
97void ModemTransfer::ati_done() { 98void ModemTransfer::ati_done() {
98 scripttimer->stop(); 99 scripttimer->stop();
99 timeout_timer->stop(); 100 timeout_timer->stop();
100 Modem::modem->closetty(); 101 _modem->closetty();
101 Modem::modem->unlockdevice(); 102 _modem->unlockdevice();
102 hide(); 103 hide();
103 104
104 // open the result window 105 // open the result window
@@ -126,7 +127,7 @@ void ModemTransfer::init() {
126 127
127 qApp->processEvents(); 128 qApp->processEvents();
128 129
129 int lock = Modem::modem->lockdevice(); 130 int lock = _modem->lockdevice();
130 if (lock == 1) { 131 if (lock == 1) {
131 132
132 statusBar->setText(i18n("Modem device is locked.")); 133 statusBar->setText(i18n("Modem device is locked."));
@@ -140,10 +141,10 @@ void ModemTransfer::init() {
140 } 141 }
141 142
142 143
143 if(Modem::modem->opentty()) { 144 if(_modem->opentty()) {
144 if(Modem::modem->hangup()) { 145 if(_modem->hangup()) {
145 usleep(100000); // wait 0.1 secs 146 usleep(100000); // wait 0.1 secs
146 Modem::modem->writeLine("ATE0Q1V1"); // E0 don't echo the commands I send ... 147 _modem->writeLine("ATE0Q1V1"); // E0 don't echo the commands I send ...
147 148
148 statusBar->setText(i18n("Modem Ready")); 149 statusBar->setText(i18n("Modem Ready"));
149 qApp->processEvents(); 150 qApp->processEvents();
@@ -152,17 +153,17 @@ void ModemTransfer::init() {
152 scripttimer->start(1000); // this one does the ati query 153 scripttimer->start(1000); // this one does the ati query
153 154
154 // clear modem buffer 155 // clear modem buffer
155 Modem::modem->flush(); 156 _modem->flush();
156 157
157 Modem::modem->notify(this, SLOT(readChar(unsigned char))); 158 _modem->notify(this, SLOT(readChar(unsigned char)));
158 return; 159 return;
159 } 160 }
160 } 161 }
161 162
162 // opentty() or hangup() failed 163 // opentty() or hangup() failed
163 statusBar->setText(Modem::modem->modemMessage()); 164 statusBar->setText(_modem->modemMessage());
164 step = 99; // wait until cancel is pressed 165 step = 99; // wait until cancel is pressed
165 Modem::modem->unlockdevice(); 166 _modem->unlockdevice();
166} 167}
167 168
168 169
@@ -175,7 +176,7 @@ void ModemTransfer::do_script() {
175 readtty(); 176 readtty();
176 statusBar->setText("ATI..."); 177 statusBar->setText("ATI...");
177 progressBar->setProgress( progressBar->progress() + 1); 178 progressBar->setProgress( progressBar->progress() + 1);
178 Modem::modem->writeLine("ATI\n"); 179 _modem->writeLine("ATI\n");
179 break; 180 break;
180 181
181 case 1: 182 case 1:
@@ -190,7 +191,7 @@ void ModemTransfer::do_script() {
190 query.sprintf("ATI%d\n", step); 191 query.sprintf("ATI%d\n", step);
191 statusBar->setText(msg); 192 statusBar->setText(msg);
192 progressBar->setProgress( progressBar->progress() + 1); 193 progressBar->setProgress( progressBar->progress() + 1);
193 Modem::modem->writeLine(query.local8Bit()); 194 _modem->writeLine(query.local8Bit());
194 break; 195 break;
195 196
196 default: 197 default:
@@ -223,16 +224,16 @@ void ModemTransfer::readtty() {
223 224
224void ModemTransfer::cancelbutton() { 225void ModemTransfer::cancelbutton() {
225 scripttimer->stop(); 226 scripttimer->stop();
226 Modem::modem->stop(); 227 _modem->stop();
227 timeout_timer->stop(); 228 timeout_timer->stop();
228 229
229 statusBar->setText(i18n("One moment please...")); 230 statusBar->setText(i18n("One moment please..."));
230 qApp->processEvents(); 231 qApp->processEvents();
231 232
232 Modem::modem->hangup(); 233 _modem->hangup();
233 234
234 Modem::modem->closetty(); 235 _modem->closetty();
235 Modem::modem->unlockdevice(); 236 _modem->unlockdevice();
236 reject(); 237 reject();
237} 238}
238 239