author | zautrix <zautrix> | 2004-07-04 17:18:13 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-07-04 17:18:13 (UTC) |
commit | 25671b4735f2604e13f4d6801b96f016ac8b9834 (patch) (unidiff) | |
tree | 8fb194ccfbec635f1ada9db16b76e81f72387216 /kmicromail/viewmail.cpp | |
parent | 48bea7694899530fdfdbc0a2fefab6d3e64be1e1 (diff) | |
download | kdepimpi-25671b4735f2604e13f4d6801b96f016ac8b9834.zip kdepimpi-25671b4735f2604e13f4d6801b96f016ac8b9834.tar.gz kdepimpi-25671b4735f2604e13f4d6801b96f016ac8b9834.tar.bz2 |
Usebility enhancement:Removed trash from toolbar, added exit button
-rw-r--r-- | kmicromail/viewmail.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp index b434318..703711d 100644 --- a/kmicromail/viewmail.cpp +++ b/kmicromail/viewmail.cpp | |||
@@ -268,97 +268,98 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
268 | } | 268 | } |
269 | break; | 269 | break; |
270 | case 1: | 270 | case 1: |
271 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) | 271 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) |
272 | { | 272 | { |
273 | setText(); | 273 | setText(); |
274 | } | 274 | } |
275 | else | 275 | else |
276 | { | 276 | { |
277 | if ( m_recMail->Wrapper() != 0l ) | 277 | if ( m_recMail->Wrapper() != 0l ) |
278 | { // make sure that there is a wrapper , even after delete or simular actions | 278 | { // make sure that there is a wrapper , even after delete or simular actions |
279 | browser->setText( m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) ); | 279 | browser->setText( m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) ); |
280 | } | 280 | } |
281 | } | 281 | } |
282 | break; | 282 | break; |
283 | } | 283 | } |
284 | delete menu; | 284 | delete menu; |
285 | } | 285 | } |
286 | 286 | ||
287 | 287 | ||
288 | void ViewMail::setMail(const RecMailP&mail ) | 288 | void ViewMail::setMail(const RecMailP&mail ) |
289 | { | 289 | { |
290 | 290 | ||
291 | m_recMail = mail; | 291 | m_recMail = mail; |
292 | 292 | ||
293 | m_mail[0] = mail->getFrom(); | 293 | m_mail[0] = mail->getFrom(); |
294 | m_mail[1] = mail->getSubject(); | 294 | m_mail[1] = mail->getSubject(); |
295 | m_mail[3] = mail->getDate(); | 295 | m_mail[3] = mail->getDate(); |
296 | m_mail[4] = mail->Msgid(); | 296 | m_mail[4] = mail->Msgid(); |
297 | 297 | ||
298 | m_mail2[0] = mail->To(); | 298 | m_mail2[0] = mail->To(); |
299 | m_mail2[1] = mail->CC(); | 299 | m_mail2[1] = mail->CC(); |
300 | m_mail2[2] = mail->Bcc(); | 300 | m_mail2[2] = mail->Bcc(); |
301 | 301 | ||
302 | setText(); | 302 | setText(); |
303 | } | 303 | } |
304 | 304 | ||
305 | 305 | ||
306 | 306 | ||
307 | ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | 307 | ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) |
308 | : ViewMailBase(parent, name, fl), _inLoop(false) | 308 | : ViewMailBase(parent, name, fl), _inLoop(false) |
309 | { | 309 | { |
310 | m_gotBody = false; | 310 | m_gotBody = false; |
311 | deleted = false; | 311 | deleted = false; |
312 | 312 | ||
313 | connect( reply, SIGNAL(activated()), SLOT(slotReply())); | 313 | connect( reply, SIGNAL(activated()), SLOT(slotReply())); |
314 | connect( forward, SIGNAL(activated()), SLOT(slotForward())); | 314 | connect( forward, SIGNAL(activated()), SLOT(slotForward())); |
315 | connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) ); | 315 | connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) ); |
316 | connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); | 316 | connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); |
317 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); | ||
317 | 318 | ||
318 | attachments->setEnabled(m_gotBody); | 319 | attachments->setEnabled(m_gotBody); |
319 | connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); | 320 | connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); |
320 | 321 | ||
321 | readConfig(); | 322 | readConfig(); |
322 | attachments->setSorting(-1); | 323 | attachments->setSorting(-1); |
323 | } | 324 | } |
324 | 325 | ||
325 | void ViewMail::readConfig() | 326 | void ViewMail::readConfig() |
326 | { | 327 | { |
327 | Config cfg( "mail" ); | 328 | Config cfg( "mail" ); |
328 | cfg.setGroup( "Settings" ); | 329 | cfg.setGroup( "Settings" ); |
329 | m_showHtml = cfg.readBoolEntry( "showHtml", false ); | 330 | m_showHtml = cfg.readBoolEntry( "showHtml", false ); |
330 | showHtml->setOn( m_showHtml ); | 331 | showHtml->setOn( m_showHtml ); |
331 | } | 332 | } |
332 | 333 | ||
333 | void ViewMail::setText() | 334 | void ViewMail::setText() |
334 | { | 335 | { |
335 | 336 | ||
336 | QString toString; | 337 | QString toString; |
337 | QString ccString; | 338 | QString ccString; |
338 | QString bccString; | 339 | QString bccString; |
339 | 340 | ||
340 | for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) | 341 | for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) |
341 | { | 342 | { |
342 | toString += (*it); | 343 | toString += (*it); |
343 | } | 344 | } |
344 | for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) | 345 | for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) |
345 | { | 346 | { |
346 | ccString += (*it); | 347 | ccString += (*it); |
347 | } | 348 | } |
348 | for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) | 349 | for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) |
349 | { | 350 | { |
350 | bccString += (*it); | 351 | bccString += (*it); |
351 | } | 352 | } |
352 | 353 | ||
353 | setCaption( tr("E-Mail by %1").arg( m_mail[0] ) ); | 354 | setCaption( tr("E-Mail by %1").arg( m_mail[0] ) ); |
354 | 355 | ||
355 | m_mailHtml = "<html><body>" | 356 | m_mailHtml = "<html><body>" |
356 | "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" | 357 | "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" |
357 | "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" | 358 | "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" |
358 | "</td></tr><tr bgcolor=\"#EEEEE6\"><td>" | 359 | "</td></tr><tr bgcolor=\"#EEEEE6\"><td>" |
359 | "<b>" + tr( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>" | 360 | "<b>" + tr( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>" |
360 | "<b>" + tr( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" + | 361 | "<b>" + tr( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" + |
361 | tr( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>" | 362 | tr( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>" |
362 | "<b>" + tr( "Date" ) + ": </b> " + m_mail[3] + | 363 | "<b>" + tr( "Date" ) + ": </b> " + m_mail[3] + |
363 | "</td></tr></table><font face=fixed>"; | 364 | "</td></tr></table><font face=fixed>"; |
364 | 365 | ||