summaryrefslogtreecommitdiffabout
path: root/kmicromail/composemail.cpp
authorzautrix <zautrix>2004-07-03 19:26:15 (UTC)
committer zautrix <zautrix>2004-07-03 19:26:15 (UTC)
commitcc67ce39cdd7730caee878da3b191d76cad9479f (patch) (unidiff)
treea19e8297fdf060845e1a81b58afe5272a58c3b61 /kmicromail/composemail.cpp
parent55413f404aa7a59bfbf38f9f91fabb595eca57ad (diff)
downloadkdepimpi-cc67ce39cdd7730caee878da3b191d76cad9479f.zip
kdepimpi-cc67ce39cdd7730caee878da3b191d76cad9479f.tar.gz
kdepimpi-cc67ce39cdd7730caee878da3b191d76cad9479f.tar.bz2
better error handling
Diffstat (limited to 'kmicromail/composemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/composemail.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index 2c2e279..ca4f247 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -121,7 +121,7 @@ void ComposeMail::saveAsDraft()
121 121
122 AttachViewItem *it = (AttachViewItem *) attList->firstChild(); 122 AttachViewItem *it = (AttachViewItem *) attList->firstChild();
123 /* attachments we will ignore! */ 123 /* attachments we will ignore! */
124 if ( it != NULL ) { 124 if ( it != 0 ) {
125 if ( warnAttach ) 125 if ( warnAttach )
126 QMessageBox::warning(0,tr("Store message"), 126 QMessageBox::warning(0,tr("Store message"),
127 tr("<center>Attachments will not be stored in \"Draft\" folder</center>")); 127 tr("<center>Attachments will not be stored in \"Draft\" folder</center>"));
@@ -136,7 +136,7 @@ void ComposeMail::clearStatus()
136void ComposeMail::setStatus( QString status ) 136void ComposeMail::setStatus( QString status )
137{ 137{
138 topLevelWidget()->setCaption( status ); 138 topLevelWidget()->setCaption( status );
139 QTimer::singleShot ( 5000, this, SLOT( clearStatus() ) ) ; 139 QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ;
140} 140}
141void ComposeMail::pickAddress( QLineEdit *line ) 141void ComposeMail::pickAddress( QLineEdit *line )
142{ 142{
@@ -300,13 +300,19 @@ void ComposeMail::accept()
300 } 300 }
301 mail->setMessage( txt ); 301 mail->setMessage( txt );
302 AttachViewItem *it = (AttachViewItem *) attList->firstChild(); 302 AttachViewItem *it = (AttachViewItem *) attList->firstChild();
303 while ( it != NULL ) { 303 while ( it != 0 ) {
304 mail->addAttachment( it->getAttachment() ); 304 mail->addAttachment( it->getAttachment() );
305 it = (AttachViewItem *) it->nextSibling(); 305 it = (AttachViewItem *) it->nextSibling();
306 } 306 }
307 307
308 SMTPwrapper wrapper( smtp ); 308 SMTPwrapper wrapper( smtp );
309 wrapper.sendMail( mail,checkBoxLater->isChecked() ); 309 if ( wrapper.sendMail( mail,checkBoxLater->isChecked() ) )
310 setStatus( tr ("Mail sent"));
311 else {
312 setStatus( tr ("Error: Something went wrong. Nothing sent"));
313 return;
314 }
315
310 316
311 QDialog::accept(); 317 QDialog::accept();
312} 318}