author | zautrix <zautrix> | 2004-09-01 10:23:29 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-01 10:23:29 (UTC) |
commit | 6cefbdc9c8f3f3001373f10715361e2740c45395 (patch) (unidiff) | |
tree | cb2c36f57620e698913c27ca4ebe59e4a7c9d46e /kmicromail/opiemail.cpp | |
parent | b9257cb225cd29bab5d96fcdaf557926603ee587 (diff) | |
download | kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.zip kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.gz kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.bz2 |
Mail fixes and libetpan updated
-rw-r--r-- | kmicromail/opiemail.cpp | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 3fbdcec..251f15a 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <libmailwrapper/abstractmail.h> | 18 | #include <libmailwrapper/abstractmail.h> |
19 | /* OPIE */ | 19 | /* OPIE */ |
20 | //#include <qpe/resource.h> | 20 | //#include <qpe/resource.h> |
21 | #include <qpe/qpeapplication.h> | 21 | //#include <qpe/qpeapplication.h> |
22 | 22 | ||
23 | /* QT */ | 23 | /* QT */ |
24 | 24 | ||
@@ -237,20 +237,27 @@ void OpieMail::slotDeleteMail() | |||
237 | } | 237 | } |
238 | void OpieMail::slotDeleteAllMail() | 238 | void OpieMail::slotDeleteAllMail() |
239 | { | 239 | { |
240 | if (!mailView->currentItem()) return; | 240 | |
241 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 241 | QValueList<RecMailP> t; |
242 | if ( QMessageBox::warning(this, tr("Delete All Mails"), tr("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 242 | if ( QMessageBox::warning(this, tr("Delete All Mails"), tr("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
243 | { | 243 | { |
244 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); | 244 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); |
245 | while ( item ) { | 245 | while ( item ) { |
246 | if ( item->isSelected() ) { | 246 | if ( item->isSelected() ) { |
247 | RecMailP mail = item->data(); | 247 | t.append( item->data() ); |
248 | mail->Wrapper()->deleteMail( mail ); | 248 | } |
249 | item = (MailListViewItem*)item->nextSibling(); | ||
249 | } | 250 | } |
250 | item = (MailListViewItem*)item->nextSibling(); | ||
251 | } | 251 | } |
252 | folderView->refreshCurrent(); | 252 | else |
253 | } | 253 | return; |
254 | if ( t.count() == 0 ) | ||
255 | return; | ||
256 | RecMailP mail = t.first(); | ||
257 | mail->Wrapper()->deleteMailList(t); | ||
258 | folderView->refreshCurrent(); | ||
259 | |||
260 | |||
254 | } | 261 | } |
255 | void OpieMail::clearSelection() | 262 | void OpieMail::clearSelection() |
256 | { | 263 | { |
@@ -276,10 +283,10 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) | |||
276 | m->insertItem(tr("Edit this mail"),this,SLOT(reEditMail())); | 283 | m->insertItem(tr("Edit this mail"),this,SLOT(reEditMail())); |
277 | } | 284 | } |
278 | m->insertItem(tr("Read this mail"),this,SLOT(displayMail())); | 285 | m->insertItem(tr("Read this mail"),this,SLOT(displayMail())); |
279 | m->insertItem(tr("Copy/Move this mail"),this,SLOT(slotMoveCopyMail())); | 286 | m->insertItem(tr("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); |
280 | m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail())); | 287 | m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail())); |
281 | m->insertSeparator(); | 288 | m->insertSeparator(); |
282 | m->insertItem(tr("Copy/Move all selected mail"),this,SLOT(slotMoveCopyAllMail())); | 289 | m->insertItem(tr("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); |
283 | m->insertItem(tr("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); | 290 | m->insertItem(tr("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); |
284 | m->insertItem(tr("Clear selection"),this,SLOT(clearSelection())); | 291 | m->insertItem(tr("Clear selection"),this,SLOT(clearSelection())); |
285 | } | 292 | } |
@@ -350,6 +357,9 @@ void OpieMail::slotMoveCopyMail() | |||
350 | tr("<center>Error while creating<br>new folder - breaking.</center>")); | 357 | tr("<center>Error while creating<br>new folder - breaking.</center>")); |
351 | return; | 358 | return; |
352 | } | 359 | } |
360 | sels.hide(); | ||
361 | qApp->processEvents(); | ||
362 | // qDebug("hiding sels "); | ||
353 | mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); | 363 | mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); |
354 | folderView->refreshCurrent(); | 364 | folderView->refreshCurrent(); |
355 | } | 365 | } |
@@ -359,7 +369,7 @@ void OpieMail::slotMoveCopyAllMail() | |||
359 | 369 | ||
360 | if (!mailView->currentItem()) return; | 370 | if (!mailView->currentItem()) return; |
361 | QValueList<RecMailP> t; | 371 | QValueList<RecMailP> t; |
362 | if ( QMessageBox::warning(this, tr("Copy/Move all selected mails"), tr("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 372 | // if ( QMessageBox::warning(this, tr("Move/Copy all selected mails"), tr("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
363 | { | 373 | { |
364 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); | 374 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); |
365 | while ( item ) { | 375 | while ( item ) { |
@@ -369,8 +379,8 @@ void OpieMail::slotMoveCopyAllMail() | |||
369 | item = (MailListViewItem*)item->nextSibling(); | 379 | item = (MailListViewItem*)item->nextSibling(); |
370 | } | 380 | } |
371 | } | 381 | } |
372 | else | 382 | // else |
373 | return; | 383 | // return; |
374 | if ( t.count() == 0 ) | 384 | if ( t.count() == 0 ) |
375 | return; | 385 | return; |
376 | RecMailP mail = t.first(); | 386 | RecMailP mail = t.first(); |
@@ -392,6 +402,9 @@ void OpieMail::slotMoveCopyAllMail() | |||
392 | tr("<center>Error while creating<br>new folder - breaking.</center>")); | 402 | tr("<center>Error while creating<br>new folder - breaking.</center>")); |
393 | return; | 403 | return; |
394 | } | 404 | } |
405 | sels.hide(); | ||
406 | qApp->processEvents(); | ||
407 | //qDebug("hiding sels "); | ||
395 | mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); | 408 | mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); |
396 | folderView->refreshCurrent(); | 409 | folderView->refreshCurrent(); |
397 | } | 410 | } |