summaryrefslogtreecommitdiff
path: root/noncore/net/mail
Side-by-side diff
Diffstat (limited to 'noncore/net/mail') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/opiemail.cpp24
-rw-r--r--noncore/net/mail/opiemail.h1
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
@@ -3,6 +3,9 @@
#include "editaccounts.h"
#include "composemail.h"
#include "smtpwrapper.h"
+#include <qpe/qcopenvelope_qws.h>
+#include <qaction.h>
+#include <qapplication.h>
OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags )
: MainWindow( parent, name, flags )
@@ -16,6 +19,27 @@ OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags )
// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
connect( editSettings, SIGNAL( activated() ), SLOT( slotEditSettings() ) );
connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) );
+ // Added by Stefan Eilers to allow starting by addressbook..
+ // copied from old mail2
+#if !defined(QT_NO_COP)
+ connect( qApp, SIGNAL( appMessage( const QCString&, const QByteArray& ) ),
+ this, SLOT( appMessage( const QCString&, const QByteArray& ) ) );
+#endif
+}
+
+void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
+{
+ // copied from old mail2
+ // TODO: compose mail should get parameters of a recipient for starting
+ // from addressbook. (qcop signal "writeMail(string,string)")
+ if (msg == "writeMail(QString,QString)") {
+ QDataStream stream(data,IO_ReadOnly);
+ QString name, email;
+ stream >> name >> email;
+ slotComposeMail();
+ } else if (msg == "newMail()") {
+ slotComposeMail();
+ }
}
void OpieMail::slotComposeMail()
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
@@ -14,6 +14,7 @@ public:
public slots:
void slotComposeMail();
+ void appMessage(const QCString &msg, const QByteArray &data);
protected slots:
void slotSendQueued();
void slotSearchMails();