author | alwin <alwin> | 2004-01-12 15:47:40 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-01-12 15:47:40 (UTC) |
commit | 334a1b57629211cdd77af4ea6857bfc41ab0cefb (patch) (unidiff) | |
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 | |||
@@ -13,6 +13,7 @@ | |||
13 | #include "mailistviewitem.h" | 13 | #include "mailistviewitem.h" |
14 | #include "viewmail.h" | 14 | #include "viewmail.h" |
15 | #include "selectstore.h" | 15 | #include "selectstore.h" |
16 | #include "selectsmtp.h" | ||
16 | 17 | ||
17 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) | 18 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) |
18 | : MainWindow( parent, name, WStyle_ContextHelp ) | 19 | : MainWindow( parent, name, WStyle_ContextHelp ) |
@@ -68,15 +69,30 @@ void OpieMail::slotSendQueued() | |||
68 | SMTPaccount *smtp = 0; | 69 | SMTPaccount *smtp = 0; |
69 | 70 | ||
70 | QList<Account> list = settings->getAccounts(); | 71 | QList<Account> list = settings->getAccounts(); |
72 | QList<SMTPaccount> smtpList; | ||
73 | smtpList.setAutoDelete(false); | ||
71 | Account *it; | 74 | Account *it; |
72 | // if (list.count()==1) { | ||
73 | for ( it = list.first(); it; it = list.next() ) { | 75 | for ( it = list.first(); it; it = list.next() ) { |
74 | if ( it->getType().compare( "SMTP" ) == 0 ) { | 76 | if ( it->getType().compare( "SMTP" ) == 0 ) { |
75 | smtp = static_cast<SMTPaccount *>(it); | 77 | smtp = static_cast<SMTPaccount *>(it); |
76 | break; | 78 | smtpList.append(smtp); |
79 | } | ||
80 | } | ||
81 | if (smtpList.count()==0) { | ||
82 | QMessageBox::information(0,tr("Info"),tr("Define a smtp account first")); | ||
83 | return; | ||
84 | } | ||
85 | if (smtpList.count()==1) { | ||
86 | smtp = smtpList.at(0); | ||
87 | } else { | ||
88 | smtp = 0; | ||
89 | selectsmtp selsmtp; | ||
90 | selsmtp.setSelectionlist(&smtpList); | ||
91 | selsmtp.showMaximized(); | ||
92 | if (selsmtp.exec()==QDialog::Accepted) { | ||
93 | smtp = selsmtp.selected_smtp(); | ||
77 | } | 94 | } |
78 | } | 95 | } |
79 | // } | ||
80 | if (smtp) { | 96 | if (smtp) { |
81 | SMTPwrapper * wrap = new SMTPwrapper(settings); | 97 | SMTPwrapper * wrap = new SMTPwrapper(settings); |
82 | if ( wrap->flushOutbox(smtp) ) { | 98 | if ( wrap->flushOutbox(smtp) ) { |