author | dwmw2 <dwmw2> | 2002-04-04 14:12:32 (UTC) |
---|---|---|
committer | dwmw2 <dwmw2> | 2002-04-04 14:12:32 (UTC) |
commit | 27602da5cda073d9f0fbcd97a62897b8a4addcdc (patch) (unidiff) | |
tree | 6c358019ae957ce760b59b1d94040b659c4b5783 | |
parent | d3ef7996a0c857451395fcdd2eed63399100586a (diff) | |
download | opie-27602da5cda073d9f0fbcd97a62897b8a4addcdc.zip opie-27602da5cda073d9f0fbcd97a62897b8a4addcdc.tar.gz opie-27602da5cda073d9f0fbcd97a62897b8a4addcdc.tar.bz2 |
no cout.
-rw-r--r-- | noncore/unsupported/gsmtool/gsmtool.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/noncore/unsupported/gsmtool/gsmtool.cpp b/noncore/unsupported/gsmtool/gsmtool.cpp index 6fea596..e6122ad 100644 --- a/noncore/unsupported/gsmtool/gsmtool.cpp +++ b/noncore/unsupported/gsmtool/gsmtool.cpp | |||
@@ -226,135 +226,131 @@ void GSMTool::doSelectedSMSChanged(QListViewItem *item) | |||
226 | SMSText->setEnabled(TRUE); | 226 | SMSText->setEnabled(TRUE); |
227 | SMSDeleteButton->setEnabled(TRUE); | 227 | SMSDeleteButton->setEnabled(TRUE); |
228 | SMSSendButton->setEnabled(TRUE); | 228 | SMSSendButton->setEnabled(TRUE); |
229 | 229 | ||
230 | } | 230 | } |
231 | 231 | ||
232 | void GSMTool::doSMSSendButton() | 232 | void GSMTool::doSMSSendButton() |
233 | { | 233 | { |
234 | qDebug("SMSSendButton"); | 234 | qDebug("SMSSendButton"); |
235 | 235 | ||
236 | QListViewItem *item = SMSList->currentItem(); | 236 | QListViewItem *item = SMSList->currentItem(); |
237 | if (!item) | 237 | if (!item) |
238 | return; | 238 | return; |
239 | 239 | ||
240 | int index = atoi(item->text(2).ascii()); | 240 | int index = atoi(item->text(2).ascii()); |
241 | qDebug("index %d\n", index); | 241 | qDebug("index %d\n", index); |
242 | 242 | ||
243 | int direction = SMSViewType->currentItem(); | 243 | int direction = SMSViewType->currentItem(); |
244 | qDebug("direction %s\n", direction?"outgoing":"incoming"); | 244 | qDebug("direction %s\n", direction?"outgoing":"incoming"); |
245 | 245 | ||
246 | SMSMessageRef message = sms_store->find(index)->message(); | 246 | SMSMessageRef message = sms_store->find(index)->message(); |
247 | 247 | ||
248 | if (direction) | 248 | if (direction) |
249 | NewSMSText->setText(message->userData().c_str()); | 249 | NewSMSText->setText(message->userData().c_str()); |
250 | else | 250 | else |
251 | NewSMSText->setText(""); | 251 | NewSMSText->setText(""); |
252 | NewSMSToBox->insertItem(message->address()._number.c_str(), 0); | 252 | NewSMSToBox->insertItem(message->address()._number.c_str(), 0); |
253 | TabWidget2->setCurrentPage(3); | 253 | TabWidget2->setCurrentPage(3); |
254 | 254 | ||
255 | } | 255 | } |
256 | 256 | ||
257 | void GSMTool::doNewSMSClearButton() | 257 | void GSMTool::doNewSMSClearButton() |
258 | { | 258 | { |
259 | NewSMSText->setText(""); | 259 | NewSMSText->setText(""); |
260 | } | 260 | } |
261 | 261 | ||
262 | void GSMTool::doNewSMSSaveButton() | 262 | void GSMTool::doNewSMSSaveButton() |
263 | { | 263 | { |
264 | qDebug("NewSMSSaveButton"); | 264 | qDebug("NewSMSSaveButton"); |
265 | const char *msgtext = strdup(NewSMSText->text().local8Bit()); | 265 | const char *msgtext = strdup(NewSMSText->text().local8Bit()); |
266 | const char *dest = NewSMSToBox->currentText().ascii(); | 266 | const char *dest = NewSMSToBox->currentText().ascii(); |
267 | 267 | ||
268 | NewSMSStatusLabel->setText("Sending..."); | 268 | NewSMSStatusLabel->setText("Sending..."); |
269 | me->setMessageService(1); | 269 | me->setMessageService(1); |
270 | 270 | ||
271 | qDebug("NewSMSSendButton: '%s' to '%s'", msgtext, dest); | 271 | qDebug("NewSMSSendButton: '%s' to '%s'", msgtext, dest); |
272 | 272 | ||
273 | SMSMessageRef m = new SMSSubmitMessage (msgtext, dest); | 273 | SMSMessageRef m = new SMSSubmitMessage (msgtext, dest); |
274 | sms_store->insert(m); | 274 | sms_store->insert(m); |
275 | free((void *)msgtext); | 275 | free((void *)msgtext); |
276 | 276 | ||
277 | } | 277 | } |
278 | void GSMTool::doNewSMSSendButton() | 278 | void GSMTool::doNewSMSSendButton() |
279 | { | 279 | { |
280 | const char *msgtext = strdup(NewSMSText->text().local8Bit()); | 280 | const char *msgtext = strdup(NewSMSText->text().local8Bit()); |
281 | const char *dest = NewSMSToBox->currentText().ascii(); | 281 | const char *dest = NewSMSToBox->currentText().ascii(); |
282 | 282 | ||
283 | NewSMSStatusLabel->setText("Sending..."); | 283 | NewSMSStatusLabel->setText("Sending..."); |
284 | me->setMessageService(1); | 284 | me->setMessageService(1); |
285 | 285 | ||
286 | qDebug("NewSMSSendButton: '%s' to '%s'", msgtext, dest); | 286 | qDebug("NewSMSSendButton: '%s' to '%s'", msgtext, dest); |
287 | 287 | ||
288 | SMSSubmitMessage m(msgtext, dest); | 288 | SMSSubmitMessage m(msgtext, dest); |
289 | try { | 289 | try { |
290 | Ref<SMSMessage> ackPDU; | ||
291 | m.setAt(new GsmAt(*me)); | 290 | m.setAt(new GsmAt(*me)); |
292 | m.send(ackPDU); | 291 | m.send(); |
293 | 292 | ||
294 | // print acknowledgement if available | ||
295 | if (! ackPDU.isnull()) | ||
296 | cout << ackPDU->toString(); | ||
297 | NewSMSStatusLabel->setText("Message sent."); | 293 | NewSMSStatusLabel->setText("Message sent."); |
298 | } catch (GsmException &ge) { | 294 | } catch (GsmException &ge) { |
299 | NewSMSStatusLabel->setText("Failed."); | 295 | NewSMSStatusLabel->setText("Failed."); |
300 | qDebug(ge.what()); | 296 | qDebug(ge.what()); |
301 | } | 297 | } |
302 | free((void *)msgtext); | 298 | free((void *)msgtext); |
303 | 299 | ||
304 | 300 | ||
305 | } | 301 | } |
306 | 302 | ||
307 | 303 | ||
308 | void GSMTool::doSMSDeleteButton() | 304 | void GSMTool::doSMSDeleteButton() |
309 | { | 305 | { |
310 | QListViewItem *item = SMSList->currentItem(); | 306 | QListViewItem *item = SMSList->currentItem(); |
311 | if (!item) | 307 | if (!item) |
312 | return; | 308 | return; |
313 | 309 | ||
314 | int index = atoi(item->text(2).ascii()); | 310 | int index = atoi(item->text(2).ascii()); |
315 | qDebug("delete SMS with index %d\n", index); | 311 | qDebug("delete SMS with index %d\n", index); |
316 | 312 | ||
317 | 313 | ||
318 | 314 | ||
319 | SortedSMSStore::iterator e = sms_store->find(index); | 315 | SortedSMSStore::iterator e = sms_store->find(index); |
320 | 316 | ||
321 | if (e != sms_store->end()) { | 317 | if (e != sms_store->end()) { |
322 | qDebug("message is %s\n", e->message()->userData().c_str()); | 318 | qDebug("message is %s\n", e->message()->userData().c_str()); |
323 | sms_store->erase(e); | 319 | sms_store->erase(e); |
324 | 320 | ||
325 | } | 321 | } |
326 | doSMSTypeChanged(); | 322 | doSMSTypeChanged(); |
327 | } | 323 | } |
328 | 324 | ||
329 | void GSMTool::doScanButton() | 325 | void GSMTool::doScanButton() |
330 | { | 326 | { |
331 | qDebug("ScanButton"); | 327 | qDebug("ScanButton"); |
332 | 328 | ||
333 | NetworkList->setEnabled(FALSE); | 329 | NetworkList->setEnabled(FALSE); |
334 | AvailNetsLabel->setEnabled(FALSE); | 330 | AvailNetsLabel->setEnabled(FALSE); |
335 | NetworkList->clear(); | 331 | NetworkList->clear(); |
336 | new QListViewItem(NetworkList, "Scanning..."); | 332 | new QListViewItem(NetworkList, "Scanning..."); |
337 | 333 | ||
338 | vector<OPInfo> opis; | 334 | vector<OPInfo> opis; |
339 | 335 | ||
340 | try { | 336 | try { |
341 | opis = me->getAvailableOPInfo(); | 337 | opis = me->getAvailableOPInfo(); |
342 | } catch (GsmException) { | 338 | } catch (GsmException) { |
343 | NetworkList->clear(); | 339 | NetworkList->clear(); |
344 | new QListViewItem(NetworkList, "Scan failed..."); | 340 | new QListViewItem(NetworkList, "Scan failed..."); |
345 | return; | 341 | return; |
346 | } | 342 | } |
347 | 343 | ||
348 | NetworkList->clear(); | 344 | NetworkList->clear(); |
349 | for (vector<OPInfo>::iterator i = opis.begin(); i != opis.end(); ++i) { | 345 | for (vector<OPInfo>::iterator i = opis.begin(); i != opis.end(); ++i) { |
350 | char *statustext; | 346 | char *statustext; |
351 | switch (i->_status) { | 347 | switch (i->_status) { |
352 | 348 | ||
353 | case UnknownOPStatus: | 349 | case UnknownOPStatus: |
354 | statustext = "unknown"; | 350 | statustext = "unknown"; |
355 | break; | 351 | break; |
356 | 352 | ||
357 | case CurrentOPStatus: | 353 | case CurrentOPStatus: |
358 | statustext = "current"; | 354 | statustext = "current"; |
359 | break; | 355 | break; |
360 | 356 | ||