author | harlekin <harlekin> | 2003-12-09 23:51:22 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-09 23:51:22 (UTC) |
commit | e8ca3ebcf4cf356497670a455f43e08a16c0f2aa (patch) (unidiff) | |
tree | 0fa7ad39387559a527bee58d24cbc4ac50a35e23 | |
parent | c361d36374d9c333ffe4b853067858df5636e1a5 (diff) | |
download | opie-e8ca3ebcf4cf356497670a455f43e08a16c0f2aa.zip opie-e8ca3ebcf4cf356497670a455f43e08a16c0f2aa.tar.gz opie-e8ca3ebcf4cf356497670a455f43e08a16c0f2aa.tar.bz2 |
more updated to the mail viewer
-rw-r--r-- | noncore/net/mail/composemail.cpp | 1 | ||||
-rw-r--r-- | noncore/net/mail/composemail.h | 3 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 46 |
3 files changed, 29 insertions, 21 deletions
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp index 88dd780..96787e4 100644 --- a/noncore/net/mail/composemail.cpp +++ b/noncore/net/mail/composemail.cpp | |||
@@ -47,12 +47,13 @@ void ComposeMail::pickAddress( QLineEdit *line ) | |||
47 | line->setText( names ); | 47 | line->setText( names ); |
48 | } else if ( !names.isEmpty() ) { | 48 | } else if ( !names.isEmpty() ) { |
49 | line->setText( line->text() + ", " + names ); | 49 | line->setText( line->text() + ", " + names ); |
50 | } | 50 | } |
51 | } | 51 | } |
52 | 52 | ||
53 | |||
53 | void ComposeMail::pickAddressTo() | 54 | void ComposeMail::pickAddressTo() |
54 | { | 55 | { |
55 | pickAddress( toLine ); | 56 | pickAddress( toLine ); |
56 | } | 57 | } |
57 | 58 | ||
58 | void ComposeMail::pickAddressCC() | 59 | void ComposeMail::pickAddressCC() |
diff --git a/noncore/net/mail/composemail.h b/noncore/net/mail/composemail.h index c7ae22a..196a471 100644 --- a/noncore/net/mail/composemail.h +++ b/noncore/net/mail/composemail.h | |||
@@ -32,12 +32,13 @@ class ComposeMail : public ComposeMailUI | |||
32 | public: | 32 | public: |
33 | ComposeMail( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 ); | 33 | ComposeMail( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 ); |
34 | 34 | ||
35 | public slots: | 35 | public slots: |
36 | void slotAdjustColumns(); | 36 | void slotAdjustColumns(); |
37 | 37 | ||
38 | |||
38 | protected slots: | 39 | protected slots: |
39 | void accept(); | 40 | void accept(); |
40 | 41 | ||
41 | private slots: | 42 | private slots: |
42 | void fillValues( int current ); | 43 | void fillValues( int current ); |
43 | void pickAddress( QLineEdit *line ); | 44 | void pickAddress( QLineEdit *line ); |
@@ -45,12 +46,14 @@ private slots: | |||
45 | void pickAddressCC(); | 46 | void pickAddressCC(); |
46 | void pickAddressBCC(); | 47 | void pickAddressBCC(); |
47 | void pickAddressReply(); | 48 | void pickAddressReply(); |
48 | void addAttachment(); | 49 | void addAttachment(); |
49 | void removeAttachment(); | 50 | void removeAttachment(); |
50 | 51 | ||
52 | |||
53 | |||
51 | private: | 54 | private: |
52 | Settings *settings; | 55 | Settings *settings; |
53 | QList<SMTPaccount> smtpAccounts; | 56 | QList<SMTPaccount> smtpAccounts; |
54 | 57 | ||
55 | }; | 58 | }; |
56 | 59 | ||
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index cba9948..ed3ece9 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp | |||
@@ -1,13 +1,13 @@ | |||
1 | #include <qtextbrowser.h> | 1 | #include <qtextbrowser.h> |
2 | #include <qmessagebox.h> | 2 | #include <qmessagebox.h> |
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qapplication.h> | 4 | #include <qapplication.h> |
5 | 5 | ||
6 | //#include "mailfactory.h" | 6 | #include "settings.h" |
7 | //#include "composer.h" | 7 | #include "composemail.h" |
8 | #include "viewmail.h" | 8 | #include "viewmail.h" |
9 | 9 | ||
10 | AttachItem::AttachItem(QListView *parent, AttachItemStore &attachItemStore) | 10 | AttachItem::AttachItem(QListView *parent, AttachItemStore &attachItemStore) |
11 | : QListViewItem(parent), _attachItemStore(attachItemStore) | 11 | : QListViewItem(parent), _attachItemStore(attachItemStore) |
12 | { | 12 | { |
13 | setText(0, _attachItemStore.mimeType()); | 13 | setText(0, _attachItemStore.mimeType()); |
@@ -70,27 +70,28 @@ void ViewMail::setText() | |||
70 | } | 70 | } |
71 | 71 | ||
72 | setCaption( caption().arg( m_mail[0] ) ); | 72 | setCaption( caption().arg( m_mail[0] ) ); |
73 | 73 | ||
74 | _mailHtml = tr( | 74 | _mailHtml = tr( |
75 | "<html><body>" | 75 | "<html><body>" |
76 | "<div align=center><b>%1</b></div>" | 76 | "<div align=center><b><font color=#FF2222>%1</b></font></div>" |
77 | "<b>From:</b> %2<br>" | 77 | "<b>From:</b> %2<br>" |
78 | "<b>To:</b> %3<br>" | 78 | "<b>To:</b> %3<br>" |
79 | "%4" | 79 | "%4" |
80 | "%5" | 80 | "%5" |
81 | "<b>Date:</b> %6<hr>" | 81 | "<b>Date:</b> %6<hr>" |
82 | "<font face=fixed>%7</font>") | 82 | "<font face=fixed>") |
83 | .arg( deHtml( m_mail[1] ) ) | 83 | .arg( deHtml( m_mail[1] ) ) |
84 | .arg( deHtml( m_mail[0] ) ) | 84 | .arg( deHtml( m_mail[0] ) ) |
85 | .arg( deHtml( toString ) ) | 85 | .arg( deHtml( toString ) ) |
86 | .arg( tr("<b>Cc:</b> %1<br>").arg( deHtml( ccString ) ) ) | 86 | .arg( tr("<b>Cc:</b> %1<br>").arg( deHtml( ccString ) ) ) |
87 | .arg( tr("<b>Bcc:</b> %1<br>").arg( deHtml( bccString ) ) ) | 87 | .arg( tr("<b>Bcc:</b> %1<br>").arg( deHtml( bccString ) ) ) |
88 | .arg( m_mail[3] ) | 88 | .arg( m_mail[3] ); |
89 | .arg("%1"); | 89 | browser->setText( QString(_mailHtml) + deHtml( m_mail[2] ) + "</font>" ); |
90 | browser->setText( QString(_mailHtml) + deHtml( m_mail[2] ) ); | 90 | // remove later in favor of a real handling |
91 | _gotBody = true; | ||
91 | } | 92 | } |
92 | 93 | ||
93 | 94 | ||
94 | 95 | ||
95 | ViewMail::~ViewMail() | 96 | ViewMail::~ViewMail() |
96 | { | 97 | { |
@@ -132,38 +133,41 @@ void ViewMail::slotReply() | |||
132 | if (!_gotBody) { | 133 | if (!_gotBody) { |
133 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot reply yet."), tr("Ok")); | 134 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot reply yet."), tr("Ok")); |
134 | return; | 135 | return; |
135 | } | 136 | } |
136 | 137 | ||
137 | QString rtext; | 138 | QString rtext; |
138 | // rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose | 139 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose |
139 | // .arg(_mail.envelope().from()[0].toString()) | 140 | .arg( m_mail[1] ) |
140 | // .arg(_mail.envelope().mailDate()); | 141 | .arg( m_mail[3] ); |
141 | 142 | ||
142 | //QString text = _mail.bodyPart(1).data(); | 143 | QString text = m_mail[2]; |
143 | //QStringList lines = QStringList::split(QRegExp("\\n"), text); | 144 | QStringList lines = QStringList::split(QRegExp("\\n"), text); |
144 | QStringList::Iterator it; | 145 | QStringList::Iterator it; |
145 | //for (it = lines.begin(); it != lines.end(); it++) { | 146 | for (it = lines.begin(); it != lines.end(); it++) { |
146 | // rtext += "> " + *it + "\n"; | 147 | rtext += "> " + *it + "\n"; |
147 | //} | 148 | } |
148 | rtext += "\n"; | 149 | rtext += "\n"; |
149 | 150 | ||
150 | QString prefix; | 151 | QString prefix; |
151 | //if (_mail.envelope().subject().find(QRegExp("^Re: *$")) != -1) prefix = ""; | 152 | if ( m_mail[1].find(QRegExp("^Re: *$")) != -1) prefix = ""; |
152 | // else prefix = "Re: "; // no i18n on purpose | 153 | else prefix = "Re: "; // no i18n on purpose |
153 | 154 | ||
154 | //SendMail sendMail; | 155 | //SendMail sendMail; |
155 | //sendMail.setTo(_mail.envelope().from()[0].toString()); | 156 | //sendMail.setTo(_mail.envelope().from()[0].toString()); |
156 | //sendMail.setSubject(prefix + _mail.envelope().subject()); | 157 | //sendMail.setSubject(prefix + _mail.envelope().subject()); |
157 | //sendMail.setInReplyTo(_mail.envelope().messageId()); | 158 | //sendMail.setInReplyTo(_mail.envelope().messageId()); |
158 | //sendMail.setMessage(rtext); | 159 | //sendMail.setMessage(rtext); |
159 | 160 | ||
160 | //Composer composer(this, 0, true); | 161 | |
161 | //composer.setSendMail(sendMail); | 162 | /* ComposeMail composer(this, 0, true); |
162 | //composer.showMaximized(); | 163 | composer.setMessage( ); |
163 | //composer.exec(); | 164 | composer.showMaximized(); |
165 | composer.exec(); | ||
166 | */ | ||
167 | qDebug ( rtext ); | ||
164 | } | 168 | } |
165 | 169 | ||
166 | void ViewMail::slotForward() | 170 | void ViewMail::slotForward() |
167 | { | 171 | { |
168 | if (!_gotBody) { | 172 | if (!_gotBody) { |
169 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok")); | 173 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok")); |