author | harlekin <harlekin> | 2003-12-20 00:05:37 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-20 00:05:37 (UTC) |
commit | dc088ad432189b4883f7654ef6b2c1e2f69112cc (patch) (unidiff) | |
tree | 090f6afd960e644d7da1fae3b8c8ffa97b669b59 /noncore/net/mail/viewmail.cpp | |
parent | 00a0c8cf03fe746c1e3ba608bf298c8e66d065f9 (diff) | |
download | opie-dc088ad432189b4883f7654ef6b2c1e2f69112cc.zip opie-dc088ad432189b4883f7654ef6b2c1e2f69112cc.tar.gz opie-dc088ad432189b4883f7654ef6b2c1e2f69112cc.tar.bz2 |
- beginning of a settings dialog
- button for switching between html and plain text view of the mail
- hide some unused icons
- completed alwins idea about status icons ( alwin you missed the one that sets the read icon .-) )
- beginning of a status widget
-
-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 | |||
@@ -6,6 +6,8 @@ | |||
6 | #include <qfile.h> | 6 | #include <qfile.h> |
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 | ||
11 | #include "settings.h" | 13 | #include "settings.h" |
@@ -109,6 +111,12 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
109 | } | 111 | } |
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 ) |
114 | return; | 122 | return; |
@@ -189,13 +197,22 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | |||
189 | connect(reply, SIGNAL(activated()), SLOT(slotReply())); | 197 | connect(reply, SIGNAL(activated()), SLOT(slotReply())); |
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 | { |
201 | 218 | ||
@@ -225,7 +242,11 @@ void ViewMail::setText() | |||
225 | "<b>" + tr( "Date" ) + ": </b> " + m_mail[3] + | 242 | "<b>" + tr( "Date" ) + ": </b> " + m_mail[3] + |
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; |
231 | } | 252 | } |