-rw-r--r-- | kmicromail/composemail.cpp | 14 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 33 | ||||
-rw-r--r-- | kmicromail/opiemail.h | 5 |
3 files changed, 48 insertions, 4 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index ed8a2ee..3231b45 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp | |||
@@ -34,50 +34,51 @@ | |||
34 | //#include <qpe/resource.h> | 34 | //#include <qpe/resource.h> |
35 | #include <qpe/global.h> | 35 | #include <qpe/global.h> |
36 | //#include <qpe/contact.h> | 36 | //#include <qpe/contact.h> |
37 | 37 | ||
38 | 38 | ||
39 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
40 | #include <qcheckbox.h> | 40 | #include <qcheckbox.h> |
41 | #include <qiconset.h> | 41 | #include <qiconset.h> |
42 | #include <qtimer.h> | 42 | #include <qtimer.h> |
43 | #include <qmessagebox.h> | 43 | #include <qmessagebox.h> |
44 | #include <qpushbutton.h> | 44 | #include <qpushbutton.h> |
45 | #include <qmultilineedit.h> | 45 | #include <qmultilineedit.h> |
46 | #include <qlabel.h> | 46 | #include <qlabel.h> |
47 | #include <qtabwidget.h> | 47 | #include <qtabwidget.h> |
48 | #include <qlistview.h> | 48 | #include <qlistview.h> |
49 | 49 | ||
50 | //using namespace Opie::Core; | 50 | //using namespace Opie::Core; |
51 | //using namespace Opie::Ui; | 51 | //using namespace Opie::Ui; |
52 | ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal ) | 52 | ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal ) |
53 | : ComposeMailUI( parent, name, modal ) | 53 | : ComposeMailUI( parent, name, modal ) |
54 | { | 54 | { |
55 | 55 | ||
56 | mPickLineEdit = 0; | 56 | mPickLineEdit = 0; |
57 | mEncoding = KOPrefs::instance()->mCurrentCodeName; | 57 | mEncoding = KOPrefs::instance()->mCurrentCodeName; |
58 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), | 58 | //managed from opiemail now |
59 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); | 59 | //connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), |
60 | // this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); | ||
60 | settings = sett; | 61 | settings = sett; |
61 | m_replyid = ""; | 62 | m_replyid = ""; |
62 | if ( KOPrefs::instance()->mUseKapi) { | 63 | if ( KOPrefs::instance()->mUseKapi) { |
63 | KConfig config( locateLocal("config", "kabcrc") ); | 64 | KConfig config( locateLocal("config", "kabcrc") ); |
64 | config.setGroup( "General" ); | 65 | config.setGroup( "General" ); |
65 | QString whoami_uid = config.readEntry( "WhoAmI" ); | 66 | QString whoami_uid = config.readEntry( "WhoAmI" ); |
66 | 67 | ||
67 | if ( whoami_uid.isEmpty() ) { | 68 | if ( whoami_uid.isEmpty() ) { |
68 | QMessageBox::information( 0, i18n( "Hint" ), | 69 | QMessageBox::information( 0, i18n( "Hint" ), |
69 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), | 70 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
70 | i18n( "Ok" ) ); | 71 | i18n( "Ok" ) ); |
71 | 72 | ||
72 | 73 | ||
73 | fillSettings(); | 74 | fillSettings(); |
74 | } else | 75 | } else |
75 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); | 76 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); |
76 | 77 | ||
77 | 78 | ||
78 | #ifdef DESKTOP_VERSION | 79 | #ifdef DESKTOP_VERSION |
79 | KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); | 80 | KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); |
80 | QStringList mails = con.emails(); | 81 | QStringList mails = con.emails(); |
81 | QString defmail = con.preferredEmail(); | 82 | QString defmail = con.preferredEmail(); |
82 | if ( mails.count() == 0) | 83 | if ( mails.count() == 0) |
83 | QMessageBox::information( 0, i18n( "Hint" ), | 84 | QMessageBox::information( 0, i18n( "Hint" ), |
@@ -239,70 +240,77 @@ void ComposeMail::pickAddress( ) | |||
239 | if ( ! names.isEmpty() ) | 240 | if ( ! names.isEmpty() ) |
240 | names+= ","; | 241 | names+= ","; |
241 | names+= "\""+list[i].realName() +"\"<" +list[i].preferredEmail() +">"; | 242 | names+= "\""+list[i].realName() +"\"<" +list[i].preferredEmail() +">"; |
242 | 243 | ||
243 | } | 244 | } |
244 | } | 245 | } |
245 | 246 | ||
246 | 247 | ||
247 | if ( line->text().isEmpty() ) { | 248 | if ( line->text().isEmpty() ) { |
248 | line->setText( names ); | 249 | line->setText( names ); |
249 | } else if ( !names.isEmpty() ) { | 250 | } else if ( !names.isEmpty() ) { |
250 | line->setText( line->text() + ", " + names ); | 251 | line->setText( line->text() + ", " + names ); |
251 | } | 252 | } |
252 | #else | 253 | #else |
253 | bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/ompi", this->name() /* name is here the unique uid*/); | 254 | bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/ompi", this->name() /* name is here the unique uid*/); |
254 | // the result should now arrive through method insertAttendees | 255 | // the result should now arrive through method insertAttendees |
255 | #endif | 256 | #endif |
256 | } | 257 | } |
257 | //the map includes name/email pairs, that comes from Ka/Pi | 258 | //the map includes name/email pairs, that comes from Ka/Pi |
258 | void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) | 259 | void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) |
259 | { | 260 | { |
260 | //qDebug("ComposeMail::insertAttendees "); | 261 | //qDebug("ComposeMail::insertAttendees "); |
261 | raise(); | 262 | raise(); |
262 | 263 | ||
264 | QString UID = uid; | ||
265 | if ( uid.left( 18 ) == (this->name() +QString("pick2")) ) { | ||
266 | mPickLineEdit = toLine; | ||
267 | UID = this->name(); | ||
268 | subjectLine->setText( uid.mid( 18 ) ); | ||
269 | } | ||
270 | //qDebug("ccc %s %s ", uid.latin1(), this->name()); | ||
263 | if ( mPickLineEdit == 0 ) { //whoami received | 271 | if ( mPickLineEdit == 0 ) { //whoami received |
264 | QString defmail = uidList[0]; | 272 | QString defmail = uidList[0]; |
265 | if ( emailList.count() == 0 ) | 273 | if ( emailList.count() == 0 ) |
266 | QMessageBox::information( 0, i18n( "Hint" ), | 274 | QMessageBox::information( 0, i18n( "Hint" ), |
267 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), | 275 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
268 | i18n( "Ok" ) ); | 276 | i18n( "Ok" ) ); |
269 | if (defmail.length()!=0) { | 277 | if (defmail.length()!=0) { |
270 | fromBox->insertItem(defmail); | 278 | fromBox->insertItem(defmail); |
271 | } | 279 | } |
272 | QStringList::ConstIterator sit = emailList.begin(); | 280 | QStringList::ConstIterator sit = emailList.begin(); |
273 | int pref = 0; | 281 | int pref = 0; |
274 | for (;sit!=emailList.end();++sit) { | 282 | for (;sit!=emailList.end();++sit) { |
275 | if ( (*sit)==defmail) | 283 | if ( (*sit)==defmail) |
276 | continue; | 284 | continue; |
277 | fromBox->insertItem((*sit)); | 285 | fromBox->insertItem((*sit)); |
278 | } | 286 | } |
279 | senderNameEdit->setText(nameList[0]); | 287 | senderNameEdit->setText(nameList[0]); |
280 | return; | 288 | return; |
281 | } | 289 | } |
282 | QString names ; | 290 | QString names ; |
283 | QLineEdit *line = mPickLineEdit; | 291 | QLineEdit *line = mPickLineEdit; |
284 | if (uid == this->name()) | 292 | if (UID == this->name()) |
285 | { | 293 | { |
286 | for ( int i = 0; i < nameList.count(); i++) | 294 | for ( int i = 0; i < nameList.count(); i++) |
287 | { | 295 | { |
288 | QString _name = nameList[i]; | 296 | QString _name = nameList[i]; |
289 | QString _email = emailList[i]; | 297 | QString _email = emailList[i]; |
290 | QString _uid = uidList[i]; | 298 | QString _uid = uidList[i]; |
291 | if ( ! _email.isEmpty() ) { | 299 | if ( ! _email.isEmpty() ) { |
292 | if ( ! names.isEmpty() ) | 300 | if ( ! names.isEmpty() ) |
293 | names+= ","; | 301 | names+= ","; |
294 | names+= "\""+_name +"\"<" +_email +">"; | 302 | names+= "\""+_name +"\"<" +_email +">"; |
295 | } | 303 | } |
296 | } | 304 | } |
297 | } | 305 | } |
298 | if ( line->text().isEmpty() ) { | 306 | if ( line->text().isEmpty() ) { |
299 | line->setText( names ); | 307 | line->setText( names ); |
300 | } else if ( !names.isEmpty() ) { | 308 | } else if ( !names.isEmpty() ) { |
301 | line->setText( line->text() + ", " + names ); | 309 | line->setText( line->text() + ", " + names ); |
302 | } | 310 | } |
303 | } | 311 | } |
304 | 312 | ||
305 | void ComposeMail::setTo( const QString & to ) | 313 | void ComposeMail::setTo( const QString & to ) |
306 | { | 314 | { |
307 | toLine->setText( to ); | 315 | toLine->setText( to ); |
308 | } | 316 | } |
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index f56711d..e159b73 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -25,53 +25,55 @@ | |||
25 | #include "klocale.h" | 25 | #include "klocale.h" |
26 | 26 | ||
27 | #include <qmessagebox.h> | 27 | #include <qmessagebox.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qcursor.h> | 29 | #include <qcursor.h> |
30 | #include <qtextbrowser.h> | 30 | #include <qtextbrowser.h> |
31 | #include <qregexp.h> | 31 | #include <qregexp.h> |
32 | #include <qpe/global.h> | 32 | #include <qpe/global.h> |
33 | 33 | ||
34 | #ifdef DESKTOP_VERSION | 34 | #ifdef DESKTOP_VERSION |
35 | #include <qapplication.h> | 35 | #include <qapplication.h> |
36 | #else | 36 | #else |
37 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
38 | #endif | 38 | #endif |
39 | #include <libmailwrapper/smtpwrapper.h> | 39 | #include <libmailwrapper/smtpwrapper.h> |
40 | #include <libmailwrapper/mailtypes.h> | 40 | #include <libmailwrapper/mailtypes.h> |
41 | #include <libmailwrapper/abstractmail.h> | 41 | #include <libmailwrapper/abstractmail.h> |
42 | #include "koprefs.h" | 42 | #include "koprefs.h" |
43 | 43 | ||
44 | //using namespace Opie::Core; | 44 | //using namespace Opie::Core; |
45 | 45 | ||
46 | OpieMail::OpieMail( QWidget *parent, const char *name ) | 46 | OpieMail::OpieMail( QWidget *parent, const char *name ) |
47 | : MainWindow( parent, name) //, WStyle_ContextHelp ) | 47 | : MainWindow( parent, name) //, WStyle_ContextHelp ) |
48 | { | 48 | { |
49 | mCurrentComposer = 0; | ||
49 | settings = new Settings(); | 50 | settings = new Settings(); |
50 | tb = 0; | 51 | tb = 0; |
51 | setIcon(SmallIcon( "kmicromail" ) ); | 52 | setIcon(SmallIcon( "kmicromail" ) ); |
52 | folderView->populate( settings->getAccounts() ); | 53 | folderView->populate( settings->getAccounts() ); |
53 | 54 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), | |
55 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); | ||
54 | } | 56 | } |
55 | 57 | ||
56 | OpieMail::~OpieMail() | 58 | OpieMail::~OpieMail() |
57 | { | 59 | { |
58 | if (settings) delete settings; | 60 | if (settings) delete settings; |
59 | if ( tb ) | 61 | if ( tb ) |
60 | delete tb; | 62 | delete tb; |
61 | } | 63 | } |
62 | 64 | ||
63 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | 65 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) |
64 | { | 66 | { |
65 | 67 | ||
66 | } | 68 | } |
67 | #include <stdlib.h> | 69 | #include <stdlib.h> |
68 | void OpieMail::message(const QCString &msg, const QByteArray &data) | 70 | void OpieMail::message(const QCString &msg, const QByteArray &data) |
69 | { | 71 | { |
70 | // copied from old mail2 | 72 | // copied from old mail2 |
71 | static int ii = 0; | 73 | static int ii = 0; |
72 | //qDebug("QCOP CALL ############################# %d ", ii); | 74 | //qDebug("QCOP CALL ############################# %d ", ii); |
73 | //QString mess ( msg ); | 75 | //QString mess ( msg ); |
74 | //qDebug("Message = %s ",mess.latin1()); | 76 | //qDebug("Message = %s ",mess.latin1()); |
75 | ++ii; | 77 | ++ii; |
76 | //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); | 78 | //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); |
77 | 79 | ||
@@ -117,72 +119,77 @@ void OpieMail::slotExtAppHandler() | |||
117 | void OpieMail::slotwriteMail2(const QString& namemail ) | 119 | void OpieMail::slotwriteMail2(const QString& namemail ) |
118 | { | 120 | { |
119 | //qDebug("OpieMail::slotwriteMail2 "); | 121 | //qDebug("OpieMail::slotwriteMail2 "); |
120 | //qApp->processEvents(); | 122 | //qApp->processEvents(); |
121 | ComposeMail compose( settings, this, 0, true ); | 123 | ComposeMail compose( settings, this, 0, true ); |
122 | if ( !namemail.isEmpty() ) { | 124 | if ( !namemail.isEmpty() ) { |
123 | QString to = namemail; | 125 | QString to = namemail; |
124 | if ( namemail.find( " <") > 1 ) { | 126 | if ( namemail.find( " <") > 1 ) { |
125 | to = "\"" +to.replace( QRegExp( " <"), "\" <") ; | 127 | to = "\"" +to.replace( QRegExp( " <"), "\" <") ; |
126 | } else | 128 | } else |
127 | if ( namemail.find( "<") > 1 ) { | 129 | if ( namemail.find( "<") > 1 ) { |
128 | to = "\"" +to.replace( QRegExp( "<"), "\" <") ; | 130 | to = "\"" +to.replace( QRegExp( "<"), "\" <") ; |
129 | } | 131 | } |
130 | int sub = to.find( ">:"); | 132 | int sub = to.find( ">:"); |
131 | if ( sub > 0 ) { | 133 | if ( sub > 0 ) { |
132 | compose.setTo( to.left(sub+1) ); | 134 | compose.setTo( to.left(sub+1) ); |
133 | compose.setSubject( to.mid(sub+2) ); | 135 | compose.setSubject( to.mid(sub+2) ); |
134 | } else | 136 | } else |
135 | compose.setTo( to ); | 137 | compose.setTo( to ); |
136 | } | 138 | } |
137 | compose.slotAdjustColumns(); | 139 | compose.slotAdjustColumns(); |
138 | #ifndef DESKTOP_VERSION | 140 | #ifndef DESKTOP_VERSION |
139 | compose.showMaximized(); | 141 | compose.showMaximized(); |
140 | #endif | 142 | #endif |
143 | mCurrentComposer = &compose; | ||
141 | compose.exec(); | 144 | compose.exec(); |
145 | mCurrentComposer = 0; | ||
142 | raise(); | 146 | raise(); |
143 | //qDebug("retttich "); | 147 | //qDebug("retttich "); |
144 | } | 148 | } |
145 | void OpieMail::slotwriteMail(const QString&name,const QString&email) | 149 | void OpieMail::slotwriteMail(const QString&name,const QString&email) |
146 | { | 150 | { |
147 | // qDebug("OpieMail::slotwriteMail "); | 151 | // qDebug("OpieMail::slotwriteMail "); |
148 | ComposeMail compose( settings, this, 0, true ); | 152 | ComposeMail compose( settings, this, 0, true ); |
149 | if (!email.isEmpty()) | 153 | if (!email.isEmpty()) |
150 | { | 154 | { |
151 | if (!name.isEmpty()) | 155 | if (!name.isEmpty()) |
152 | { | 156 | { |
153 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); | 157 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); |
154 | } | 158 | } |
155 | else | 159 | else |
156 | { | 160 | { |
157 | compose.setTo(email); | 161 | compose.setTo(email); |
158 | } | 162 | } |
159 | } | 163 | } |
160 | compose.slotAdjustColumns(); | 164 | compose.slotAdjustColumns(); |
161 | #ifndef DESKTOP_VERSION | 165 | #ifndef DESKTOP_VERSION |
162 | compose.showMaximized(); | 166 | compose.showMaximized(); |
163 | #endif | 167 | #endif |
168 | |||
169 | mCurrentComposer = &compose; | ||
164 | compose.exec(); | 170 | compose.exec(); |
171 | mCurrentComposer = 0; | ||
165 | raise(); | 172 | raise(); |
166 | } | 173 | } |
167 | 174 | ||
168 | void OpieMail::slotComposeMail() | 175 | void OpieMail::slotComposeMail() |
169 | { | 176 | { |
170 | if ( mPendingEmail == QString::null && mPendingName == QString::null) | 177 | if ( mPendingEmail == QString::null && mPendingName == QString::null) |
171 | slotwriteMail2( QString () ); | 178 | slotwriteMail2( QString () ); |
172 | else { | 179 | else { |
173 | if ( mPendingEmail == QString::null ) | 180 | if ( mPendingEmail == QString::null ) |
174 | slotwriteMail2( mPendingName ); | 181 | slotwriteMail2( mPendingName ); |
175 | else | 182 | else |
176 | slotwriteMail( mPendingName, mPendingEmail ); | 183 | slotwriteMail( mPendingName, mPendingEmail ); |
177 | } | 184 | } |
178 | //slotwriteMail(0l,0l); | 185 | //slotwriteMail(0l,0l); |
179 | } | 186 | } |
180 | 187 | ||
181 | void OpieMail::slotSendQueued() | 188 | void OpieMail::slotSendQueued() |
182 | { | 189 | { |
183 | SMTPaccount *smtp = 0; | 190 | SMTPaccount *smtp = 0; |
184 | 191 | ||
185 | QList<Account> list = settings->getAccounts(); | 192 | QList<Account> list = settings->getAccounts(); |
186 | QList<SMTPaccount> smtpList; | 193 | QList<SMTPaccount> smtpList; |
187 | smtpList.setAutoDelete(false); | 194 | smtpList.setAutoDelete(false); |
188 | Account *it; | 195 | Account *it; |
@@ -279,52 +286,55 @@ void OpieMail::replyMail() | |||
279 | QString text = body->Bodytext(); | 286 | QString text = body->Bodytext(); |
280 | QStringList lines = QStringList::split(QRegExp("\\n"), text); | 287 | QStringList lines = QStringList::split(QRegExp("\\n"), text); |
281 | QStringList::Iterator it; | 288 | QStringList::Iterator it; |
282 | for (it = lines.begin(); it != lines.end(); it++) | 289 | for (it = lines.begin(); it != lines.end(); it++) |
283 | { | 290 | { |
284 | rtext += "> " + *it + "\n"; | 291 | rtext += "> " + *it + "\n"; |
285 | } | 292 | } |
286 | rtext += "\n"; | 293 | rtext += "\n"; |
287 | 294 | ||
288 | QString prefix; | 295 | QString prefix; |
289 | if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; | 296 | if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; |
290 | else prefix = "Re: "; // no i18n on purpose | 297 | else prefix = "Re: "; // no i18n on purpose |
291 | 298 | ||
292 | Settings *settings = new Settings(); | 299 | Settings *settings = new Settings(); |
293 | ComposeMail composer( settings ,this, 0, true); | 300 | ComposeMail composer( settings ,this, 0, true); |
294 | if (mail->Replyto().isEmpty()) { | 301 | if (mail->Replyto().isEmpty()) { |
295 | composer.setTo( mail->getFrom()); | 302 | composer.setTo( mail->getFrom()); |
296 | } else { | 303 | } else { |
297 | composer.setTo( mail->Replyto()); | 304 | composer.setTo( mail->Replyto()); |
298 | } | 305 | } |
299 | composer.setSubject( prefix + mail->getSubject()); | 306 | composer.setSubject( prefix + mail->getSubject()); |
300 | composer.setMessage( rtext ); | 307 | composer.setMessage( rtext ); |
301 | composer.setInReplyTo( mail->Msgid()); | 308 | composer.setInReplyTo( mail->Msgid()); |
302 | composer.setCharset( body->getCharset() ); | 309 | composer.setCharset( body->getCharset() ); |
310 | |||
311 | mCurrentComposer = &composer; | ||
303 | if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) | 312 | if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) |
304 | { | 313 | { |
305 | mail->Wrapper()->answeredMail(mail); | 314 | mail->Wrapper()->answeredMail(mail); |
306 | } | 315 | } |
316 | mCurrentComposer = 0; | ||
307 | delete settings; | 317 | delete settings; |
308 | 318 | ||
309 | } | 319 | } |
310 | void OpieMail::closeViewMail(ViewMail * vm) | 320 | void OpieMail::closeViewMail(ViewMail * vm) |
311 | { | 321 | { |
312 | vm->hide(); | 322 | vm->hide(); |
313 | } | 323 | } |
314 | 324 | ||
315 | void OpieMail::slotDownloadMail( ) | 325 | void OpieMail::slotDownloadMail( ) |
316 | { | 326 | { |
317 | QListViewItem*item = mailView->currentItem(); | 327 | QListViewItem*item = mailView->currentItem(); |
318 | if (!item ) { | 328 | if (!item ) { |
319 | Global::statusMessage("Error: No item slected!"); | 329 | Global::statusMessage("Error: No item slected!"); |
320 | return; | 330 | return; |
321 | } | 331 | } |
322 | RecMailP mail = ((MailListViewItem*)item)->data(); | 332 | RecMailP mail = ((MailListViewItem*)item)->data(); |
323 | Account * acc = mail->Wrapper()->getAccount(); | 333 | Account * acc = mail->Wrapper()->getAccount(); |
324 | if ( !acc ) { | 334 | if ( !acc ) { |
325 | Global::statusMessage("Mail is already stored locally!"); | 335 | Global::statusMessage("Mail is already stored locally!"); |
326 | return; | 336 | return; |
327 | } | 337 | } |
328 | QString lfName = acc->getLocalFolder(); | 338 | QString lfName = acc->getLocalFolder(); |
329 | //qDebug("local folder " + lfName ); | 339 | //qDebug("local folder " + lfName ); |
330 | if ( lfName.isEmpty() ) | 340 | if ( lfName.isEmpty() ) |
@@ -616,26 +626,47 @@ void OpieMail::slotMoveCopyAllMail() | |||
616 | { | 626 | { |
617 | QMessageBox::critical(0,i18n("Error creating new Folder"), | 627 | QMessageBox::critical(0,i18n("Error creating new Folder"), |
618 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); | 628 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); |
619 | return; | 629 | return; |
620 | } | 630 | } |
621 | sels.hide(); | 631 | sels.hide(); |
622 | qApp->processEvents(); | 632 | qApp->processEvents(); |
623 | //qDebug("hiding sels "); | 633 | //qDebug("hiding sels "); |
624 | mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); | 634 | mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); |
625 | folderView->refreshCurrent(); | 635 | folderView->refreshCurrent(); |
626 | } | 636 | } |
627 | 637 | ||
628 | void OpieMail::reEditMail() | 638 | void OpieMail::reEditMail() |
629 | { | 639 | { |
630 | if (!mailView->currentItem()) return; | 640 | if (!mailView->currentItem()) return; |
631 | 641 | ||
632 | ComposeMail compose( settings, this, 0, true ); | 642 | ComposeMail compose( settings, this, 0, true ); |
633 | compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); | 643 | compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); |
634 | compose.slotAdjustColumns(); | 644 | compose.slotAdjustColumns(); |
635 | #ifndef DESKTOP_VERSION | 645 | #ifndef DESKTOP_VERSION |
636 | compose.showMaximized(); | 646 | compose.showMaximized(); |
637 | #else | 647 | #else |
638 | compose.resize(640,480); | 648 | compose.resize(640,480); |
639 | #endif | 649 | #endif |
650 | mCurrentComposer = &compose; | ||
640 | compose.exec(); | 651 | compose.exec(); |
652 | mCurrentComposer = 0; | ||
653 | } | ||
654 | |||
655 | void OpieMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) | ||
656 | { | ||
657 | |||
658 | if ( mCurrentComposer ) { | ||
659 | mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList); | ||
660 | } else { | ||
661 | ComposeMail compose( settings, this, 0, true ); | ||
662 | compose.slotAdjustColumns(); | ||
663 | #ifndef DESKTOP_VERSION | ||
664 | compose.showMaximized(); | ||
665 | #endif | ||
666 | mCurrentComposer = &compose; | ||
667 | mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList); | ||
668 | compose.exec(); | ||
669 | mCurrentComposer = 0; | ||
670 | raise(); | ||
671 | } | ||
641 | } | 672 | } |
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h index b8a527f..4f75b3f 100644 --- a/kmicromail/opiemail.h +++ b/kmicromail/opiemail.h | |||
@@ -1,61 +1,66 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | #ifndef OPIEMAIL_H | 2 | #ifndef OPIEMAIL_H |
3 | #define OPIEMAIL_H | 3 | #define OPIEMAIL_H |
4 | 4 | ||
5 | #include "mainwindow.h" | 5 | #include "mainwindow.h" |
6 | #include <libmailwrapper/settings.h> | 6 | #include <libmailwrapper/settings.h> |
7 | 7 | ||
8 | #include <opie2/osmartpointer.h> | 8 | #include <opie2/osmartpointer.h> |
9 | #include <libmailwrapper/mailtypes.h> | 9 | #include <libmailwrapper/mailtypes.h> |
10 | #include <viewmail.h> | 10 | #include <viewmail.h> |
11 | #include <qstringlist.h> | ||
12 | |||
13 | class ComposeMail; | ||
11 | 14 | ||
12 | class OpieMail : public MainWindow | 15 | class OpieMail : public MainWindow |
13 | { | 16 | { |
14 | Q_OBJECT | 17 | Q_OBJECT |
15 | 18 | ||
16 | public: | 19 | public: |
17 | OpieMail( QWidget *parent = 0, const char *name = 0 ); | 20 | OpieMail( QWidget *parent = 0, const char *name = 0 ); |
18 | virtual ~OpieMail(); | 21 | virtual ~OpieMail(); |
19 | static QString appName() { return QString::fromLatin1("kopiemail"); } | 22 | static QString appName() { return QString::fromLatin1("kopiemail"); } |
20 | 23 | ||
21 | public slots: | 24 | public slots: |
22 | virtual void slotwriteMail(const QString&name,const QString&email); | 25 | virtual void slotwriteMail(const QString&name,const QString&email); |
23 | virtual void slotwriteMail2(const QString&nameemail); | 26 | virtual void slotwriteMail2(const QString&nameemail); |
24 | virtual void slotComposeMail(); | 27 | virtual void slotComposeMail(); |
25 | virtual void slotExtAppHandler(); | 28 | virtual void slotExtAppHandler(); |
26 | virtual void appMessage(const QCString &msg, const QByteArray &data); | 29 | virtual void appMessage(const QCString &msg, const QByteArray &data); |
27 | virtual void message(const QCString &msg, const QByteArray &data); | 30 | virtual void message(const QCString &msg, const QByteArray &data); |
31 | void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist); | ||
28 | protected slots: | 32 | protected slots: |
29 | virtual void deleteAndDisplayNextMail(ViewMail * vm); | 33 | virtual void deleteAndDisplayNextMail(ViewMail * vm); |
30 | virtual void displayNextMail(ViewMail * vm); | 34 | virtual void displayNextMail(ViewMail * vm); |
31 | virtual void slotSendQueued(); | 35 | virtual void slotSendQueued(); |
32 | virtual void slotSearchMails(); | 36 | virtual void slotSearchMails(); |
33 | virtual void slotEditSettings(); | 37 | virtual void slotEditSettings(); |
34 | virtual void slotEditAccounts(); | 38 | virtual void slotEditAccounts(); |
35 | virtual void displayMail(); | 39 | virtual void displayMail(); |
36 | virtual void replyMail(); | 40 | virtual void replyMail(); |
37 | virtual void slotDeleteMail(); | 41 | virtual void slotDeleteMail(); |
38 | virtual void slotGetMail(); | 42 | virtual void slotGetMail(); |
39 | virtual void slotGetAllMail(); | 43 | virtual void slotGetAllMail(); |
40 | virtual void slotDeleteAllMail(); | 44 | virtual void slotDeleteAllMail(); |
41 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); | 45 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); |
42 | virtual void slotShowFolders( bool show ); | 46 | virtual void slotShowFolders( bool show ); |
43 | virtual void refreshMailView(const QValueList<RecMailP>&); | 47 | virtual void refreshMailView(const QValueList<RecMailP>&); |
44 | virtual void mailLeftClicked( QListViewItem * ); | 48 | virtual void mailLeftClicked( QListViewItem * ); |
45 | virtual void slotMoveCopyMail(); | 49 | virtual void slotMoveCopyMail(); |
46 | virtual void slotMoveCopyAllMail(); | 50 | virtual void slotMoveCopyAllMail(); |
47 | virtual void reEditMail(); | 51 | virtual void reEditMail(); |
48 | void clearSelection(); | 52 | void clearSelection(); |
49 | void slotDownloadMail(); | 53 | void slotDownloadMail(); |
50 | private: | 54 | private: |
55 | ComposeMail* mCurrentComposer; | ||
51 | void closeViewMail(ViewMail * vm); | 56 | void closeViewMail(ViewMail * vm); |
52 | QString mPendingEmail; | 57 | QString mPendingEmail; |
53 | QString mPendingName; | 58 | QString mPendingName; |
54 | QByteArray mPendingData; | 59 | QByteArray mPendingData; |
55 | QCString mPendingMessage; | 60 | QCString mPendingMessage; |
56 | Settings *settings; | 61 | Settings *settings; |
57 | QTextBrowser * tb; | 62 | QTextBrowser * tb; |
58 | 63 | ||
59 | }; | 64 | }; |
60 | 65 | ||
61 | #endif | 66 | #endif |