summaryrefslogtreecommitdiffabout
path: root/kmicromail/viewmail.cpp
Unidiff
Diffstat (limited to 'kmicromail/viewmail.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/viewmail.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index 67b77f8..6e560d7 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -6,35 +6,35 @@
6#include <libmailwrapper/abstractmail.h> 6#include <libmailwrapper/abstractmail.h>
7#include <libmailwrapper/mailtypes.h> 7#include <libmailwrapper/mailtypes.h>
8#include <kapplication.h> 8#include <kapplication.h>
9 9
10/* OPIE */ 10/* OPIE */
11//#include <opie2/odebug.h> 11//#include <opie2/odebug.h>
12//#include <opie2/ofiledialog.h> 12//#include <opie2/ofiledialog.h>
13//#include <opie2/oimagescrollview.h> 13//#include <opie2/oimagescrollview.h>
14 14
15#include <kfiledialog.h> 15#include <kfiledialog.h>
16#include <kdialog.h> 16#include <kdialog.h>
17 17
18#include <qpe/config.h>
19#include <qpe/qpeapplication.h> 18#include <qpe/qpeapplication.h>
20 19
21/* QT */ 20/* QT */
22#include <qtextbrowser.h> 21#include <qtextbrowser.h>
23#include <qmessagebox.h> 22#include <qmessagebox.h>
24#include <qtextstream.h> 23#include <qtextstream.h>
25#include <qaction.h> 24#include <qaction.h>
26#include <qpopupmenu.h> 25#include <qpopupmenu.h>
27#include <qfile.h> 26#include <qfile.h>
28#include <qlayout.h> 27#include <qlayout.h>
28#include "koprefs.h"
29 29
30//using namespace Opie::Ui; 30//using namespace Opie::Ui;
31//using namespace Opie::Core; 31//using namespace Opie::Core;
32 32
33AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 33AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
34 const QString&fsize,int num,const QValueList<int>&path) 34 const QString&fsize,int num,const QValueList<int>&path)
35 : QListViewItem(parent,after),_partNum(num) 35 : QListViewItem(parent,after),_partNum(num)
36{ 36{
37 _path=path; 37 _path=path;
38 setText(0, mime); 38 setText(0, mime);
39 setText(1, desc); 39 setText(1, desc);
40 setText(2, file); 40 setText(2, file);
@@ -317,27 +317,27 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
317 connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); 317 connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) );
318 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); 318 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) );
319 319
320 attachments->setEnabled(m_gotBody); 320 attachments->setEnabled(m_gotBody);
321 connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); 321 connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) );
322 322
323 readConfig(); 323 readConfig();
324 attachments->setSorting(-1); 324 attachments->setSorting(-1);
325} 325}
326 326
327void ViewMail::readConfig() 327void ViewMail::readConfig()
328{ 328{
329 Config cfg( "mail" ); 329
330 cfg.setGroup( "Settings" ); 330 setFont ( KOPrefs::instance()->mReadFont );
331 m_showHtml = cfg.readBoolEntry( "showHtml", false ); 331 m_showHtml = KOPrefs::instance()->mViewAsHtml;
332 showHtml->setOn( m_showHtml ); 332 showHtml->setOn( m_showHtml );
333} 333}
334 334
335void ViewMail::setText() 335void ViewMail::setText()
336{ 336{
337 337
338 QString toString; 338 QString toString;
339 QString ccString; 339 QString ccString;
340 QString bccString; 340 QString bccString;
341 341
342 for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) 342 for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it )
343 { 343 {
@@ -353,25 +353,25 @@ void ViewMail::setText()
353 } 353 }
354 354
355 setCaption( tr("E-Mail by %1").arg( m_mail[0] ) ); 355 setCaption( tr("E-Mail by %1").arg( m_mail[0] ) );
356 356
357 m_mailHtml = "<html><body>" 357 m_mailHtml = "<html><body>"
358 "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" 358 "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>"
359 "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" 359 "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>"
360 "</td></tr><tr bgcolor=\"#EEEEE6\"><td>" 360 "</td></tr><tr bgcolor=\"#EEEEE6\"><td>"
361 "<b>" + tr( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>" 361 "<b>" + tr( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>"
362 "<b>" + tr( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" + 362 "<b>" + tr( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" +
363 tr( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>" 363 tr( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>"
364 "<b>" + tr( "Date" ) + ": </b> " + m_mail[3] + 364 "<b>" + tr( "Date" ) + ": </b> " + m_mail[3] +
365 "</td></tr></table><font face=fixed>"; 365 "</td></tr></table><font>";
366 366
367 if ( !m_showHtml ) 367 if ( !m_showHtml )
368 { 368 {
369 browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" ); 369 browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" );
370 } 370 }
371 else 371 else
372 { 372 {
373 browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" ); 373 browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" );
374 } 374 }
375 // remove later in favor of a real handling 375 // remove later in favor of a real handling
376 m_gotBody = true; 376 m_gotBody = true;
377} 377}