From fa581423c0ffcf35cbc403645e2131e84342dae4 Mon Sep 17 00:00:00 2001 From: alwin Date: Wed, 24 Dec 2003 02:00:34 +0000 Subject: ah, ok. I found the trick or better I found what I forgot :) Means: When sending mail a progress dialog comes up. --- diff --git a/noncore/net/mail/libmailwrapper/sendmailprogress.cpp b/noncore/net/mail/libmailwrapper/sendmailprogress.cpp index 13ddd37..ef22750 100644 --- a/noncore/net/mail/libmailwrapper/sendmailprogress.cpp +++ b/noncore/net/mail/libmailwrapper/sendmailprogress.cpp @@ -4,7 +4,7 @@ #include progressMailSend::progressMailSend(QWidget*parent, const char * name) - :progressMailSendUI(parent,name,false),m_current_mail(0),m_current_single(0),m_max_mail(0),m_max_single(0) + :progressMailSendUI(parent,name,true),m_current_mail(0),m_current_single(0),m_max_mail(0),m_max_single(0) { } @@ -43,6 +43,6 @@ void progressMailSend::setSingle() void progressMailSend::setMails() { - QString text = QString(tr("Sending mail %1 of %2")).arg(m_current_single+1).arg(m_max_single); + QString text = QString(tr("Sending mail %1 of %2")).arg(m_current_mail+1).arg(m_max_mail); allMailLabel->setText(text); } diff --git a/noncore/net/mail/libmailwrapper/sendmailprogressui.ui b/noncore/net/mail/libmailwrapper/sendmailprogressui.ui index b90b088..287ab5e 100644 --- a/noncore/net/mail/libmailwrapper/sendmailprogressui.ui +++ b/noncore/net/mail/libmailwrapper/sendmailprogressui.ui @@ -11,8 +11,8 @@ 0 0 - 316 - 266 + 221 + 127 diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp index 53c0af5..770e2b8 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp @@ -525,7 +525,7 @@ void SMTPwrapper::progress( size_t current, size_t maximum ) { if (SMTPwrapper::sendProgress) { SMTPwrapper::sendProgress->setSingleMail(current, maximum ); - qDebug("%u of %u",current,maximum); + qApp->processEvents(); } } @@ -652,9 +652,9 @@ void SMTPwrapper::sendMail(const Mail&mail,bool later ) qDebug( "sendMail: error creating mime mail" ); } else { sendProgress = new progressMailSend(); - sendProgress->showMaximized(); +// sendProgress->showMaximized(); sendProgress->show(); - qApp->processEvents(10); + sendProgress->setMaxMails(1); smtpSend( mimeMail,later,smtp); mailmime_free( mimeMail ); qDebug("Clean up done"); @@ -713,6 +713,11 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) return; } mailsToSend.setAutoDelete(false); + sendProgress = new progressMailSend(); +// sendProgress->showMaximized(); + sendProgress->show(); + sendProgress->setMaxMails(mailsToSend.count()); + while (mailsToSend.count()>0) { if (sendQueuedMail(wrap,smtp,mailsToSend.at(0))==0) { QMessageBox::critical(0,tr("Error sending mail"), @@ -721,7 +726,11 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) } mailsToRemove.append(mailsToSend.at(0)); mailsToSend.removeFirst(); + sendProgress->setCurrentMails(mailsToRemove.count()); } + sendProgress->hide(); + delete sendProgress; + sendProgress = 0; wrap->deleteMails(mbox,mailsToRemove); mailsToSend.setAutoDelete(true); delete wrap; diff --git a/noncore/net/mail/sendmailprogress.cpp b/noncore/net/mail/sendmailprogress.cpp index 13ddd37..ef22750 100644 --- a/noncore/net/mail/sendmailprogress.cpp +++ b/noncore/net/mail/sendmailprogress.cpp @@ -4,7 +4,7 @@ #include progressMailSend::progressMailSend(QWidget*parent, const char * name) - :progressMailSendUI(parent,name,false),m_current_mail(0),m_current_single(0),m_max_mail(0),m_max_single(0) + :progressMailSendUI(parent,name,true),m_current_mail(0),m_current_single(0),m_max_mail(0),m_max_single(0) { } @@ -43,6 +43,6 @@ void progressMailSend::setSingle() void progressMailSend::setMails() { - QString text = QString(tr("Sending mail %1 of %2")).arg(m_current_single+1).arg(m_max_single); + QString text = QString(tr("Sending mail %1 of %2")).arg(m_current_mail+1).arg(m_max_mail); allMailLabel->setText(text); } diff --git a/noncore/net/mail/sendmailprogressui.ui b/noncore/net/mail/sendmailprogressui.ui index b90b088..287ab5e 100644 --- a/noncore/net/mail/sendmailprogressui.ui +++ b/noncore/net/mail/sendmailprogressui.ui @@ -11,8 +11,8 @@ 0 0 - 316 - 266 + 221 + 127 diff --git a/noncore/net/mail/smtpwrapper.cpp b/noncore/net/mail/smtpwrapper.cpp index 53c0af5..770e2b8 100644 --- a/noncore/net/mail/smtpwrapper.cpp +++ b/noncore/net/mail/smtpwrapper.cpp @@ -525,7 +525,7 @@ void SMTPwrapper::progress( size_t current, size_t maximum ) { if (SMTPwrapper::sendProgress) { SMTPwrapper::sendProgress->setSingleMail(current, maximum ); - qDebug("%u of %u",current,maximum); + qApp->processEvents(); } } @@ -652,9 +652,9 @@ void SMTPwrapper::sendMail(const Mail&mail,bool later ) qDebug( "sendMail: error creating mime mail" ); } else { sendProgress = new progressMailSend(); - sendProgress->showMaximized(); +// sendProgress->showMaximized(); sendProgress->show(); - qApp->processEvents(10); + sendProgress->setMaxMails(1); smtpSend( mimeMail,later,smtp); mailmime_free( mimeMail ); qDebug("Clean up done"); @@ -713,6 +713,11 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) return; } mailsToSend.setAutoDelete(false); + sendProgress = new progressMailSend(); +// sendProgress->showMaximized(); + sendProgress->show(); + sendProgress->setMaxMails(mailsToSend.count()); + while (mailsToSend.count()>0) { if (sendQueuedMail(wrap,smtp,mailsToSend.at(0))==0) { QMessageBox::critical(0,tr("Error sending mail"), @@ -721,7 +726,11 @@ void SMTPwrapper::flushOutbox(SMTPaccount*smtp) } mailsToRemove.append(mailsToSend.at(0)); mailsToSend.removeFirst(); + sendProgress->setCurrentMails(mailsToRemove.count()); } + sendProgress->hide(); + delete sendProgress; + sendProgress = 0; wrap->deleteMails(mbox,mailsToRemove); mailsToSend.setAutoDelete(true); delete wrap; -- cgit v0.9.0.2