Diffstat (limited to 'noncore/net/mailit/readmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mailit/readmail.cpp | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/noncore/net/mailit/readmail.cpp b/noncore/net/mailit/readmail.cpp index 7cd3e09..dc98a6f 100644 --- a/noncore/net/mailit/readmail.cpp +++ b/noncore/net/mailit/readmail.cpp | |||
@@ -56,13 +56,17 @@ void ReadMail::init() | |||
56 | bar = new QToolBar(this); | 56 | bar = new QToolBar(this); |
57 | 57 | ||
58 | //reply dependant on viewing inbox | 58 | //reply dependant on viewing inbox |
59 | replyButton = new QAction( tr( "Reply" ), Resource::loadPixmap( "mailit/reply" ), | 59 | replyButton = new QAction( tr( "Reply" ), Resource::loadPixmap( "mailit/reply" ), |
60 | QString::null, 0, this, 0 ); | 60 | QString::null, 0, this, 0 ); |
61 | connect(replyButton, SIGNAL(activated()), this, SLOT(reply()) ); | 61 | connect(replyButton, SIGNAL(activated()), this, SLOT(reply()) ); |
62 | 62 | ||
63 | forwardButton = new QAction( tr( "Forward" ), Resource::loadPixmap( "mailit/forward" ), | ||
64 | QString::null, 0, this, 0 ); | ||
65 | connect(forwardButton, SIGNAL(activated()), this, SLOT(forward()) ); | ||
66 | |||
63 | previousButton = new QAction( tr( "Previous" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 67 | previousButton = new QAction( tr( "Previous" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
64 | connect( previousButton, SIGNAL( activated() ), this, SLOT( previous() ) ); | 68 | connect( previousButton, SIGNAL( activated() ), this, SLOT( previous() ) ); |
65 | previousButton->addTo(bar); | 69 | previousButton->addTo(bar); |
66 | previousButton->addTo(viewMenu); | 70 | previousButton->addTo(viewMenu); |
67 | 71 | ||
68 | nextButton = new QAction( tr( "Next" ), Resource::loadPixmap( "forward" ), QString::null, 0, this, 0 ); | 72 | nextButton = new QAction( tr( "Next" ), Resource::loadPixmap( "forward" ), QString::null, 0, this, 0 ); |
@@ -104,17 +108,22 @@ void ReadMail::updateView() | |||
104 | 108 | ||
105 | mail->read = TRUE; //mark as read | 109 | mail->read = TRUE; //mark as read |
106 | inbox = mail->received; | 110 | inbox = mail->received; |
107 | 111 | ||
108 | replyButton->removeFrom(mailMenu); | 112 | replyButton->removeFrom(mailMenu); |
109 | replyButton->removeFrom(bar); | 113 | replyButton->removeFrom(bar); |
114 | forwardButton->removeFrom(mailMenu); | ||
115 | forwardButton->removeFrom(bar); | ||
110 | 116 | ||
111 | if (inbox == TRUE) { | 117 | if (inbox == TRUE) { |
112 | replyButton->addTo(bar); | 118 | replyButton->addTo(bar); |
113 | replyButton->addTo(mailMenu); | 119 | replyButton->addTo(mailMenu); |
114 | 120 | forwardButton->addTo(bar); | |
121 | forwardButton->addTo(mailMenu); | ||
122 | |||
123 | |||
115 | if (!mail->downloaded) { | 124 | if (!mail->downloaded) { |
116 | //report currently viewed mail so that it will be | 125 | //report currently viewed mail so that it will be |
117 | //placed first in the queue of new mails to download | 126 | //placed first in the queue of new mails to download |
118 | emit viewingMail(mail); | 127 | emit viewingMail(mail); |
119 | 128 | ||
120 | double mailSize = (double) mail->size; | 129 | double mailSize = (double) mail->size; |
@@ -142,12 +151,19 @@ void ReadMail::updateView() | |||
142 | 151 | ||
143 | text +="<b>To: </b>"; | 152 | text +="<b>To: </b>"; |
144 | for (QStringList::Iterator it = mail->recipients.begin(); | 153 | for (QStringList::Iterator it = mail->recipients.begin(); |
145 | it != mail->recipients.end(); ++it ) { | 154 | it != mail->recipients.end(); ++it ) { |
146 | text += *it + " "; | 155 | text += *it + " "; |
147 | } | 156 | } |
157 | |||
158 | text +="<br><b>CC: </b>"; | ||
159 | for (QStringList::Iterator it = mail->carbonCopies.begin(); | ||
160 | it != mail->carbonCopies.end(); ++it ) { | ||
161 | text += *it + " "; | ||
162 | } | ||
163 | |||
148 | text += "<br>" + mail->date; | 164 | text += "<br>" + mail->date; |
149 | 165 | ||
150 | if (mail->files.count() > 0) { | 166 | if (mail->files.count() > 0) { |
151 | text += "<br><b>Attatchments: </b>"; | 167 | text += "<br><b>Attatchments: </b>"; |
152 | 168 | ||
153 | for ( ePtr=mail->files.first(); ePtr != 0; ePtr=mail->files.next() ) { | 169 | for ( ePtr=mail->files.first(); ePtr != 0; ePtr=mail->files.next() ) { |
@@ -199,12 +215,20 @@ void ReadMail::updateView() | |||
199 | text += "From: " + mail->from + " " + mail->fromMail + "\n"; | 215 | text += "From: " + mail->from + " " + mail->fromMail + "\n"; |
200 | text += "To: "; | 216 | text += "To: "; |
201 | for (QStringList::Iterator it = mail->recipients.begin(); | 217 | for (QStringList::Iterator it = mail->recipients.begin(); |
202 | it != mail->recipients.end(); ++it ) { | 218 | it != mail->recipients.end(); ++it ) { |
203 | text += *it + " "; | 219 | text += *it + " "; |
204 | } | 220 | } |
221 | |||
222 | text += "\nCC: "; | ||
223 | for (QStringList::Iterator it = mail->carbonCopies.begin(); | ||
224 | it != mail->carbonCopies.end(); ++it ) { | ||
225 | text += *it + " "; | ||
226 | } | ||
227 | |||
228 | |||
205 | text += "\nDate: " + mail->date + "\n"; | 229 | text += "\nDate: " + mail->date + "\n"; |
206 | if (mail->files.count() > 0) { | 230 | if (mail->files.count() > 0) { |
207 | text += "Attatchments: "; | 231 | text += "Attatchments: "; |
208 | for ( ePtr=mail->files.first(); ePtr != 0; ePtr=mail->files.next() ) { | 232 | for ( ePtr=mail->files.first(); ePtr != 0; ePtr=mail->files.next() ) { |
209 | text += ePtr->originalName + " "; | 233 | text += ePtr->originalName + " "; |
210 | } | 234 | } |
@@ -320,8 +344,14 @@ void ReadMail::viewAttatchments() | |||
320 | viewAtt->update(mail, inbox); | 344 | viewAtt->update(mail, inbox); |
321 | viewAtt->showMaximized(); | 345 | viewAtt->showMaximized(); |
322 | } | 346 | } |
323 | 347 | ||
324 | void ReadMail::reply() | 348 | void ReadMail::reply() |
325 | { | 349 | { |
326 | emit replyRequested(*mail); | 350 | emit replyRequested(*mail, (bool&)TRUE); |
327 | } | 351 | } |
352 | |||
353 | void ReadMail::forward() | ||
354 | { | ||
355 | emit forwardRequested(*mail); | ||
356 | } | ||
357 | |||