author | ar <ar> | 2004-02-21 15:27:41 (UTC) |
---|---|---|
committer | ar <ar> | 2004-02-21 15:27:41 (UTC) |
commit | 460258f203be746ff79e14f32a823f381b8ea513 (patch) (unidiff) | |
tree | 87dddbacda3050027d343730cf021b53045e80cb | |
parent | 76b70b355d2c1c32c0f74e844e0654e39db2a175 (diff) | |
download | opie-460258f203be746ff79e14f32a823f381b8ea513.zip opie-460258f203be746ff79e14f32a823f381b8ea513.tar.gz opie-460258f203be746ff79e14f32a823f381b8ea513.tar.bz2 |
improve support for BigScreen
-rw-r--r-- | noncore/net/mail/accountitem.cpp | 259 | ||||
-rw-r--r-- | noncore/net/mail/accountview.cpp | 40 | ||||
-rw-r--r-- | noncore/net/mail/addresspicker.cpp | 54 | ||||
-rw-r--r-- | noncore/net/mail/editaccounts.cpp | 153 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 101 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 151 | ||||
-rw-r--r-- | noncore/net/opieirc/ircservereditor.cpp | 10 | ||||
-rw-r--r-- | noncore/net/opieirc/ircserverlist.cpp | 72 | ||||
-rw-r--r-- | noncore/net/opieirc/ircsettings.cpp | 22 | ||||
-rw-r--r-- | noncore/net/opietooth/blue-pin/pindlg.cc | 39 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 201 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/obexpopup.cpp | 22 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp | 41 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/rfcpopup.cpp | 35 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 5 |
15 files changed, 791 insertions, 414 deletions
diff --git a/noncore/net/mail/accountitem.cpp b/noncore/net/mail/accountitem.cpp index 2d3cd4b..c8f6ec4 100644 --- a/noncore/net/mail/accountitem.cpp +++ b/noncore/net/mail/accountitem.cpp | |||
@@ -1,12 +1,18 @@ | |||
1 | |||
1 | #include "accountitem.h" | 2 | #include "accountitem.h" |
2 | #include "accountview.h" | 3 | #include "accountview.h" |
3 | #include <qpopupmenu.h> | ||
4 | #include <qmessagebox.h> | ||
5 | #include "selectstore.h" | 4 | #include "selectstore.h" |
6 | #include "newmaildir.h" | 5 | #include "newmaildir.h" |
6 | #include "defines.h" | ||
7 | |||
8 | /* OPIE */ | ||
7 | #include <libmailwrapper/mailtypes.h> | 9 | #include <libmailwrapper/mailtypes.h> |
8 | #include <libmailwrapper/abstractmail.h> | 10 | #include <libmailwrapper/abstractmail.h> |
9 | #include <libmailwrapper/mailwrapper.h> | 11 | #include <libmailwrapper/mailwrapper.h> |
10 | #include "defines.h" | 12 | #include <qpe/qpeapplication.h> |
13 | |||
14 | /* QT */ | ||
15 | #include <qpopupmenu.h> | ||
16 | #include <qmessagebox.h> | ||
11 | 17 | ||
12 | #define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );} | 18 | #define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );} |
@@ -21,7 +27,10 @@ POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent ) | |||
21 | SETPIX(PIXMAP_POP3FOLDER); | 27 | SETPIX(PIXMAP_POP3FOLDER); |
22 | #if 0 | 28 | #if 0 |
23 | if (!account->getOffline()) { | 29 | if (!account->getOffline()) |
30 | { | ||
24 | setPixmap( 0, ); | 31 | setPixmap( 0, ); |
25 | } else { | 32 | } |
33 | else | ||
34 | { | ||
26 | setPixmap( 0, PIXMAP_OFFLINE ); | 35 | setPixmap( 0, PIXMAP_OFFLINE ); |
27 | } | 36 | } |
@@ -51,5 +60,6 @@ void POP3viewItem::refresh() | |||
51 | QList<Folder> *folders = wrapper->listFolders(); | 60 | QList<Folder> *folders = wrapper->listFolders(); |
52 | QListViewItem *child = firstChild(); | 61 | QListViewItem *child = firstChild(); |
53 | while ( child ) { | 62 | while ( child ) |
63 | { | ||
54 | QListViewItem *tmp = child; | 64 | QListViewItem *tmp = child; |
55 | child = child->nextSibling(); | 65 | child = child->nextSibling(); |
@@ -58,5 +68,6 @@ void POP3viewItem::refresh() | |||
58 | Folder *it; | 68 | Folder *it; |
59 | QListViewItem*item = 0; | 69 | QListViewItem*item = 0; |
60 | for ( it = folders->first(); it; it = folders->next() ) { | 70 | for ( it = folders->first(); it; it = folders->next() ) |
71 | { | ||
61 | item = new POP3folderItem( it, this , item ); | 72 | item = new POP3folderItem( it, this , item ); |
62 | item->setSelectable(it->may_select()); | 73 | item->setSelectable(it->may_select()); |
@@ -76,9 +87,13 @@ QPopupMenu * POP3viewItem::getContextMenu() | |||
76 | { | 87 | { |
77 | QPopupMenu *m = new QPopupMenu(0); | 88 | QPopupMenu *m = new QPopupMenu(0); |
78 | if (m) { | 89 | if (m) |
79 | if (!account->getOffline()) { | 90 | { |
91 | if (!account->getOffline()) | ||
92 | { | ||
80 | m->insertItem(QObject::tr("Disconnect",contextName),0); | 93 | m->insertItem(QObject::tr("Disconnect",contextName),0); |
81 | m->insertItem(QObject::tr("Set offline",contextName),1); | 94 | m->insertItem(QObject::tr("Set offline",contextName),1); |
82 | } else { | 95 | } |
96 | else | ||
97 | { | ||
83 | m->insertItem(QObject::tr("Set online",contextName),1); | 98 | m->insertItem(QObject::tr("Set online",contextName),1); |
84 | } | 99 | } |
@@ -90,5 +105,6 @@ void POP3viewItem::disconnect() | |||
90 | { | 105 | { |
91 | QListViewItem *child = firstChild(); | 106 | QListViewItem *child = firstChild(); |
92 | while ( child ) { | 107 | while ( child ) |
108 | { | ||
93 | QListViewItem *tmp = child; | 109 | QListViewItem *tmp = child; |
94 | child = child->nextSibling(); | 110 | child = child->nextSibling(); |
@@ -100,5 +116,6 @@ void POP3viewItem::disconnect() | |||
100 | void POP3viewItem::setOnOffline() | 116 | void POP3viewItem::setOnOffline() |
101 | { | 117 | { |
102 | if (!account->getOffline()) { | 118 | if (!account->getOffline()) |
119 | { | ||
103 | disconnect(); | 120 | disconnect(); |
104 | } | 121 | } |
@@ -111,5 +128,6 @@ void POP3viewItem::setOnOffline() | |||
111 | void POP3viewItem::contextMenuSelected(int which) | 128 | void POP3viewItem::contextMenuSelected(int which) |
112 | { | 129 | { |
113 | switch (which) { | 130 | switch (which) |
131 | { | ||
114 | case 0: | 132 | case 0: |
115 | disconnect(); | 133 | disconnect(); |
@@ -122,6 +140,5 @@ void POP3viewItem::contextMenuSelected(int which) | |||
122 | 140 | ||
123 | POP3folderItem::~POP3folderItem() | 141 | POP3folderItem::~POP3folderItem() |
124 | { | 142 | {} |
125 | } | ||
126 | 143 | ||
127 | POP3folderItem::POP3folderItem( Folder *folderInit, POP3viewItem *parent , QListViewItem*after ) | 144 | POP3folderItem::POP3folderItem( Folder *folderInit, POP3viewItem *parent , QListViewItem*after ) |
@@ -130,7 +147,10 @@ POP3folderItem::POP3folderItem( Folder *folderInit, POP3viewItem *parent , QList | |||
130 | folder = folderInit; | 147 | folder = folderInit; |
131 | pop3 = parent; | 148 | pop3 = parent; |
132 | if (folder->getDisplayName().lower()!="inbox") { | 149 | if (folder->getDisplayName().lower()!="inbox") |
150 | { | ||
133 | setPixmap( 0, PIXMAP_POP3FOLDER ); | 151 | setPixmap( 0, PIXMAP_POP3FOLDER ); |
134 | } else { | 152 | } |
153 | else | ||
154 | { | ||
135 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 155 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
136 | } | 156 | } |
@@ -152,5 +172,6 @@ QPopupMenu * POP3folderItem::getContextMenu() | |||
152 | { | 172 | { |
153 | QPopupMenu *m = new QPopupMenu(0); | 173 | QPopupMenu *m = new QPopupMenu(0); |
154 | if (m) { | 174 | if (m) |
175 | { | ||
155 | m->insertItem(QObject::tr("Refresh header list",contextName),0); | 176 | m->insertItem(QObject::tr("Refresh header list",contextName),0); |
156 | m->insertItem(QObject::tr("Delete all mails",contextName),1); | 177 | m->insertItem(QObject::tr("Delete all mails",contextName),1); |
@@ -170,5 +191,6 @@ void POP3folderItem::contextMenuSelected(int which) | |||
170 | { | 191 | { |
171 | AccountView * view = (AccountView*)listView(); | 192 | AccountView * view = (AccountView*)listView(); |
172 | switch (which) { | 193 | switch (which) |
194 | { | ||
173 | case 0: | 195 | case 0: |
174 | /* must be 'cause pop3 lists are cached */ | 196 | /* must be 'cause pop3 lists are cached */ |
@@ -237,6 +259,8 @@ void IMAPviewItem::refreshFolders(bool force) | |||
237 | folders->setAutoDelete(false); | 259 | folders->setAutoDelete(false); |
238 | 260 | ||
239 | for ( it = folders->first(); it; it = folders->next() ) { | 261 | for ( it = folders->first(); it; it = folders->next() ) |
240 | if (it->getDisplayName().lower()=="inbox") { | 262 | { |
263 | if (it->getDisplayName().lower()=="inbox") | ||
264 | { | ||
241 | item = new IMAPfolderItem( it, this , item ); | 265 | item = new IMAPfolderItem( it, this , item ); |
242 | folders->remove(it); | 266 | folders->remove(it); |
@@ -245,13 +269,16 @@ void IMAPviewItem::refreshFolders(bool force) | |||
245 | } | 269 | } |
246 | } | 270 | } |
247 | for ( it = folders->first(); it; it = folders->next() ) { | 271 | for ( it = folders->first(); it; it = folders->next() ) |
272 | { | ||
248 | fname = it->getDisplayName(); | 273 | fname = it->getDisplayName(); |
249 | currentFolders.append(it->getName()); | 274 | currentFolders.append(it->getName()); |
250 | pos = fname.findRev(it->Separator()); | 275 | pos = fname.findRev(it->Separator()); |
251 | if (pos != -1) { | 276 | if (pos != -1) |
277 | { | ||
252 | fname = fname.left(pos); | 278 | fname = fname.left(pos); |
253 | } | 279 | } |
254 | IMAPfolderItem*pitem = (IMAPfolderItem*)findSubItem(fname); | 280 | IMAPfolderItem*pitem = (IMAPfolderItem*)findSubItem(fname); |
255 | if (pitem) { | 281 | if (pitem) |
282 | { | ||
256 | titem = item; | 283 | titem = item; |
257 | item = new IMAPfolderItem(it,pitem,pitem->firstChild(),this); | 284 | item = new IMAPfolderItem(it,pitem,pitem->firstChild(),this); |
@@ -259,5 +286,7 @@ void IMAPviewItem::refreshFolders(bool force) | |||
259 | item->setText(0,it->getDisplayName().right(it->getDisplayName().length()-pos-1)); | 286 | item->setText(0,it->getDisplayName().right(it->getDisplayName().length()-pos-1)); |
260 | item = titem; | 287 | item = titem; |
261 | } else { | 288 | } |
289 | else | ||
290 | { | ||
262 | item = new IMAPfolderItem( it, this , item ); | 291 | item = new IMAPfolderItem( it, this , item ); |
263 | } | 292 | } |
@@ -269,6 +298,8 @@ QPopupMenu * IMAPviewItem::getContextMenu() | |||
269 | { | 298 | { |
270 | QPopupMenu *m = new QPopupMenu(0); | 299 | QPopupMenu *m = new QPopupMenu(0); |
271 | if (m) { | 300 | if (m) |
272 | if (!account->getOffline()) { | 301 | { |
302 | if (!account->getOffline()) | ||
303 | { | ||
273 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); | 304 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); |
274 | m->insertItem(QObject::tr("Create new folder",contextName),1); | 305 | m->insertItem(QObject::tr("Create new folder",contextName),1); |
@@ -276,5 +307,7 @@ QPopupMenu * IMAPviewItem::getContextMenu() | |||
276 | m->insertItem(QObject::tr("Disconnect",contextName),2); | 307 | m->insertItem(QObject::tr("Disconnect",contextName),2); |
277 | m->insertItem(QObject::tr("Set offline",contextName),3); | 308 | m->insertItem(QObject::tr("Set offline",contextName),3); |
278 | } else { | 309 | } |
310 | else | ||
311 | { | ||
279 | m->insertItem(QObject::tr("Set online",contextName),3); | 312 | m->insertItem(QObject::tr("Set online",contextName),3); |
280 | } | 313 | } |
@@ -286,14 +319,16 @@ void IMAPviewItem::createNewFolder() | |||
286 | { | 319 | { |
287 | Newmdirdlg ndirdlg; | 320 | Newmdirdlg ndirdlg; |
288 | ndirdlg.showMaximized(); | 321 | if ( QPEApplication::execDialog( &ndirdlg )) |
289 | if (ndirdlg.exec()) { | 322 | { |
290 | QString ndir = ndirdlg.Newdir(); | 323 | QString ndir = ndirdlg.Newdir(); |
291 | bool makesubs = ndirdlg.subpossible(); | 324 | bool makesubs = ndirdlg.subpossible(); |
292 | QString delemiter = "/"; | 325 | QString delemiter = "/"; |
293 | IMAPfolderItem*item = (IMAPfolderItem*)firstChild(); | 326 | IMAPfolderItem*item = (IMAPfolderItem*)firstChild(); |
294 | if (item) { | 327 | if (item) |
328 | { | ||
295 | delemiter = item->Delemiter(); | 329 | delemiter = item->Delemiter(); |
296 | } | 330 | } |
297 | if (wrapper->createMbox(ndir,0,delemiter,makesubs)) { | 331 | if (wrapper->createMbox(ndir,0,delemiter,makesubs)) |
332 | { | ||
298 | refreshFolders(true); | 333 | refreshFolders(true); |
299 | } | 334 | } |
@@ -304,5 +339,6 @@ void IMAPviewItem::contextMenuSelected(int id) | |||
304 | { | 339 | { |
305 | qDebug("Id selected: %i",id); | 340 | qDebug("Id selected: %i",id); |
306 | switch (id) { | 341 | switch (id) |
342 | { | ||
307 | case 0: | 343 | case 0: |
308 | refreshFolders(true); | 344 | refreshFolders(true); |
@@ -316,5 +352,6 @@ void IMAPviewItem::contextMenuSelected(int id) | |||
316 | break; | 352 | break; |
317 | case 3: | 353 | case 3: |
318 | if (account->getOffline()==false) { | 354 | if (account->getOffline()==false) |
355 | { | ||
319 | removeChilds(); | 356 | removeChilds(); |
320 | wrapper->logout(); | 357 | wrapper->logout(); |
@@ -345,7 +382,10 @@ IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent , QList | |||
345 | folder = folderInit; | 382 | folder = folderInit; |
346 | imap = parent; | 383 | imap = parent; |
347 | if (folder->getDisplayName().lower()!="inbox") { | 384 | if (folder->getDisplayName().lower()!="inbox") |
385 | { | ||
348 | setPixmap( 0, PIXMAP_IMAPFOLDER ); | 386 | setPixmap( 0, PIXMAP_IMAPFOLDER ); |
349 | } else { | 387 | } |
388 | else | ||
389 | { | ||
350 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 390 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
351 | } | 391 | } |
@@ -358,7 +398,10 @@ IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPfolderItem *parent , QLi | |||
358 | folder = folderInit; | 398 | folder = folderInit; |
359 | imap = master; | 399 | imap = master; |
360 | if (folder->getDisplayName().lower()!="inbox") { | 400 | if (folder->getDisplayName().lower()!="inbox") |
401 | { | ||
361 | setPixmap( 0, PIXMAP_IMAPFOLDER ); | 402 | setPixmap( 0, PIXMAP_IMAPFOLDER ); |
362 | } else { | 403 | } |
404 | else | ||
405 | { | ||
363 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 406 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
364 | } | 407 | } |
@@ -367,6 +410,5 @@ IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPfolderItem *parent , QLi | |||
367 | 410 | ||
368 | IMAPfolderItem::~IMAPfolderItem() | 411 | IMAPfolderItem::~IMAPfolderItem() |
369 | { | 412 | {} |
370 | } | ||
371 | 413 | ||
372 | const QString& IMAPfolderItem::Delemiter()const | 414 | const QString& IMAPfolderItem::Delemiter()const |
@@ -377,7 +419,10 @@ const QString& IMAPfolderItem::Delemiter()const | |||
377 | void IMAPfolderItem::refresh(QList<RecMail>&target) | 419 | void IMAPfolderItem::refresh(QList<RecMail>&target) |
378 | { | 420 | { |
379 | if (folder->may_select()) { | 421 | if (folder->may_select()) |
422 | { | ||
380 | imap->getWrapper()->listMessages( folder->getName(),target ); | 423 | imap->getWrapper()->listMessages( folder->getName(),target ); |
381 | } else { | 424 | } |
425 | else | ||
426 | { | ||
382 | target.clear(); | 427 | target.clear(); |
383 | } | 428 | } |
@@ -392,14 +437,18 @@ QPopupMenu * IMAPfolderItem::getContextMenu() | |||
392 | { | 437 | { |
393 | QPopupMenu *m = new QPopupMenu(0); | 438 | QPopupMenu *m = new QPopupMenu(0); |
394 | if (m) { | 439 | if (m) |
395 | if (folder->may_select()) { | 440 | { |
441 | if (folder->may_select()) | ||
442 | { | ||
396 | m->insertItem(QObject::tr("Refresh header list",contextName),0); | 443 | m->insertItem(QObject::tr("Refresh header list",contextName),0); |
397 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),4); | 444 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),4); |
398 | m->insertItem(QObject::tr("Delete all mails",contextName),1); | 445 | m->insertItem(QObject::tr("Delete all mails",contextName),1); |
399 | } | 446 | } |
400 | if (folder->no_inferior()==false) { | 447 | if (folder->no_inferior()==false) |
448 | { | ||
401 | m->insertItem(QObject::tr("Create new subfolder",contextName),2); | 449 | m->insertItem(QObject::tr("Create new subfolder",contextName),2); |
402 | } | 450 | } |
403 | if (folder->getDisplayName().lower()!="inbox") { | 451 | if (folder->getDisplayName().lower()!="inbox") |
452 | { | ||
404 | m->insertItem(QObject::tr("Delete folder",contextName),3); | 453 | m->insertItem(QObject::tr("Delete folder",contextName),3); |
405 | } | 454 | } |
@@ -411,10 +460,11 @@ void IMAPfolderItem::createNewFolder() | |||
411 | { | 460 | { |
412 | Newmdirdlg ndirdlg; | 461 | Newmdirdlg ndirdlg; |
413 | ndirdlg.showMaximized(); | 462 | if ( QPEApplication::execDialog( &ndirdlg ) ) |
414 | if (ndirdlg.exec()) { | 463 | { |
415 | QString ndir = ndirdlg.Newdir(); | 464 | QString ndir = ndirdlg.Newdir(); |
416 | bool makesubs = ndirdlg.subpossible(); | 465 | bool makesubs = ndirdlg.subpossible(); |
417 | QString delemiter = Delemiter(); | 466 | QString delemiter = Delemiter(); |
418 | if (imap->wrapper->createMbox(ndir,folder,delemiter,makesubs)) { | 467 | if (imap->wrapper->createMbox(ndir,folder,delemiter,makesubs)) |
468 | { | ||
419 | imap->refreshFolders(true); | 469 | imap->refreshFolders(true); |
420 | } | 470 | } |
@@ -429,6 +479,8 @@ void IMAPfolderItem::deleteFolder() | |||
429 | QObject::tr("No",contextName),QString::null,1,1); | 479 | QObject::tr("No",contextName),QString::null,1,1); |
430 | qDebug("Auswahl: %i",yesno); | 480 | qDebug("Auswahl: %i",yesno); |
431 | if (yesno == 0) { | 481 | if (yesno == 0) |
432 | if (imap->getWrapper()->deleteMbox(folder)) { | 482 | { |
483 | if (imap->getWrapper()->deleteMbox(folder)) | ||
484 | { | ||
433 | QListView*v=listView(); | 485 | QListView*v=listView(); |
434 | IMAPviewItem * box = imap; | 486 | IMAPviewItem * box = imap; |
@@ -436,5 +488,6 @@ void IMAPfolderItem::deleteFolder() | |||
436 | * any member of it after that call!!*/ | 488 | * any member of it after that call!!*/ |
437 | imap->refreshFolders(true); | 489 | imap->refreshFolders(true); |
438 | if (v) { | 490 | if (v) |
491 | { | ||
439 | v->setSelected(box,true); | 492 | v->setSelected(box,true); |
440 | } | 493 | } |
@@ -454,5 +507,6 @@ void IMAPfolderItem::contextMenuSelected(int id) | |||
454 | qDebug("Selected id: %i",id); | 507 | qDebug("Selected id: %i",id); |
455 | AccountView * view = (AccountView*)listView(); | 508 | AccountView * view = (AccountView*)listView(); |
456 | switch(id) { | 509 | switch(id) |
510 | { | ||
457 | case 0: | 511 | case 0: |
458 | view->refreshCurrent(); | 512 | view->refreshCurrent(); |
@@ -519,8 +573,10 @@ void MHviewItem::refresh(bool force) | |||
519 | QString fname = ""; | 573 | QString fname = ""; |
520 | int pos; | 574 | int pos; |
521 | for ( it = folders->first(); it; it = folders->next() ) { | 575 | for ( it = folders->first(); it; it = folders->next() ) |
576 | { | ||
522 | fname = it->getDisplayName(); | 577 | fname = it->getDisplayName(); |
523 | /* this folder itself */ | 578 | /* this folder itself */ |
524 | if (fname=="/") { | 579 | if (fname=="/") |
580 | { | ||
525 | currentFolders.append(fname); | 581 | currentFolders.append(fname); |
526 | folder = it; | 582 | folder = it; |
@@ -529,13 +585,19 @@ void MHviewItem::refresh(bool force) | |||
529 | currentFolders.append(fname); | 585 | currentFolders.append(fname); |
530 | pos = fname.findRev("/"); | 586 | pos = fname.findRev("/"); |
531 | if (pos > 0) { | 587 | if (pos > 0) |
588 | { | ||
532 | fname = fname.left(pos); | 589 | fname = fname.left(pos); |
533 | pmaster = (MHfolderItem*)findSubItem(fname); | 590 | pmaster = (MHfolderItem*)findSubItem(fname); |
534 | } else { | 591 | } |
592 | else | ||
593 | { | ||
535 | pmaster = 0; | 594 | pmaster = 0; |
536 | } | 595 | } |
537 | if (pmaster) { | 596 | if (pmaster) |
597 | { | ||
538 | item = new MHfolderItem( it, pmaster, item, this ); | 598 | item = new MHfolderItem( it, pmaster, item, this ); |
539 | } else { | 599 | } |
600 | else | ||
601 | { | ||
540 | item = new MHfolderItem( it, this , item ); | 602 | item = new MHfolderItem( it, this , item ); |
541 | } | 603 | } |
@@ -556,5 +618,6 @@ QPopupMenu * MHviewItem::getContextMenu() | |||
556 | { | 618 | { |
557 | QPopupMenu *m = new QPopupMenu(0); | 619 | QPopupMenu *m = new QPopupMenu(0); |
558 | if (m) { | 620 | if (m) |
621 | { | ||
559 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); | 622 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); |
560 | m->insertItem(QObject::tr("Create new folder",contextName),1); | 623 | m->insertItem(QObject::tr("Create new folder",contextName),1); |
@@ -568,8 +631,9 @@ void MHviewItem::createFolder() | |||
568 | { | 631 | { |
569 | Newmdirdlg ndirdlg(0,0,true); | 632 | Newmdirdlg ndirdlg(0,0,true); |
570 | ndirdlg.showMaximized(); | 633 | if ( QPEApplication::execDialog( &ndirdlg ) ) |
571 | if (ndirdlg.exec()) { | 634 | { |
572 | QString ndir = ndirdlg.Newdir(); | 635 | QString ndir = ndirdlg.Newdir(); |
573 | if (wrapper->createMbox(ndir)) { | 636 | if (wrapper->createMbox(ndir)) |
637 | { | ||
574 | refresh(true); | 638 | refresh(true); |
575 | } | 639 | } |
@@ -591,5 +655,6 @@ QStringList MHviewItem::subFolders() | |||
591 | void MHviewItem::contextMenuSelected(int which) | 655 | void MHviewItem::contextMenuSelected(int which) |
592 | { | 656 | { |
593 | switch (which) { | 657 | switch (which) |
658 | { | ||
594 | case 0: | 659 | case 0: |
595 | refresh(true); | 660 | refresh(true); |
@@ -610,6 +675,5 @@ void MHviewItem::contextMenuSelected(int which) | |||
610 | 675 | ||
611 | MHfolderItem::~MHfolderItem() | 676 | MHfolderItem::~MHfolderItem() |
612 | { | 677 | {} |
613 | } | ||
614 | 678 | ||
615 | MHfolderItem::MHfolderItem( Folder *folderInit, MHviewItem *parent , QListViewItem*after ) | 679 | MHfolderItem::MHfolderItem( Folder *folderInit, MHviewItem *parent , QListViewItem*after ) |
@@ -632,16 +696,23 @@ void MHfolderItem::initName() | |||
632 | { | 696 | { |
633 | QString bName = folder->getDisplayName(); | 697 | QString bName = folder->getDisplayName(); |
634 | if (bName.startsWith("/")&&bName.length()>1) { | 698 | if (bName.startsWith("/")&&bName.length()>1) |
699 | { | ||
635 | bName.replace(0,1,""); | 700 | bName.replace(0,1,""); |
636 | } | 701 | } |
637 | int pos = bName.findRev("/"); | 702 | int pos = bName.findRev("/"); |
638 | if (pos > 0) { | 703 | if (pos > 0) |
704 | { | ||
639 | bName.replace(0,pos+1,""); | 705 | bName.replace(0,pos+1,""); |
640 | } | 706 | } |
641 | if (bName.lower() == "outgoing") { | 707 | if (bName.lower() == "outgoing") |
708 | { | ||
642 | setPixmap( 0, PIXMAP_OUTBOXFOLDER ); | 709 | setPixmap( 0, PIXMAP_OUTBOXFOLDER ); |
643 | } else if (bName.lower() == "inbox") { | 710 | } |
711 | else if (bName.lower() == "inbox") | ||
712 | { | ||
644 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 713 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
645 | } else { | 714 | } |
715 | else | ||
716 | { | ||
646 | setPixmap( 0, PIXMAP_MBOXFOLDER ); | 717 | setPixmap( 0, PIXMAP_MBOXFOLDER ); |
647 | } | 718 | } |
@@ -672,6 +743,8 @@ void MHfolderItem::deleteFolder() | |||
672 | QObject::tr("No",contextName),QString::null,1,1); | 743 | QObject::tr("No",contextName),QString::null,1,1); |
673 | qDebug("Auswahl: %i",yesno); | 744 | qDebug("Auswahl: %i",yesno); |
674 | if (yesno == 0) { | 745 | if (yesno == 0) |
675 | if (mbox->getWrapper()->deleteMbox(folder)) { | 746 | { |
747 | if (mbox->getWrapper()->deleteMbox(folder)) | ||
748 | { | ||
676 | QListView*v=listView(); | 749 | QListView*v=listView(); |
677 | MHviewItem * box = mbox; | 750 | MHviewItem * box = mbox; |
@@ -679,5 +752,6 @@ void MHfolderItem::deleteFolder() | |||
679 | * any member of it after that call!!*/ | 752 | * any member of it after that call!!*/ |
680 | mbox->refresh(true); | 753 | mbox->refresh(true); |
681 | if (v) { | 754 | if (v) |
755 | { | ||
682 | v->setSelected(box,true); | 756 | v->setSelected(box,true); |
683 | } | 757 | } |
@@ -689,5 +763,6 @@ QPopupMenu * MHfolderItem::getContextMenu() | |||
689 | { | 763 | { |
690 | QPopupMenu *m = new QPopupMenu(0); | 764 | QPopupMenu *m = new QPopupMenu(0); |
691 | if (m) { | 765 | if (m) |
766 | { | ||
692 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),2); | 767 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),2); |
693 | m->insertItem(QObject::tr("Delete all mails",contextName),0); | 768 | m->insertItem(QObject::tr("Delete all mails",contextName),0); |
@@ -708,8 +783,9 @@ void MHfolderItem::createFolder() | |||
708 | { | 783 | { |
709 | Newmdirdlg ndirdlg(0,0,true); | 784 | Newmdirdlg ndirdlg(0,0,true); |
710 | ndirdlg.showMaximized(); | 785 | if ( QPEApplication::execDialog( &ndirdlg ) ) |
711 | if (ndirdlg.exec()) { | 786 | { |
712 | QString ndir = ndirdlg.Newdir(); | 787 | QString ndir = ndirdlg.Newdir(); |
713 | if (mbox->getWrapper()->createMbox(ndir,folder)) { | 788 | if (mbox->getWrapper()->createMbox(ndir,folder)) |
789 | { | ||
714 | QListView*v=listView(); | 790 | QListView*v=listView(); |
715 | MHviewItem * box = mbox; | 791 | MHviewItem * box = mbox; |
@@ -717,5 +793,6 @@ void MHfolderItem::createFolder() | |||
717 | * any member of it after that call!!*/ | 793 | * any member of it after that call!!*/ |
718 | mbox->refresh(true); | 794 | mbox->refresh(true); |
719 | if (v) { | 795 | if (v) |
796 | { | ||
720 | v->setSelected(box,true); | 797 | v->setSelected(box,true); |
721 | } | 798 | } |
@@ -726,5 +803,6 @@ void MHfolderItem::createFolder() | |||
726 | void MHfolderItem::contextMenuSelected(int which) | 803 | void MHfolderItem::contextMenuSelected(int which) |
727 | { | 804 | { |
728 | switch(which) { | 805 | switch(which) |
806 | { | ||
729 | case 0: | 807 | case 0: |
730 | deleteAllMail(mbox->getWrapper(),folder); | 808 | deleteAllMail(mbox->getWrapper(),folder); |
@@ -796,6 +874,8 @@ void AccountViewItem::deleteAllMail(AbstractMail*wrapper,Folder*folder) | |||
796 | QObject::tr("No",contextName),QString::null,1,1); | 874 | QObject::tr("No",contextName),QString::null,1,1); |
797 | qDebug("Auswahl: %i",yesno); | 875 | qDebug("Auswahl: %i",yesno); |
798 | if (yesno == 0) { | 876 | if (yesno == 0) |
799 | if (wrapper->deleteAllMail(folder)) { | 877 | { |
878 | if (wrapper->deleteAllMail(folder)) | ||
879 | { | ||
800 | AccountView * view = (AccountView*)listView(); | 880 | AccountView * view = (AccountView*)listView(); |
801 | if (view) view->refreshCurrent(); | 881 | if (view) view->refreshCurrent(); |
@@ -807,5 +887,6 @@ void AccountViewItem::removeChilds() | |||
807 | { | 887 | { |
808 | QListViewItem *child = firstChild(); | 888 | QListViewItem *child = firstChild(); |
809 | while ( child ) { | 889 | while ( child ) |
890 | { | ||
810 | QListViewItem *tmp = child; | 891 | QListViewItem *tmp = child; |
811 | child = child->nextSibling(); | 892 | child = child->nextSibling(); |
@@ -826,11 +907,15 @@ AccountViewItem*AccountViewItem::findSubItem(const QString&path,AccountViewItem* | |||
826 | if (!start) pitem = (AccountViewItem*)firstChild(); | 907 | if (!start) pitem = (AccountViewItem*)firstChild(); |
827 | else pitem = (AccountViewItem*)start->firstChild(); | 908 | else pitem = (AccountViewItem*)start->firstChild(); |
828 | while (pitem) { | 909 | while (pitem) |
829 | if (pitem->matchName(path)) { | 910 | { |
911 | if (pitem->matchName(path)) | ||
912 | { | ||
830 | break; | 913 | break; |
831 | } | 914 | } |
832 | if (pitem->childCount()>0) { | 915 | if (pitem->childCount()>0) |
916 | { | ||
833 | sitem = findSubItem(path,pitem); | 917 | sitem = findSubItem(path,pitem); |
834 | if (sitem) { | 918 | if (sitem) |
919 | { | ||
835 | pitem = sitem; | 920 | pitem = sitem; |
836 | break; | 921 | break; |
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index d9792d4..2ddf834 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -1,12 +1,17 @@ | |||
1 | |||
1 | #include "accountview.h" | 2 | #include "accountview.h" |
2 | #include "accountitem.h" | 3 | #include "accountitem.h" |
3 | #include "selectstore.h" | 4 | #include "selectstore.h" |
4 | #include <qmessagebox.h> | 5 | |
5 | #include <qpopupmenu.h> | 6 | /* OPIE */ |
6 | #include <libmailwrapper/settings.h> | 7 | #include <libmailwrapper/settings.h> |
7 | #include <libmailwrapper/mailwrapper.h> | 8 | #include <libmailwrapper/mailwrapper.h> |
8 | #include <libmailwrapper/mailtypes.h> | 9 | #include <libmailwrapper/mailtypes.h> |
9 | #include <libmailwrapper/abstractmail.h> | 10 | #include <libmailwrapper/abstractmail.h> |
11 | #include <qpe/qpeapplication.h> | ||
10 | 12 | ||
13 | /* QT */ | ||
14 | #include <qmessagebox.h> | ||
15 | #include <qpopupmenu.h> | ||
11 | 16 | ||
12 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) | 17 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) |
@@ -56,10 +61,14 @@ void AccountView::populate( QList<Account> list ) | |||
56 | 61 | ||
57 | Account *it; | 62 | Account *it; |
58 | for ( it = list.first(); it; it = list.next() ) { | 63 | for ( it = list.first(); it; it = list.next() ) |
59 | if ( it->getType().compare( "IMAP" ) == 0 ) { | 64 | { |
65 | if ( it->getType().compare( "IMAP" ) == 0 ) | ||
66 | { | ||
60 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); | 67 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); |
61 | qDebug( "added IMAP " + imap->getAccountName() ); | 68 | qDebug( "added IMAP " + imap->getAccountName() ); |
62 | imapAccounts.append(new IMAPviewItem( imap, this )); | 69 | imapAccounts.append(new IMAPviewItem( imap, this )); |
63 | } else if ( it->getType().compare( "POP3" ) == 0 ) { | 70 | } |
71 | else if ( it->getType().compare( "POP3" ) == 0 ) | ||
72 | { | ||
64 | POP3account *pop3 = static_cast<POP3account *>(it); | 73 | POP3account *pop3 = static_cast<POP3account *>(it); |
65 | qDebug( "added POP3 " + pop3->getAccountName() ); | 74 | qDebug( "added POP3 " + pop3->getAccountName() ); |
@@ -70,8 +79,10 @@ void AccountView::populate( QList<Account> list ) | |||
70 | } | 79 | } |
71 | 80 | ||
72 | void AccountView::refresh(QListViewItem *item) { | 81 | void AccountView::refresh(QListViewItem *item) |
82 | { | ||
73 | 83 | ||
74 | qDebug("AccountView refresh..."); | 84 | qDebug("AccountView refresh..."); |
75 | if ( item ) { | 85 | if ( item ) |
86 | { | ||
76 | m_currentItem = item; | 87 | m_currentItem = item; |
77 | QList<RecMail> headerlist; | 88 | QList<RecMail> headerlist; |
@@ -96,5 +107,4 @@ void AccountView::refreshCurrent() | |||
96 | void AccountView::refreshAll() | 107 | void AccountView::refreshAll() |
97 | { | 108 | { |
98 | |||
99 | } | 109 | } |
100 | 110 | ||
@@ -109,13 +119,15 @@ RecBody AccountView::fetchBody(const RecMail&aMail) | |||
109 | void AccountView::setupFolderselect(Selectstore*sels) | 119 | void AccountView::setupFolderselect(Selectstore*sels) |
110 | { | 120 | { |
111 | sels->showMaximized(); | 121 | QPEApplication::showDialog( sels ); |
112 | QStringList sFolders; | 122 | QStringList sFolders; |
113 | unsigned int i = 0; | 123 | unsigned int i = 0; |
114 | for (i=0; i < mhAccounts.count();++i) { | 124 | for (i=0; i < mhAccounts.count();++i) |
125 | { | ||
115 | mhAccounts[i]->refresh(false); | 126 | mhAccounts[i]->refresh(false); |
116 | sFolders = mhAccounts[i]->subFolders(); | 127 | sFolders = mhAccounts[i]->subFolders(); |
117 | sels->addAccounts(mhAccounts[i]->getWrapper(),sFolders); | 128 | sels->addAccounts(mhAccounts[i]->getWrapper(),sFolders); |
118 | } | 129 | } |
119 | for (i=0; i < imapAccounts.count();++i) { | 130 | for (i=0; i < imapAccounts.count();++i) |
131 | { | ||
120 | if (imapAccounts[i]->offline()) | 132 | if (imapAccounts[i]->offline()) |
121 | continue; | 133 | continue; |
@@ -135,8 +147,10 @@ void AccountView::downloadMails(Folder*fromFolder,AbstractMail*fromWrapper) | |||
135 | targetFolder = sels.currentFolder(); | 147 | targetFolder = sels.currentFolder(); |
136 | if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || | 148 | if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || |
137 | targetFolder.isEmpty()) { | 149 | targetFolder.isEmpty()) |
150 | { | ||
138 | return; | 151 | return; |
139 | } | 152 | } |
140 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) { | 153 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
154 | { | ||
141 | QMessageBox::critical(0,tr("Error creating new Folder"), | 155 | QMessageBox::critical(0,tr("Error creating new Folder"), |
142 | tr("<center>Error while creating<br>new folder - breaking.</center>")); | 156 | tr("<center>Error while creating<br>new folder - breaking.</center>")); |
diff --git a/noncore/net/mail/addresspicker.cpp b/noncore/net/mail/addresspicker.cpp index f4f4cea..8cdabde 100644 --- a/noncore/net/mail/addresspicker.cpp +++ b/noncore/net/mail/addresspicker.cpp | |||
@@ -1,2 +1,12 @@ | |||
1 | |||
2 | #include "composemail.h" | ||
3 | |||
4 | /* OPIE */ | ||
5 | #include <opie2/ocontactaccess.h> | ||
6 | #include <opie2/ocontact.h> | ||
7 | #include <qpe/resource.h> | ||
8 | #include <qpe/qpeapplication.h> | ||
9 | |||
10 | /* QT */ | ||
1 | #include <qpushbutton.h> | 11 | #include <qpushbutton.h> |
2 | #include <qmessagebox.h> | 12 | #include <qmessagebox.h> |
@@ -5,13 +15,7 @@ | |||
5 | #include <qfile.h> | 15 | #include <qfile.h> |
6 | 16 | ||
7 | #include <qpe/resource.h> | 17 | /* STD */ |
8 | #include <opie2/ocontactaccess.h> | ||
9 | #include <opie2/ocontact.h> | ||
10 | |||
11 | |||
12 | #include <stdlib.h> | 18 | #include <stdlib.h> |
13 | 19 | ||
14 | #include "composemail.h" | ||
15 | |||
16 | AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFlags flags ) | 20 | AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFlags flags ) |
17 | : AddressPickerUI( parent, name, modal, flags ) | 21 | : AddressPickerUI( parent, name, modal, flags ) |
@@ -31,16 +35,22 @@ AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFl | |||
31 | QString pre,suf; | 35 | QString pre,suf; |
32 | Opie::OContactAccess::List m_list = m_contactdb.sorted( true, 0, 0, 0 ); | 36 | Opie::OContactAccess::List m_list = m_contactdb.sorted( true, 0, 0, 0 ); |
33 | for ( it = m_list.begin(); it != m_list.end(); ++it ) { | 37 | for ( it = m_list.begin(); it != m_list.end(); ++it ) |
34 | if ((*it).defaultEmail().length()!=0) { | 38 | { |
39 | if ((*it).defaultEmail().length()!=0) | ||
40 | { | ||
35 | mails = (*it).emailList(); | 41 | mails = (*it).emailList(); |
36 | if ((*it).fileAs().length()>0) { | 42 | if ((*it).fileAs().length()>0) |
43 | { | ||
37 | pre = "\""+(*it).firstName()+" "+(*it).lastName()+"\" <"; | 44 | pre = "\""+(*it).firstName()+" "+(*it).lastName()+"\" <"; |
38 | suf = ">"; | 45 | suf = ">"; |
39 | } else { | 46 | } |
47 | else | ||
48 | { | ||
40 | pre = ""; | 49 | pre = ""; |
41 | suf = ""; | 50 | suf = ""; |
42 | } | 51 | } |
43 | QStringList::ConstIterator sit = mails.begin(); | 52 | QStringList::ConstIterator sit = mails.begin(); |
44 | for (;sit!=mails.end();++sit) { | 53 | for (;sit!=mails.end();++sit) |
54 | { | ||
45 | contactLine=pre+(*sit)+suf; | 55 | contactLine=pre+(*sit)+suf; |
46 | addressList->insertItem(contactLine); | 56 | addressList->insertItem(contactLine); |
@@ -48,5 +58,6 @@ AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFl | |||
48 | } | 58 | } |
49 | } | 59 | } |
50 | if ( addressList->count() <= 0 ) { | 60 | if ( addressList->count() <= 0 ) |
61 | { | ||
51 | #if 0 | 62 | #if 0 |
52 | // makes this realy sense?? | 63 | // makes this realy sense?? |
@@ -56,5 +67,7 @@ AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFl | |||
56 | addressList->setEnabled( false ); | 67 | addressList->setEnabled( false ); |
57 | okButton->setEnabled( false ); | 68 | okButton->setEnabled( false ); |
58 | } else { | 69 | } |
70 | else | ||
71 | { | ||
59 | // addressList->sort(); | 72 | // addressList->sort(); |
60 | } | 73 | } |
@@ -66,5 +79,6 @@ void AddressPicker::accept() | |||
66 | QString names; | 79 | QString names; |
67 | 80 | ||
68 | while ( item ) { | 81 | while ( item ) |
82 | { | ||
69 | if ( item->selected() ) | 83 | if ( item->selected() ) |
70 | names += item->text() + ", "; | 84 | names += item->text() + ", "; |
@@ -73,5 +87,6 @@ void AddressPicker::accept() | |||
73 | names.replace( names.length() - 2, 2, "" ); | 87 | names.replace( names.length() - 2, 2, "" ); |
74 | 88 | ||
75 | if ( names.isEmpty() ) { | 89 | if ( names.isEmpty() ) |
90 | { | ||
76 | QMessageBox::information(this, tr("Error"), tr("<p>You have to select" | 91 | QMessageBox::information(this, tr("Error"), tr("<p>You have to select" |
77 | " at least one address entry.</p>"), tr("Ok")); | 92 | " at least one address entry.</p>"), tr("Ok")); |
@@ -88,9 +103,8 @@ QString AddressPicker::getNames() | |||
88 | 103 | ||
89 | AddressPicker picker(0, 0, true); | 104 | AddressPicker picker(0, 0, true); |
90 | picker.showMaximized(); | ||
91 | picker.show(); | ||
92 | 105 | ||
93 | int ret = picker.exec(); | 106 | int ret = QPEApplication::execDialog( &picker ); |
94 | if ( QDialog::Accepted == ret ) { | 107 | if ( QDialog::Accepted == ret ) |
108 | { | ||
95 | return picker.selectedNames; | 109 | return picker.selectedNames; |
96 | } | 110 | } |
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp index 1cb202e..60bffa5 100644 --- a/noncore/net/mail/editaccounts.cpp +++ b/noncore/net/mail/editaccounts.cpp | |||
@@ -1,7 +1,12 @@ | |||
1 | #include <qt.h> | ||
2 | 1 | ||
3 | #include "defines.h" | 2 | #include "defines.h" |
4 | #include "editaccounts.h" | 3 | #include "editaccounts.h" |
5 | 4 | ||
5 | /* OPIE */ | ||
6 | #include <qpe/qpeapplication.h> | ||
7 | |||
8 | /* QT */ | ||
9 | #include <qt.h> | ||
10 | |||
6 | AccountListItem::AccountListItem( QListView *parent, Account *a) | 11 | AccountListItem::AccountListItem( QListView *parent, Account *a) |
7 | : QListViewItem( parent ) | 12 | : QListViewItem( parent ) |
@@ -40,8 +45,12 @@ void EditAccounts::slotFillLists() | |||
40 | QList<Account> accounts = settings->getAccounts(); | 45 | QList<Account> accounts = settings->getAccounts(); |
41 | Account *it; | 46 | Account *it; |
42 | for ( it = accounts.first(); it; it = accounts.next() ) { | 47 | for ( it = accounts.first(); it; it = accounts.next() ) |
43 | if ( it->getType().compare( "NNTP" ) == 0 ) { | 48 | { |
49 | if ( it->getType().compare( "NNTP" ) == 0 ) | ||
50 | { | ||
44 | (void) new AccountListItem( newsList, it ); | 51 | (void) new AccountListItem( newsList, it ); |
45 | } else { | 52 | } |
53 | else | ||
54 | { | ||
46 | (void) new AccountListItem( mailList, it ); | 55 | (void) new AccountListItem( mailList, it ); |
47 | } | 56 | } |
@@ -55,5 +64,6 @@ void EditAccounts::slotNewMail() | |||
55 | SelectMailType selType( selection, this, 0, true ); | 64 | SelectMailType selType( selection, this, 0, true ); |
56 | selType.show(); | 65 | selType.show(); |
57 | if ( QDialog::Accepted == selType.exec() ) { | 66 | if ( QDialog::Accepted == selType.exec() ) |
67 | { | ||
58 | slotNewAccount( *selection ); | 68 | slotNewAccount( *selection ); |
59 | } | 69 | } |
@@ -62,51 +72,66 @@ void EditAccounts::slotNewMail() | |||
62 | void EditAccounts::slotNewAccount( const QString &type ) | 72 | void EditAccounts::slotNewAccount( const QString &type ) |
63 | { | 73 | { |
64 | if ( type.compare( "IMAP" ) == 0 ) { | 74 | if ( type.compare( "IMAP" ) == 0 ) |
75 | { | ||
65 | qDebug( "-> config IMAP" ); | 76 | qDebug( "-> config IMAP" ); |
66 | IMAPaccount *account = new IMAPaccount(); | 77 | IMAPaccount *account = new IMAPaccount(); |
67 | IMAPconfig imap( account, this, 0, true ); | 78 | IMAPconfig imap( account, this, 0, true ); |
68 | imap.showMaximized(); | 79 | if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) ) |
69 | if ( QDialog::Accepted == imap.exec() ) { | 80 | { |
70 | settings->addAccount( account ); | 81 | settings->addAccount( account ); |
71 | account->save(); | 82 | account->save(); |
72 | slotFillLists(); | 83 | slotFillLists(); |
73 | } else { | 84 | } |
85 | else | ||
86 | { | ||
74 | account->remove(); | 87 | account->remove(); |
75 | } | 88 | } |
76 | } else if ( type.compare( "POP3" ) == 0 ) { | 89 | } |
90 | else if ( type.compare( "POP3" ) == 0 ) | ||
91 | { | ||
77 | qDebug( "-> config POP3" ); | 92 | qDebug( "-> config POP3" ); |
78 | POP3account *account = new POP3account(); | 93 | POP3account *account = new POP3account(); |
79 | POP3config pop3( account, this, 0, true, WStyle_ContextHelp ); | 94 | POP3config pop3( account, this, 0, true, WStyle_ContextHelp ); |
80 | pop3.showMaximized(); | 95 | if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) ) |
81 | if ( QDialog::Accepted == pop3.exec() ) { | 96 | { |
82 | settings->addAccount( account ); | 97 | settings->addAccount( account ); |
83 | account->save(); | 98 | account->save(); |
84 | slotFillLists(); | 99 | slotFillLists(); |
85 | } else { | 100 | } |
101 | else | ||
102 | { | ||
86 | account->remove(); | 103 | account->remove(); |
87 | } | 104 | } |
88 | } else if ( type.compare( "SMTP" ) == 0 ) { | 105 | } |
106 | else if ( type.compare( "SMTP" ) == 0 ) | ||
107 | { | ||
89 | qDebug( "-> config SMTP" ); | 108 | qDebug( "-> config SMTP" ); |
90 | SMTPaccount *account = new SMTPaccount(); | 109 | SMTPaccount *account = new SMTPaccount(); |
91 | SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp ); | 110 | SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp ); |
92 | smtp.showMaximized(); | 111 | if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) ) |
93 | if ( QDialog::Accepted == smtp.exec() ) { | 112 | { |
94 | settings->addAccount( account ); | 113 | settings->addAccount( account ); |
95 | account->save(); | 114 | account->save(); |
96 | slotFillLists(); | 115 | slotFillLists(); |
97 | 116 | ||
98 | } else { | 117 | } |
118 | else | ||
119 | { | ||
99 | account->remove(); | 120 | account->remove(); |
100 | } | 121 | } |
101 | } else if ( type.compare( "NNTP" ) == 0 ) { | 122 | } |
123 | else if ( type.compare( "NNTP" ) == 0 ) | ||
124 | { | ||
102 | qDebug( "-> config NNTP" ); | 125 | qDebug( "-> config NNTP" ); |
103 | NNTPaccount *account = new NNTPaccount(); | 126 | NNTPaccount *account = new NNTPaccount(); |
104 | NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp ); | 127 | NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp ); |
105 | nntp.showMaximized(); | 128 | if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) ) |
106 | if ( QDialog::Accepted == nntp.exec() ) { | 129 | { |
107 | settings->addAccount( account ); | 130 | settings->addAccount( account ); |
108 | account->save(); | 131 | account->save(); |
109 | slotFillLists(); | 132 | slotFillLists(); |
110 | } else { | 133 | } |
134 | else | ||
135 | { | ||
111 | account->remove(); | 136 | account->remove(); |
112 | } | 137 | } |
@@ -116,30 +141,37 @@ void EditAccounts::slotNewAccount( const QString &type ) | |||
116 | void EditAccounts::slotEditAccount( Account *account ) | 141 | void EditAccounts::slotEditAccount( Account *account ) |
117 | { | 142 | { |
118 | if ( account->getType().compare( "IMAP" ) == 0 ) { | 143 | if ( account->getType().compare( "IMAP" ) == 0 ) |
144 | { | ||
119 | IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account); | 145 | IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account); |
120 | IMAPconfig imap( imapAcc, this, 0, true, WStyle_ContextHelp ); | 146 | IMAPconfig imap( imapAcc, this, 0, true, WStyle_ContextHelp ); |
121 | imap.showMaximized(); | 147 | if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) ) |
122 | if ( QDialog::Accepted == imap.exec() ) { | 148 | { |
123 | slotFillLists(); | 149 | slotFillLists(); |
124 | } | 150 | } |
125 | } else if ( account->getType().compare( "POP3" ) == 0 ) { | 151 | } |
152 | else if ( account->getType().compare( "POP3" ) == 0 ) | ||
153 | { | ||
126 | POP3account *pop3Acc = static_cast<POP3account *>(account); | 154 | POP3account *pop3Acc = static_cast<POP3account *>(account); |
127 | POP3config pop3( pop3Acc, this, 0, true, WStyle_ContextHelp ); | 155 | POP3config pop3( pop3Acc, this, 0, true, WStyle_ContextHelp ); |
128 | pop3.showMaximized(); | 156 | if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) ) |
129 | if ( QDialog::Accepted == pop3.exec() ) { | 157 | { |
130 | slotFillLists(); | 158 | slotFillLists(); |
131 | } | 159 | } |
132 | } else if ( account->getType().compare( "SMTP" ) == 0 ) { | 160 | } |
161 | else if ( account->getType().compare( "SMTP" ) == 0 ) | ||
162 | { | ||
133 | SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account); | 163 | SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account); |
134 | SMTPconfig smtp( smtpAcc, this, 0, true, WStyle_ContextHelp ); | 164 | SMTPconfig smtp( smtpAcc, this, 0, true, WStyle_ContextHelp ); |
135 | smtp.showMaximized(); | 165 | if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) ) |
136 | if ( QDialog::Accepted == smtp.exec() ) { | 166 | { |
137 | slotFillLists(); | 167 | slotFillLists(); |
138 | } | 168 | } |
139 | } else if ( account->getType().compare( "NNTP" ) == 0 ) { | 169 | } |
170 | else if ( account->getType().compare( "NNTP" ) == 0 ) | ||
171 | { | ||
140 | NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account); | 172 | NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account); |
141 | NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp ); | 173 | NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp ); |
142 | nntp.showMaximized(); | 174 | if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) ) |
143 | if ( QDialog::Accepted == nntp.exec() ) { | 175 | { |
144 | slotFillLists(); | 176 | slotFillLists(); |
145 | } | 177 | } |
@@ -151,5 +183,6 @@ void EditAccounts::slotDeleteAccount( Account *account ) | |||
151 | if ( QMessageBox::information( this, tr( "Question" ), | 183 | if ( QMessageBox::information( this, tr( "Question" ), |
152 | tr( "<p>Do you really want to delete the selected Account?</p>" ), | 184 | tr( "<p>Do you really want to delete the selected Account?</p>" ), |
153 | tr( "Yes" ), tr( "No" ) ) == 0 ) { | 185 | tr( "Yes" ), tr( "No" ) ) == 0 ) |
186 | { | ||
154 | settings->delAccount( account ); | 187 | settings->delAccount( account ); |
155 | slotFillLists(); | 188 | slotFillLists(); |
@@ -160,5 +193,6 @@ void EditAccounts::slotEditMail() | |||
160 | { | 193 | { |
161 | qDebug( "Edit Mail Account" ); | 194 | qDebug( "Edit Mail Account" ); |
162 | if ( !mailList->currentItem() ) { | 195 | if ( !mailList->currentItem() ) |
196 | { | ||
163 | QMessageBox::information( this, tr( "Error" ), | 197 | QMessageBox::information( this, tr( "Error" ), |
164 | tr( "<p>Please select an account.</p>" ), | 198 | tr( "<p>Please select an account.</p>" ), |
@@ -173,5 +207,6 @@ void EditAccounts::slotEditMail() | |||
173 | void EditAccounts::slotDeleteMail() | 207 | void EditAccounts::slotDeleteMail() |
174 | { | 208 | { |
175 | if ( !mailList->currentItem() ) { | 209 | if ( !mailList->currentItem() ) |
210 | { | ||
176 | QMessageBox::information( this, tr( "Error" ), | 211 | QMessageBox::information( this, tr( "Error" ), |
177 | tr( "<p>Please select an account.</p>" ), | 212 | tr( "<p>Please select an account.</p>" ), |
@@ -193,5 +228,6 @@ void EditAccounts::slotEditNews() | |||
193 | { | 228 | { |
194 | qDebug( "Edit News Account" ); | 229 | qDebug( "Edit News Account" ); |
195 | if ( !newsList->currentItem() ) { | 230 | if ( !newsList->currentItem() ) |
231 | { | ||
196 | QMessageBox::information( this, tr( "Error" ), | 232 | QMessageBox::information( this, tr( "Error" ), |
197 | tr( "<p>Please select an account.</p>" ), | 233 | tr( "<p>Please select an account.</p>" ), |
@@ -207,5 +243,6 @@ void EditAccounts::slotDeleteNews() | |||
207 | { | 243 | { |
208 | qDebug( "Delete News Account" ); | 244 | qDebug( "Delete News Account" ); |
209 | if ( !newsList->currentItem() ) { | 245 | if ( !newsList->currentItem() ) |
246 | { | ||
210 | QMessageBox::information( this, tr( "Error" ), | 247 | QMessageBox::information( this, tr( "Error" ), |
211 | tr( "<p>Please select an account.</p>" ), | 248 | tr( "<p>Please select an account.</p>" ), |
@@ -278,10 +315,15 @@ IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, | |||
278 | void IMAPconfig::slotConnectionToggle( int index ) | 315 | void IMAPconfig::slotConnectionToggle( int index ) |
279 | { | 316 | { |
280 | if ( index == 2 ) { | 317 | if ( index == 2 ) |
318 | { | ||
281 | portLine->setText( IMAP_SSL_PORT ); | 319 | portLine->setText( IMAP_SSL_PORT ); |
282 | } else if ( index == 3 ) { | 320 | } |
321 | else if ( index == 3 ) | ||
322 | { | ||
283 | portLine->setText( IMAP_PORT ); | 323 | portLine->setText( IMAP_PORT ); |
284 | CommandEdit->show(); | 324 | CommandEdit->show(); |
285 | } else { | 325 | } |
326 | else | ||
327 | { | ||
286 | portLine->setText( IMAP_PORT ); | 328 | portLine->setText( IMAP_PORT ); |
287 | } | 329 | } |
@@ -334,10 +376,15 @@ void POP3config::slotConnectionToggle( int index ) | |||
334 | { | 376 | { |
335 | // 2 is ssl connection | 377 | // 2 is ssl connection |
336 | if ( index == 2 ) { | 378 | if ( index == 2 ) |
379 | { | ||
337 | portLine->setText( POP3_SSL_PORT ); | 380 | portLine->setText( POP3_SSL_PORT ); |
338 | } else if ( index == 3 ) { | 381 | } |
382 | else if ( index == 3 ) | ||
383 | { | ||
339 | portLine->setText( POP3_PORT ); | 384 | portLine->setText( POP3_PORT ); |
340 | CommandEdit->show(); | 385 | CommandEdit->show(); |
341 | } else { | 386 | } |
387 | else | ||
388 | { | ||
342 | portLine->setText( POP3_PORT ); | 389 | portLine->setText( POP3_PORT ); |
343 | } | 390 | } |
@@ -392,10 +439,15 @@ void SMTPconfig::slotConnectionToggle( int index ) | |||
392 | { | 439 | { |
393 | // 2 is ssl connection | 440 | // 2 is ssl connection |
394 | if ( index == 2 ) { | 441 | if ( index == 2 ) |
442 | { | ||
395 | portLine->setText( SMTP_SSL_PORT ); | 443 | portLine->setText( SMTP_SSL_PORT ); |
396 | } else if ( index == 3 ) { | 444 | } |
445 | else if ( index == 3 ) | ||
446 | { | ||
397 | portLine->setText( SMTP_PORT ); | 447 | portLine->setText( SMTP_PORT ); |
398 | CommandEdit->show(); | 448 | CommandEdit->show(); |
399 | } else { | 449 | } |
450 | else | ||
451 | { | ||
400 | portLine->setText( SMTP_PORT ); | 452 | portLine->setText( SMTP_PORT ); |
401 | } | 453 | } |
@@ -445,7 +497,10 @@ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, | |||
445 | void NNTPconfig::slotSSL( bool enabled ) | 497 | void NNTPconfig::slotSSL( bool enabled ) |
446 | { | 498 | { |
447 | if ( enabled ) { | 499 | if ( enabled ) |
500 | { | ||
448 | portLine->setText( NNTP_SSL_PORT ); | 501 | portLine->setText( NNTP_SSL_PORT ); |
449 | } else { | 502 | } |
503 | else | ||
504 | { | ||
450 | portLine->setText( NNTP_PORT ); | 505 | portLine->setText( NNTP_PORT ); |
451 | } | 506 | } |
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 0795436..abf93dc 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -1,18 +1,24 @@ | |||
1 | #include <qmessagebox.h> | 1 | |
2 | #include "settingsdialog.h" | 2 | #include "settingsdialog.h" |
3 | #include "opiemail.h" | 3 | #include "opiemail.h" |
4 | #include "editaccounts.h" | 4 | #include "editaccounts.h" |
5 | #include "composemail.h" | 5 | #include "composemail.h" |
6 | #include "mailistviewitem.h" | ||
7 | #include "viewmail.h" | ||
8 | #include "selectstore.h" | ||
9 | #include "selectsmtp.h" | ||
10 | |||
11 | /* OPIE */ | ||
6 | #include <libmailwrapper/smtpwrapper.h> | 12 | #include <libmailwrapper/smtpwrapper.h> |
13 | #include <libmailwrapper/mailtypes.h> | ||
14 | #include <libmailwrapper/abstractmail.h> | ||
7 | #include <qpe/qcopenvelope_qws.h> | 15 | #include <qpe/qcopenvelope_qws.h> |
8 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
17 | #include <qpe/qpeapplication.h> | ||
18 | |||
19 | /* QT */ | ||
20 | #include <qmessagebox.h> | ||
9 | #include <qaction.h> | 21 | #include <qaction.h> |
10 | #include <qapplication.h> | 22 | #include <qapplication.h> |
11 | #include <libmailwrapper/mailtypes.h> | ||
12 | #include <libmailwrapper/abstractmail.h> | ||
13 | #include "mailistviewitem.h" | ||
14 | #include "viewmail.h" | ||
15 | #include "selectstore.h" | ||
16 | #include "selectsmtp.h" | ||
17 | 23 | ||
18 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) | 24 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) |
@@ -32,5 +38,6 @@ void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | |||
32 | { | 38 | { |
33 | // copied from old mail2 | 39 | // copied from old mail2 |
34 | if (msg == "writeMail(QString,QString)") { | 40 | if (msg == "writeMail(QString,QString)") |
41 | { | ||
35 | QDataStream stream(data,IO_ReadOnly); | 42 | QDataStream stream(data,IO_ReadOnly); |
36 | QString name, email; | 43 | QString name, email; |
@@ -38,5 +45,7 @@ void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | |||
38 | // removing the whitespaces at beginning and end is needed! | 45 | // removing the whitespaces at beginning and end is needed! |
39 | slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace()); | 46 | slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace()); |
40 | } else if (msg == "newMail()") { | 47 | } |
48 | else if (msg == "newMail()") | ||
49 | { | ||
41 | slotComposeMail(); | 50 | slotComposeMail(); |
42 | } | 51 | } |
@@ -46,14 +55,17 @@ void OpieMail::slotwriteMail(const QString&name,const QString&email) | |||
46 | { | 55 | { |
47 | ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp ); | 56 | ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp ); |
48 | if (!email.isEmpty()) { | 57 | if (!email.isEmpty()) |
49 | if (!name.isEmpty()) { | 58 | { |
59 | if (!name.isEmpty()) | ||
60 | { | ||
50 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); | 61 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); |
51 | } else { | 62 | } |
63 | else | ||
64 | { | ||
52 | compose.setTo(email); | 65 | compose.setTo(email); |
53 | } | 66 | } |
54 | } | 67 | } |
55 | compose.showMaximized(); | ||
56 | compose.slotAdjustColumns(); | 68 | compose.slotAdjustColumns(); |
57 | compose.exec(); | 69 | QPEApplication::execDialog( &compose ); |
58 | } | 70 | } |
59 | 71 | ||
@@ -73,28 +85,36 @@ void OpieMail::slotSendQueued() | |||
73 | smtpList.setAutoDelete(false); | 85 | smtpList.setAutoDelete(false); |
74 | Account *it; | 86 | Account *it; |
75 | for ( it = list.first(); it; it = list.next() ) { | 87 | for ( it = list.first(); it; it = list.next() ) |
76 | if ( it->getType().compare( "SMTP" ) == 0 ) { | 88 | { |
89 | if ( it->getType().compare( "SMTP" ) == 0 ) | ||
90 | { | ||
77 | smtp = static_cast<SMTPaccount *>(it); | 91 | smtp = static_cast<SMTPaccount *>(it); |
78 | smtpList.append(smtp); | 92 | smtpList.append(smtp); |
79 | } | 93 | } |
80 | } | 94 | } |
81 | if (smtpList.count()==0) { | 95 | if (smtpList.count()==0) |
96 | { | ||
82 | QMessageBox::information(0,tr("Info"),tr("Define a smtp account first")); | 97 | QMessageBox::information(0,tr("Info"),tr("Define a smtp account first")); |
83 | return; | 98 | return; |
84 | } | 99 | } |
85 | if (smtpList.count()==1) { | 100 | if (smtpList.count()==1) |
101 | { | ||
86 | smtp = smtpList.at(0); | 102 | smtp = smtpList.at(0); |
87 | } else { | 103 | } |
104 | else | ||
105 | { | ||
88 | smtp = 0; | 106 | smtp = 0; |
89 | selectsmtp selsmtp; | 107 | selectsmtp selsmtp; |
90 | selsmtp.setSelectionlist(&smtpList); | 108 | selsmtp.setSelectionlist(&smtpList); |
91 | selsmtp.showMaximized(); | 109 | if ( QPEApplication::execDialog( &selsmtp ) == QDialog::Accepted ) |
92 | if (selsmtp.exec()==QDialog::Accepted) { | 110 | { |
93 | smtp = selsmtp.selected_smtp(); | 111 | smtp = selsmtp.selected_smtp(); |
94 | } | 112 | } |
95 | } | 113 | } |
96 | if (smtp) { | 114 | if (smtp) |
115 | { | ||
97 | SMTPwrapper * wrap = new SMTPwrapper(smtp); | 116 | SMTPwrapper * wrap = new SMTPwrapper(smtp); |
98 | if ( wrap->flushOutbox() ) { | 117 | if ( wrap->flushOutbox() ) |
118 | { | ||
99 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); | 119 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); |
100 | } | 120 | } |
@@ -111,6 +131,5 @@ void OpieMail::slotEditSettings() | |||
111 | { | 131 | { |
112 | SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp ); | 132 | SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp ); |
113 | settingsDialog.showMaximized(); | 133 | QPEApplication::execDialog( &settingsDialog ); |
114 | settingsDialog.exec(); | ||
115 | } | 134 | } |
116 | 135 | ||
@@ -119,7 +138,6 @@ void OpieMail::slotEditAccounts() | |||
119 | qDebug( "Edit Accounts" ); | 138 | qDebug( "Edit Accounts" ); |
120 | EditAccounts eaDialog( settings, this, 0, true, WStyle_ContextHelp ); | 139 | EditAccounts eaDialog( settings, this, 0, true, WStyle_ContextHelp ); |
121 | eaDialog.showMaximized(); | ||
122 | eaDialog.slotAdjustColumns(); | 140 | eaDialog.slotAdjustColumns(); |
123 | eaDialog.exec(); | 141 | QPEApplication::execDialog( &eaDialog ); |
124 | if ( settings ) delete settings; | 142 | if ( settings ) delete settings; |
125 | settings = new Settings(); | 143 | settings = new Settings(); |
@@ -140,7 +158,10 @@ void OpieMail::displayMail() | |||
140 | readMail.exec(); | 158 | readMail.exec(); |
141 | 159 | ||
142 | if ( readMail.deleted ) { | 160 | if ( readMail.deleted ) |
161 | { | ||
143 | folderView->refreshCurrent(); | 162 | folderView->refreshCurrent(); |
144 | } else { | 163 | } |
164 | else | ||
165 | { | ||
145 | ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "" ) ); | 166 | ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "" ) ); |
146 | } | 167 | } |
@@ -151,5 +172,6 @@ void OpieMail::slotDeleteMail() | |||
151 | if (!mailView->currentItem()) return; | 172 | if (!mailView->currentItem()) return; |
152 | RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 173 | RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
153 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail.getFrom() + " - " + mail.getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { | 174 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail.getFrom() + " - " + mail.getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
175 | { | ||
154 | mail.Wrapper()->deleteMail( mail ); | 176 | mail.Wrapper()->deleteMail( mail ); |
155 | folderView->refreshCurrent(); | 177 | folderView->refreshCurrent(); |
@@ -164,5 +186,6 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) | |||
164 | if (!item) return; | 186 | if (!item) return; |
165 | QPopupMenu *m = new QPopupMenu(0); | 187 | QPopupMenu *m = new QPopupMenu(0); |
166 | if (m) { | 188 | if (m) |
189 | { | ||
167 | m->insertItem(tr("Read this mail"),this,SLOT(displayMail())); | 190 | m->insertItem(tr("Read this mail"),this,SLOT(displayMail())); |
168 | m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail())); | 191 | m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail())); |
@@ -177,8 +200,11 @@ void OpieMail::slotShowFolders( bool show ) | |||
177 | { | 200 | { |
178 | qDebug( "Show Folders" ); | 201 | qDebug( "Show Folders" ); |
179 | if ( show && folderView->isHidden() ) { | 202 | if ( show && folderView->isHidden() ) |
203 | { | ||
180 | qDebug( "-> showing" ); | 204 | qDebug( "-> showing" ); |
181 | folderView->show(); | 205 | folderView->show(); |
182 | } else if ( !show && !folderView->isHidden() ) { | 206 | } |
207 | else if ( !show && !folderView->isHidden() ) | ||
208 | { | ||
183 | qDebug( "-> hiding" ); | 209 | qDebug( "-> hiding" ); |
184 | folderView->hide(); | 210 | folderView->hide(); |
@@ -190,5 +216,6 @@ void OpieMail::refreshMailView(QList<RecMail>*list) | |||
190 | MailListViewItem*item = 0; | 216 | MailListViewItem*item = 0; |
191 | mailView->clear(); | 217 | mailView->clear(); |
192 | for (unsigned int i = 0; i < list->count();++i) { | 218 | for (unsigned int i = 0; i < list->count();++i) |
219 | { | ||
193 | item = new MailListViewItem(mailView,item); | 220 | item = new MailListViewItem(mailView,item); |
194 | item->storeData(*(list->at(i))); | 221 | item->storeData(*(list->at(i))); |
@@ -217,8 +244,10 @@ void OpieMail::slotMoveCopyMail() | |||
217 | targetFolder = sels.currentFolder(); | 244 | targetFolder = sels.currentFolder(); |
218 | if ( (mail.Wrapper()==targetMail && mail.getMbox()==targetFolder) || | 245 | if ( (mail.Wrapper()==targetMail && mail.getMbox()==targetFolder) || |
219 | targetFolder.isEmpty()) { | 246 | targetFolder.isEmpty()) |
247 | { | ||
220 | return; | 248 | return; |
221 | } | 249 | } |
222 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) { | 250 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
251 | { | ||
223 | QMessageBox::critical(0,tr("Error creating new Folder"), | 252 | QMessageBox::critical(0,tr("Error creating new Folder"), |
224 | tr("<center>Error while creating<br>new folder - breaking.</center>")); | 253 | tr("<center>Error while creating<br>new folder - breaking.</center>")); |
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index 99965d4..f015228 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp | |||
@@ -1,2 +1,16 @@ | |||
1 | #include "composemail.h" | ||
2 | #include "viewmail.h" | ||
3 | #include "accountview.h" | ||
4 | |||
5 | /* OPIE */ | ||
6 | #include <libmailwrapper/settings.h> | ||
7 | #include <libmailwrapper/abstractmail.h> | ||
8 | #include <libmailwrapper/mailtypes.h> | ||
9 | |||
10 | #include <opie2/ofiledialog.h> | ||
11 | #include <qpe/config.h> | ||
12 | #include <qpe/qpeapplication.h> | ||
13 | |||
14 | /* QT */ | ||
1 | #include <qtextbrowser.h> | 15 | #include <qtextbrowser.h> |
2 | #include <qmessagebox.h> | 16 | #include <qmessagebox.h> |
@@ -8,15 +22,4 @@ | |||
8 | #include <qvaluelist.h> | 22 | #include <qvaluelist.h> |
9 | 23 | ||
10 | #include <qpe/config.h> | ||
11 | |||
12 | #include <opie2/ofiledialog.h> | ||
13 | |||
14 | #include <libmailwrapper/settings.h> | ||
15 | #include "composemail.h" | ||
16 | #include "viewmail.h" | ||
17 | #include <libmailwrapper/abstractmail.h> | ||
18 | #include "accountview.h" | ||
19 | #include <libmailwrapper/mailtypes.h> | ||
20 | |||
21 | AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, | 24 | AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, |
22 | const QString&fsize,int num,const QValueList<int>&path) | 25 | const QString&fsize,int num,const QValueList<int>&path) |
@@ -47,5 +50,6 @@ bool AttachItem::isParentof(const QValueList<int>&path) | |||
47 | /* the parent must have one digit less then a child */ | 50 | /* the parent must have one digit less then a child */ |
48 | if (path.count()!=_path.count()+1) return false; | 51 | if (path.count()!=_path.count()+1) return false; |
49 | for (unsigned int i=0; i < _path.count();++i) { | 52 | for (unsigned int i=0; i < _path.count();++i) |
53 | { | ||
50 | if (_path[i]!=path[i]) return false; | 54 | if (_path[i]!=path[i]) return false; |
51 | } | 55 | } |
@@ -56,5 +60,6 @@ AttachItem* ViewMail::searchParent(const QValueList<int>&path) | |||
56 | { | 60 | { |
57 | QListViewItemIterator it( attachments ); | 61 | QListViewItemIterator it( attachments ); |
58 | for ( ; it.current(); ++it ) { | 62 | for ( ; it.current(); ++it ) |
63 | { | ||
59 | AttachItem*ati = (AttachItem*)it.current(); | 64 | AttachItem*ati = (AttachItem*)it.current(); |
60 | if (ati->isParentof(path)) return ati; | 65 | if (ati->isParentof(path)) return ati; |
@@ -69,5 +74,6 @@ AttachItem* ViewMail::lastChild(AttachItem*parent) | |||
69 | if (!item) return item; | 74 | if (!item) return item; |
70 | AttachItem*temp=0; | 75 | AttachItem*temp=0; |
71 | while( (temp=(AttachItem*)item->nextSibling())) { | 76 | while( (temp=(AttachItem*)item->nextSibling())) |
77 | { | ||
72 | item = temp; | 78 | item = temp; |
73 | } | 79 | } |
@@ -75,5 +81,6 @@ AttachItem* ViewMail::lastChild(AttachItem*parent) | |||
75 | } | 81 | } |
76 | 82 | ||
77 | void ViewMail::setBody( RecBody body ) { | 83 | void ViewMail::setBody( RecBody body ) |
84 | { | ||
78 | 85 | ||
79 | m_body = body; | 86 | m_body = body; |
@@ -81,5 +88,6 @@ m_mail[2] = body.Bodytext(); | |||
81 | attachbutton->setEnabled(body.Parts().count()>0); | 88 | attachbutton->setEnabled(body.Parts().count()>0); |
82 | attachments->setEnabled(body.Parts().count()>0); | 89 | attachments->setEnabled(body.Parts().count()>0); |
83 | if (body.Parts().count()==0) { | 90 | if (body.Parts().count()==0) |
91 | { | ||
84 | return; | 92 | return; |
85 | } | 93 | } |
@@ -92,5 +100,6 @@ int w; | |||
92 | w=0; | 100 | w=0; |
93 | 101 | ||
94 | while (s>1024) { | 102 | while (s>1024) |
103 | { | ||
95 | s/=1024; | 104 | s/=1024; |
96 | ++w; | 105 | ++w; |
@@ -99,5 +108,6 @@ while (s>1024) { | |||
99 | 108 | ||
100 | QString q=""; | 109 | QString q=""; |
101 | switch(w) { | 110 | switch(w) |
111 | { | ||
102 | case 1: | 112 | case 1: |
103 | q="k"; | 113 | q="k"; |
@@ -125,10 +135,13 @@ curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1,body.Desc | |||
125 | QString filename = ""; | 135 | QString filename = ""; |
126 | 136 | ||
127 | for (unsigned int i = 0; i < body.Parts().count();++i) { | 137 | for (unsigned int i = 0; i < body.Parts().count();++i) |
138 | { | ||
128 | type = body.Parts()[i].Type()+"/"+body.Parts()[i].Subtype(); | 139 | type = body.Parts()[i].Type()+"/"+body.Parts()[i].Subtype(); |
129 | part_plist_t::ConstIterator it = body.Parts()[i].Parameters().begin(); | 140 | part_plist_t::ConstIterator it = body.Parts()[i].Parameters().begin(); |
130 | for (;it!=body.Parts()[i].Parameters().end();++it) { | 141 | for (;it!=body.Parts()[i].Parameters().end();++it) |
142 | { | ||
131 | qDebug(it.key()); | 143 | qDebug(it.key()); |
132 | if (it.key().lower()=="name") { | 144 | if (it.key().lower()=="name") |
145 | { | ||
133 | filename=it.data(); | 146 | filename=it.data(); |
134 | } | 147 | } |
@@ -136,10 +149,12 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
136 | s = body.Parts()[i].Size(); | 149 | s = body.Parts()[i].Size(); |
137 | w = 0; | 150 | w = 0; |
138 | while (s>1024) { | 151 | while (s>1024) |
152 | { | ||
139 | s/=1024; | 153 | s/=1024; |
140 | ++w; | 154 | ++w; |
141 | if (w>=2) break; | 155 | if (w>=2) break; |
142 | } | 156 | } |
143 | switch(w) { | 157 | switch(w) |
158 | { | ||
144 | case 1: | 159 | case 1: |
145 | q="k"; | 160 | q="k"; |
@@ -158,5 +173,6 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
158 | desc = body.Parts()[i].Description(); | 173 | desc = body.Parts()[i].Description(); |
159 | parentItem = searchParent(body.Parts()[i].Positionlist()); | 174 | parentItem = searchParent(body.Parts()[i].Positionlist()); |
160 | if (parentItem) { | 175 | if (parentItem) |
176 | { | ||
161 | AttachItem*temp = lastChild(parentItem); | 177 | AttachItem*temp = lastChild(parentItem); |
162 | if (temp) curItem = temp; | 178 | if (temp) curItem = temp; |
@@ -164,5 +180,7 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
164 | attachments->setRootIsDecorated(true); | 180 | attachments->setRootIsDecorated(true); |
165 | curItem = parentItem; | 181 | curItem = parentItem; |
166 | } else { | 182 | } |
183 | else | ||
184 | { | ||
167 | curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist()); | 185 | curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist()); |
168 | } | 186 | } |
@@ -171,14 +189,17 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
171 | 189 | ||
172 | 190 | ||
173 | void ViewMail::slotShowHtml( bool state ) { | 191 | void ViewMail::slotShowHtml( bool state ) |
192 | { | ||
174 | m_showHtml = state; | 193 | m_showHtml = state; |
175 | setText(); | 194 | setText(); |
176 | } | 195 | } |
177 | 196 | ||
178 | void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) { | 197 | void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) |
198 | { | ||
179 | if (!item ) | 199 | if (!item ) |
180 | return; | 200 | return; |
181 | 201 | ||
182 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { | 202 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) |
203 | { | ||
183 | setText(); | 204 | setText(); |
184 | return; | 205 | return; |
@@ -187,5 +208,6 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
187 | int ret=0; | 208 | int ret=0; |
188 | 209 | ||
189 | if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) { | 210 | if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) |
211 | { | ||
190 | menu->insertItem( tr( "Show Text" ), 1 ); | 212 | menu->insertItem( tr( "Show Text" ), 1 ); |
191 | } | 213 | } |
@@ -195,14 +217,18 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
195 | ret = menu->exec( point, 0 ); | 217 | ret = menu->exec( point, 0 ); |
196 | 218 | ||
197 | switch(ret) { | 219 | switch(ret) |
220 | { | ||
198 | case 0: | 221 | case 0: |
199 | { MimeTypes types; | 222 | { |
223 | MimeTypes types; | ||
200 | types.insert( "all", "*" ); | 224 | types.insert( "all", "*" ); |
201 | QString str = Opie::OFileDialog::getSaveFileName( 1, | 225 | QString str = Opie::OFileDialog::getSaveFileName( 1, |
202 | "/", item->text( 2 ) , types, 0 ); | 226 | "/", item->text( 2 ) , types, 0 ); |
203 | 227 | ||
204 | if( !str.isEmpty() ) { | 228 | if( !str.isEmpty() ) |
229 | { | ||
205 | encodedString*content = m_recMail.Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); | 230 | encodedString*content = m_recMail.Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); |
206 | if (content) { | 231 | if (content) |
232 | { | ||
207 | QFile output(str); | 233 | QFile output(str); |
208 | output.open(IO_WriteOnly); | 234 | output.open(IO_WriteOnly); |
@@ -216,8 +242,12 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
216 | 242 | ||
217 | case 1: | 243 | case 1: |
218 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { | 244 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) |
245 | { | ||
219 | setText(); | 246 | setText(); |
220 | } else { | 247 | } |
221 | if ( m_recMail.Wrapper() != 0l ) { // make sure that there is a wrapper , even after delete or simular actions | 248 | else |
249 | { | ||
250 | if ( m_recMail.Wrapper() != 0l ) | ||
251 | { // make sure that there is a wrapper , even after delete or simular actions | ||
222 | browser->setText( m_recMail.Wrapper()->fetchTextPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) ); | 252 | browser->setText( m_recMail.Wrapper()->fetchTextPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) ); |
223 | } | 253 | } |
@@ -229,5 +259,6 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
229 | 259 | ||
230 | 260 | ||
231 | void ViewMail::setMail( RecMail mail ) { | 261 | void ViewMail::setMail( RecMail mail ) |
262 | { | ||
232 | 263 | ||
233 | m_recMail = mail; | 264 | m_recMail = mail; |
@@ -265,5 +296,6 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | |||
265 | } | 296 | } |
266 | 297 | ||
267 | void ViewMail::readConfig() { | 298 | void ViewMail::readConfig() |
299 | { | ||
268 | Config cfg( "mail" ); | 300 | Config cfg( "mail" ); |
269 | cfg.setGroup( "Settings" ); | 301 | cfg.setGroup( "Settings" ); |
@@ -279,11 +311,14 @@ void ViewMail::setText() | |||
279 | QString bccString; | 311 | QString bccString; |
280 | 312 | ||
281 | for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) { | 313 | for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) |
314 | { | ||
282 | toString += (*it); | 315 | toString += (*it); |
283 | } | 316 | } |
284 | for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) { | 317 | for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) |
318 | { | ||
285 | ccString += (*it); | 319 | ccString += (*it); |
286 | } | 320 | } |
287 | for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) { | 321 | for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) |
322 | { | ||
288 | bccString += (*it); | 323 | bccString += (*it); |
289 | } | 324 | } |
@@ -301,7 +336,10 @@ void ViewMail::setText() | |||
301 | "</td></tr></table><font face=fixed>"; | 336 | "</td></tr></table><font face=fixed>"; |
302 | 337 | ||
303 | if ( !m_showHtml ) { | 338 | if ( !m_showHtml ) |
339 | { | ||
304 | browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" ); | 340 | browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" ); |
305 | } else { | 341 | } |
342 | else | ||
343 | { | ||
306 | browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" ); | 344 | browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" ); |
307 | } | 345 | } |
@@ -321,5 +359,6 @@ void ViewMail::hide() | |||
321 | QWidget::hide(); | 359 | QWidget::hide(); |
322 | 360 | ||
323 | if (_inLoop) { | 361 | if (_inLoop) |
362 | { | ||
324 | _inLoop = false; | 363 | _inLoop = false; |
325 | qApp->exit_loop(); | 364 | qApp->exit_loop(); |
@@ -333,5 +372,6 @@ void ViewMail::exec() | |||
333 | show(); | 372 | show(); |
334 | 373 | ||
335 | if (!_inLoop) { | 374 | if (!_inLoop) |
375 | { | ||
336 | _inLoop = true; | 376 | _inLoop = true; |
337 | qApp->enter_loop(); | 377 | qApp->enter_loop(); |
@@ -352,5 +392,6 @@ QString ViewMail::deHtml(const QString &string) | |||
352 | void ViewMail::slotReply() | 392 | void ViewMail::slotReply() |
353 | { | 393 | { |
354 | if (!m_gotBody) { | 394 | if (!m_gotBody) |
395 | { | ||
355 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot reply yet."), tr("Ok")); | 396 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot reply yet."), tr("Ok")); |
356 | return; | 397 | return; |
@@ -365,5 +406,6 @@ void ViewMail::slotReply() | |||
365 | QStringList lines = QStringList::split(QRegExp("\\n"), text); | 406 | QStringList lines = QStringList::split(QRegExp("\\n"), text); |
366 | QStringList::Iterator it; | 407 | QStringList::Iterator it; |
367 | for (it = lines.begin(); it != lines.end(); it++) { | 408 | for (it = lines.begin(); it != lines.end(); it++) |
409 | { | ||
368 | rtext += "> " + *it + "\n"; | 410 | rtext += "> " + *it + "\n"; |
369 | } | 411 | } |
@@ -379,6 +421,6 @@ void ViewMail::slotReply() | |||
379 | composer.setSubject( "Re: " + m_mail[1] ); | 421 | composer.setSubject( "Re: " + m_mail[1] ); |
380 | composer.setMessage( rtext ); | 422 | composer.setMessage( rtext ); |
381 | composer.showMaximized(); | 423 | if ( QDialog::Accepted == QPEApplication::execDialog( &composer ) ) |
382 | if ( QDialog::Accepted==composer.exec()) { | 424 | { |
383 | m_recMail.Wrapper()->answeredMail(m_recMail); | 425 | m_recMail.Wrapper()->answeredMail(m_recMail); |
384 | } | 426 | } |
@@ -387,5 +429,6 @@ void ViewMail::slotReply() | |||
387 | void ViewMail::slotForward() | 429 | void ViewMail::slotForward() |
388 | { | 430 | { |
389 | if (!m_gotBody) { | 431 | if (!m_gotBody) |
432 | { | ||
390 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok")); | 433 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok")); |
391 | return; | 434 | return; |
@@ -414,7 +457,6 @@ void ViewMail::slotForward() | |||
414 | composer.setSubject( "Fwd: " + m_mail[1] ); | 457 | composer.setSubject( "Fwd: " + m_mail[1] ); |
415 | composer.setMessage( ftext ); | 458 | composer.setMessage( ftext ); |
416 | composer.showMaximized(); | 459 | if ( QDialog::Accepted == QPEApplication::execDialog( &composer )) |
417 | if ( QDialog::Accepted==composer.exec()) { | 460 | { |
418 | |||
419 | } | 461 | } |
420 | } | 462 | } |
@@ -422,5 +464,6 @@ void ViewMail::slotForward() | |||
422 | void ViewMail::slotDeleteMail( ) | 464 | void ViewMail::slotDeleteMail( ) |
423 | { | 465 | { |
424 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { | 466 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
467 | { | ||
425 | m_recMail.Wrapper()->deleteMail( m_recMail ); | 468 | m_recMail.Wrapper()->deleteMail( m_recMail ); |
426 | hide(); | 469 | hide(); |
diff --git a/noncore/net/opieirc/ircservereditor.cpp b/noncore/net/opieirc/ircservereditor.cpp index 60274d1..2d11bf0 100644 --- a/noncore/net/opieirc/ircservereditor.cpp +++ b/noncore/net/opieirc/ircservereditor.cpp | |||
@@ -1,7 +1,12 @@ | |||
1 | #include "ircservereditor.h" | ||
2 | |||
3 | /* OPIE */ | ||
4 | #include <qpe/qpeapplication.h> | ||
5 | |||
6 | /* QT */ | ||
1 | #include <qmessagebox.h> | 7 | #include <qmessagebox.h> |
2 | #include <qlayout.h> | 8 | #include <qlayout.h> |
3 | #include <qlabel.h> | 9 | #include <qlabel.h> |
4 | #include <qwhatsthis.h> | 10 | #include <qwhatsthis.h> |
5 | #include "ircservereditor.h" | ||
6 | 11 | ||
7 | IRCServerEditor::IRCServerEditor(IRCServer server, QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) { | 12 | IRCServerEditor::IRCServerEditor(IRCServer server, QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) { |
@@ -44,5 +49,6 @@ IRCServerEditor::IRCServerEditor(IRCServer server, QWidget* parent, const char* | |||
44 | layout->addWidget(m_channels, 6, 1); | 49 | layout->addWidget(m_channels, 6, 1); |
45 | setCaption(tr("Edit server information")); | 50 | setCaption(tr("Edit server information")); |
46 | showMaximized(); | 51 | |
52 | QPEApplication::showDialog( this ); | ||
47 | } | 53 | } |
48 | 54 | ||
diff --git a/noncore/net/opieirc/ircserverlist.cpp b/noncore/net/opieirc/ircserverlist.cpp index 595ae3e..62bfc17 100644 --- a/noncore/net/opieirc/ircserverlist.cpp +++ b/noncore/net/opieirc/ircserverlist.cpp | |||
@@ -1,2 +1,10 @@ | |||
1 | |||
2 | #include "ircserverlist.h" | ||
3 | #include "ircservereditor.h" | ||
4 | |||
5 | /* OPIE */ | ||
6 | #include <qpe/qpeapplication.h> | ||
7 | |||
8 | /* QT */ | ||
1 | #include <qlayout.h> | 9 | #include <qlayout.h> |
2 | #include <qlabel.h> | 10 | #include <qlabel.h> |
@@ -4,18 +12,20 @@ | |||
4 | #include <qpushbutton.h> | 12 | #include <qpushbutton.h> |
5 | #include <qwhatsthis.h> | 13 | #include <qwhatsthis.h> |
6 | #include "ircserverlist.h" | ||
7 | #include "ircservereditor.h" | ||
8 | 14 | ||
9 | class IRCListBoxServer : public QListBoxText { | 15 | class IRCListBoxServer : public QListBoxText |
16 | { | ||
10 | public: | 17 | public: |
11 | IRCListBoxServer(IRCServer server) : QListBoxText(server.name()) { | 18 | IRCListBoxServer(IRCServer server) : QListBoxText(server.name()) |
19 | { | ||
12 | m_server = server; | 20 | m_server = server; |
13 | } | 21 | } |
14 | 22 | ||
15 | IRCServer server() { | 23 | IRCServer server() |
24 | { | ||
16 | return m_server; | 25 | return m_server; |
17 | } | 26 | } |
18 | 27 | ||
19 | void setServer(IRCServer server) { | 28 | void setServer(IRCServer server) |
29 | { | ||
20 | m_server = server; | 30 | m_server = server; |
21 | setText(m_server.name()); | 31 | setText(m_server.name()); |
@@ -25,5 +35,6 @@ protected: | |||
25 | }; | 35 | }; |
26 | 36 | ||
27 | IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) { | 37 | IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) |
38 | { | ||
28 | QVBoxLayout *layout = new QVBoxLayout(this, 5, 5); | 39 | QVBoxLayout *layout = new QVBoxLayout(this, 5, 5); |
29 | setCaption(tr("Serverlist Browser")); | 40 | setCaption(tr("Serverlist Browser")); |
@@ -49,9 +60,12 @@ IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFla | |||
49 | m_config->setGroup("OpieIRC"); | 60 | m_config->setGroup("OpieIRC"); |
50 | int count = m_config->readNumEntry("ServerCount", 0); | 61 | int count = m_config->readNumEntry("ServerCount", 0); |
51 | if (count) { | 62 | if (count) |
52 | for (int i=0; i<count; i++) { | 63 | { |
64 | for (int i=0; i<count; i++) | ||
65 | { | ||
53 | m_config->setGroup("OpieIRC"); | 66 | m_config->setGroup("OpieIRC"); |
54 | QString name = m_config->readEntry("Server"+QString::number(i)); | 67 | QString name = m_config->readEntry("Server"+QString::number(i)); |
55 | if (name.length() > 0) { | 68 | if (name.length() > 0) |
69 | { | ||
56 | IRCServer server; | 70 | IRCServer server; |
57 | m_config->setGroup(name); | 71 | m_config->setGroup(name); |
@@ -69,11 +83,13 @@ IRCServerList::IRCServerList(QWidget* parent, const char *name, bool modal, WFla | |||
69 | } | 83 | } |
70 | 84 | ||
71 | showMaximized(); | 85 | QPEApplication::showDialog( this ); |
72 | } | 86 | } |
73 | 87 | ||
74 | void IRCServerList::addServer() { | 88 | void IRCServerList::addServer() |
89 | { | ||
75 | IRCServer server; | 90 | IRCServer server; |
76 | IRCServerEditor editor(server, this, "ServerEditor", TRUE); | 91 | IRCServerEditor editor(server, this, "ServerEditor", TRUE); |
77 | if (editor.exec() == QDialog::Accepted) { | 92 | if (editor.exec() == QDialog::Accepted) |
93 | { | ||
78 | server = editor.getServer(); | 94 | server = editor.getServer(); |
79 | /* Gets deleted by QListBox, so this is ok */ | 95 | /* Gets deleted by QListBox, so this is ok */ |
@@ -82,18 +98,23 @@ void IRCServerList::addServer() { | |||
82 | } | 98 | } |
83 | 99 | ||
84 | void IRCServerList::delServer() { | 100 | void IRCServerList::delServer() |
101 | { | ||
85 | int index = m_list->currentItem(); | 102 | int index = m_list->currentItem(); |
86 | if (index != -1) { | 103 | if (index != -1) |
104 | { | ||
87 | m_list->removeItem(index); | 105 | m_list->removeItem(index); |
88 | } | 106 | } |
89 | } | 107 | } |
90 | 108 | ||
91 | void IRCServerList::editServer() { | 109 | void IRCServerList::editServer() |
110 | { | ||
92 | int index = m_list->currentItem(); | 111 | int index = m_list->currentItem(); |
93 | if (index != -1) { | 112 | if (index != -1) |
113 | { | ||
94 | IRCListBoxServer *item = (IRCListBoxServer *)m_list->item(index); | 114 | IRCListBoxServer *item = (IRCListBoxServer *)m_list->item(index); |
95 | IRCServer server = item->server(); | 115 | IRCServer server = item->server(); |
96 | IRCServerEditor editor(server, this, "ServerEditor", TRUE); | 116 | IRCServerEditor editor(server, this, "ServerEditor", TRUE); |
97 | if (editor.exec() == QDialog::Accepted) { | 117 | if (editor.exec() == QDialog::Accepted) |
118 | { | ||
98 | server = editor.getServer(); | 119 | server = editor.getServer(); |
99 | item->setServer(server); | 120 | item->setServer(server); |
@@ -102,10 +123,12 @@ void IRCServerList::editServer() { | |||
102 | } | 123 | } |
103 | 124 | ||
104 | int IRCServerList::exec() { | 125 | int IRCServerList::exec() |
126 | { | ||
105 | int returncode = QDialog::exec(); | 127 | int returncode = QDialog::exec(); |
106 | /* Now save the changes */ | 128 | /* Now save the changes */ |
107 | m_config->setGroup("OpieIRC"); | 129 | m_config->setGroup("OpieIRC"); |
108 | m_config->writeEntry("ServerCount", QString::number(m_list->count())); | 130 | m_config->writeEntry("ServerCount", QString::number(m_list->count())); |
109 | for (unsigned int i=0; i<m_list->count(); i++) { | 131 | for (unsigned int i=0; i<m_list->count(); i++) |
132 | { | ||
110 | IRCServer server = ((IRCListBoxServer *)m_list->item(i))->server(); | 133 | IRCServer server = ((IRCListBoxServer *)m_list->item(i))->server(); |
111 | m_config->setGroup("OpieIRC"); | 134 | m_config->setGroup("OpieIRC"); |
@@ -123,13 +146,16 @@ int IRCServerList::exec() { | |||
123 | } | 146 | } |
124 | 147 | ||
125 | bool IRCServerList::hasServer() { | 148 | bool IRCServerList::hasServer() |
149 | { | ||
126 | return (m_list->currentItem() != -1); | 150 | return (m_list->currentItem() != -1); |
127 | } | 151 | } |
128 | 152 | ||
129 | IRCServer IRCServerList::server() { | 153 | IRCServer IRCServerList::server() |
154 | { | ||
130 | return ((IRCListBoxServer *)m_list->item(m_list->currentItem()))->server(); | 155 | return ((IRCListBoxServer *)m_list->item(m_list->currentItem()))->server(); |
131 | } | 156 | } |
132 | 157 | ||
133 | IRCServerList::~IRCServerList() { | 158 | IRCServerList::~IRCServerList() |
159 | { | ||
134 | delete m_config; | 160 | delete m_config; |
135 | } | 161 | } |
diff --git a/noncore/net/opieirc/ircsettings.cpp b/noncore/net/opieirc/ircsettings.cpp index 2862296..f69d2c4 100644 --- a/noncore/net/opieirc/ircsettings.cpp +++ b/noncore/net/opieirc/ircsettings.cpp | |||
@@ -1,10 +1,17 @@ | |||
1 | |||
2 | #include "ircsettings.h" | ||
3 | #include "irctab.h" | ||
4 | |||
5 | /* OPIE */ | ||
1 | #include <opie/ocolorbutton.h> | 6 | #include <opie/ocolorbutton.h> |
2 | #include <opie/otabwidget.h> | 7 | #include <opie/otabwidget.h> |
8 | #include <qpe/qpeapplication.h> | ||
9 | |||
10 | /* QT */ | ||
3 | #include <qvalidator.h> | 11 | #include <qvalidator.h> |
4 | #include <qwhatsthis.h> | 12 | #include <qwhatsthis.h> |
5 | #include "ircsettings.h" | ||
6 | #include "irctab.h" | ||
7 | 13 | ||
8 | IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) { | 14 | IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) |
15 | { | ||
9 | setCaption(tr("Settings") ); | 16 | setCaption(tr("Settings") ); |
10 | m_config = new Config("OpieIRC"); | 17 | m_config = new Config("OpieIRC"); |
@@ -71,8 +78,10 @@ IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) | |||
71 | tw->addTab(view, "opieirc/colors", tr("Colors")); | 78 | tw->addTab(view, "opieirc/colors", tr("Colors")); |
72 | tw->setCurrentTab( genwidget ); | 79 | tw->setCurrentTab( genwidget ); |
73 | showMaximized(); | 80 | |
81 | QPEApplication::showDialog( this ); | ||
74 | } | 82 | } |
75 | 83 | ||
76 | void IRCSettings::accept() { | 84 | void IRCSettings::accept() |
85 | { | ||
77 | IRCTab::m_backgroundColor = m_background->color().name(); | 86 | IRCTab::m_backgroundColor = m_background->color().name(); |
78 | IRCTab::m_textColor = m_text->color().name(); | 87 | IRCTab::m_textColor = m_text->color().name(); |
@@ -94,5 +103,6 @@ void IRCSettings::accept() { | |||
94 | } | 103 | } |
95 | 104 | ||
96 | IRCSettings::~IRCSettings() { | 105 | IRCSettings::~IRCSettings() |
106 | { | ||
97 | delete m_config; | 107 | delete m_config; |
98 | } | 108 | } |
diff --git a/noncore/net/opietooth/blue-pin/pindlg.cc b/noncore/net/opietooth/blue-pin/pindlg.cc index 7d60d6c..9418a20 100644 --- a/noncore/net/opietooth/blue-pin/pindlg.cc +++ b/noncore/net/opietooth/blue-pin/pindlg.cc | |||
@@ -1,5 +1,10 @@ | |||
1 | 1 | ||
2 | #include <stdio.h> | 2 | #include "pindlg.h" |
3 | |||
4 | /* OPIE */ | ||
5 | #include <qpe/config.h> | ||
6 | #include <qpe/qpeapplication.h> | ||
3 | 7 | ||
8 | /* QT */ | ||
4 | #include <qcheckbox.h> | 9 | #include <qcheckbox.h> |
5 | #include <qlabel.h> | 10 | #include <qlabel.h> |
@@ -7,7 +12,6 @@ | |||
7 | #include <qtimer.h> | 12 | #include <qtimer.h> |
8 | 13 | ||
9 | #include <qpe/config.h> | 14 | /* STD */ |
10 | 15 | #include <stdio.h> | |
11 | #include "pindlg.h" | ||
12 | 16 | ||
13 | using namespace OpieTooth; | 17 | using namespace OpieTooth; |
@@ -21,22 +25,27 @@ PinDlg::PinDlg( const QString& status, | |||
21 | test( mac ); | 25 | test( mac ); |
22 | txtStatus->setText(status); | 26 | txtStatus->setText(status); |
23 | showMaximized(); | 27 | QPEApplication::showDialog( this ); |
24 | } | 28 | } |
25 | PinDlg::~PinDlg() { | ||
26 | 29 | ||
27 | } | 30 | PinDlg::~PinDlg() |
28 | void PinDlg::setMac( const QString& mac ) { | 31 | {} |
32 | void PinDlg::setMac( const QString& mac ) | ||
33 | { | ||
29 | txtStatus->setText( mac ); | 34 | txtStatus->setText( mac ); |
30 | } | 35 | } |
31 | QString PinDlg::pin() const{ | 36 | QString PinDlg::pin() const |
37 | { | ||
32 | return lnePin->text(); | 38 | return lnePin->text(); |
33 | } | 39 | } |
34 | 40 | ||
35 | void PinDlg::test( const QString& mac ) { | 41 | void PinDlg::test( const QString& mac ) |
36 | if (!mac.isEmpty() ) { | 42 | { |
43 | if (!mac.isEmpty() ) | ||
44 | { | ||
37 | Config cfg("bluepin"); | 45 | Config cfg("bluepin"); |
38 | cfg.setGroup(mac); | 46 | cfg.setGroup(mac); |
39 | lnePin->setText(cfg.readEntryCrypt("pin", QString::null ) ); | 47 | lnePin->setText(cfg.readEntryCrypt("pin", QString::null ) ); |
40 | if ( !lnePin->text().isEmpty() ) { | 48 | if ( !lnePin->text().isEmpty() ) |
49 | { | ||
41 | //QTimer::singleShot(100, this, SLOT(accept() ) ); | 50 | //QTimer::singleShot(100, this, SLOT(accept() ) ); |
42 | } | 51 | } |
@@ -45,6 +54,8 @@ void PinDlg::test( const QString& mac ) { | |||
45 | 54 | ||
46 | } | 55 | } |
47 | void PinDlg::accept() { | 56 | void PinDlg::accept() |
48 | if ( ckbPin->isChecked() ) { | 57 | { |
58 | if ( ckbPin->isChecked() ) | ||
59 | { | ||
49 | Config cfg("bluepin"); | 60 | Config cfg("bluepin"); |
50 | cfg.setGroup(m_mac ); | 61 | cfg.setGroup(m_mac ); |
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 2e68984..0ea45d2 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -23,9 +23,10 @@ | |||
23 | #include "rfcommassigndialogimpl.h" | 23 | #include "rfcommassigndialogimpl.h" |
24 | 24 | ||
25 | #include <remotedevice.h> | 25 | /* OPIE */ |
26 | #include <services.h> | 26 | #include <qpe/qpeapplication.h> |
27 | 27 | #include <qpe/resource.h> | |
28 | #include <stdlib.h> | 28 | #include <qpe/config.h> |
29 | 29 | ||
30 | /* QT */ | ||
30 | #include <qframe.h> | 31 | #include <qframe.h> |
31 | #include <qlabel.h> | 32 | #include <qlabel.h> |
@@ -47,13 +48,14 @@ | |||
47 | #include <qlist.h> | 48 | #include <qlist.h> |
48 | 49 | ||
49 | #include <qpe/qpeapplication.h> | 50 | /* STD */ |
50 | #include <qpe/resource.h> | 51 | #include <remotedevice.h> |
51 | #include <qpe/config.h> | 52 | #include <services.h> |
52 | 53 | #include <stdlib.h> | |
53 | 54 | ||
54 | using namespace OpieTooth; | 55 | using namespace OpieTooth; |
55 | 56 | ||
56 | BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) | 57 | BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) |
57 | : BluetoothBase( parent, name, fl ) { | 58 | : BluetoothBase( parent, name, fl ) |
59 | { | ||
58 | 60 | ||
59 | m_localDevice = new Manager( "hci0" ); | 61 | m_localDevice = new Manager( "hci0" ); |
@@ -116,5 +118,6 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) | |||
116 | * Reads all options from the config file | 118 | * Reads all options from the config file |
117 | */ | 119 | */ |
118 | void BlueBase::readConfig() { | 120 | void BlueBase::readConfig() |
121 | { | ||
119 | 122 | ||
120 | Config cfg( "bluetoothmanager" ); | 123 | Config cfg( "bluetoothmanager" ); |
@@ -132,5 +135,6 @@ void BlueBase::readConfig() { | |||
132 | * Writes all options to the config file | 135 | * Writes all options to the config file |
133 | */ | 136 | */ |
134 | void BlueBase::writeConfig() { | 137 | void BlueBase::writeConfig() |
138 | { | ||
135 | 139 | ||
136 | Config cfg( "bluetoothmanager" ); | 140 | Config cfg( "bluetoothmanager" ); |
@@ -150,5 +154,6 @@ void BlueBase::writeConfig() { | |||
150 | * Modify the hcid.conf file to our needs | 154 | * Modify the hcid.conf file to our needs |
151 | */ | 155 | */ |
152 | void BlueBase::writeToHciConfig() { | 156 | void BlueBase::writeToHciConfig() |
157 | { | ||
153 | qWarning("writeToHciConfig"); | 158 | qWarning("writeToHciConfig"); |
154 | HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); | 159 | HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); |
@@ -167,5 +172,6 @@ void BlueBase::writeToHciConfig() { | |||
167 | * Read the list of allready known devices | 172 | * Read the list of allready known devices |
168 | */ | 173 | */ |
169 | void BlueBase::readSavedDevices() { | 174 | void BlueBase::readSavedDevices() |
175 | { | ||
170 | 176 | ||
171 | QValueList<RemoteDevice> loadedDevices; | 177 | QValueList<RemoteDevice> loadedDevices; |
@@ -180,10 +186,12 @@ void BlueBase::readSavedDevices() { | |||
180 | * Write the list of allready known devices | 186 | * Write the list of allready known devices |
181 | */ | 187 | */ |
182 | void BlueBase::writeSavedDevices() { | 188 | void BlueBase::writeSavedDevices() |
189 | { | ||
183 | QListViewItemIterator it( ListView2 ); | 190 | QListViewItemIterator it( ListView2 ); |
184 | BTListItem* item; | 191 | BTListItem* item; |
185 | BTDeviceItem* device; | 192 | BTDeviceItem* device; |
186 | RemoteDevice::ValueList list; | 193 | RemoteDevice::ValueList list; |
187 | for ( ; it.current(); ++it ) { | 194 | for ( ; it.current(); ++it ) |
195 | { | ||
188 | item = (BTListItem*)it.current(); | 196 | item = (BTListItem*)it.current(); |
189 | if(item->typeId() != BTListItem::Device ) | 197 | if(item->typeId() != BTListItem::Device ) |
@@ -206,5 +214,6 @@ void BlueBase::writeSavedDevices() { | |||
206 | * Set up the gui | 214 | * Set up the gui |
207 | */ | 215 | */ |
208 | void BlueBase::initGui() { | 216 | void BlueBase::initGui() |
217 | { | ||
209 | StatusLabel->setText( status() ); // maybe move it to getStatus() | 218 | StatusLabel->setText( status() ); // maybe move it to getStatus() |
210 | cryptCheckBox->setChecked( m_useEncryption ); | 219 | cryptCheckBox->setChecked( m_useEncryption ); |
@@ -223,5 +232,6 @@ void BlueBase::initGui() { | |||
223 | * @return QString the status informations gathered | 232 | * @return QString the status informations gathered |
224 | */ | 233 | */ |
225 | QString BlueBase::status()const{ | 234 | QString BlueBase::status()const |
235 | { | ||
226 | QString infoString = tr( "<b>Device name : </b> Ipaq" ); | 236 | QString infoString = tr( "<b>Device name : </b> Ipaq" ); |
227 | infoString += QString( "<br><b>" + tr( "MAC adress: " ) +"</b> No idea" ); | 237 | infoString += QString( "<br><b>" + tr( "MAC adress: " ) +"</b> No idea" ); |
@@ -235,5 +245,6 @@ QString BlueBase::status()const{ | |||
235 | * Read the current values from the gui and invoke writeConfig() | 245 | * Read the current values from the gui and invoke writeConfig() |
236 | */ | 246 | */ |
237 | void BlueBase::applyConfigChanges() { | 247 | void BlueBase::applyConfigChanges() |
248 | { | ||
238 | m_deviceName = deviceNameLine->text(); | 249 | m_deviceName = deviceNameLine->text(); |
239 | m_defaultPasskey = passkeyLine->text(); | 250 | m_defaultPasskey = passkeyLine->text(); |
@@ -252,10 +263,10 @@ void BlueBase::applyConfigChanges() { | |||
252 | * | 263 | * |
253 | */ | 264 | */ |
254 | void BlueBase::rfcommDialog() { | 265 | void BlueBase::rfcommDialog() |
266 | { | ||
255 | RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp ); | 267 | RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp ); |
256 | 268 | ||
257 | rfcommAssign.showMaximized(); | 269 | if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted ) |
258 | 270 | { | |
259 | if ( rfcommAssign.exec() == QDialog::Accepted ) { | ||
260 | rfcommAssign.saveConfig(); | 271 | rfcommAssign.saveConfig(); |
261 | } | 272 | } |
@@ -266,9 +277,11 @@ void BlueBase::rfcommDialog() { | |||
266 | * | 277 | * |
267 | */ | 278 | */ |
268 | void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) { | 279 | void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) |
280 | { | ||
269 | BTDeviceItem * deviceItem; | 281 | BTDeviceItem * deviceItem; |
270 | QValueList<RemoteDevice>::ConstIterator it; | 282 | QValueList<RemoteDevice>::ConstIterator it; |
271 | 283 | ||
272 | for( it = newDevices.begin(); it != newDevices.end() ; ++it ) { | 284 | for( it = newDevices.begin(); it != newDevices.end() ; ++it ) |
285 | { | ||
273 | 286 | ||
274 | if (find( (*it) )) // is already inserted | 287 | if (find( (*it) )) // is already inserted |
@@ -291,6 +304,6 @@ void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) | |||
291 | * Action that is toggled on entrys on click | 304 | * Action that is toggled on entrys on click |
292 | */ | 305 | */ |
293 | void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) { | 306 | void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) |
294 | } | 307 | {} |
295 | 308 | ||
296 | 309 | ||
@@ -298,5 +311,6 @@ void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) { | |||
298 | * Action that are toggled on hold (mostly QPopups i guess) | 311 | * Action that are toggled on hold (mostly QPopups i guess) |
299 | */ | 312 | */ |
300 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) { | 313 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) |
314 | { | ||
301 | if (!item ) | 315 | if (!item ) |
302 | return; | 316 | return; |
@@ -305,5 +319,6 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
305 | int ret=0; | 319 | int ret=0; |
306 | 320 | ||
307 | if ( ((BTListItem*)item)->type() == "device") { | 321 | if ( ((BTListItem*)item)->type() == "device") |
322 | { | ||
308 | 323 | ||
309 | QPopupMenu *groups = new QPopupMenu(); | 324 | QPopupMenu *groups = new QPopupMenu(); |
@@ -317,5 +332,6 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
317 | ret = menu->exec( point , 0); | 332 | ret = menu->exec( point , 0); |
318 | 333 | ||
319 | switch(ret) { | 334 | switch(ret) |
335 | { | ||
320 | case -1: | 336 | case -1: |
321 | break; | 337 | break; |
@@ -344,19 +360,24 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
344 | * | 360 | * |
345 | */ | 361 | */ |
346 | else if ( ((BTListItem*)item)->type() == "service") { | 362 | else if ( ((BTListItem*)item)->type() == "service") |
363 | { | ||
347 | BTServiceItem* service = (BTServiceItem*)item; | 364 | BTServiceItem* service = (BTServiceItem*)item; |
348 | QMap<int, QString> list = service->services().classIdList(); | 365 | QMap<int, QString> list = service->services().classIdList(); |
349 | QMap<int, QString>::Iterator it = list.begin(); | 366 | QMap<int, QString>::Iterator it = list.begin(); |
350 | QPopupMenu *popup =0l; | 367 | QPopupMenu *popup =0l; |
351 | if ( it != list.end() ) { | 368 | if ( it != list.end() ) |
369 | { | ||
352 | qWarning("Searching id %d %s", it.key(), it.data().latin1() ); | 370 | qWarning("Searching id %d %s", it.key(), it.data().latin1() ); |
353 | popup = m_popHelper.find( it.key(), | 371 | popup = m_popHelper.find( it.key(), |
354 | service->services(), | 372 | service->services(), |
355 | (BTDeviceItem*)service->parent() ); | 373 | (BTDeviceItem*)service->parent() ); |
356 | }else { | 374 | } |
375 | else | ||
376 | { | ||
357 | qWarning("Empty"); | 377 | qWarning("Empty"); |
358 | } | 378 | } |
359 | 379 | ||
360 | if ( popup == 0l ) { | 380 | if ( popup == 0l ) |
381 | { | ||
361 | qWarning("factory returned 0l"); | 382 | qWarning("factory returned 0l"); |
362 | popup = new QPopupMenu(); | 383 | popup = new QPopupMenu(); |
@@ -366,7 +387,10 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
366 | ret = popup->exec( point ); | 387 | ret = popup->exec( point ); |
367 | qWarning("returned from exec() "); | 388 | qWarning("returned from exec() "); |
368 | if ( ret == -1 ) { | 389 | if ( ret == -1 ) |
390 | { | ||
369 | ; | 391 | ; |
370 | } else if ( ret == test1 ) { | 392 | } |
393 | else if ( ret == test1 ) | ||
394 | { | ||
371 | ; | 395 | ; |
372 | } | 396 | } |
@@ -381,5 +405,6 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
381 | * @param item the service item returned | 405 | * @param item the service item returned |
382 | */ | 406 | */ |
383 | void BlueBase::addServicesToDevice( BTDeviceItem * item ) { | 407 | void BlueBase::addServicesToDevice( BTDeviceItem * item ) |
408 | { | ||
384 | qDebug("addServicesToDevice"); | 409 | qDebug("addServicesToDevice"); |
385 | // row of mac adress text(3) | 410 | // row of mac adress text(3) |
@@ -397,5 +422,6 @@ void BlueBase::addServicesToDevice( BTDeviceItem * item ) { | |||
397 | * @param servicesList the list with the service the device has. | 422 | * @param servicesList the list with the service the device has. |
398 | */ | 423 | */ |
399 | void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) { | 424 | void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) |
425 | { | ||
400 | qDebug("fill services list"); | 426 | qDebug("fill services list"); |
401 | 427 | ||
@@ -413,5 +439,6 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s | |||
413 | tempList.setAutoDelete( true ); | 439 | tempList.setAutoDelete( true ); |
414 | QListViewItem * child = deviceItem->firstChild(); | 440 | QListViewItem * child = deviceItem->firstChild(); |
415 | while( child ) { | 441 | while( child ) |
442 | { | ||
416 | tempList.append( child ); | 443 | tempList.append( child ); |
417 | child = child->nextSibling(); | 444 | child = child->nextSibling(); |
@@ -423,14 +450,17 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s | |||
423 | 450 | ||
424 | 451 | ||
425 | if (!servicesList.isEmpty() ) { | 452 | if (!servicesList.isEmpty() ) |
453 | { | ||
426 | // add services | 454 | // add services |
427 | QMap<int, QString> list; | 455 | QMap<int, QString> list; |
428 | QMap<int, QString>::Iterator classIt; | 456 | QMap<int, QString>::Iterator classIt; |
429 | for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) { | 457 | for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) |
458 | { | ||
430 | serviceItem = new BTServiceItem( deviceItem, (*it2) ); | 459 | serviceItem = new BTServiceItem( deviceItem, (*it2) ); |
431 | list = (*it2).classIdList(); | 460 | list = (*it2).classIdList(); |
432 | classIt = list.begin(); | 461 | classIt = list.begin(); |
433 | int classId=0; | 462 | int classId=0; |
434 | if ( classIt != list.end() ) { | 463 | if ( classIt != list.end() ) |
464 | { | ||
435 | classId = classIt.key(); | 465 | classId = classIt.key(); |
436 | } | 466 | } |
@@ -438,5 +468,7 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s | |||
438 | serviceItem->setPixmap( 0, m_iconLoader->serviceIcon( classId ) ); | 468 | serviceItem->setPixmap( 0, m_iconLoader->serviceIcon( classId ) ); |
439 | } | 469 | } |
440 | } else { | 470 | } |
471 | else | ||
472 | { | ||
441 | Services s1; | 473 | Services s1; |
442 | s1.setServiceName( tr("no services found") ); | 474 | s1.setServiceName( tr("no services found") ); |
@@ -451,8 +483,10 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s | |||
451 | 483 | ||
452 | 484 | ||
453 | void BlueBase::addSignalStrength() { | 485 | void BlueBase::addSignalStrength() |
486 | { | ||
454 | 487 | ||
455 | QListViewItemIterator it( ListView4 ); | 488 | QListViewItemIterator it( ListView4 ); |
456 | for ( ; it.current(); ++it ) { | 489 | for ( ; it.current(); ++it ) |
490 | { | ||
457 | m_localDevice->signalStrength( ((BTConnectionItem*)it.current() )->connection().mac() ); | 491 | m_localDevice->signalStrength( ((BTConnectionItem*)it.current() )->connection().mac() ); |
458 | } | 492 | } |
@@ -461,9 +495,12 @@ void BlueBase::addSignalStrength() { | |||
461 | } | 495 | } |
462 | 496 | ||
463 | void BlueBase::addSignalStrength( const QString& mac, const QString& strength ) { | 497 | void BlueBase::addSignalStrength( const QString& mac, const QString& strength ) |
498 | { | ||
464 | 499 | ||
465 | QListViewItemIterator it( ListView4 ); | 500 | QListViewItemIterator it( ListView4 ); |
466 | for ( ; it.current(); ++it ) { | 501 | for ( ; it.current(); ++it ) |
467 | if( ((BTConnectionItem*)it.current())->connection().mac() == mac ) { | 502 | { |
503 | if( ((BTConnectionItem*)it.current())->connection().mac() == mac ) | ||
504 | { | ||
468 | ((BTConnectionItem*)it.current() )->setSignalStrength( strength ); | 505 | ((BTConnectionItem*)it.current() )->setSignalStrength( strength ); |
469 | } | 506 | } |
@@ -475,5 +512,6 @@ void BlueBase::addSignalStrength( const QString& mac, const QString& strength ) | |||
475 | * This one triggers the search | 512 | * This one triggers the search |
476 | */ | 513 | */ |
477 | void BlueBase::addConnectedDevices() { | 514 | void BlueBase::addConnectedDevices() |
515 | { | ||
478 | m_localDevice->searchConnections(); | 516 | m_localDevice->searchConnections(); |
479 | } | 517 | } |
@@ -483,25 +521,32 @@ void BlueBase::addConnectedDevices() { | |||
483 | * @param connectionList the ValueList with all current connections | 521 | * @param connectionList the ValueList with all current connections |
484 | */ | 522 | */ |
485 | void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) { | 523 | void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) |
524 | { | ||
486 | 525 | ||
487 | QValueList<OpieTooth::ConnectionState>::Iterator it; | 526 | QValueList<OpieTooth::ConnectionState>::Iterator it; |
488 | BTConnectionItem * connectionItem; | 527 | BTConnectionItem * connectionItem; |
489 | 528 | ||
490 | if ( !connectionList.isEmpty() ) { | 529 | if ( !connectionList.isEmpty() ) |
530 | { | ||
491 | 531 | ||
492 | for (it = connectionList.begin(); it != connectionList.end(); ++it) { | 532 | for (it = connectionList.begin(); it != connectionList.end(); ++it) |
533 | { | ||
493 | 534 | ||
494 | QListViewItemIterator it2( ListView4 ); | 535 | QListViewItemIterator it2( ListView4 ); |
495 | bool found = false; | 536 | bool found = false; |
496 | for ( ; it2.current(); ++it2 ) { | 537 | for ( ; it2.current(); ++it2 ) |
497 | if( ( (BTConnectionItem*)it2.current())->connection().mac() == (*it).mac() ) { | 538 | { |
539 | if( ( (BTConnectionItem*)it2.current())->connection().mac() == (*it).mac() ) | ||
540 | { | ||
498 | found = true; | 541 | found = true; |
499 | } | 542 | } |
500 | } | 543 | } |
501 | 544 | ||
502 | if ( found == false ) { | 545 | if ( found == false ) |
546 | { | ||
503 | connectionItem = new BTConnectionItem( ListView4, (*it) ); | 547 | connectionItem = new BTConnectionItem( ListView4, (*it) ); |
504 | 548 | ||
505 | if( m_deviceList.find((*it).mac()).data() ) { | 549 | if( m_deviceList.find((*it).mac()).data() ) |
550 | { | ||
506 | connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() ); | 551 | connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() ); |
507 | } | 552 | } |
@@ -511,13 +556,17 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) | |||
511 | 556 | ||
512 | QListViewItemIterator it2( ListView4 ); | 557 | QListViewItemIterator it2( ListView4 ); |
513 | for ( ; it2.current(); ++it2 ) { | 558 | for ( ; it2.current(); ++it2 ) |
559 | { | ||
514 | bool found = false; | 560 | bool found = false; |
515 | for (it = connectionList.begin(); it != connectionList.end(); ++it) { | 561 | for (it = connectionList.begin(); it != connectionList.end(); ++it) |
516 | if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() ) { | 562 | { |
563 | if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() ) | ||
564 | { | ||
517 | found = true; | 565 | found = true; |
518 | } | 566 | } |
519 | } | 567 | } |
520 | 568 | ||
521 | if ( !found ) { | 569 | if ( !found ) |
570 | { | ||
522 | delete it2.current(); | 571 | delete it2.current(); |
523 | } | 572 | } |
@@ -526,5 +575,7 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) | |||
526 | 575 | ||
527 | 576 | ||
528 | } else { | 577 | } |
578 | else | ||
579 | { | ||
529 | ListView4->clear(); | 580 | ListView4->clear(); |
530 | ConnectionState con; | 581 | ConnectionState con; |
@@ -542,5 +593,6 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) | |||
542 | * @param device | 593 | * @param device |
543 | */ | 594 | */ |
544 | void BlueBase::deviceActive( const RemoteDevice &device ) { | 595 | void BlueBase::deviceActive( const RemoteDevice &device ) |
596 | { | ||
545 | // search by mac, async, gets a signal back | 597 | // search by mac, async, gets a signal back |
546 | // We should have a BTDeviceItem there or where does it get added to the map -zecke | 598 | // We should have a BTDeviceItem there or where does it get added to the map -zecke |
@@ -554,5 +606,6 @@ void BlueBase::deviceActive( const RemoteDevice &device ) { | |||
554 | * @param connected - if it is avail. or not | 606 | * @param connected - if it is avail. or not |
555 | */ | 607 | */ |
556 | void BlueBase::deviceActive( const QString& device, bool connected ) { | 608 | void BlueBase::deviceActive( const QString& device, bool connected ) |
609 | { | ||
557 | qDebug("deviceActive slot"); | 610 | qDebug("deviceActive slot"); |
558 | 611 | ||
@@ -566,7 +619,10 @@ void BlueBase::deviceActive( const QString& device, bool connected ) { | |||
566 | 619 | ||
567 | 620 | ||
568 | if ( connected ) { | 621 | if ( connected ) |
622 | { | ||
569 | deviceItem->setPixmap( 1, m_onPix ); | 623 | deviceItem->setPixmap( 1, m_onPix ); |
570 | } else { | 624 | } |
625 | else | ||
626 | { | ||
571 | deviceItem->setPixmap( 1, m_offPix ); | 627 | deviceItem->setPixmap( 1, m_offPix ); |
572 | } | 628 | } |
@@ -578,5 +634,6 @@ void BlueBase::deviceActive( const QString& device, bool connected ) { | |||
578 | * Open the "scan for devices" dialog | 634 | * Open the "scan for devices" dialog |
579 | */ | 635 | */ |
580 | void BlueBase::startScan() { | 636 | void BlueBase::startScan() |
637 | { | ||
581 | ScanDialog *scan = new ScanDialog( this, "ScanDialog", | 638 | ScanDialog *scan = new ScanDialog( this, "ScanDialog", |
582 | true, WDestructiveClose ); | 639 | true, WDestructiveClose ); |
@@ -584,5 +641,5 @@ void BlueBase::startScan() { | |||
584 | this, SLOT( addSearchedDevices( const QValueList<RemoteDevice>& ) ) ); | 641 | this, SLOT( addSearchedDevices( const QValueList<RemoteDevice>& ) ) ); |
585 | 642 | ||
586 | scan->showMaximized(); | 643 | QPEApplication::showDialog( scan ); |
587 | } | 644 | } |
588 | 645 | ||
@@ -591,5 +648,6 @@ void BlueBase::startScan() { | |||
591 | * Set the informations about the local device in information Tab | 648 | * Set the informations about the local device in information Tab |
592 | */ | 649 | */ |
593 | void BlueBase::setInfo() { | 650 | void BlueBase::setInfo() |
651 | { | ||
594 | StatusLabel->setText( status() ); | 652 | StatusLabel->setText( status() ); |
595 | } | 653 | } |
@@ -599,5 +657,6 @@ void BlueBase::setInfo() { | |||
599 | * Decontructor | 657 | * Decontructor |
600 | */ | 658 | */ |
601 | BlueBase::~BlueBase() { | 659 | BlueBase::~BlueBase() |
660 | { | ||
602 | writeSavedDevices(); | 661 | writeSavedDevices(); |
603 | delete m_iconLoader; | 662 | delete m_iconLoader; |
@@ -611,9 +670,11 @@ BlueBase::~BlueBase() { | |||
611 | * @return returns true if found | 670 | * @return returns true if found |
612 | */ | 671 | */ |
613 | bool BlueBase::find( const RemoteDevice& rem ) { | 672 | bool BlueBase::find( const RemoteDevice& rem ) |
673 | { | ||
614 | QListViewItemIterator it( ListView2 ); | 674 | QListViewItemIterator it( ListView2 ); |
615 | BTListItem* item; | 675 | BTListItem* item; |
616 | BTDeviceItem* device; | 676 | BTDeviceItem* device; |
617 | for (; it.current(); ++it ) { | 677 | for (; it.current(); ++it ) |
678 | { | ||
618 | item = (BTListItem*) it.current(); | 679 | item = (BTListItem*) it.current(); |
619 | if ( item->typeId() != BTListItem::Device ) | 680 | if ( item->typeId() != BTListItem::Device ) |
diff --git a/noncore/net/opietooth/manager/obexpopup.cpp b/noncore/net/opietooth/manager/obexpopup.cpp index a550648..d147d52 100644 --- a/noncore/net/opietooth/manager/obexpopup.cpp +++ b/noncore/net/opietooth/manager/obexpopup.cpp | |||
@@ -1,8 +1,12 @@ | |||
1 | 1 | ||
2 | #include <qtimer.h> | ||
3 | |||
4 | #include "obexdialog.h" | 2 | #include "obexdialog.h" |
5 | #include "obexpopup.h" | 3 | #include "obexpopup.h" |
6 | 4 | ||
5 | /* OPIE */ | ||
6 | #include <qpe/qpeapplication.h> | ||
7 | |||
8 | /* QT */ | ||
9 | #include <qtimer.h> | ||
10 | |||
7 | using namespace OpieTooth; | 11 | using namespace OpieTooth; |
8 | 12 | ||
@@ -11,5 +15,6 @@ using namespace OpieTooth; | |||
11 | */ | 15 | */ |
12 | ObexPopup::ObexPopup() | 16 | ObexPopup::ObexPopup() |
13 | : QPopupMenu() { | 17 | : QPopupMenu() |
18 | { | ||
14 | qWarning("RfcCommPopup c'tor"); | 19 | qWarning("RfcCommPopup c'tor"); |
15 | 20 | ||
@@ -25,16 +30,15 @@ ObexPopup::ObexPopup() | |||
25 | 30 | ||
26 | 31 | ||
27 | ObexPopup::~ObexPopup() { | 32 | ObexPopup::~ObexPopup() |
28 | } | 33 | {} |
29 | 34 | ||
30 | 35 | ||
31 | void ObexPopup::slotPush() { | 36 | void ObexPopup::slotPush() |
37 | { | ||
32 | 38 | ||
33 | qWarning("push something"); | 39 | qWarning("push something"); |
34 | 40 | ||
35 | |||
36 | ObexDialog obexDialog; | 41 | ObexDialog obexDialog; |
37 | obexDialog.showMaximized(); | 42 | QPEApplication::execDialog( &obexDialog ); |
38 | obexDialog.exec(); | ||
39 | } | 43 | } |
40 | 44 | ||
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp index b5cc074..fc76301 100644 --- a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp +++ b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp | |||
@@ -4,6 +4,9 @@ | |||
4 | #include "rfcommconfhandler.h" | 4 | #include "rfcommconfhandler.h" |
5 | 5 | ||
6 | /* OPIE */ | ||
6 | #include <qpe/config.h> | 7 | #include <qpe/config.h> |
8 | #include <qpe/qpeapplication.h> | ||
7 | 9 | ||
10 | /* QT */ | ||
8 | #include <qlayout.h> | 11 | #include <qlayout.h> |
9 | 12 | ||
@@ -16,5 +19,6 @@ using namespace OpieTooth; | |||
16 | 19 | ||
17 | RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 20 | RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) |
18 | : RfcommAssignDialogBase( parent, name, modal, fl ) { | 21 | : RfcommAssignDialogBase( parent, name, modal, fl ) |
22 | { | ||
19 | 23 | ||
20 | m_range = 5; | 24 | m_range = 5; |
@@ -34,6 +38,8 @@ RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool | |||
34 | } | 38 | } |
35 | 39 | ||
36 | RfcommAssignDialog::~RfcommAssignDialog() { | 40 | RfcommAssignDialog::~RfcommAssignDialog() |
37 | if ( confHandler ) { | 41 | { |
42 | if ( confHandler ) | ||
43 | { | ||
38 | delete confHandler; | 44 | delete confHandler; |
39 | } | 45 | } |
@@ -41,19 +47,23 @@ RfcommAssignDialog::~RfcommAssignDialog() { | |||
41 | 47 | ||
42 | 48 | ||
43 | void RfcommAssignDialog::newDevice( const QString & mac ) { | 49 | void RfcommAssignDialog::newDevice( const QString & mac ) |
50 | { | ||
44 | 51 | ||
45 | for ( int i = 0 ; i < m_range; i++ ) { | 52 | for ( int i = 0 ; i < m_range; i++ ) |
53 | { | ||
46 | 54 | ||
47 | QMap<QString, RfCommConfObject*>::Iterator it; | 55 | QMap<QString, RfCommConfObject*>::Iterator it; |
48 | it = confHandler->foundEntries().find( QString("%1").arg( i ) ); | 56 | it = confHandler->foundEntries().find( QString("%1").arg( i ) ); |
49 | // make sure that rfcommX is not assigned yet | 57 | // make sure that rfcommX is not assigned yet |
50 | if ( it == confHandler->foundEntries().end() ) { | 58 | if ( it == confHandler->foundEntries().end() ) |
59 | { | ||
51 | QDialog dialog( this, "newdevice", true, WStyle_ContextHelp ); | 60 | QDialog dialog( this, "newdevice", true, WStyle_ContextHelp ); |
52 | dialog.showMaximized(); | 61 | |
53 | RfcommDialogItem *newDev = new RfcommDialogItem( &dialog ); | 62 | RfcommDialogItem *newDev = new RfcommDialogItem( &dialog ); |
54 | newDev->setIdent( i ); | 63 | newDev->setIdent( i ); |
55 | newDev->setMac( mac ); | 64 | newDev->setMac( mac ); |
56 | 65 | ||
57 | if ( dialog.exec() == QDialog::Accepted ) { | 66 | if ( QPEApplication::execDialog( &dialog ) == QDialog::Accepted ) |
67 | { | ||
58 | RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); | 68 | RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); |
59 | m_itemList.insert( i , rfcomm ); | 69 | m_itemList.insert( i , rfcomm ); |
@@ -68,9 +78,11 @@ void RfcommAssignDialog::newDevice( const QString & mac ) { | |||
68 | } | 78 | } |
69 | 79 | ||
70 | void RfcommAssignDialog::loadConfig() { | 80 | void RfcommAssignDialog::loadConfig() |
81 | { | ||
71 | 82 | ||
72 | //Config cfg( "bluetoothmanager-rfcommbind" ); | 83 | //Config cfg( "bluetoothmanager-rfcommbind" ); |
73 | 84 | ||
74 | for ( int i = 0 ; i < m_range; i++ ) { | 85 | for ( int i = 0 ; i < m_range; i++ ) |
86 | { | ||
75 | // cfg.setGroup( QString("%1").arg( i ) ); | 87 | // cfg.setGroup( QString("%1").arg( i ) ); |
76 | RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); | 88 | RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); |
@@ -79,5 +91,6 @@ void RfcommAssignDialog::loadConfig() { | |||
79 | QMap<QString, RfCommConfObject*>::Iterator it; | 91 | QMap<QString, RfCommConfObject*>::Iterator it; |
80 | it = confHandler->foundEntries().find( QString("%1").arg( i ) ); | 92 | it = confHandler->foundEntries().find( QString("%1").arg( i ) ); |
81 | if ( it != confHandler->foundEntries().end() ) { | 93 | if ( it != confHandler->foundEntries().end() ) |
94 | { | ||
82 | qDebug( "Found key in foundEntries() " ); | 95 | qDebug( "Found key in foundEntries() " ); |
83 | rfcomm->setMac( it.data()->mac() ); | 96 | rfcomm->setMac( it.data()->mac() ); |
@@ -94,5 +107,6 @@ void RfcommAssignDialog::loadConfig() { | |||
94 | 107 | ||
95 | 108 | ||
96 | void RfcommAssignDialog::saveConfig() { | 109 | void RfcommAssignDialog::saveConfig() |
110 | { | ||
97 | 111 | ||
98 | //Config cfg( "bluetoothmanager-rfcommbind" ); | 112 | //Config cfg( "bluetoothmanager-rfcommbind" ); |
@@ -102,5 +116,6 @@ void RfcommAssignDialog::saveConfig() { | |||
102 | QMap< QString, RfCommConfObject*> outMap; | 116 | QMap< QString, RfCommConfObject*> outMap; |
103 | 117 | ||
104 | for( it = m_itemList.begin(); it != m_itemList.end(); ++it ) { | 118 | for( it = m_itemList.begin(); it != m_itemList.end(); ++it ) |
119 | { | ||
105 | 120 | ||
106 | //cfg.setGroup( QString("%1").arg( it.key() ) ); | 121 | //cfg.setGroup( QString("%1").arg( it.key() ) ); |
diff --git a/noncore/net/opietooth/manager/rfcpopup.cpp b/noncore/net/opietooth/manager/rfcpopup.cpp index d95f14b..04bfe48 100644 --- a/noncore/net/opietooth/manager/rfcpopup.cpp +++ b/noncore/net/opietooth/manager/rfcpopup.cpp | |||
@@ -1,9 +1,13 @@ | |||
1 | 1 | ||
2 | #include <qtimer.h> | ||
3 | |||
4 | #include "pppdialog.h" | 2 | #include "pppdialog.h" |
5 | #include "rfcpopup.h" | 3 | #include "rfcpopup.h" |
6 | #include "rfcommassigndialogimpl.h" | 4 | #include "rfcommassigndialogimpl.h" |
7 | 5 | ||
6 | /* OPIE */ | ||
7 | #include <qpe/qpeapplication.h> | ||
8 | |||
9 | /* QT */ | ||
10 | #include <qtimer.h> | ||
11 | |||
8 | using namespace OpieTooth; | 12 | using namespace OpieTooth; |
9 | 13 | ||
@@ -12,5 +16,6 @@ using namespace OpieTooth; | |||
12 | */ | 16 | */ |
13 | RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item ) | 17 | RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item ) |
14 | : QPopupMenu() { | 18 | : QPopupMenu() |
19 | { | ||
15 | qWarning("RfcCommPopup c'tor"); | 20 | qWarning("RfcCommPopup c'tor"); |
16 | 21 | ||
@@ -54,5 +59,6 @@ RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item ) | |||
54 | 59 | ||
55 | 60 | ||
56 | RfcCommPopup::~RfcCommPopup() { | 61 | RfcCommPopup::~RfcCommPopup() |
62 | { | ||
57 | /* delete m_con; | 63 | /* delete m_con; |
58 | delete m_dis; | 64 | delete m_dis; |
@@ -62,28 +68,28 @@ RfcCommPopup::~RfcCommPopup() { | |||
62 | 68 | ||
63 | 69 | ||
64 | void RfcCommPopup::slotConnect() { | 70 | void RfcCommPopup::slotConnect() |
71 | { | ||
65 | 72 | ||
66 | qWarning("connect"); | 73 | qWarning("connect"); |
67 | 74 | ||
68 | |||
69 | |||
70 | PPPDialog pppDialog; | 75 | PPPDialog pppDialog; |
71 | pppDialog.showMaximized(); | 76 | QPEApplication::execDialog( &pppDialog ); |
72 | pppDialog.exec(); | ||
73 | } | 77 | } |
74 | 78 | ||
75 | 79 | ||
76 | void RfcCommPopup::slotDisconnect() { | 80 | void RfcCommPopup::slotDisconnect() |
81 | { | ||
77 | qWarning("slot disconnected"); | 82 | qWarning("slot disconnected"); |
78 | } | 83 | } |
79 | 84 | ||
80 | 85 | ||
81 | void RfcCommPopup::slotBind() { | 86 | void RfcCommPopup::slotBind() |
87 | { | ||
82 | RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp ); | 88 | RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp ); |
83 | 89 | ||
84 | rfcommAssign.showMaximized(); | ||
85 | rfcommAssign.newDevice( m_item->mac() ); | 90 | rfcommAssign.newDevice( m_item->mac() ); |
86 | 91 | ||
87 | if ( rfcommAssign.exec() == QDialog::Accepted ) { | 92 | if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted ) |
93 | { | ||
88 | rfcommAssign.saveConfig(); | 94 | rfcommAssign.saveConfig(); |
89 | } | 95 | } |
@@ -91,5 +97,6 @@ void RfcCommPopup::slotBind() { | |||
91 | 97 | ||
92 | 98 | ||
93 | void RfcCommPopup::slotBar() { | 99 | void RfcCommPopup::slotBar() |
100 | { | ||
94 | qWarning("slotBar"); | 101 | qWarning("slotBar"); |
95 | }; | 102 | }; |
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index 3729ed0..95a8294 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp | |||
@@ -178,8 +178,5 @@ void WellenreiterMainWindow::showConfigure() | |||
178 | qDebug( "show configure..." ); | 178 | qDebug( "show configure..." ); |
179 | cw->setCaption( tr( "Configure" ) ); | 179 | cw->setCaption( tr( "Configure" ) ); |
180 | #ifdef QWS | 180 | int result = QPEApplication::execDialog( cw ); |
181 | cw->showMaximized(); | ||
182 | #endif | ||
183 | int result = cw->exec(); | ||
184 | 181 | ||
185 | if ( result ) updateToolButtonState(); | 182 | if ( result ) updateToolButtonState(); |