summaryrefslogtreecommitdiff
path: root/noncore/net/mail/mainwindow.cpp
authorharlekin <harlekin>2003-12-14 00:20:38 (UTC)
committer harlekin <harlekin>2003-12-14 00:20:38 (UTC)
commitff2b84787e454f8a11aaef7a4ce18941ac0d28fd (patch) (side-by-side diff)
tree44bf51f9a3935542cdcfa5dafcc212e4f01ee8ce /noncore/net/mail/mainwindow.cpp
parentb0a71314013a3367767526b68928a7168b4ad460 (diff)
downloadopie-ff2b84787e454f8a11aaef7a4ce18941ac0d28fd.zip
opie-ff2b84787e454f8a11aaef7a4ce18941ac0d28fd.tar.gz
opie-ff2b84787e454f8a11aaef7a4ce18941ac0d28fd.tar.bz2
deleting of mails working
Diffstat (limited to 'noncore/net/mail/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/mainwindow.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index 8ef7ddd..c410829 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -57,12 +57,17 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS,
0, 0, this );
searchMails->addTo( toolBar );
searchMails->addTo( mailMenu );
+ deleteMails = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this);
+ deleteMails->addTo( toolBar );
+ deleteMails->addTo( mailMenu );
+ connect( deleteMails, SIGNAL( activated() ),
+ SLOT( slotDeleteMail() ) );
editSettings = new QAction( tr( "Edit settings" ), ICON_EDITSETTINGS,
0, 0, this );
editSettings->addTo( settingsMenu );
editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS,
@@ -150,23 +155,41 @@ void MainWindow::refreshMailView(QList<RecMail>*list)
item->storeData(*(list->at(i)));
item->showEntry();
}
}
void MainWindow::displayMail(QListViewItem*item)
{
+
+ m_currentItem = item;
+
if (!item) return;
RecMail mail = ((MailListViewItem*)item)->data();
RecBody body = folderView->fetchBody(mail);
ViewMail readMail( this );
readMail.setBody( body );
readMail.setMail( mail );
readMail.showMaximized();
readMail.exec();
+
+ if ( readMail.deleted ) {
+ folderView->refreshCurrent();
+ } else {
( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "opiemail/kmmsgunseen") );
}
+}
+
+void MainWindow::slotDeleteMail()
+{
+ if (!m_currentItem) return;
+ RecMail mail = ((MailListViewItem*)m_currentItem)->data();
+ mail.Wrapper()->deleteMail( mail );
+ folderView->refreshCurrent();
+}
+
+
MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item )
:QListViewItem(parent,item),mail_data()
{
}