summaryrefslogtreecommitdiffabout
path: root/kmicromail/accountitem.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/accountitem.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/accountitem.cpp97
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
@@ -10,16 +10,17 @@
#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
*/
@@ -87,24 +88,24 @@ RECBODYP POP3viewItem::fetchBody( const RecMailP &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();
@@ -182,20 +183,20 @@ 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;
@@ -295,23 +296,23 @@ RECBODYP NNTPviewItem::fetchBody( const RecMailP &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);
@@ -391,18 +392,18 @@ 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;
@@ -512,28 +513,28 @@ void IMAPviewItem::refreshFolders(bool force)
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;
@@ -667,28 +668,28 @@ RECBODYP IMAPfolderItem::fetchBody(const RecMailP&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;
@@ -702,20 +703,20 @@ void IMAPfolderItem::createNewFolder()
{
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
@@ -852,20 +853,20 @@ 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();
@@ -970,20 +971,20 @@ void MHfolderItem::refresh(QValueList<RecMailP>&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
@@ -997,20 +998,20 @@ void MHfolderItem::deleteFolder()
}
}
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;
@@ -1112,21 +1113,21 @@ 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();
}