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
-
Diffstat (limited to 'noncore/net/mail/viewmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 91 |
1 files changed, 56 insertions, 35 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 | |||
@@ -8,2 +8,4 @@ | |||
8 | 8 | ||
9 | #include <qpe/config.h> | ||
10 | |||
9 | #include <opie/ofiledialog.h> | 11 | #include <opie/ofiledialog.h> |
@@ -111,2 +113,8 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
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 ) { |
@@ -166,14 +174,14 @@ void ViewMail::setMail( RecMail mail ) { | |||
166 | 174 | ||
167 | m_recMail = mail; | 175 | m_recMail = mail; |
168 | 176 | ||
169 | m_mail[0] = mail.getFrom(); | 177 | m_mail[0] = mail.getFrom(); |
170 | m_mail[1] = mail.getSubject(); | 178 | m_mail[1] = mail.getSubject(); |
171 | m_mail[3] = mail.getDate(); | 179 | m_mail[3] = mail.getDate(); |
172 | m_mail[4] = mail.Msgid(); | 180 | m_mail[4] = mail.Msgid(); |
173 | 181 | ||
174 | m_mail2[0] = mail.To(); | 182 | m_mail2[0] = mail.To(); |
175 | m_mail2[1] = mail.CC(); | 183 | m_mail2[1] = mail.CC(); |
176 | m_mail2[2] = mail.Bcc(); | 184 | m_mail2[2] = mail.Bcc(); |
177 | 185 | ||
178 | setText(); | 186 | setText(); |
179 | } | 187 | } |
@@ -188,5 +196,6 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | |||
188 | 196 | ||
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 | ||
@@ -195,2 +204,3 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | |||
195 | 204 | ||
205 | readConfig(); | ||
196 | 206 | ||
@@ -198,2 +208,9 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | |||
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() |
@@ -201,31 +218,35 @@ void ViewMail::setText() | |||
201 | 218 | ||
202 | QString toString; | 219 | QString toString; |
203 | QString ccString; | 220 | QString ccString; |
204 | QString bccString; | 221 | QString bccString; |
205 | 222 | ||
206 | for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) { | 223 | for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) { |
207 | toString += (*it); | 224 | toString += (*it); |
208 | } | 225 | } |
209 | for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) { | 226 | for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) { |
210 | ccString += (*it); | 227 | ccString += (*it); |
211 | } | 228 | } |
212 | for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) { | 229 | for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) { |
213 | bccString += (*it); | 230 | bccString += (*it); |
214 | } | 231 | } |
215 | 232 | ||
216 | setCaption( caption().arg( m_mail[0] ) ); | 233 | setCaption( caption().arg( m_mail[0] ) ); |
217 | 234 | ||
218 | m_mailHtml = "<html><body>" | 235 | m_mailHtml = "<html><body>" |
219 | "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" | 236 | "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" |
220 | "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" | 237 | "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" |
221 | "</td></tr><tr bgcolor=\"#EEEEE6\"><td>" | 238 | "</td></tr><tr bgcolor=\"#EEEEE6\"><td>" |
222 | "<b>" + tr( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>" | 239 | "<b>" + tr( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>" |
223 | "<b>" + tr( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" + | 240 | "<b>" + tr( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" + |
224 | tr( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>" | 241 | tr( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>" |
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>" ); |
229 | // remove later in favor of a real handling | 247 | } else { |
230 | m_gotBody = true; | 248 | browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" ); |
249 | } | ||
250 | // remove later in favor of a real handling | ||
251 | m_gotBody = true; | ||
231 | } | 252 | } |