-rw-r--r-- | kmicromail/viewmail.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp index 767a369..726f540 100644 --- a/kmicromail/viewmail.cpp +++ b/kmicromail/viewmail.cpp | |||
@@ -332,98 +332,101 @@ void ViewMail::setMail(const RecMailP&mail ) | |||
332 | } | 332 | } |
333 | 333 | ||
334 | 334 | ||
335 | 335 | ||
336 | ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | 336 | ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) |
337 | : ViewMailBase(parent, name, fl), _inLoop(false) | 337 | : ViewMailBase(parent, name, fl), _inLoop(false) |
338 | { | 338 | { |
339 | m_gotBody = false; | 339 | m_gotBody = false; |
340 | deleted = false; | 340 | deleted = false; |
341 | sourceOn = false; | 341 | sourceOn = false; |
342 | connect( reply, SIGNAL(activated()), SLOT(slotReply())); | 342 | connect( reply, SIGNAL(activated()), SLOT(slotReply())); |
343 | connect( forward, SIGNAL(activated()), SLOT(slotForward())); | 343 | connect( forward, SIGNAL(activated()), SLOT(slotForward())); |
344 | connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) ); | 344 | connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) ); |
345 | connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); | 345 | connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); |
346 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); | 346 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); |
347 | connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) ); | 347 | connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) ); |
348 | connect( viewSource, SIGNAL( activated() ), SLOT( slotViewSource() ) ); | 348 | connect( viewSource, SIGNAL( activated() ), SLOT( slotViewSource() ) ); |
349 | connect( downloadMail, SIGNAL( activated() ), SIGNAL( signalDownloadMail() ) ); | 349 | connect( downloadMail, SIGNAL( activated() ), SIGNAL( signalDownloadMail() ) ); |
350 | 350 | ||
351 | attachments->setEnabled(m_gotBody); | 351 | attachments->setEnabled(m_gotBody); |
352 | connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); | 352 | connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); |
353 | 353 | ||
354 | readConfig(); | 354 | readConfig(); |
355 | attachments->setSorting(-1); | 355 | attachments->setSorting(-1); |
356 | } | 356 | } |
357 | 357 | ||
358 | void ViewMail::readConfig() | 358 | void ViewMail::readConfig() |
359 | { | 359 | { |
360 | 360 | ||
361 | setFont ( KOPrefs::instance()->mReadFont ); | 361 | setFont ( KOPrefs::instance()->mReadFont ); |
362 | m_showHtml = KOPrefs::instance()->mViewAsHtml; | 362 | m_showHtml = KOPrefs::instance()->mViewAsHtml; |
363 | showHtml->setOn( m_showHtml ); | 363 | showHtml->setOn( m_showHtml ); |
364 | } | 364 | } |
365 | 365 | ||
366 | void ViewMail::setText() | 366 | void ViewMail::setText() |
367 | { | 367 | { |
368 | 368 | ||
369 | viewSource->setText(i18n("View Source")); | 369 | viewSource->setText(i18n("View Source")); |
370 | sourceOn = false; | 370 | sourceOn = false; |
371 | QString toString; | 371 | QString toString; |
372 | QString ccString; | 372 | QString ccString; |
373 | QString bccString; | 373 | QString bccString; |
374 | 374 | ||
375 | 375 | ||
376 | toString = m_mail2[0].join(","); | 376 | toString = m_mail2[0].join(","); |
377 | ccString = m_mail2[1].join(","); | 377 | ccString = m_mail2[1].join(","); |
378 | bccString = m_mail2[2].join(","); | 378 | bccString = m_mail2[2].join(","); |
379 | 379 | ||
380 | 380 | #ifdef DESKTOP_VERSION | |
381 | setCaption( i18n("E-Mail by %1").arg( m_mail[0] ) ); | 381 | setCaption( i18n("Size: ")+m_recMail->MsgsizeString()+" - "+i18n("E-Mail by %1").arg( m_mail[0] ) ); |
382 | #else | ||
383 | setCaption( m_recMail->MsgsizeString()+" - "+m_mail[0] ); | ||
384 | #endif | ||
382 | 385 | ||
383 | m_mailHtml = "<html><body>" | 386 | m_mailHtml = "<html><body>" |
384 | "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" | 387 | "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" |
385 | "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" | 388 | "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" |
386 | "</td></tr><tr bgcolor=\"#EEEEE6\"><td>" | 389 | "</td></tr><tr bgcolor=\"#EEEEE6\"><td>" |
387 | "<b>" + i18n( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>" | 390 | "<b>" + i18n( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>" |
388 | "<b>" + i18n( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" + | 391 | "<b>" + i18n( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" + |
389 | i18n( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>" | 392 | i18n( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>" |
390 | "<b>" + i18n( "Date" ) + ": </b> " + m_mail[3] + | 393 | "<b>" + i18n( "Date" ) + ": </b> " + m_mail[3] + |
391 | "</td></tr></table><font>"; | 394 | "</td></tr></table><font>"; |
392 | 395 | ||
393 | if ( !m_showHtml ) | 396 | if ( !m_showHtml ) |
394 | { | 397 | { |
395 | browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" ); | 398 | browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" ); |
396 | } | 399 | } |
397 | else | 400 | else |
398 | { | 401 | { |
399 | browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" ); | 402 | browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" ); |
400 | } | 403 | } |
401 | // remove later in favor of a real handling | 404 | // remove later in favor of a real handling |
402 | m_gotBody = true; | 405 | m_gotBody = true; |
403 | } | 406 | } |
404 | 407 | ||
405 | 408 | ||
406 | ViewMail::~ViewMail() | 409 | ViewMail::~ViewMail() |
407 | { | 410 | { |
408 | m_recMail->Wrapper()->cleanMimeCache(); | 411 | m_recMail->Wrapper()->cleanMimeCache(); |
409 | hide(); | 412 | hide(); |
410 | } | 413 | } |
411 | 414 | ||
412 | void ViewMail::hide() | 415 | void ViewMail::hide() |
413 | { | 416 | { |
414 | QWidget::hide(); | 417 | QWidget::hide(); |
415 | 418 | ||
416 | if (_inLoop) | 419 | if (_inLoop) |
417 | { | 420 | { |
418 | _inLoop = false; | 421 | _inLoop = false; |
419 | qApp->exit_loop(); | 422 | qApp->exit_loop(); |
420 | 423 | ||
421 | } | 424 | } |
422 | 425 | ||
423 | } | 426 | } |
424 | 427 | ||
425 | void ViewMail::exec() | 428 | void ViewMail::exec() |
426 | { | 429 | { |
427 | show(); | 430 | show(); |
428 | 431 | ||
429 | if (!_inLoop) | 432 | if (!_inLoop) |