summaryrefslogtreecommitdiff
path: root/noncore/net/mail/opiemail.cpp
authoralwin <alwin>2004-03-10 22:44:44 (UTC)
committer alwin <alwin>2004-03-10 22:44:44 (UTC)
commit9454ac48a53f3b49e03288311b71436ccacd2d04 (patch) (side-by-side diff)
treee05d40f575c87431d84c5ac374ff8ce656e6a419 /noncore/net/mail/opiemail.cpp
parenta72855867dedd2b4c16f703fa104b5c6175ce484 (diff)
downloadopie-9454ac48a53f3b49e03288311b71436ccacd2d04.zip
opie-9454ac48a53f3b49e03288311b71436ccacd2d04.tar.gz
opie-9454ac48a53f3b49e03288311b71436ccacd2d04.tar.bz2
some bugfixes
When edit a mail to send and cancel is pressed the mail can stored in a draft folder and later edit again. This moment we will not store attachments into drafts.
Diffstat (limited to 'noncore/net/mail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/opiemail.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp
index 61e7dc4..d95b3c9 100644
--- a/noncore/net/mail/opiemail.cpp
+++ b/noncore/net/mail/opiemail.cpp
@@ -174,24 +174,27 @@ void OpieMail::slotDeleteMail()
}
}
void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
{
if (!mailView->currentItem()) return;
- RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data();
+ MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType();
/* just the RIGHT button - or hold on pda */
if (button!=2) {return;}
qDebug("Event right/hold");
if (!item) return;
QPopupMenu *m = new QPopupMenu(0);
if (m)
{
- if (mail.Wrapper()->getType()==MAILLIB::A_NNTP) {
+ if (mailtype==MAILLIB::A_NNTP) {
m->insertItem(tr("Read this posting"),this,SLOT(displayMail()));
// m->insertItem(tr("Copy this posting"),this,SLOT(slotMoveCopyMail()));
} else {
+ if (folderView->currentisDraft()) {
+ m->insertItem(tr("Edit this mail"),this,SLOT(reEditMail()));
+ }
m->insertItem(tr("Read this mail"),this,SLOT(displayMail()));
m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail()));
m->insertItem(tr("Copy/Move this mail"),this,SLOT(slotMoveCopyMail()));
}
m->setFocus();
m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
@@ -228,13 +231,17 @@ void OpieMail::refreshMailView(QList<RecMail>*list)
void OpieMail::mailLeftClicked(int button, QListViewItem *item,const QPoint&,int )
{
/* just LEFT button - or tap with stylus on pda */
if (button!=1) return;
if (!item) return;
- displayMail();
+ if (folderView->currentisDraft()) {
+ reEditMail();
+ } else {
+ displayMail();
+ }
}
void OpieMail::slotMoveCopyMail()
{
if (!mailView->currentItem()) return;
RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data();
@@ -256,6 +263,16 @@ void OpieMail::slotMoveCopyMail()
tr("<center>Error while creating<br>new folder - breaking.</center>"));
return;
}
mail.Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails());
folderView->refreshCurrent();
}
+
+void OpieMail::reEditMail()
+{
+ if (!mailView->currentItem()) return;
+
+ ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp );
+ compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data());
+ compose.slotAdjustColumns();
+ QPEApplication::execDialog( &compose );
+}