summaryrefslogtreecommitdiff
path: root/noncore/net/mail/opiemail.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/opiemail.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/opiemail.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp
index e35f5b6..54453b7 100644
--- a/noncore/net/mail/opiemail.cpp
+++ b/noncore/net/mail/opiemail.cpp
@@ -1,75 +1,78 @@
1#include <qmessagebox.h> 1#include <qmessagebox.h>
2#include "settingsdialog.h" 2#include "settingsdialog.h"
3#include "opiemail.h" 3#include "opiemail.h"
4#include "editaccounts.h" 4#include "editaccounts.h"
5#include "composemail.h" 5#include "composemail.h"
6#include "smtpwrapper.h" 6#include "smtpwrapper.h"
7#include <qpe/qcopenvelope_qws.h> 7#include <qpe/qcopenvelope_qws.h>
8#include <qaction.h> 8#include <qaction.h>
9#include <qapplication.h> 9#include <qapplication.h>
10 10
11OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) 11OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags )
12 : MainWindow( parent, name, flags ) 12 : MainWindow( parent, name, flags )
13{ 13{
14 settings = new Settings(); 14 settings = new Settings();
15 15
16 folderView->populate( settings->getAccounts() ); 16 folderView->populate( settings->getAccounts() );
17 17
18 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); 18 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) );
19 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); 19 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
20// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); 20// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
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
29
30
28} 31}
29 32
30void OpieMail::appMessage(const QCString &msg, const QByteArray &data) 33void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
31{ 34{
32 // copied from old mail2 35 // copied from old mail2
33 if (msg == "writeMail(QString,QString)") { 36 if (msg == "writeMail(QString,QString)") {
34 QDataStream stream(data,IO_ReadOnly); 37 QDataStream stream(data,IO_ReadOnly);
35 QString name, email; 38 QString name, email;
36 stream >> name >> email; 39 stream >> name >> email;
37 // removing the whitespaces at beginning and end is needed! 40 // removing the whitespaces at beginning and end is needed!
38 slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace()); 41 slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace());
39 } else if (msg == "newMail()") { 42 } else if (msg == "newMail()") {
40 slotComposeMail(); 43 slotComposeMail();
41 } 44 }
42} 45}
43 46
44void OpieMail::slotwriteMail(const QString&name,const QString&email) 47void OpieMail::slotwriteMail(const QString&name,const QString&email)
45{ 48{
46 ComposeMail compose( settings, this, 0 , true ); 49 ComposeMail compose( settings, this, 0 , true );
47 if (!email.isEmpty()) { 50 if (!email.isEmpty()) {
48 if (!name.isEmpty()) { 51 if (!name.isEmpty()) {
49 compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); 52 compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">");
50 } else { 53 } else {
51 compose.setTo(email); 54 compose.setTo(email);
52 } 55 }
53 } 56 }
54 compose.showMaximized(); 57 compose.showMaximized();
55 compose.slotAdjustColumns(); 58 compose.slotAdjustColumns();
56 compose.exec(); 59 compose.exec();
57} 60}
58 61
59void OpieMail::slotComposeMail() 62void OpieMail::slotComposeMail()
60{ 63{
61 qDebug( "Compose Mail" ); 64 qDebug( "Compose Mail" );
62 slotwriteMail(0l,0l); 65 slotwriteMail(0l,0l);
63} 66}
64 67
65void OpieMail::slotSendQueued() 68void OpieMail::slotSendQueued()
66{ 69{
67 qDebug( "Send Queued" ); 70 qDebug( "Send Queued" );
68 SMTPaccount *smtp = 0; 71 SMTPaccount *smtp = 0;
69 72
70 QList<Account> list = settings->getAccounts(); 73 QList<Account> list = settings->getAccounts();
71 Account *it; 74 Account *it;
72// if (list.count()==1) { 75// if (list.count()==1) {
73 for ( it = list.first(); it; it = list.next() ) { 76 for ( it = list.first(); it; it = list.next() ) {
74 if ( it->getType().compare( "SMTP" ) == 0 ) { 77 if ( it->getType().compare( "SMTP" ) == 0 ) {
75 smtp = static_cast<SMTPaccount *>(it); 78 smtp = static_cast<SMTPaccount *>(it);