author | alwin <alwin> | 2004-01-12 15:47:40 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-01-12 15:47:40 (UTC) |
commit | 334a1b57629211cdd77af4ea6857bfc41ab0cefb (patch) (side-by-side diff) | |
tree | d9a7daf0e05efad79d05bf4dbffa19953ddbae17 /noncore/net/mail/opiemail.cpp | |
parent | 713a845a0d2ad3aba8230a5ba743a1c7b1622ef1 (diff) | |
download | opie-334a1b57629211cdd77af4ea6857bfc41ab0cefb.zip opie-334a1b57629211cdd77af4ea6857bfc41ab0cefb.tar.gz opie-334a1b57629211cdd77af4ea6857bfc41ab0cefb.tar.bz2 |
when flush sendmail queue the user will be asked for selecting an
smtp account to use when there are more than one smtp-accounts
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index d3d3cdb..ea0019d 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp @@ -10,12 +10,13 @@ #include <qapplication.h> #include <libmailwrapper/mailtypes.h> #include <libmailwrapper/abstractmail.h> #include "mailistviewitem.h" #include "viewmail.h" #include "selectstore.h" +#include "selectsmtp.h" OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) : MainWindow( parent, name, WStyle_ContextHelp ) { settings = new Settings(); @@ -65,21 +66,36 @@ void OpieMail::slotComposeMail() void OpieMail::slotSendQueued() { qDebug( "Send Queued" ); SMTPaccount *smtp = 0; QList<Account> list = settings->getAccounts(); + QList<SMTPaccount> smtpList; + smtpList.setAutoDelete(false); Account *it; -// if (list.count()==1) { for ( it = list.first(); it; it = list.next() ) { if ( it->getType().compare( "SMTP" ) == 0 ) { smtp = static_cast<SMTPaccount *>(it); - break; + smtpList.append(smtp); + } + } + if (smtpList.count()==0) { + QMessageBox::information(0,tr("Info"),tr("Define a smtp account first")); + return; + } + if (smtpList.count()==1) { + smtp = smtpList.at(0); + } else { + smtp = 0; + selectsmtp selsmtp; + selsmtp.setSelectionlist(&smtpList); + selsmtp.showMaximized(); + if (selsmtp.exec()==QDialog::Accepted) { + smtp = selsmtp.selected_smtp(); } } -// } if (smtp) { SMTPwrapper * wrap = new SMTPwrapper(settings); if ( wrap->flushOutbox(smtp) ) { QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); } } |