-rw-r--r-- | kmicromail/accountitem.cpp | 97 |
1 files changed, 49 insertions, 48 deletions
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp index 49d86fc..567de87 100644 --- a/kmicromail/accountitem.cpp +++ b/kmicromail/accountitem.cpp @@ -6,24 +6,25 @@ #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> +#include <klocale.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; @@ -83,32 +84,32 @@ 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("Get new messages",contextName),GET_NEW_MAILS); - m->insertItem(QObject::tr("Disconnect",contextName),0); - m->insertItem(QObject::tr("Set offline",contextName),1); + m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); + m->insertItem(i18n("Disconnect"),0); + m->insertItem(i18n("Set offline"),1); } else { - m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); - m->insertItem(QObject::tr("Set online",contextName),1); + m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); + m->insertItem(i18n("Set online"),1); } } return m; } void POP3viewItem::disconnect() { QListViewItem *child = firstChild(); while ( child ) { QListViewItem *tmp = child; child = child->nextSibling(); @@ -178,28 +179,28 @@ void POP3folderItem::refresh(QValueList<RecMailP>&target) } RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail) { return pop3->getWrapper()->fetchBody(aMail); } QPopupMenu * POP3folderItem::getContextMenu() { QPopupMenu *m = new QPopupMenu(0); if (m) { - m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); - m->insertItem(QObject::tr("Refresh header list",contextName),0); - m->insertItem(QObject::tr("Delete all mails",contextName),1); - m->insertItem(QObject::tr("Move/Copie all mails",contextName),2); + m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); + m->insertItem(i18n("Refresh header list"),0); + m->insertItem(i18n("Delete all mails"),1); + m->insertItem(i18n("Move/Copie all mails"),2); } return m; } void POP3folderItem::downloadMails() { AccountView*bl = pop3->accountView(); if (!bl) return; bl->downloadMails(folder,pop3->getWrapper()); } void POP3folderItem::contextMenuSelected(int which) @@ -291,31 +292,31 @@ RECBODYP NNTPviewItem::fetchBody( const RecMailP &mail ) { return wrapper->fetchBody( mail ); } QPopupMenu * NNTPviewItem::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("(Un-)Subscribe groups",contextName),2); + m->insertItem(i18n("Disconnect"),0); + m->insertItem(i18n("Set offline"),1); + //m->insertItem(i18n("(Un-)Subscribe groups"),2); } else { - m->insertItem(QObject::tr("Set online",contextName),1); + m->insertItem(i18n("Set online"),1); } } return m; } void NNTPviewItem::subscribeGroups() { NNTPGroupsDlg dlg(account); dlg.showMaximized(); if ( dlg.exec()== QDialog::Accepted ){ refresh(); } @@ -387,26 +388,26 @@ void NNTPfolderItem::refresh(QValueList<RecMailP>&target) } RECBODYP NNTPfolderItem::fetchBody(const RecMailP&aMail) { return nntp->getWrapper()->fetchBody(aMail); } QPopupMenu * NNTPfolderItem::getContextMenu() { QPopupMenu *m = new QPopupMenu(0); if (m) { - m->insertItem(QObject::tr("Refresh header list",contextName),0); - m->insertItem(QObject::tr("Copy all postings",contextName),1); + m->insertItem(i18n("Refresh header list"),0); + m->insertItem(i18n("Copy all postings"),1); } return m; } void NNTPfolderItem::downloadMails() { AccountView*bl = nntp->accountView(); if (!bl) return; bl->downloadMails(folder,nntp->getWrapper()); } void NNTPfolderItem::contextMenuSelected(int which) @@ -508,36 +509,36 @@ void IMAPviewItem::refreshFolders(bool force) } } delete folders; } QPopupMenu * IMAPviewItem::getContextMenu() { QPopupMenu *m = new QPopupMenu(0); if (m) { if (!account->getOffline()) { - m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); - m->insertItem(QObject::tr("Refresh folder list",contextName),0); - m->insertItem(QObject::tr("Create new folder",contextName),1); + m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); + m->insertItem(i18n("Refresh folder list"),0); + m->insertItem(i18n("Create new folder"),1); m->insertSeparator(); - m->insertItem(QObject::tr("Disconnect",contextName),2); - m->insertItem(QObject::tr("Set offline",contextName),3); + m->insertItem(i18n("Disconnect"),2); + m->insertItem(i18n("Set offline"),3); m->insertSeparator(); } else { - m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); - m->insertItem(QObject::tr("Set online",contextName),3); + m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); + m->insertItem(i18n("Set online"),3); } } return m; } void IMAPviewItem::createNewFolder() { Newmdirdlg ndirdlg; ndirdlg.showMaximized(); if ( ndirdlg.exec() ) { @@ -663,63 +664,63 @@ void IMAPfolderItem::refresh(QValueList<RecMailP>&target) RECBODYP IMAPfolderItem::fetchBody(const RecMailP&aMail) { return imap->getWrapper()->fetchBody(aMail); } QPopupMenu * IMAPfolderItem::getContextMenu() { QPopupMenu *m = new QPopupMenu(0); if (m) { if (folder->may_select()) { - m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); - m->insertItem(QObject::tr("Refresh header list",contextName),0); - m->insertItem(QObject::tr("Move/Copie all mails",contextName),4); - m->insertItem(QObject::tr("Delete all mails",contextName),1); + m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); + m->insertItem(i18n("Refresh header list"),0); + m->insertItem(i18n("Move/Copie all mails"),4); + m->insertItem(i18n("Delete all mails"),1); } if (folder->no_inferior()==false) { - m->insertItem(QObject::tr("Create new subfolder",contextName),2); + m->insertItem(i18n("Create new subfolder"),2); } if (folder->getDisplayName().lower()!="inbox") { - m->insertItem(QObject::tr("Delete folder",contextName),3); + m->insertItem(i18n("Delete folder"),3); } } return m; } void IMAPfolderItem::createNewFolder() { Newmdirdlg ndirdlg; ndirdlg.showMaximized(); if ( ndirdlg.exec() ) { QString ndir = ndirdlg.Newdir(); bool makesubs = ndirdlg.subpossible(); QString delemiter = Delemiter(); if (imap->wrapper->createMbox(ndir,folder,delemiter,makesubs)) { imap->refreshFolders(true); } } } void IMAPfolderItem::deleteFolder() { - int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName), - QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()), - QObject::tr("Yes",contextName), - QObject::tr("No",contextName),QString::null,1,1); + int yesno = QMessageBox::warning(0,i18n("Delete folder"), + i18n("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>").arg(folder->getDisplayName()), + i18n("Yes"), + i18n("No"),QString::null,1,1); if (yesno == 0) { if (imap->getWrapper()->deleteMbox(folder)) { QListView*v=listView(); IMAPviewItem * box = imap; /* be carefull - after that this object is destroyd so don't use * any member of it after that call!!*/ imap->refreshFolders(true); if (v) { @@ -848,28 +849,28 @@ void MHviewItem::refresh(bool force) RECBODYP MHviewItem::fetchBody( const RecMailP &mail ) { return wrapper->fetchBody( mail ); } QPopupMenu * MHviewItem::getContextMenu() { QPopupMenu *m = new QPopupMenu(0); if (m) { - m->insertItem(QObject::tr("Refresh folder list",contextName),0); - m->insertItem(QObject::tr("Create new folder",contextName),1); - m->insertItem(QObject::tr("Delete all mails",contextName),2); - m->insertItem(QObject::tr("Move/Copie all mails",contextName),3); + m->insertItem(i18n("Refresh folder list"),0); + m->insertItem(i18n("Create new folder"),1); + m->insertItem(i18n("Delete all mails"),2); + m->insertItem(i18n("Move/Copie all mails"),3); } return m; } void MHviewItem::createFolder() { Newmdirdlg ndirdlg(0,0,true); ndirdlg.showMaximized(); if ( ndirdlg.exec() ) { QString ndir = ndirdlg.Newdir(); if (wrapper->createMbox(ndir)) @@ -966,55 +967,55 @@ void MHfolderItem::refresh(QValueList<RecMailP>&target) { if (folder->may_select()) mbox->getWrapper()->listMessages( folder->getName(),target ); } RECBODYP MHfolderItem::fetchBody(const RecMailP&aMail) { return mbox->getWrapper()->fetchBody(aMail); } void MHfolderItem::deleteFolder() { - int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName), - QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()), - QObject::tr("Yes",contextName), - QObject::tr("No",contextName),QString::null,1,1); + int yesno = QMessageBox::warning(0,i18n("Delete folder"), + i18n("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>").arg(folder->getDisplayName()), + i18n("Yes"), + i18n("No"),QString::null,1,1); if (yesno == 0) { if (mbox->getWrapper()->deleteMbox(folder)) { QListView*v=listView(); MHviewItem * box = mbox; /* be carefull - after that this object is destroyd so don't use * any member of it after that call!!*/ mbox->refresh(true); if (v) { v->setSelected(box,true); } } } } QPopupMenu * MHfolderItem::getContextMenu() { QPopupMenu *m = new QPopupMenu(0); if (m) { - m->insertItem(QObject::tr("Move/Copie all mails",contextName),2); - m->insertItem(QObject::tr("Delete all mails",contextName),0); - m->insertItem(QObject::tr("Create new subfolder",contextName),3); - m->insertItem(QObject::tr("Delete folder",contextName),1); + m->insertItem(i18n("Move/Copie all mails"),2); + m->insertItem(i18n("Delete all mails"),0); + m->insertItem(i18n("Create new subfolder"),3); + m->insertItem(i18n("Delete folder"),1); } return m; } void MHfolderItem::downloadMails() { AccountView*bl = mbox->accountView(); if (!bl) return; bl->downloadMails(folder,mbox->getWrapper()); } void MHfolderItem::createFolder() @@ -1108,29 +1109,29 @@ AccountViewItem::~AccountViewItem() } AccountView*AccountViewItem::accountView() { return m_Backlink; } void AccountViewItem::deleteAllMail(AbstractMail*wrapper,const FolderP&folder) { if (!wrapper) return; QString fname=""; if (folder) fname = folder->getDisplayName(); - int yesno = QMessageBox::warning(0,QObject::tr("Delete all mails",contextName), - QObject::tr("<center>Realy delete all mails in box <br>%1</center>",contextName). + int yesno = QMessageBox::warning(0,i18n("Delete all mails"), + i18n("<center>Realy delete all mails in box <br>%1</center>"). arg(fname), - QObject::tr("Yes",contextName), - QObject::tr("No",contextName),QString::null,1,1); + i18n("Yes"), + i18n("No"),QString::null,1,1); if (yesno == 0) { if (wrapper->deleteAllMail(folder)) { AccountView * view = (AccountView*)listView(); if (view) view->refreshCurrent(); } } } void AccountViewItem::removeChilds() |