summaryrefslogtreecommitdiff
path: root/noncore/net/mail/opiemail.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/opiemail.cpp30
1 files changed, 23 insertions, 7 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
@@ -4,24 +4,25 @@
4#include "editaccounts.h" 4#include "editaccounts.h"
5#include "composemail.h" 5#include "composemail.h"
6#include <libmailwrapper/smtpwrapper.h> 6#include <libmailwrapper/smtpwrapper.h>
7#include <qpe/qcopenvelope_qws.h> 7#include <qpe/qcopenvelope_qws.h>
8#include <qpe/resource.h> 8#include <qpe/resource.h>
9#include <qaction.h> 9#include <qaction.h>
10#include <qapplication.h> 10#include <qapplication.h>
11#include <libmailwrapper/mailtypes.h> 11#include <libmailwrapper/mailtypes.h>
12#include <libmailwrapper/abstractmail.h> 12#include <libmailwrapper/abstractmail.h>
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
17OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) 18OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags )
18 : MainWindow( parent, name, WStyle_ContextHelp ) 19 : MainWindow( parent, name, WStyle_ContextHelp )
19{ 20{
20 settings = new Settings(); 21 settings = new Settings();
21 22
22 folderView->populate( settings->getAccounts() ); 23 folderView->populate( settings->getAccounts() );
23} 24}
24 25
25OpieMail::~OpieMail() 26OpieMail::~OpieMail()
26{ 27{
27 if (settings) delete settings; 28 if (settings) delete settings;
@@ -59,33 +60,48 @@ void OpieMail::slotwriteMail(const QString&name,const QString&email)
59void OpieMail::slotComposeMail() 60void OpieMail::slotComposeMail()
60{ 61{
61 qDebug( "Compose Mail" ); 62 qDebug( "Compose Mail" );
62 slotwriteMail(0l,0l); 63 slotwriteMail(0l,0l);
63} 64}
64 65
65void OpieMail::slotSendQueued() 66void OpieMail::slotSendQueued()
66{ 67{
67 qDebug( "Send Queued" ); 68 qDebug( "Send Queued" );
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) { 75 for ( it = list.first(); it; it = list.next() ) {
73 for ( it = list.first(); it; it = list.next() ) { 76 if ( it->getType().compare( "SMTP" ) == 0 ) {
74 if ( it->getType().compare( "SMTP" ) == 0 ) { 77 smtp = static_cast<SMTPaccount *>(it);
75 smtp = static_cast<SMTPaccount *>(it); 78 smtpList.append(smtp);
76 break;
77 }
78 } 79 }
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();
94 }
95 }
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) ) {
83 QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); 99 QMessageBox::information(0,tr("Info"),tr("Mail queue flushed"));
84 } 100 }
85 } 101 }
86} 102}
87 103
88void OpieMail::slotSearchMails() 104void OpieMail::slotSearchMails()
89{ 105{
90 qDebug( "Search Mails" ); 106 qDebug( "Search Mails" );
91} 107}