summaryrefslogtreecommitdiffabout
path: root/kmicromail/editaccounts.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/editaccounts.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/editaccounts.cpp45
1 files changed, 23 insertions, 22 deletions
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp
index 733e38a..7ad4ec8 100644
--- a/kmicromail/editaccounts.cpp
+++ b/kmicromail/editaccounts.cpp
@@ -8,24 +8,25 @@
/* QT */
#include <qstringlist.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qmessagebox.h>
#include <qpushbutton.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qtabwidget.h>
#include <qlistview.h>
#include <qspinbox.h>
+#include <klocale.h>
#include <libmailwrapper/nntpwrapper.h>
using namespace Opie::Core;
AccountListItem::AccountListItem( QListView *parent, Account *a)
: QListViewItem( parent )
{
account = a;
setText( 0, account->getAccountName() );
QString ttext = "";
switch (account->getType()) {
@@ -44,28 +45,28 @@ AccountListItem::AccountListItem( QListView *parent, Account *a)
default:
ttext = "UNKNOWN";
break;
}
setText( 1, ttext);
}
EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
: EditAccountsUI( parent, name, modal, flags )
{
settings = s;
- mailList->addColumn( tr( "Account" ) );
- mailList->addColumn( tr( "Type" ) );
+ mailList->addColumn( i18n( "Account" ) );
+ mailList->addColumn( i18n( "Type" ) );
- newsList->addColumn( tr( "Account" ) );
+ newsList->addColumn( i18n( "Account" ) );
connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) );
connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) );
connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) );
connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) );
connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) );
connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) );
slotFillLists();
}
void EditAccounts::slotFillLists()
@@ -198,87 +199,87 @@ void EditAccounts::slotEditAccount( Account *account )
{
NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account);
NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp );
if ( QDialog::Accepted == KApplication::execDialog( &nntp ) )
{
slotFillLists();
}
}
}
void EditAccounts::slotDeleteAccount( Account *account )
{
- if ( QMessageBox::information( this, tr( "Question" ),
- tr( "<p>Do you really want to delete the selected Account?</p>" ),
- tr( "Yes" ), tr( "No" ) ) == 0 )
+ if ( QMessageBox::information( this, i18n( "Question" ),
+ i18n( "<p>Do you really want to delete the selected Account?</p>" ),
+ i18n( "Yes" ), i18n( "No" ) ) == 0 )
{
settings->delAccount( account );
slotFillLists();
}
}
void EditAccounts::slotEditMail()
{
if ( !mailList->currentItem() )
{
- QMessageBox::information( this, tr( "Error" ),
- tr( "<p>Please select an account.</p>" ),
- tr( "Ok" ) );
+ QMessageBox::information( this, i18n( "Error" ),
+ i18n( "<p>Please select an account.</p>" ),
+ i18n( "Ok" ) );
return;
}
Account *a = ((AccountListItem *) mailList->currentItem())->getAccount();
slotEditAccount( a );
}
void EditAccounts::slotDeleteMail()
{
if ( !mailList->currentItem() )
{
- QMessageBox::information( this, tr( "Error" ),
- tr( "<p>Please select an account.</p>" ),
- tr( "Ok" ) );
+ QMessageBox::information( this, i18n( "Error" ),
+ i18n( "<p>Please select an account.</p>" ),
+ i18n( "Ok" ) );
return;
}
Account *a = ((AccountListItem *) mailList->currentItem())->getAccount();
slotDeleteAccount( a );
}
void EditAccounts::slotNewNews()
{
slotNewAccount( "NNTP" );
}
void EditAccounts::slotEditNews()
{
if ( !newsList->currentItem() )
{
- QMessageBox::information( this, tr( "Error" ),
- tr( "<p>Please select an account.</p>" ),
- tr( "Ok" ) );
+ QMessageBox::information( this, i18n( "Error" ),
+ i18n( "<p>Please select an account.</p>" ),
+ i18n( "Ok" ) );
return;
}
Account *a = ((AccountListItem *) newsList->currentItem())->getAccount();
slotEditAccount( a );
}
void EditAccounts::slotDeleteNews()
{
if ( !newsList->currentItem() )
{
- QMessageBox::information( this, tr( "Error" ),
- tr( "<p>Please select an account.</p>" ),
- tr( "Ok" ) );
+ QMessageBox::information( this, i18n( "Error" ),
+ i18n( "<p>Please select an account.</p>" ),
+ i18n( "Ok" ) );
return;
}
Account *a = ((AccountListItem *) newsList->currentItem())->getAccount();
slotDeleteAccount( a );
}
void EditAccounts::slotAdjustColumns()
{
int currPage = configTab->currentPageIndex();
configTab->showPage( mailTab );
@@ -546,52 +547,52 @@ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name,
}
void NNTPconfig::slotShowSub()
{
save();
data->save();
ListViewGroups->clear();
for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) {
QCheckListItem *item;
item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox );
item->setOn( true );
}
- topLevelWidget()->setCaption( tr("%1 groups subscribed").arg( subscribedGroups.count()));
+ topLevelWidget()->setCaption( i18n("%1 groups subscribed").arg( subscribedGroups.count()));
}
void NNTPconfig::slotShowFilter()
{
save();
data->save();
ListViewGroups->clear();
int count = 0;
for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) {
QCheckListItem *item;
if ( GroupFilter->text().isEmpty() || (*it).find( GroupFilter->text() ) >= 0 ) {
item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox );
++count;
if ( subscribedGroups.contains( (*it) ) >= 1 ) {
item->setOn( true );
}
}
}
- topLevelWidget()->setCaption( tr("Filter found %1 groups").arg( count));
+ topLevelWidget()->setCaption( i18n("Filter found %1 groups").arg( count));
}
void NNTPconfig::slotGetNG() {
save();
data->save();
- topLevelWidget()->setCaption( tr("Fetching group list..."));
+ topLevelWidget()->setCaption( i18n("Fetching group list..."));
qApp->processEvents();
NNTPwrapper* tmp = new NNTPwrapper( data );
allGroups = tmp->listAllNewsgroups();
- topLevelWidget()->setCaption( tr("Downloaded %1 group names").arg( allGroups.count()));
+ topLevelWidget()->setCaption( i18n("Downloaded %1 group names").arg( allGroups.count()));
ListViewGroups->clear();
for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) {
QCheckListItem *item;
item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox );
if ( subscribedGroups.contains( (*it) ) >= 1 ) {
item->setOn( true );
}
}
delete tmp;