From 6cefbdc9c8f3f3001373f10715361e2740c45395 Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 01 Sep 2004 10:23:29 +0000 Subject: Mail fixes and libetpan updated --- (limited to 'kmicromail/opiemail.cpp') 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 @@ #include /* OPIE */ //#include -#include +//#include /* QT */ @@ -237,20 +237,27 @@ void OpieMail::slotDeleteMail() } void OpieMail::slotDeleteAllMail() { - if (!mailView->currentItem()) return; - RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); + + QValueList t; if ( QMessageBox::warning(this, tr("Delete All Mails"), tr("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) - { - MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); - while ( item ) { - if ( item->isSelected() ) { - RecMailP mail = item->data(); - mail->Wrapper()->deleteMail( mail ); + { + MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); + while ( item ) { + if ( item->isSelected() ) { + t.append( item->data() ); + } + item = (MailListViewItem*)item->nextSibling(); } - item = (MailListViewItem*)item->nextSibling(); } - folderView->refreshCurrent(); - } + else + return; + if ( t.count() == 0 ) + return; + RecMailP mail = t.first(); + mail->Wrapper()->deleteMailList(t); + folderView->refreshCurrent(); + + } void OpieMail::clearSelection() { @@ -276,10 +283,10 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) m->insertItem(tr("Edit this mail"),this,SLOT(reEditMail())); } m->insertItem(tr("Read this mail"),this,SLOT(displayMail())); - m->insertItem(tr("Copy/Move this mail"),this,SLOT(slotMoveCopyMail())); + m->insertItem(tr("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail())); m->insertSeparator(); - m->insertItem(tr("Copy/Move all selected mail"),this,SLOT(slotMoveCopyAllMail())); + m->insertItem(tr("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); m->insertItem(tr("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); m->insertItem(tr("Clear selection"),this,SLOT(clearSelection())); } @@ -350,6 +357,9 @@ void OpieMail::slotMoveCopyMail() tr("
Error while creating
new folder - breaking.
")); return; } + sels.hide(); + qApp->processEvents(); + // qDebug("hiding sels "); mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); folderView->refreshCurrent(); } @@ -359,7 +369,7 @@ void OpieMail::slotMoveCopyAllMail() if (!mailView->currentItem()) return; QValueList t; - 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 ) + // 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 ) { MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); while ( item ) { @@ -369,8 +379,8 @@ void OpieMail::slotMoveCopyAllMail() item = (MailListViewItem*)item->nextSibling(); } } - else - return; + // else + // return; if ( t.count() == 0 ) return; RecMailP mail = t.first(); @@ -392,6 +402,9 @@ void OpieMail::slotMoveCopyAllMail() tr("
Error while creating
new folder - breaking.
")); return; } + sels.hide(); + qApp->processEvents(); + //qDebug("hiding sels "); mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); folderView->refreshCurrent(); } -- cgit v0.9.0.2