-rw-r--r-- | noncore/net/mail/accountview.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/defines.h | 6 | ||||
-rw-r--r-- | pics/mail/imapfolder.png | bin | 767 -> 470 bytes | |||
-rw-r--r-- | pics/mail/inbox.png | bin | 616 -> 783 bytes | |||
-rw-r--r-- | pics/mail/localfolder.png | bin | 0 -> 736 bytes | |||
-rw-r--r-- | pics/mail/mboxfolder.png | bin | 0 -> 473 bytes | |||
-rw-r--r-- | pics/mail/outbox.png | bin | 0 -> 769 bytes | |||
-rw-r--r-- | pics/mail/pop3folder.png | bin | 701 -> 520 bytes |
8 files changed, 13 insertions, 5 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index 6bc8b8b..59e8bc0 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -214,166 +214,168 @@ IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPfolderItem *parent , QLi | |||
214 | 214 | ||
215 | bool IMAPfolderItem::matchName(const QString&name)const | 215 | bool IMAPfolderItem::matchName(const QString&name)const |
216 | { | 216 | { |
217 | return folder->getDisplayName()==name; | 217 | return folder->getDisplayName()==name; |
218 | } | 218 | } |
219 | 219 | ||
220 | void IMAPfolderItem::refresh(QList<RecMail>&target) | 220 | void IMAPfolderItem::refresh(QList<RecMail>&target) |
221 | { | 221 | { |
222 | if (folder->may_select()) | 222 | if (folder->may_select()) |
223 | imap->getWrapper()->listMessages( folder->getName(),target ); | 223 | imap->getWrapper()->listMessages( folder->getName(),target ); |
224 | } | 224 | } |
225 | 225 | ||
226 | RecBody IMAPfolderItem::fetchBody(const RecMail&aMail) | 226 | RecBody IMAPfolderItem::fetchBody(const RecMail&aMail) |
227 | { | 227 | { |
228 | return imap->getWrapper()->fetchBody(aMail); | 228 | return imap->getWrapper()->fetchBody(aMail); |
229 | } | 229 | } |
230 | 230 | ||
231 | 231 | ||
232 | /** | 232 | /** |
233 | * Generic stuff | 233 | * Generic stuff |
234 | */ | 234 | */ |
235 | 235 | ||
236 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) | 236 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) |
237 | : QListView( parent, name, flags ) | 237 | : QListView( parent, name, flags ) |
238 | { | 238 | { |
239 | connect( this, SIGNAL( selectionChanged( QListViewItem * ) ), | 239 | connect( this, SIGNAL( selectionChanged( QListViewItem * ) ), |
240 | SLOT( refresh( QListViewItem * ) ) ); | 240 | SLOT( refresh( QListViewItem * ) ) ); |
241 | setSorting(0); | 241 | setSorting(0); |
242 | } | 242 | } |
243 | 243 | ||
244 | void AccountView::populate( QList<Account> list ) | 244 | void AccountView::populate( QList<Account> list ) |
245 | { | 245 | { |
246 | clear(); | 246 | clear(); |
247 | 247 | ||
248 | QString localfolders = (QString) getenv( "HOME" ) + QString("/Applications/opiemail/localmail/"); | 248 | QString localfolders = (QString) getenv( "HOME" ) + QString("/Applications/opiemail/localmail/"); |
249 | (void) new MBOXviewItem(localfolders,this); | 249 | (void) new MBOXviewItem(localfolders,this); |
250 | 250 | ||
251 | Account *it; | 251 | Account *it; |
252 | for ( it = list.first(); it; it = list.next() ) { | 252 | for ( it = list.first(); it; it = list.next() ) { |
253 | if ( it->getType().compare( "IMAP" ) == 0 ) { | 253 | if ( it->getType().compare( "IMAP" ) == 0 ) { |
254 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); | 254 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); |
255 | qDebug( "added IMAP " + imap->getAccountName() ); | 255 | qDebug( "added IMAP " + imap->getAccountName() ); |
256 | (void) new IMAPviewItem( imap, this ); | 256 | (void) new IMAPviewItem( imap, this ); |
257 | } else if ( it->getType().compare( "POP3" ) == 0 ) { | 257 | } else if ( it->getType().compare( "POP3" ) == 0 ) { |
258 | POP3account *pop3 = static_cast<POP3account *>(it); | 258 | POP3account *pop3 = static_cast<POP3account *>(it); |
259 | qDebug( "added POP3 " + pop3->getAccountName() ); | 259 | qDebug( "added POP3 " + pop3->getAccountName() ); |
260 | (void) new POP3viewItem( pop3, this ); | 260 | (void) new POP3viewItem( pop3, this ); |
261 | } | 261 | } |
262 | } | 262 | } |
263 | } | 263 | } |
264 | 264 | ||
265 | void AccountView::refresh(QListViewItem *item) { | 265 | void AccountView::refresh(QListViewItem *item) { |
266 | 266 | ||
267 | qDebug("AccountView refresh..."); | 267 | qDebug("AccountView refresh..."); |
268 | if ( item ) { | 268 | if ( item ) { |
269 | m_currentItem = item; | 269 | m_currentItem = item; |
270 | QList<RecMail> headerlist; | 270 | QList<RecMail> headerlist; |
271 | headerlist.setAutoDelete(true); | 271 | headerlist.setAutoDelete(true); |
272 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 272 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
273 | view->refresh(headerlist); | 273 | view->refresh(headerlist); |
274 | emit refreshMailview(&headerlist); | 274 | emit refreshMailview(&headerlist); |
275 | } | 275 | } |
276 | } | 276 | } |
277 | 277 | ||
278 | void AccountView::refreshCurrent() | 278 | void AccountView::refreshCurrent() |
279 | { | 279 | { |
280 | if ( !m_currentItem ) return; | 280 | if ( !m_currentItem ) return; |
281 | QList<RecMail> headerlist; | 281 | QList<RecMail> headerlist; |
282 | headerlist.setAutoDelete(true); | 282 | headerlist.setAutoDelete(true); |
283 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); | 283 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); |
284 | view->refresh(headerlist); | 284 | view->refresh(headerlist); |
285 | emit refreshMailview(&headerlist); | 285 | emit refreshMailview(&headerlist); |
286 | } | 286 | } |
287 | 287 | ||
288 | void AccountView::refreshAll() | 288 | void AccountView::refreshAll() |
289 | { | 289 | { |
290 | 290 | ||
291 | } | 291 | } |
292 | 292 | ||
293 | RecBody AccountView::fetchBody(const RecMail&aMail) | 293 | RecBody AccountView::fetchBody(const RecMail&aMail) |
294 | { | 294 | { |
295 | QListViewItem*item = selectedItem (); | 295 | QListViewItem*item = selectedItem (); |
296 | if (!item) return RecBody(); | 296 | if (!item) return RecBody(); |
297 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 297 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
298 | return view->fetchBody(aMail); | 298 | return view->fetchBody(aMail); |
299 | } | 299 | } |
300 | 300 | ||
301 | /** | 301 | /** |
302 | * MBOX Account stuff | 302 | * MBOX Account stuff |
303 | */ | 303 | */ |
304 | 304 | ||
305 | MBOXviewItem::MBOXviewItem( const QString&aPath, QListView *parent ) | 305 | MBOXviewItem::MBOXviewItem( const QString&aPath, QListView *parent ) |
306 | : AccountViewItem( parent ) | 306 | : AccountViewItem( parent ) |
307 | { | 307 | { |
308 | m_Path = aPath; | 308 | m_Path = aPath; |
309 | wrapper = AbstractMail::getWrapper( m_Path ); | 309 | wrapper = AbstractMail::getWrapper( m_Path ); |
310 | setPixmap( 0, PIXMAP_POP3FOLDER ); | 310 | setPixmap( 0, PIXMAP_LOCALFOLDER ); |
311 | setText( 0, " Local Folders" ); | 311 | setText( 0, " Local Folders" ); |
312 | setOpen( true ); | 312 | setOpen( true ); |
313 | } | 313 | } |
314 | 314 | ||
315 | MBOXviewItem::~MBOXviewItem() | 315 | MBOXviewItem::~MBOXviewItem() |
316 | { | 316 | { |
317 | delete wrapper; | 317 | delete wrapper; |
318 | } | 318 | } |
319 | 319 | ||
320 | AbstractMail *MBOXviewItem::getWrapper() | 320 | AbstractMail *MBOXviewItem::getWrapper() |
321 | { | 321 | { |
322 | return wrapper; | 322 | return wrapper; |
323 | } | 323 | } |
324 | 324 | ||
325 | void MBOXviewItem::refresh( QList<RecMail> & ) | 325 | void MBOXviewItem::refresh( QList<RecMail> & ) |
326 | { | 326 | { |
327 | QList<Folder> *folders = wrapper->listFolders(); | 327 | QList<Folder> *folders = wrapper->listFolders(); |
328 | QListViewItem *child = firstChild(); | 328 | QListViewItem *child = firstChild(); |
329 | while ( child ) { | 329 | while ( child ) { |
330 | QListViewItem *tmp = child; | 330 | QListViewItem *tmp = child; |
331 | child = child->nextSibling(); | 331 | child = child->nextSibling(); |
332 | delete tmp; | 332 | delete tmp; |
333 | } | 333 | } |
334 | Folder *it; | 334 | Folder *it; |
335 | QListViewItem*item = 0; | 335 | QListViewItem*item = 0; |
336 | for ( it = folders->first(); it; it = folders->next() ) { | 336 | for ( it = folders->first(); it; it = folders->next() ) { |
337 | item = new MBOXfolderItem( it, this , item ); | 337 | item = new MBOXfolderItem( it, this , item ); |
338 | item->setSelectable(it->may_select()); | 338 | item->setSelectable(it->may_select()); |
339 | } | 339 | } |
340 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 340 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
341 | folders->setAutoDelete(false); | 341 | folders->setAutoDelete(false); |
342 | delete folders; | 342 | delete folders; |
343 | } | 343 | } |
344 | 344 | ||
345 | RecBody MBOXviewItem::fetchBody( const RecMail &mail ) | 345 | RecBody MBOXviewItem::fetchBody( const RecMail &mail ) |
346 | { | 346 | { |
347 | qDebug( "POP3 fetchBody" ); | 347 | qDebug( "POP3 fetchBody" ); |
348 | return wrapper->fetchBody( mail ); | 348 | return wrapper->fetchBody( mail ); |
349 | } | 349 | } |
350 | 350 | ||
351 | MBOXfolderItem::~MBOXfolderItem() | 351 | MBOXfolderItem::~MBOXfolderItem() |
352 | { | 352 | { |
353 | delete folder; | 353 | delete folder; |
354 | } | 354 | } |
355 | 355 | ||
356 | MBOXfolderItem::MBOXfolderItem( Folder *folderInit, MBOXviewItem *parent , QListViewItem*after ) | 356 | MBOXfolderItem::MBOXfolderItem( Folder *folderInit, MBOXviewItem *parent , QListViewItem*after ) |
357 | : AccountViewItem( parent,after ) | 357 | : AccountViewItem( parent,after ) |
358 | { | 358 | { |
359 | folder = folderInit; | 359 | folder = folderInit; |
360 | mbox = parent; | 360 | mbox = parent; |
361 | if (folder->getDisplayName().lower()!="inbox") { | 361 | if (folder->getDisplayName().lower() == "outgoing") { |
362 | setPixmap( 0, PIXMAP_POP3FOLDER ); | 362 | setPixmap( 0, PIXMAP_OUTBOXFOLDER ); |
363 | } else { | 363 | } else if (folder->getDisplayName().lower() == "inbox") { |
364 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 364 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
365 | } | 365 | } else { |
366 | setPixmap( 0, PIXMAP_MBOXFOLDER ); | ||
367 | } | ||
366 | setText( 0, folder->getDisplayName() ); | 368 | setText( 0, folder->getDisplayName() ); |
367 | } | 369 | } |
368 | 370 | ||
369 | void MBOXfolderItem::refresh(QList<RecMail>&target) | 371 | void MBOXfolderItem::refresh(QList<RecMail>&target) |
370 | { | 372 | { |
371 | if (folder->may_select()) | 373 | if (folder->may_select()) |
372 | mbox->getWrapper()->listMessages( folder->getName(),target ); | 374 | mbox->getWrapper()->listMessages( folder->getName(),target ); |
373 | } | 375 | } |
374 | 376 | ||
375 | RecBody MBOXfolderItem::fetchBody(const RecMail&aMail) | 377 | RecBody MBOXfolderItem::fetchBody(const RecMail&aMail) |
376 | { | 378 | { |
377 | return mbox->getWrapper()->fetchBody(aMail); | 379 | return mbox->getWrapper()->fetchBody(aMail); |
378 | } | 380 | } |
379 | 381 | ||
diff --git a/noncore/net/mail/defines.h b/noncore/net/mail/defines.h index d9cdab0..36c85c7 100644 --- a/noncore/net/mail/defines.h +++ b/noncore/net/mail/defines.h | |||
@@ -1,51 +1,57 @@ | |||
1 | #ifndef DEFINE_CONSTANTS_H | 1 | #ifndef DEFINE_CONSTANTS_H |
2 | #define DEFINE_CONSTANTS_H | 2 | #define DEFINE_CONSTANTS_H |
3 | 3 | ||
4 | #include <qpe/resource.h> | 4 | #include <qpe/resource.h> |
5 | 5 | ||
6 | #define USER_AGENT "OpieMail v0.1" | 6 | #define USER_AGENT "OpieMail v0.1" |
7 | 7 | ||
8 | #define PIC_COMPOSEMAIL "mail/composemail" | 8 | #define PIC_COMPOSEMAIL "mail/composemail" |
9 | #define PIC_SENDQUEUED "mail/sendqueued" | 9 | #define PIC_SENDQUEUED "mail/sendqueued" |
10 | #define PIC_SHOWFOLDERS "mail/showfolders" | 10 | #define PIC_SHOWFOLDERS "mail/showfolders" |
11 | #define PIC_SEARCHMAILS "mail/searchmails" | 11 | #define PIC_SEARCHMAILS "mail/searchmails" |
12 | #define PIC_EDITSETTINGS "mail/editsettings" | 12 | #define PIC_EDITSETTINGS "mail/editsettings" |
13 | #define PIC_EDITACCOUNTS "mail/editaccounts" | 13 | #define PIC_EDITACCOUNTS "mail/editaccounts" |
14 | #define PIC_SYNC "mail/sync" | 14 | #define PIC_SYNC "mail/sync" |
15 | #define PIC_IMAPFOLDER "mail/imapfolder" | 15 | #define PIC_IMAPFOLDER "mail/imapfolder" |
16 | #define PIC_MBOXFOLDER "mail/mboxfolder" | ||
16 | #define PIC_POP3FOLDER "mail/pop3folder" | 17 | #define PIC_POP3FOLDER "mail/pop3folder" |
17 | #define PIC_INBOXFOLDER "mail/inbox" | 18 | #define PIC_INBOXFOLDER "mail/inbox" |
19 | #define PIC_OUTBOXFOLDER "mail/outbox" | ||
20 | #define PIC_LOCALFOLDER "mail/localfolder" | ||
18 | 21 | ||
19 | #define ICON_COMPOSEMAIL QIconSet( Resource::loadPixmap( PIC_COMPOSEMAIL ) ) | 22 | #define ICON_COMPOSEMAIL QIconSet( Resource::loadPixmap( PIC_COMPOSEMAIL ) ) |
20 | #define ICON_SENDQUEUED QIconSet( Resource::loadPixmap( PIC_SENDQUEUED ) ) | 23 | #define ICON_SENDQUEUED QIconSet( Resource::loadPixmap( PIC_SENDQUEUED ) ) |
21 | #define ICON_SHOWFOLDERS QIconSet( Resource::loadPixmap( PIC_SHOWFOLDERS ) ) | 24 | #define ICON_SHOWFOLDERS QIconSet( Resource::loadPixmap( PIC_SHOWFOLDERS ) ) |
22 | #define ICON_SEARCHMAILS QIconSet( Resource::loadPixmap( PIC_SEARCHMAILS ) ) | 25 | #define ICON_SEARCHMAILS QIconSet( Resource::loadPixmap( PIC_SEARCHMAILS ) ) |
23 | #define ICON_EDITSETTINGS QIconSet( Resource::loadPixmap( PIC_EDITSETTINGS ) ) | 26 | #define ICON_EDITSETTINGS QIconSet( Resource::loadPixmap( PIC_EDITSETTINGS ) ) |
24 | #define ICON_EDITACCOUNTS QIconSet( Resource::loadPixmap( PIC_EDITACCOUNTS ) ) | 27 | #define ICON_EDITACCOUNTS QIconSet( Resource::loadPixmap( PIC_EDITACCOUNTS ) ) |
25 | #define ICON_SYNC QIconSet( Resource::loadPixmap( PIC_SYNC ) ) | 28 | #define ICON_SYNC QIconSet( Resource::loadPixmap( PIC_SYNC ) ) |
26 | 29 | ||
27 | #define PIXMAP_IMAPFOLDER QPixmap( Resource::loadPixmap( PIC_IMAPFOLDER ) ) | 30 | #define PIXMAP_IMAPFOLDER QPixmap( Resource::loadPixmap( PIC_IMAPFOLDER ) ) |
28 | #define PIXMAP_POP3FOLDER QPixmap( Resource::loadPixmap( PIC_POP3FOLDER ) ) | 31 | #define PIXMAP_POP3FOLDER QPixmap( Resource::loadPixmap( PIC_POP3FOLDER ) ) |
29 | #define PIXMAP_INBOXFOLDER QPixmap( Resource::loadPixmap( PIC_INBOXFOLDER) ) | 32 | #define PIXMAP_INBOXFOLDER QPixmap( Resource::loadPixmap( PIC_INBOXFOLDER) ) |
33 | #define PIXMAP_MBOXFOLDER QPixmap( Resource::loadPixmap( PIC_MBOXFOLDER ) ) | ||
34 | #define PIXMAP_OUTBOXFOLDER QPixmap( Resource::loadPixmap( PIC_OUTBOXFOLDER) ) | ||
35 | #define PIXMAP_LOCALFOLDER QPixmap( Resource::loadPixmap( PIC_LOCALFOLDER) ) | ||
30 | 36 | ||
31 | #define IMAP_PORT "143" | 37 | #define IMAP_PORT "143" |
32 | #define IMAP_SSL_PORT "993" | 38 | #define IMAP_SSL_PORT "993" |
33 | #define SMTP_PORT "25" | 39 | #define SMTP_PORT "25" |
34 | #define SMTP_SSL_PORT "465" | 40 | #define SMTP_SSL_PORT "465" |
35 | #define POP3_PORT "110" | 41 | #define POP3_PORT "110" |
36 | #define POP3_SSL_PORT "995" | 42 | #define POP3_SSL_PORT "995" |
37 | #define NNTP_PORT "119" | 43 | #define NNTP_PORT "119" |
38 | #define NNTP_SSL_PORT "563" | 44 | #define NNTP_SSL_PORT "563" |
39 | 45 | ||
40 | /* used for decoding imapfoldername */ | 46 | /* used for decoding imapfoldername */ |
41 | #define UNDEFINED 64 | 47 | #define UNDEFINED 64 |
42 | #define MAXLINE 76 | 48 | #define MAXLINE 76 |
43 | #define UTF16MASK 0x03FFUL | 49 | #define UTF16MASK 0x03FFUL |
44 | #define UTF16SHIFT 10 | 50 | #define UTF16SHIFT 10 |
45 | #define UTF16BASE 0x10000UL | 51 | #define UTF16BASE 0x10000UL |
46 | #define UTF16HIGHSTART 0xD800UL | 52 | #define UTF16HIGHSTART 0xD800UL |
47 | #define UTF16HIGHEND 0xDBFFUL | 53 | #define UTF16HIGHEND 0xDBFFUL |
48 | #define UTF16LOSTART 0xDC00UL | 54 | #define UTF16LOSTART 0xDC00UL |
49 | #define UTF16LOEND 0xDFFFUL | 55 | #define UTF16LOEND 0xDFFFUL |
50 | 56 | ||
51 | #endif | 57 | #endif |
diff --git a/pics/mail/imapfolder.png b/pics/mail/imapfolder.png index 0c980dc..f7a2901 100644 --- a/pics/mail/imapfolder.png +++ b/pics/mail/imapfolder.png | |||
Binary files differ | |||
diff --git a/pics/mail/inbox.png b/pics/mail/inbox.png index 662573d..b34f5fe 100644 --- a/pics/mail/inbox.png +++ b/pics/mail/inbox.png | |||
Binary files differ | |||
diff --git a/pics/mail/localfolder.png b/pics/mail/localfolder.png new file mode 100644 index 0000000..6b0ac61 --- a/dev/null +++ b/pics/mail/localfolder.png | |||
Binary files differ | |||
diff --git a/pics/mail/mboxfolder.png b/pics/mail/mboxfolder.png new file mode 100644 index 0000000..5012829 --- a/dev/null +++ b/pics/mail/mboxfolder.png | |||
Binary files differ | |||
diff --git a/pics/mail/outbox.png b/pics/mail/outbox.png new file mode 100644 index 0000000..3c81b43 --- a/dev/null +++ b/pics/mail/outbox.png | |||
Binary files differ | |||
diff --git a/pics/mail/pop3folder.png b/pics/mail/pop3folder.png index fad29f4..65baa24 100644 --- a/pics/mail/pop3folder.png +++ b/pics/mail/pop3folder.png | |||
Binary files differ | |||