-rw-r--r-- | kmicromail/opiemail.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index d522ad0..3fbdcec 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp @@ -1,3 +1,4 @@ +// CHANGED 2004-09-31 Lutz Rogowski // CHANGED 2004-08-06 Lutz Rogowski #include "settingsdialog.h" @@ -278,6 +279,7 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) m->insertItem(tr("Copy/Move 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("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); m->insertItem(tr("Clear selection"),this,SLOT(clearSelection())); } @@ -352,6 +354,48 @@ void OpieMail::slotMoveCopyMail() folderView->refreshCurrent(); } +void OpieMail::slotMoveCopyAllMail() +{ + + if (!mailView->currentItem()) return; + QValueList<RecMailP> 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 ) + { + MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); + while ( item ) { + if ( item->isSelected() ) { + t.append( item->data() ); + } + item = (MailListViewItem*)item->nextSibling(); + } + } + else + return; + if ( t.count() == 0 ) + return; + RecMailP mail = t.first(); + AbstractMail*targetMail = 0; + QString targetFolder = ""; + Selectstore sels; + folderView->setupFolderselect(&sels); + if (!sels.exec()) return; + targetMail = sels.currentMail(); + targetFolder = sels.currentFolder(); + if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || + targetFolder.isEmpty()) + { + return; + } + if (sels.newFolder() && !targetMail->createMbox(targetFolder)) + { + QMessageBox::critical(0,tr("Error creating new Folder"), + tr("<center>Error while creating<br>new folder - breaking.</center>")); + return; + } + mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); + folderView->refreshCurrent(); +} + void OpieMail::reEditMail() { if (!mailView->currentItem()) return; |