Diffstat (limited to 'noncore/net/mail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 7ab4e0d..9257866 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -1,54 +1,73 @@ | |||
1 | #include <qmessagebox.h> | ||
1 | #include "opiemail.h" | 2 | #include "opiemail.h" |
2 | #include "editaccounts.h" | 3 | #include "editaccounts.h" |
3 | #include "composemail.h" | 4 | #include "composemail.h" |
5 | #include "smtpwrapper.h" | ||
4 | 6 | ||
5 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) | 7 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) |
6 | : MainWindow( parent, name, flags ) | 8 | : MainWindow( parent, name, flags ) |
7 | { | 9 | { |
8 | settings = new Settings(); | 10 | settings = new Settings(); |
9 | 11 | ||
10 | folderView->populate( settings->getAccounts() ); | 12 | folderView->populate( settings->getAccounts() ); |
11 | 13 | ||
12 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 14 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
13 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 15 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
14 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 16 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
15 | connect( editSettings, SIGNAL( activated() ), SLOT( slotEditSettings() ) ); | 17 | connect( editSettings, SIGNAL( activated() ), SLOT( slotEditSettings() ) ); |
16 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 18 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
17 | } | 19 | } |
18 | 20 | ||
19 | void OpieMail::slotComposeMail() | 21 | void OpieMail::slotComposeMail() |
20 | { | 22 | { |
21 | qDebug( "Compose Mail" ); | 23 | qDebug( "Compose Mail" ); |
22 | ComposeMail compose( settings, this, 0 , true ); | 24 | ComposeMail compose( settings, this, 0 , true ); |
23 | compose.showMaximized(); | 25 | compose.showMaximized(); |
24 | compose.slotAdjustColumns(); | 26 | compose.slotAdjustColumns(); |
25 | compose.exec(); | 27 | compose.exec(); |
26 | } | 28 | } |
27 | 29 | ||
28 | void OpieMail::slotSendQueued() | 30 | void OpieMail::slotSendQueued() |
29 | { | 31 | { |
30 | qDebug( "Send Queued" ); | 32 | qDebug( "Send Queued" ); |
33 | SMTPaccount *smtp = 0; | ||
34 | |||
35 | QList<Account> list = settings->getAccounts(); | ||
36 | Account *it; | ||
37 | // if (list.count()==1) { | ||
38 | for ( it = list.first(); it; it = list.next() ) { | ||
39 | if ( it->getType().compare( "SMTP" ) == 0 ) { | ||
40 | smtp = static_cast<SMTPaccount *>(it); | ||
41 | break; | ||
42 | } | ||
43 | } | ||
44 | // } | ||
45 | if (smtp) { | ||
46 | SMTPwrapper * wrap = new SMTPwrapper(settings); | ||
47 | wrap->flushOutbox(smtp); | ||
48 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); | ||
49 | } | ||
31 | } | 50 | } |
32 | 51 | ||
33 | void OpieMail::slotSearchMails() | 52 | void OpieMail::slotSearchMails() |
34 | { | 53 | { |
35 | qDebug( "Search Mails" ); | 54 | qDebug( "Search Mails" ); |
36 | } | 55 | } |
37 | 56 | ||
38 | void OpieMail::slotEditSettings() | 57 | void OpieMail::slotEditSettings() |
39 | { | 58 | { |
40 | qDebug( "Edit Settings" ); | 59 | qDebug( "Edit Settings" ); |
41 | } | 60 | } |
42 | 61 | ||
43 | void OpieMail::slotEditAccounts() | 62 | void OpieMail::slotEditAccounts() |
44 | { | 63 | { |
45 | qDebug( "Edit Accounts" ); | 64 | qDebug( "Edit Accounts" ); |
46 | EditAccounts eaDialog( settings, this, 0, true ); | 65 | EditAccounts eaDialog( settings, this, 0, true ); |
47 | eaDialog.showMaximized(); | 66 | eaDialog.showMaximized(); |
48 | eaDialog.slotAdjustColumns(); | 67 | eaDialog.slotAdjustColumns(); |
49 | eaDialog.exec(); | 68 | eaDialog.exec(); |
50 | if ( settings ) delete settings; | 69 | if ( settings ) delete settings; |
51 | settings = new Settings(); | 70 | settings = new Settings(); |
52 | 71 | ||
53 | folderView->populate( settings->getAccounts() ); | 72 | folderView->populate( settings->getAccounts() ); |
54 | } | 73 | } |