Diffstat (limited to 'noncore/net/mail/viewmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index e53f4a3..68d3c51 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp | |||
@@ -250,47 +250,48 @@ QString ViewMail::deHtml(const QString &string) | |||
250 | return string_; | 250 | return string_; |
251 | } | 251 | } |
252 | 252 | ||
253 | void ViewMail::slotReply() | 253 | void ViewMail::slotReply() |
254 | { | 254 | { |
255 | if (!m_gotBody) { | 255 | if (!m_gotBody) { |
256 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot reply yet."), tr("Ok")); | 256 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot reply yet."), tr("Ok")); |
257 | return; | 257 | return; |
258 | } | 258 | } |
259 | 259 | ||
260 | QString rtext; | 260 | QString rtext; |
261 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose | 261 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose |
262 | .arg( m_mail[1] ) | 262 | .arg( m_mail[0] ) |
263 | .arg( m_mail[3] ); | 263 | .arg( m_mail[3] ); |
264 | 264 | ||
265 | QString text = m_mail[2]; | 265 | QString text = m_mail[2]; |
266 | QStringList lines = QStringList::split(QRegExp("\\n"), text); | 266 | QStringList lines = QStringList::split(QRegExp("\\n"), text); |
267 | QStringList::Iterator it; | 267 | QStringList::Iterator it; |
268 | for (it = lines.begin(); it != lines.end(); it++) { | 268 | for (it = lines.begin(); it != lines.end(); it++) { |
269 | rtext += "> " + *it + "\n"; | 269 | rtext += "> " + *it + "\n"; |
270 | } | 270 | } |
271 | rtext += "\n"; | 271 | rtext += "\n"; |
272 | 272 | ||
273 | QString prefix; | 273 | QString prefix; |
274 | if ( m_mail[1].find(QRegExp("^Re: *$")) != -1) prefix = ""; | 274 | if ( m_mail[1].find(QRegExp("^Re: *$")) != -1) prefix = ""; |
275 | else prefix = "Re: "; // no i18n on purpose | 275 | else prefix = "Re: "; // no i18n on purpose |
276 | 276 | ||
277 | Settings *settings = new Settings(); | 277 | Settings *settings = new Settings(); |
278 | ComposeMail composer( settings ,this, 0, true); | 278 | ComposeMail composer( settings ,this, 0, true); |
279 | composer.setTo( m_mail[0] ); | 279 | composer.setTo( m_mail[0] ); |
280 | composer.setSubject( "Re: " + m_mail[1] ); | 280 | composer.setSubject( "Re: " + m_mail[1] ); |
281 | composer.setMessage( rtext ); | 281 | composer.setMessage( rtext ); |
282 | composer.showMaximized(); | 282 | composer.showMaximized(); |
283 | composer.exec(); | 283 | if ( QDialog::Accepted==composer.exec()) { |
284 | 284 | m_recMail.Wrapper()->answeredMail(m_recMail); | |
285 | } | ||
285 | } | 286 | } |
286 | 287 | ||
287 | void ViewMail::slotForward() | 288 | void ViewMail::slotForward() |
288 | { | 289 | { |
289 | if (!m_gotBody) { | 290 | if (!m_gotBody) { |
290 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok")); | 291 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok")); |
291 | return; | 292 | return; |
292 | } | 293 | } |
293 | 294 | ||
294 | QString ftext; | 295 | QString ftext; |
295 | ftext += QString("\n----- Forwarded message from %1 -----\n\n") | 296 | ftext += QString("\n----- Forwarded message from %1 -----\n\n") |
296 | .arg( m_mail[0] ); | 297 | .arg( m_mail[0] ); |
@@ -305,23 +306,25 @@ void ViewMail::slotForward() | |||
305 | .arg( m_mail[1] ); | 306 | .arg( m_mail[1] ); |
306 | 307 | ||
307 | ftext += QString("\n%1\n") | 308 | ftext += QString("\n%1\n") |
308 | .arg( m_mail[2]); | 309 | .arg( m_mail[2]); |
309 | 310 | ||
310 | ftext += QString("----- End forwarded message -----\n"); | 311 | ftext += QString("----- End forwarded message -----\n"); |
311 | 312 | ||
312 | Settings *settings = new Settings(); | 313 | Settings *settings = new Settings(); |
313 | ComposeMail composer( settings ,this, 0, true); | 314 | ComposeMail composer( settings ,this, 0, true); |
314 | composer.setSubject( "Fwd: " + m_mail[1] ); | 315 | composer.setSubject( "Fwd: " + m_mail[1] ); |
315 | composer.setMessage( ftext ); | 316 | composer.setMessage( ftext ); |
316 | composer.showMaximized(); | 317 | composer.showMaximized(); |
317 | composer.exec(); | 318 | if ( QDialog::Accepted==composer.exec()) { |
319 | |||
320 | } | ||
318 | } | 321 | } |
319 | 322 | ||
320 | void ViewMail::slotDeleteMail( ) | 323 | void ViewMail::slotDeleteMail( ) |
321 | { | 324 | { |
322 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { | 325 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { |
323 | m_recMail.Wrapper()->deleteMail( m_recMail ); | 326 | m_recMail.Wrapper()->deleteMail( m_recMail ); |
324 | hide(); | 327 | hide(); |
325 | deleted = true; | 328 | deleted = true; |
326 | } | 329 | } |
327 | } | 330 | } |