-rw-r--r-- | kmicromail/opiemail.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index b2119e6..19ffdb3 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -1,35 +1,36 @@ | |||
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 "settingsdialog.h" | 4 | #include "settingsdialog.h" |
5 | #include "opiemail.h" | 5 | #include "opiemail.h" |
6 | #include "editaccounts.h" | 6 | #include "editaccounts.h" |
7 | #include "composemail.h" | 7 | #include "composemail.h" |
8 | #include "mailistviewitem.h" | 8 | #include "mailistviewitem.h" |
9 | #include "viewmail.h" | 9 | #include "viewmail.h" |
10 | #include "selectstore.h" | 10 | #include "selectstore.h" |
11 | #include "selectsmtp.h" | 11 | #include "selectsmtp.h" |
12 | #include "accountitem.h" | ||
12 | 13 | ||
13 | #include <qmessagebox.h> | 14 | #include <qmessagebox.h> |
14 | #include <qtimer.h> | 15 | #include <qtimer.h> |
15 | #include <libkdepim/externalapphandler.h> | 16 | #include <libkdepim/externalapphandler.h> |
16 | 17 | ||
17 | #include <qpe/qpeapplication.h> | 18 | #include <qpe/qpeapplication.h> |
18 | #include <libmailwrapper/smtpwrapper.h> | 19 | #include <libmailwrapper/smtpwrapper.h> |
19 | #include <libmailwrapper/mailtypes.h> | 20 | #include <libmailwrapper/mailtypes.h> |
20 | #include <libmailwrapper/abstractmail.h> | 21 | #include <libmailwrapper/abstractmail.h> |
21 | /* OPIE */ | 22 | /* OPIE */ |
22 | //#include <qpe/resource.h> | 23 | //#include <qpe/resource.h> |
23 | //#include <qpe/qpeapplication.h> | 24 | //#include <qpe/qpeapplication.h> |
24 | 25 | ||
25 | /* QT */ | 26 | /* QT */ |
26 | 27 | ||
27 | //using namespace Opie::Core; | 28 | //using namespace Opie::Core; |
28 | 29 | ||
29 | OpieMail::OpieMail( QWidget *parent, const char *name ) | 30 | OpieMail::OpieMail( QWidget *parent, const char *name ) |
30 | : MainWindow( parent, name) //, WStyle_ContextHelp ) | 31 | : MainWindow( parent, name) //, WStyle_ContextHelp ) |
31 | { | 32 | { |
32 | settings = new Settings(); | 33 | settings = new Settings(); |
33 | 34 | ||
34 | folderView->populate( settings->getAccounts() ); | 35 | folderView->populate( settings->getAccounts() ); |
35 | 36 | ||
@@ -223,49 +224,56 @@ void OpieMail::slotEditAccounts() | |||
223 | folderView->populate( settings->getAccounts() ); | 224 | folderView->populate( settings->getAccounts() ); |
224 | } | 225 | } |
225 | 226 | ||
226 | void OpieMail::displayMail() | 227 | void OpieMail::displayMail() |
227 | { | 228 | { |
228 | QListViewItem*item = mailView->currentItem(); | 229 | QListViewItem*item = mailView->currentItem(); |
229 | if (!item) return; | 230 | if (!item) return; |
230 | RecMailP mail = ((MailListViewItem*)item)->data(); | 231 | RecMailP mail = ((MailListViewItem*)item)->data(); |
231 | RecBodyP body = folderView->fetchBody(mail); | 232 | RecBodyP body = folderView->fetchBody(mail); |
232 | ViewMail readMail( this,"", Qt::WType_Modal | WStyle_ContextHelp ); | 233 | ViewMail readMail( this,"", Qt::WType_Modal | WStyle_ContextHelp ); |
233 | readMail.setBody( body ); | 234 | readMail.setBody( body ); |
234 | readMail.setMail( mail ); | 235 | readMail.setMail( mail ); |
235 | readMail.showMaximized(); | 236 | readMail.showMaximized(); |
236 | readMail.exec(); | 237 | readMail.exec(); |
237 | 238 | ||
238 | if ( readMail.deleted ) | 239 | if ( readMail.deleted ) |
239 | { | 240 | { |
240 | folderView->refreshCurrent(); | 241 | folderView->refreshCurrent(); |
241 | } | 242 | } |
242 | else | 243 | else |
243 | { | 244 | { |
244 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); | 245 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); |
245 | } | 246 | } |
246 | } | 247 | } |
247 | 248 | void OpieMail::slotGetMail() | |
249 | { | ||
250 | QListViewItem * item = folderView->currentItem(); | ||
251 | if ( ! item ) return; | ||
252 | while ( item->parent () ) | ||
253 | item = item->parent (); | ||
254 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | ||
255 | } | ||
248 | void OpieMail::slotDeleteMail() | 256 | void OpieMail::slotDeleteMail() |
249 | { | 257 | { |
250 | if (!mailView->currentItem()) return; | 258 | if (!mailView->currentItem()) return; |
251 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 259 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
252 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 260 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
253 | { | 261 | { |
254 | mail->Wrapper()->deleteMail( mail ); | 262 | mail->Wrapper()->deleteMail( mail ); |
255 | folderView->refreshCurrent(); | 263 | folderView->refreshCurrent(); |
256 | } | 264 | } |
257 | } | 265 | } |
258 | void OpieMail::slotDeleteAllMail() | 266 | void OpieMail::slotDeleteAllMail() |
259 | { | 267 | { |
260 | 268 | ||
261 | QValueList<RecMailP> t; | 269 | QValueList<RecMailP> t; |
262 | if ( QMessageBox::warning(this, tr("Delete All Mails"), tr("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 270 | if ( QMessageBox::warning(this, tr("Delete All Mails"), tr("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
263 | { | 271 | { |
264 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); | 272 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); |
265 | while ( item ) { | 273 | while ( item ) { |
266 | if ( item->isSelected() ) { | 274 | if ( item->isSelected() ) { |
267 | t.append( item->data() ); | 275 | t.append( item->data() ); |
268 | } | 276 | } |
269 | item = (MailListViewItem*)item->nextSibling(); | 277 | item = (MailListViewItem*)item->nextSibling(); |
270 | } | 278 | } |
271 | } | 279 | } |