author | alwin <alwin> | 2003-12-24 02:56:27 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-24 02:56:27 (UTC) |
commit | ff20f6d33cffd84222029df9f118a9e5db5ec3e5 (patch) (unidiff) | |
tree | 5617a3d099c2ced644a05cbd94956ba851f68f95 | |
parent | fa581423c0ffcf35cbc403645e2131e84342dae4 (diff) | |
download | opie-ff20f6d33cffd84222029df9f118a9e5db5ec3e5.zip opie-ff20f6d33cffd84222029df9f118a9e5db5ec3e5.tar.gz opie-ff20f6d33cffd84222029df9f118a9e5db5ec3e5.tar.bz2 |
setup interface for qcop signal "newMail()"
TODO: setup composer to get a recipient address for calling from addressbook!
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 24 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.h | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 9257866..833cac2 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -1,11 +1,14 @@ | |||
1 | #include <qmessagebox.h> | 1 | #include <qmessagebox.h> |
2 | #include "opiemail.h" | 2 | #include "opiemail.h" |
3 | #include "editaccounts.h" | 3 | #include "editaccounts.h" |
4 | #include "composemail.h" | 4 | #include "composemail.h" |
5 | #include "smtpwrapper.h" | 5 | #include "smtpwrapper.h" |
6 | #include <qpe/qcopenvelope_qws.h> | ||
7 | #include <qaction.h> | ||
8 | #include <qapplication.h> | ||
6 | 9 | ||
7 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) | 10 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) |
8 | : MainWindow( parent, name, flags ) | 11 | : MainWindow( parent, name, flags ) |
9 | { | 12 | { |
10 | settings = new Settings(); | 13 | settings = new Settings(); |
11 | 14 | ||
@@ -13,12 +16,33 @@ OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) | |||
13 | 16 | ||
14 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 17 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
15 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 18 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
16 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 19 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
17 | connect( editSettings, SIGNAL( activated() ), SLOT( slotEditSettings() ) ); | 20 | connect( editSettings, SIGNAL( activated() ), SLOT( slotEditSettings() ) ); |
18 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 21 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
22 | // Added by Stefan Eilers to allow starting by addressbook.. | ||
23 | // copied from old mail2 | ||
24 | #if !defined(QT_NO_COP) | ||
25 | connect( qApp, SIGNAL( appMessage( const QCString&, const QByteArray& ) ), | ||
26 | this, SLOT( appMessage( const QCString&, const QByteArray& ) ) ); | ||
27 | #endif | ||
28 | } | ||
29 | |||
30 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | ||
31 | { | ||
32 | // copied from old mail2 | ||
33 | // TODO: compose mail should get parameters of a recipient for starting | ||
34 | // from addressbook. (qcop signal "writeMail(string,string)") | ||
35 | if (msg == "writeMail(QString,QString)") { | ||
36 | QDataStream stream(data,IO_ReadOnly); | ||
37 | QString name, email; | ||
38 | stream >> name >> email; | ||
39 | slotComposeMail(); | ||
40 | } else if (msg == "newMail()") { | ||
41 | slotComposeMail(); | ||
42 | } | ||
19 | } | 43 | } |
20 | 44 | ||
21 | void OpieMail::slotComposeMail() | 45 | void OpieMail::slotComposeMail() |
22 | { | 46 | { |
23 | qDebug( "Compose Mail" ); | 47 | qDebug( "Compose Mail" ); |
24 | ComposeMail compose( settings, this, 0 , true ); | 48 | ComposeMail compose( settings, this, 0 , true ); |
diff --git a/noncore/net/mail/opiemail.h b/noncore/net/mail/opiemail.h index ba60297..3cf5972 100644 --- a/noncore/net/mail/opiemail.h +++ b/noncore/net/mail/opiemail.h | |||
@@ -11,12 +11,13 @@ class OpieMail : public MainWindow | |||
11 | public: | 11 | public: |
12 | OpieMail( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); | 12 | OpieMail( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); |
13 | static QString appName() { return QString::fromLatin1("opiemail"); } | 13 | static QString appName() { return QString::fromLatin1("opiemail"); } |
14 | 14 | ||
15 | public slots: | 15 | public slots: |
16 | void slotComposeMail(); | 16 | void slotComposeMail(); |
17 | void appMessage(const QCString &msg, const QByteArray &data); | ||
17 | protected slots: | 18 | protected slots: |
18 | void slotSendQueued(); | 19 | void slotSendQueued(); |
19 | void slotSearchMails(); | 20 | void slotSearchMails(); |
20 | void slotEditSettings(); | 21 | void slotEditSettings(); |
21 | void slotEditAccounts(); | 22 | void slotEditAccounts(); |
22 | private: | 23 | private: |