From 3f5c51234c8068f3d4826a2a0066648ace21a19f Mon Sep 17 00:00:00 2001 From: zautrix Date: Tue, 31 Aug 2004 21:01:18 +0000 Subject: Enhancements of kopiemail --- (limited to 'kmicromail/opiemail.cpp') 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 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("
Error while creating
new folder - breaking.
")); + return; + } + mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); + folderView->refreshCurrent(); +} + void OpieMail::reEditMail() { if (!mailView->currentItem()) return; -- cgit v0.9.0.2