author | zautrix <zautrix> | 2004-11-01 14:15:56 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-11-01 14:15:56 (UTC) |
commit | 3320af5e47cdb4b54c4185c91d0332c013d90818 (patch) (unidiff) | |
tree | 9d7db42d4350616d315c5f95e1ac0aed00ed1314 /kmicromail/opiemail.cpp | |
parent | 56845a3ee7013af8a2db26a89aa151ee482ef0ed (diff) | |
download | kdepimpi-3320af5e47cdb4b54c4185c91d0332c013d90818.zip kdepimpi-3320af5e47cdb4b54c4185c91d0332c013d90818.tar.gz kdepimpi-3320af5e47cdb4b54c4185c91d0332c013d90818.tar.bz2 |
ompi fixes
-rw-r--r-- | kmicromail/opiemail.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 8d16ae7..af5376f 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -10,32 +10,33 @@ | |||
10 | #endif | 10 | #endif |
11 | #include "settingsdialog.h" | 11 | #include "settingsdialog.h" |
12 | #include "opiemail.h" | 12 | #include "opiemail.h" |
13 | #include "editaccounts.h" | 13 | #include "editaccounts.h" |
14 | #include "composemail.h" | 14 | #include "composemail.h" |
15 | #include "mailistviewitem.h" | 15 | #include "mailistviewitem.h" |
16 | #include "viewmail.h" | 16 | #include "viewmail.h" |
17 | #include "selectstore.h" | 17 | #include "selectstore.h" |
18 | #include "selectsmtp.h" | 18 | #include "selectsmtp.h" |
19 | #include "accountitem.h" | 19 | #include "accountitem.h" |
20 | #include "klocale.h" | 20 | #include "klocale.h" |
21 | 21 | ||
22 | #include <qmessagebox.h> | 22 | #include <qmessagebox.h> |
23 | #include <qtimer.h> | 23 | #include <qtimer.h> |
24 | #include <qcursor.h> | 24 | #include <qcursor.h> |
25 | #include <qregexp.h> | 25 | #include <qregexp.h> |
26 | #include <qpe/global.h> | ||
26 | 27 | ||
27 | #ifdef DESKTOP_VERSION | 28 | #ifdef DESKTOP_VERSION |
28 | #include <qapplication.h> | 29 | #include <qapplication.h> |
29 | #else | 30 | #else |
30 | #include <qpe/qpeapplication.h> | 31 | #include <qpe/qpeapplication.h> |
31 | #endif | 32 | #endif |
32 | #include <libmailwrapper/smtpwrapper.h> | 33 | #include <libmailwrapper/smtpwrapper.h> |
33 | #include <libmailwrapper/mailtypes.h> | 34 | #include <libmailwrapper/mailtypes.h> |
34 | #include <libmailwrapper/abstractmail.h> | 35 | #include <libmailwrapper/abstractmail.h> |
35 | 36 | ||
36 | //using namespace Opie::Core; | 37 | //using namespace Opie::Core; |
37 | 38 | ||
38 | OpieMail::OpieMail( QWidget *parent, const char *name ) | 39 | OpieMail::OpieMail( QWidget *parent, const char *name ) |
39 | : MainWindow( parent, name) //, WStyle_ContextHelp ) | 40 | : MainWindow( parent, name) //, WStyle_ContextHelp ) |
40 | { | 41 | { |
41 | settings = new Settings(); | 42 | settings = new Settings(); |
@@ -176,58 +177,63 @@ void OpieMail::slotSendQueued() | |||
176 | QList<SMTPaccount> smtpList; | 177 | QList<SMTPaccount> smtpList; |
177 | smtpList.setAutoDelete(false); | 178 | smtpList.setAutoDelete(false); |
178 | Account *it; | 179 | Account *it; |
179 | for ( it = list.first(); it; it = list.next() ) | 180 | for ( it = list.first(); it; it = list.next() ) |
180 | { | 181 | { |
181 | if ( it->getType() == MAILLIB::A_SMTP ) | 182 | if ( it->getType() == MAILLIB::A_SMTP ) |
182 | { | 183 | { |
183 | smtp = static_cast<SMTPaccount *>(it); | 184 | smtp = static_cast<SMTPaccount *>(it); |
184 | smtpList.append(smtp); | 185 | smtpList.append(smtp); |
185 | } | 186 | } |
186 | } | 187 | } |
187 | if (smtpList.count()==0) | 188 | if (smtpList.count()==0) |
188 | { | 189 | { |
189 | QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n")); | 190 | QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n")); |
190 | return; | 191 | return; |
191 | } | 192 | } |
193 | if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to send\nall queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) | ||
194 | return; | ||
192 | if (smtpList.count()==1) | 195 | if (smtpList.count()==1) |
193 | { | 196 | { |
194 | smtp = smtpList.at(0); | 197 | smtp = smtpList.at(0); |
195 | } | 198 | } |
196 | else | 199 | else |
197 | { | 200 | { |
198 | smtp = 0; | 201 | smtp = 0; |
199 | selectsmtp selsmtp; | 202 | selectsmtp selsmtp; |
200 | selsmtp.setSelectionlist(&smtpList); | 203 | selsmtp.setSelectionlist(&smtpList); |
201 | #ifndef DESKTOP_VERSION | 204 | #ifndef DESKTOP_VERSION |
202 | selsmtp.showMaximized(); | 205 | selsmtp.showMaximized(); |
203 | #endif | 206 | #endif |
204 | if ( selsmtp.exec() == QDialog::Accepted ) | 207 | if ( selsmtp.exec() == QDialog::Accepted ) |
205 | { | 208 | { |
206 | smtp = selsmtp.selected_smtp(); | 209 | smtp = selsmtp.selected_smtp(); |
207 | } | 210 | } |
208 | } | 211 | } |
209 | if (smtp) | 212 | if (smtp) |
210 | { | 213 | { |
214 | |||
215 | Global::statusMessage("Sending mails...!"); | ||
211 | SMTPwrapper * wrap = new SMTPwrapper(smtp); | 216 | SMTPwrapper * wrap = new SMTPwrapper(smtp); |
212 | if ( wrap->flushOutbox() ) | 217 | if ( wrap->flushOutbox() ) |
213 | { | 218 | { |
214 | QMessageBox::information(0,i18n("Info"),i18n("Mail queue flushed")); | 219 | Global::statusMessage("Mails sent!"); |
215 | } | 220 | } |
216 | delete wrap; | 221 | delete wrap; |
217 | } | 222 | } |
223 | // pending refresh list view, if outgoing is displayed | ||
218 | } | 224 | } |
219 | 225 | ||
220 | void OpieMail::slotSearchMails() | 226 | void OpieMail::slotSearchMails() |
221 | { | 227 | { |
222 | qDebug("OpieMail::slotSearchMails():not implemented "); | 228 | qDebug("OpieMail::slotSearchMails():not implemented "); |
223 | } | 229 | } |
224 | 230 | ||
225 | void OpieMail::slotEditSettings() | 231 | void OpieMail::slotEditSettings() |
226 | { | 232 | { |
227 | 233 | ||
228 | KOPrefsDialog settingsDialog( this, "koprefs", true ); | 234 | KOPrefsDialog settingsDialog( this, "koprefs", true ); |
229 | #ifndef DESKTOP_VERSION | 235 | #ifndef DESKTOP_VERSION |
230 | settingsDialog.showMaximized(); | 236 | settingsDialog.showMaximized(); |
231 | #endif | 237 | #endif |
232 | settingsDialog.exec(); | 238 | settingsDialog.exec(); |
233 | 239 | ||
@@ -417,32 +423,33 @@ void OpieMail::slotShowFolders( bool show ) | |||
417 | folderView->hide(); | 423 | folderView->hide(); |
418 | } | 424 | } |
419 | } | 425 | } |
420 | 426 | ||
421 | void OpieMail::refreshMailView(const QValueList<RecMailP>&list) | 427 | void OpieMail::refreshMailView(const QValueList<RecMailP>&list) |
422 | { | 428 | { |
423 | MailListViewItem*item = 0; | 429 | MailListViewItem*item = 0; |
424 | mailView->clear(); | 430 | mailView->clear(); |
425 | 431 | ||
426 | QValueList<RecMailP>::ConstIterator it; | 432 | QValueList<RecMailP>::ConstIterator it; |
427 | for (it = list.begin(); it != list.end();++it) | 433 | for (it = list.begin(); it != list.end();++it) |
428 | { | 434 | { |
429 | item = new MailListViewItem(mailView,item); | 435 | item = new MailListViewItem(mailView,item); |
430 | item->storeData((*it)); | 436 | item->storeData((*it)); |
431 | item->showEntry(); | 437 | item->showEntry(); |
432 | } | 438 | } |
439 | mailView->setSorting ( 4, false ); | ||
433 | } | 440 | } |
434 | 441 | ||
435 | void OpieMail::mailLeftClicked( QListViewItem *item ) | 442 | void OpieMail::mailLeftClicked( QListViewItem *item ) |
436 | { | 443 | { |
437 | mailView->clearSelection(); | 444 | mailView->clearSelection(); |
438 | /* just LEFT button - or tap with stylus on pda */ | 445 | /* just LEFT button - or tap with stylus on pda */ |
439 | //if (button!=1) return; | 446 | //if (button!=1) return; |
440 | if (!item) return; | 447 | if (!item) return; |
441 | if (folderView->currentisDraft()) { | 448 | if (folderView->currentisDraft()) { |
442 | reEditMail(); | 449 | reEditMail(); |
443 | } else { | 450 | } else { |
444 | displayMail(); | 451 | displayMail(); |
445 | } | 452 | } |
446 | } | 453 | } |
447 | 454 | ||
448 | void OpieMail::slotMoveCopyMail() | 455 | void OpieMail::slotMoveCopyMail() |