author | zautrix <zautrix> | 2004-09-11 16:44:49 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-11 16:44:49 (UTC) |
commit | 06be094df4e34cc41db113d8c0e78eccde5365b5 (patch) (side-by-side diff) | |
tree | b99317f9c83886d05b83cdb49e066f414e0fde25 /kmicromail/accountitem.cpp | |
parent | 53e10fa5e66620ff1eba1c9d17738103ad511c91 (diff) | |
download | kdepimpi-06be094df4e34cc41db113d8c0e78eccde5365b5.zip kdepimpi-06be094df4e34cc41db113d8c0e78eccde5365b5.tar.gz kdepimpi-06be094df4e34cc41db113d8c0e78eccde5365b5.tar.bz2 |
Mail more useful
-rw-r--r-- | kmicromail/accountitem.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp index 7b9b881..59c8abb 100644 --- a/kmicromail/accountitem.cpp +++ b/kmicromail/accountitem.cpp @@ -3,32 +3,34 @@ #include "accountview.h" #include "newmaildir.h" #include "nntpgroupsdlg.h" #include "defines.h" #include <libmailwrapper/mailtypes.h> #include <libmailwrapper/abstractmail.h> #include <libmailwrapper/mailwrapper.h> /* OPIE */ //#include <qpe/qpeapplication.h> /* QT */ #include <qpopupmenu.h> #include <qmessagebox.h> #include <kiconloader.h> +#define GET_NEW_MAILS 101 + using namespace Opie::Core; #define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );} /** * POP3 Account stuff */ POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent ) : AccountViewItem( parent ) { account = a; wrapper = AbstractMail::getWrapper( account ); SETPIX(PIXMAP_POP3FOLDER); #if 0 if (!account->getOffline()) { setPixmap( 0, ); } @@ -79,38 +81,38 @@ void POP3viewItem::refresh() RECBODYP POP3viewItem::fetchBody( const RecMailP &mail ) { return wrapper->fetchBody( mail ); } QPopupMenu * POP3viewItem::getContextMenu() { QPopupMenu *m = new QPopupMenu(0); if (m) { if (!account->getOffline()) { m->insertItem(QObject::tr("Disconnect",contextName),0); m->insertItem(QObject::tr("Set offline",contextName),1); - m->insertItem(QObject::tr("Download new INBOX messages",contextName),2); + m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); } else { m->insertItem(QObject::tr("Set online",contextName),1); - m->insertItem(QObject::tr("Download new INBOX messages",contextName),2); + m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); } } return m; } void POP3viewItem::disconnect() { QListViewItem *child = firstChild(); while ( child ) { QListViewItem *tmp = child; child = child->nextSibling(); delete tmp; } wrapper->logout(); } @@ -124,33 +126,33 @@ void POP3viewItem::setOnOffline() account->setOffline(!account->getOffline()); account->save(); SETPIX(PIXMAP_POP3FOLDER); refresh(); } void POP3viewItem::contextMenuSelected(int which) { switch (which) { case 0: disconnect(); break; case 1: setOnOffline(); break; - case 2: // daunlood + case GET_NEW_MAILS: // daunlood if (account->getOffline()) setOnOffline(); AccountView*bl = accountView(); if (!bl) return; AccountViewItem* in = findSubItem( "inbox" , 0); if ( ! in ) return; bl->downloadMailsInbox(in->getFolder() ,getWrapper()); setOnOffline(); break; } } POP3folderItem::~POP3folderItem() {} @@ -504,39 +506,39 @@ void IMAPviewItem::refreshFolders(bool force) delete folders; } QPopupMenu * IMAPviewItem::getContextMenu() { QPopupMenu *m = new QPopupMenu(0); if (m) { if (!account->getOffline()) { m->insertItem(QObject::tr("Refresh folder list",contextName),0); m->insertItem(QObject::tr("Create new folder",contextName),1); m->insertSeparator(); m->insertItem(QObject::tr("Disconnect",contextName),2); m->insertItem(QObject::tr("Set offline",contextName),3); m->insertSeparator(); - m->insertItem(QObject::tr("Download new INBOX messages",contextName),4); + m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); } else { m->insertItem(QObject::tr("Set online",contextName),3); m->insertSeparator(); - m->insertItem(QObject::tr("Download new INBOX messages",contextName),4); + m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); } } return m; } void IMAPviewItem::createNewFolder() { Newmdirdlg ndirdlg; ndirdlg.showMaximized(); if ( ndirdlg.exec() ) { QString ndir = ndirdlg.Newdir(); bool makesubs = ndirdlg.subpossible(); QString delemiter = "/"; IMAPfolderItem*item = (IMAPfolderItem*)firstChild(); @@ -564,33 +566,33 @@ void IMAPviewItem::contextMenuSelected(int id) break; case 2: removeChilds(); wrapper->logout(); break; case 3: if (account->getOffline()==false) { removeChilds(); wrapper->logout(); } account->setOffline(!account->getOffline()); account->save(); SETPIX(PIXMAP_IMAPFOLDER); refreshFolders(false); break; - case 4: // daunlood + case GET_NEW_MAILS: // daunlood { if (account->getOffline()) { contextMenuSelected( 3 ); } AccountView*bl = accountView(); if (!bl) return; AccountViewItem* in = findSubItem( "inbox" , 0); if ( ! in ) return; bl->downloadMailsInbox(in->getFolder(),getWrapper()); } break; default: break; } } |