Diffstat (limited to 'noncore/unsupported/mailit/writemail.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/mailit/writemail.cpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/noncore/unsupported/mailit/writemail.cpp b/noncore/unsupported/mailit/writemail.cpp index dcf0c6e..c75494e 100644 --- a/noncore/unsupported/mailit/writemail.cpp +++ b/noncore/unsupported/mailit/writemail.cpp @@ -13,26 +13,25 @@ ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <qmessagebox.h> #include <qwhatsthis.h> #include "writemail.h" #include <qpe/resource.h> -WriteMail::WriteMail( QWidget* parent, const char* name, WFlags fl ) - : QMainWindow( parent, name, fl ) +WriteMail::WriteMail( QWidget* parent, const char* name, WFlags fl ):QMainWindow( parent, name, fl ) { showingAddressList = FALSE; init(); addAtt = new AddAtt(0, "Add Attachments"); } WriteMail::~WriteMail() { delete addAtt; } @@ -259,37 +258,43 @@ void WriteMail::reply(Email replyMail, bool replyAll) toInput->setText(mail.fromMail); if (replyAll) { for (QStringList::Iterator it = mail.carbonCopies.begin();it != mail.carbonCopies.end(); ++it) { ccRecipients.append(*it); ccRecipients.append(";"); } ccRecipients.truncate(ccRecipients.length()-1); //no ; at the end ccInput->setText(ccRecipients); } - - addRecipients(replyAll); + else ccInput->clear(); subjectInput->setText(tr("Re: ") + mail.subject); + QString citation=mail.fromMail; + citation.append(tr(" wrote on ")); + citation.append(mail.date); + citation.append(":\n"); + + + //mail.body.insert(0,tr("On")); pos = 0; mail.body.insert(pos, ">"); while (pos != -1) { pos = mail.body.find('\n', pos); if (pos != -1) mail.body.insert(++pos, ">>"); } - + mail.body.insert(0,citation); emailInput->setText(mail.body); } void WriteMail::forward(Email forwMail) { int pos=0; QString fwdBody=tr("======forwarded message from "); fwdBody.append(forwMail.fromMail); fwdBody.append(tr(" starts======\n\n")); mail=forwMail; @@ -299,41 +304,48 @@ void WriteMail::forward(Email forwMail) fwdBody+=mail.body; fwdBody+=QString(tr("======end of forwarded message======\n\n")); emailInput->setText(fwdBody); } bool WriteMail::getRecipients(bool ccField) { QString str, temp; int pos = 0; + if (ccField) + { + mail.carbonCopies.clear(); + temp = ccInput->text(); + } + else + { mail.recipients.clear(); - - ccField ? temp = ccInput->text() : temp=toInput->text() ; + temp=toInput->text() ; + } while ( (pos = temp.find(';')) != -1) { str = temp.left(pos).stripWhiteSpace(); temp = temp.right(temp.length() - (pos + 1)); if ( str.find('@') == -1) return false; ccField ? mail.carbonCopies.append(str) : mail.recipients.append(str); - addressList->addContact(str, ""); + //addressList->addContact(str, ""); } temp = temp.stripWhiteSpace(); if ( temp.find('@') == -1) return false; ccField ? mail.carbonCopies.append(temp) : mail.recipients.append(temp); - addressList->addContact(temp, ""); + //addressList->addContact(temp, ""); return TRUE; } void WriteMail::addRecipients() { toInput->isVisible() ? addRecipients(false) : addRecipients(true); } void WriteMail::addRecipients(bool ccField) { QString recipients = ""; @@ -374,16 +386,17 @@ void WriteMail::changeRecipients(int selection) ccInput->show(); } } void WriteMail::setRecipient(const QString &recipient) { toInput->setText(recipient); } void WriteMail::newMail() { toInput->clear(); + ccInput->clear(); subjectInput->clear(); emailInput->clear(); setAddressList(addressList); } |