Diffstat (limited to 'noncore/net/mail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 2909893..e35f5b6 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -1,44 +1,44 @@ | |||
1 | #include <qmessagebox.h> | 1 | #include <qmessagebox.h> |
2 | #include "settingsdialog.h" | ||
2 | #include "opiemail.h" | 3 | #include "opiemail.h" |
3 | #include "editaccounts.h" | 4 | #include "editaccounts.h" |
4 | #include "composemail.h" | 5 | #include "composemail.h" |
5 | #include "smtpwrapper.h" | 6 | #include "smtpwrapper.h" |
6 | #include <qpe/qcopenvelope_qws.h> | 7 | #include <qpe/qcopenvelope_qws.h> |
7 | #include <qaction.h> | 8 | #include <qaction.h> |
8 | #include <qapplication.h> | 9 | #include <qapplication.h> |
9 | 10 | ||
10 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) | 11 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) |
11 | : MainWindow( parent, name, flags ) | 12 | : MainWindow( parent, name, flags ) |
12 | { | 13 | { |
13 | settings = new Settings(); | 14 | settings = new Settings(); |
14 | 15 | ||
15 | folderView->populate( settings->getAccounts() ); | 16 | folderView->populate( settings->getAccounts() ); |
16 | 17 | ||
17 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 18 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
18 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 19 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
19 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 20 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
20 | connect( editSettings, SIGNAL( activated() ), SLOT( slotEditSettings() ) ); | ||
21 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 21 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
22 | // Added by Stefan Eilers to allow starting by addressbook.. | 22 | // Added by Stefan Eilers to allow starting by addressbook.. |
23 | // copied from old mail2 | 23 | // copied from old mail2 |
24 | #if !defined(QT_NO_COP) | 24 | #if !defined(QT_NO_COP) |
25 | connect( qApp, SIGNAL( appMessage( const QCString&, const QByteArray& ) ), | 25 | connect( qApp, SIGNAL( appMessage( const QCString&, const QByteArray& ) ), |
26 | this, SLOT( appMessage( const QCString&, const QByteArray& ) ) ); | 26 | this, SLOT( appMessage( const QCString&, const QByteArray& ) ) ); |
27 | #endif | 27 | #endif |
28 | } | 28 | } |
29 | 29 | ||
30 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | 30 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) |
31 | { | 31 | { |
32 | // copied from old mail2 | 32 | // copied from old mail2 |
33 | if (msg == "writeMail(QString,QString)") { | 33 | if (msg == "writeMail(QString,QString)") { |
34 | QDataStream stream(data,IO_ReadOnly); | 34 | QDataStream stream(data,IO_ReadOnly); |
35 | QString name, email; | 35 | QString name, email; |
36 | stream >> name >> email; | 36 | stream >> name >> email; |
37 | // removing the whitespaces at beginning and end is needed! | 37 | // removing the whitespaces at beginning and end is needed! |
38 | slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace()); | 38 | slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace()); |
39 | } else if (msg == "newMail()") { | 39 | } else if (msg == "newMail()") { |
40 | slotComposeMail(); | 40 | slotComposeMail(); |
41 | } | 41 | } |
42 | } | 42 | } |
43 | 43 | ||
44 | void OpieMail::slotwriteMail(const QString&name,const QString&email) | 44 | void OpieMail::slotwriteMail(const QString&name,const QString&email) |
@@ -71,40 +71,42 @@ void OpieMail::slotSendQueued() | |||
71 | Account *it; | 71 | Account *it; |
72 | // if (list.count()==1) { | 72 | // if (list.count()==1) { |
73 | for ( it = list.first(); it; it = list.next() ) { | 73 | for ( it = list.first(); it; it = list.next() ) { |
74 | if ( it->getType().compare( "SMTP" ) == 0 ) { | 74 | if ( it->getType().compare( "SMTP" ) == 0 ) { |
75 | smtp = static_cast<SMTPaccount *>(it); | 75 | smtp = static_cast<SMTPaccount *>(it); |
76 | break; | 76 | break; |
77 | } | 77 | } |
78 | } | 78 | } |
79 | // } | 79 | // } |
80 | if (smtp) { | 80 | if (smtp) { |
81 | SMTPwrapper * wrap = new SMTPwrapper(settings); | 81 | SMTPwrapper * wrap = new SMTPwrapper(settings); |
82 | if ( wrap->flushOutbox(smtp) ) { | 82 | if ( wrap->flushOutbox(smtp) ) { |
83 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); | 83 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); |
84 | } | 84 | } |
85 | } | 85 | } |
86 | } | 86 | } |
87 | 87 | ||
88 | void OpieMail::slotSearchMails() | 88 | void OpieMail::slotSearchMails() |
89 | { | 89 | { |
90 | qDebug( "Search Mails" ); | 90 | qDebug( "Search Mails" ); |
91 | } | 91 | } |
92 | 92 | ||
93 | void OpieMail::slotEditSettings() | 93 | void OpieMail::slotEditSettings() |
94 | { | 94 | { |
95 | qDebug( "Edit Settings" ); | 95 | SettingsDialog settingsDialog( this, 0, true ); |
96 | settingsDialog.showMaximized(); | ||
97 | settingsDialog.exec(); | ||
96 | } | 98 | } |
97 | 99 | ||
98 | void OpieMail::slotEditAccounts() | 100 | void OpieMail::slotEditAccounts() |
99 | { | 101 | { |
100 | qDebug( "Edit Accounts" ); | 102 | qDebug( "Edit Accounts" ); |
101 | EditAccounts eaDialog( settings, this, 0, true ); | 103 | EditAccounts eaDialog( settings, this, 0, true ); |
102 | eaDialog.showMaximized(); | 104 | eaDialog.showMaximized(); |
103 | eaDialog.slotAdjustColumns(); | 105 | eaDialog.slotAdjustColumns(); |
104 | eaDialog.exec(); | 106 | eaDialog.exec(); |
105 | if ( settings ) delete settings; | 107 | if ( settings ) delete settings; |
106 | settings = new Settings(); | 108 | settings = new Settings(); |
107 | 109 | ||
108 | folderView->populate( settings->getAccounts() ); | 110 | folderView->populate( settings->getAccounts() ); |
109 | } | 111 | } |
110 | 112 | ||