summaryrefslogtreecommitdiffabout
path: root/kmicromail/opiemail.cpp
Unidiff
Diffstat (limited to 'kmicromail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/opiemail.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 4e7c6be..7ccfb65 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -232,48 +232,56 @@ void OpieMail::slotEditAccounts()
232 folderView->populate( settings->getAccounts() ); 232 folderView->populate( settings->getAccounts() );
233} 233}
234 234
235void OpieMail::displayMail() 235void OpieMail::displayMail()
236{ 236{
237 QListViewItem*item = mailView->currentItem(); 237 QListViewItem*item = mailView->currentItem();
238 if (!item) return; 238 if (!item) return;
239 RecMailP mail = ((MailListViewItem*)item)->data(); 239 RecMailP mail = ((MailListViewItem*)item)->data();
240 RecBodyP body = folderView->fetchBody(mail); 240 RecBodyP body = folderView->fetchBody(mail);
241 ViewMail readMail( this,"", Qt::WType_Modal ); 241 ViewMail readMail( this,"", Qt::WType_Modal );
242 readMail.setBody( body ); 242 readMail.setBody( body );
243 readMail.setMail( mail ); 243 readMail.setMail( mail );
244 readMail.showMaximized(); 244 readMail.showMaximized();
245 readMail.exec(); 245 readMail.exec();
246 246
247 if ( readMail.deleted ) 247 if ( readMail.deleted )
248 { 248 {
249 folderView->refreshCurrent(); 249 folderView->refreshCurrent();
250 } 250 }
251 else 251 else
252 { 252 {
253 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); 253 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
254 } 254 }
255} 255}
256void OpieMail::slotGetAllMail()
257{
258 QListViewItem * item = folderView->firstChild();
259 while ( item ){
260 ((AccountViewItem *)item)->contextMenuSelected( 101 );
261 item = item->nextSibling ();
262 }
263}
256void OpieMail::slotGetMail() 264void OpieMail::slotGetMail()
257{ 265{
258 QListViewItem * item = folderView->currentItem(); 266 QListViewItem * item = folderView->currentItem();
259 if ( ! item ) return; 267 if ( ! item ) return;
260 while ( item->parent () ) 268 while ( item->parent () )
261 item = item->parent (); 269 item = item->parent ();
262 ((AccountViewItem *)item)->contextMenuSelected( 101 ); 270 ((AccountViewItem *)item)->contextMenuSelected( 101 );
263} 271}
264void OpieMail::slotDeleteMail() 272void OpieMail::slotDeleteMail()
265{ 273{
266 if (!mailView->currentItem()) return; 274 if (!mailView->currentItem()) return;
267 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); 275 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data();
268 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 ) 276 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 )
269 { 277 {
270 mail->Wrapper()->deleteMail( mail ); 278 mail->Wrapper()->deleteMail( mail );
271 folderView->refreshCurrent(); 279 folderView->refreshCurrent();
272 } 280 }
273} 281}
274void OpieMail::slotDeleteAllMail() 282void OpieMail::slotDeleteAllMail()
275{ 283{
276 284
277 QValueList<RecMailP> t; 285 QValueList<RecMailP> t;
278 if ( QMessageBox::warning(this, tr("Delete All Mails"), tr("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 286 if ( QMessageBox::warning(this, tr("Delete All Mails"), tr("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
279 { 287 {