-rw-r--r-- | kmicromail/opiemail.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 153c7c0..e088b9e 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -1,117 +1,120 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
3 | 3 | ||
4 | #include "koprefsdialog.h" | ||
5 | #include <libkdepim/externalapphandler.h> | ||
6 | #include <libkdepim/kpimglobalprefs.h> | ||
7 | #ifdef MINIKDE_KDIALOG_H | ||
8 | #undef MINIKDE_KDIALOG_H | ||
9 | #endif | ||
4 | #include "settingsdialog.h" | 10 | #include "settingsdialog.h" |
5 | #include "opiemail.h" | 11 | #include "opiemail.h" |
6 | #include "editaccounts.h" | 12 | #include "editaccounts.h" |
7 | #include "composemail.h" | 13 | #include "composemail.h" |
8 | #include "mailistviewitem.h" | 14 | #include "mailistviewitem.h" |
9 | #include "viewmail.h" | 15 | #include "viewmail.h" |
10 | #include "selectstore.h" | 16 | #include "selectstore.h" |
11 | #include "selectsmtp.h" | 17 | #include "selectsmtp.h" |
12 | #include "accountitem.h" | 18 | #include "accountitem.h" |
13 | #include "koprefsdialog.h" | ||
14 | #include "klocale.h" | 19 | #include "klocale.h" |
15 | 20 | ||
16 | #include <qmessagebox.h> | 21 | #include <qmessagebox.h> |
17 | #include <qtimer.h> | 22 | #include <qtimer.h> |
18 | #include <qcursor.h> | 23 | #include <qcursor.h> |
19 | #include <qregexp.h> | 24 | #include <qregexp.h> |
20 | #include <libkdepim/externalapphandler.h> | ||
21 | #include <libkdepim/kpimglobalprefs.h> | ||
22 | 25 | ||
23 | #ifdef DESKTOP_VERSION | 26 | #ifdef DESKTOP_VERSION |
24 | #include <qapplication.h> | 27 | #include <qapplication.h> |
25 | #else | 28 | #else |
26 | #include <qpe/qpeapplication.h> | 29 | #include <qpe/qpeapplication.h> |
27 | #endif | 30 | #endif |
28 | #include <libmailwrapper/smtpwrapper.h> | 31 | #include <libmailwrapper/smtpwrapper.h> |
29 | #include <libmailwrapper/mailtypes.h> | 32 | #include <libmailwrapper/mailtypes.h> |
30 | #include <libmailwrapper/abstractmail.h> | 33 | #include <libmailwrapper/abstractmail.h> |
31 | /* OPIE */ | 34 | /* OPIE */ |
32 | //#include <qpe/resource.h> | 35 | //#include <qpe/resource.h> |
33 | //#include <qpe/qpeapplication.h> | 36 | //#include <qpe/qpeapplication.h> |
34 | 37 | ||
35 | /* QT */ | 38 | /* QT */ |
36 | 39 | ||
37 | //using namespace Opie::Core; | 40 | //using namespace Opie::Core; |
38 | 41 | ||
39 | OpieMail::OpieMail( QWidget *parent, const char *name ) | 42 | OpieMail::OpieMail( QWidget *parent, const char *name ) |
40 | : MainWindow( parent, name) //, WStyle_ContextHelp ) | 43 | : MainWindow( parent, name) //, WStyle_ContextHelp ) |
41 | { | 44 | { |
42 | settings = new Settings(); | 45 | settings = new Settings(); |
43 | 46 | ||
44 | folderView->populate( settings->getAccounts() ); | 47 | folderView->populate( settings->getAccounts() ); |
45 | 48 | ||
46 | } | 49 | } |
47 | 50 | ||
48 | OpieMail::~OpieMail() | 51 | OpieMail::~OpieMail() |
49 | { | 52 | { |
50 | if (settings) delete settings; | 53 | if (settings) delete settings; |
51 | } | 54 | } |
52 | 55 | ||
53 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | 56 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) |
54 | { | 57 | { |
55 | 58 | ||
56 | } | 59 | } |
57 | #include <stdlib.h> | 60 | #include <stdlib.h> |
58 | void OpieMail::message(const QCString &msg, const QByteArray &data) | 61 | void OpieMail::message(const QCString &msg, const QByteArray &data) |
59 | { | 62 | { |
60 | // copied from old mail2 | 63 | // copied from old mail2 |
61 | static int ii = 0; | 64 | static int ii = 0; |
62 | //qDebug("QCOP CALL ############################# %d ", ii); | 65 | //qDebug("QCOP CALL ############################# %d ", ii); |
63 | //QString mess ( msg ); | 66 | //QString mess ( msg ); |
64 | //qDebug("Message = %s ",mess.latin1()); | 67 | //qDebug("Message = %s ",mess.latin1()); |
65 | ++ii; | 68 | ++ii; |
66 | //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); | 69 | //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); |
67 | 70 | ||
68 | mPendingEmail = QString::null; | 71 | mPendingEmail = QString::null; |
69 | mPendingName = QString::null; | 72 | mPendingName = QString::null; |
70 | if (msg == "writeMail(QString,QString)") | 73 | if (msg == "writeMail(QString,QString)") |
71 | { | 74 | { |
72 | //qDebug("writeMail(QString,QString) "); | 75 | //qDebug("writeMail(QString,QString) "); |
73 | QDataStream stream(data,IO_ReadOnly); | 76 | QDataStream stream(data,IO_ReadOnly); |
74 | stream >> mPendingName >> mPendingEmail; | 77 | stream >> mPendingName >> mPendingEmail; |
75 | // removing the whitespaces at beginning and end is needed! | 78 | // removing the whitespaces at beginning and end is needed! |
76 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 79 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
77 | } | 80 | } |
78 | else if (msg == "newMail()") | 81 | else if (msg == "newMail()") |
79 | { | 82 | { |
80 | //qDebug("slotComposeMail() "); | 83 | //qDebug("slotComposeMail() "); |
81 | // we cannot call slotComposeMail(); directly, because may be executing a QCOP call | 84 | // we cannot call slotComposeMail(); directly, because may be executing a QCOP call |
82 | // and a QCOP call does not like a processevents in his execution | 85 | // and a QCOP call does not like a processevents in his execution |
83 | // with the Qtimer we call slotComposeMail() after we reached the main event loop | 86 | // with the Qtimer we call slotComposeMail() after we reached the main event loop |
84 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 87 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
85 | // slotComposeMail(); | 88 | // slotComposeMail(); |
86 | } | 89 | } |
87 | else if (msg == "newMail(QString)") | 90 | else if (msg == "newMail(QString)") |
88 | { | 91 | { |
89 | //qDebug(" newMail(QString)"); | 92 | //qDebug(" newMail(QString)"); |
90 | QDataStream stream(data,IO_ReadOnly); | 93 | QDataStream stream(data,IO_ReadOnly); |
91 | stream >> mPendingName; | 94 | stream >> mPendingName; |
92 | // the format is | 95 | // the format is |
93 | // NAME <EMAIL>:SUBJECT | 96 | // NAME <EMAIL>:SUBJECT |
94 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 97 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
95 | } else { | 98 | } else { |
96 | mPendingData = data; | 99 | mPendingData = data; |
97 | mPendingMessage = msg; | 100 | mPendingMessage = msg; |
98 | QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); | 101 | QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); |
99 | } | 102 | } |
100 | 103 | ||
101 | //qDebug("END OpieMail::message "); | 104 | //qDebug("END OpieMail::message "); |
102 | } | 105 | } |
103 | void OpieMail::slotExtAppHandler() | 106 | void OpieMail::slotExtAppHandler() |
104 | { | 107 | { |
105 | ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData ); | 108 | ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData ); |
106 | } | 109 | } |
107 | void OpieMail::slotwriteMail2(const QString& namemail ) | 110 | void OpieMail::slotwriteMail2(const QString& namemail ) |
108 | { | 111 | { |
109 | //qDebug("OpieMail::slotwriteMail2 "); | 112 | //qDebug("OpieMail::slotwriteMail2 "); |
110 | //qApp->processEvents(); | 113 | //qApp->processEvents(); |
111 | ComposeMail compose( settings, this, 0, true ); | 114 | ComposeMail compose( settings, this, 0, true ); |
112 | if ( !namemail.isEmpty() ) { | 115 | if ( !namemail.isEmpty() ) { |
113 | QString to = namemail; | 116 | QString to = namemail; |
114 | if ( namemail.find( " <") > 1 ) { | 117 | if ( namemail.find( " <") > 1 ) { |
115 | to = "\"" +to.replace( QRegExp( " <"), "\" <") ; | 118 | to = "\"" +to.replace( QRegExp( " <"), "\" <") ; |
116 | } else | 119 | } else |
117 | if ( namemail.find( "<") > 1 ) { | 120 | if ( namemail.find( "<") > 1 ) { |