-rw-r--r-- | noncore/net/mail/viewmail.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index d86454c..e11fe1f 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp | |||
@@ -7,4 +7,6 @@ | |||
7 | #include <qapplication.h> | 7 | #include <qapplication.h> |
8 | 8 | ||
9 | #include <qpe/config.h> | ||
10 | |||
9 | #include <opie/ofiledialog.h> | 11 | #include <opie/ofiledialog.h> |
10 | 12 | ||
@@ -110,4 +112,10 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
110 | } | 112 | } |
111 | 113 | ||
114 | |||
115 | void ViewMail::slotShowHtml( bool state ) { | ||
116 | m_showHtml = state; | ||
117 | setText(); | ||
118 | } | ||
119 | |||
112 | void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) { | 120 | void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) { |
113 | if (!item ) | 121 | if (!item ) |
@@ -190,11 +198,20 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | |||
190 | connect(forward, SIGNAL(activated()), SLOT(slotForward())); | 198 | connect(forward, SIGNAL(activated()), SLOT(slotForward())); |
191 | connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail( ) ) ); | 199 | connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail( ) ) ); |
200 | connect( showHtml, SIGNAL( toggled( bool ) ), SLOT( slotShowHtml( bool ) ) ); | ||
192 | 201 | ||
193 | attachments->setEnabled(m_gotBody); | 202 | attachments->setEnabled(m_gotBody); |
194 | connect( attachments, SIGNAL( clicked ( QListViewItem *, const QPoint & , int ) ), SLOT( slotItemClicked( QListViewItem *, const QPoint & , int ) ) ); | 203 | connect( attachments, SIGNAL( clicked ( QListViewItem *, const QPoint & , int ) ), SLOT( slotItemClicked( QListViewItem *, const QPoint & , int ) ) ); |
195 | 204 | ||
205 | readConfig(); | ||
196 | 206 | ||
197 | } | 207 | } |
198 | 208 | ||
209 | void ViewMail::readConfig() { | ||
210 | Config cfg( "mail" ); | ||
211 | cfg.setGroup( "Settings" ); | ||
212 | m_showHtml = cfg.readBoolEntry( "showHtml", false ); | ||
213 | showHtml->setOn( m_showHtml ); | ||
214 | } | ||
215 | |||
199 | void ViewMail::setText() | 216 | void ViewMail::setText() |
200 | { | 217 | { |
@@ -226,5 +243,9 @@ void ViewMail::setText() | |||
226 | "</td></tr></table><font face=fixed>"; | 243 | "</td></tr></table><font face=fixed>"; |
227 | 244 | ||
245 | if ( !m_showHtml ) { | ||
228 | browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" ); | 246 | browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" ); |
247 | } else { | ||
248 | browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" ); | ||
249 | } | ||
229 | // remove later in favor of a real handling | 250 | // remove later in favor of a real handling |
230 | m_gotBody = true; | 251 | m_gotBody = true; |