summaryrefslogtreecommitdiffabout
path: root/kmicromail/editaccounts.cpp
Unidiff
Diffstat (limited to 'kmicromail/editaccounts.cpp') (more/less context) (ignore 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
@@ -14,12 +14,13 @@
14#include <qpushbutton.h> 14#include <qpushbutton.h>
15#include <qlineedit.h> 15#include <qlineedit.h>
16#include <qlabel.h> 16#include <qlabel.h>
17#include <qtabwidget.h> 17#include <qtabwidget.h>
18#include <qlistview.h> 18#include <qlistview.h>
19#include <qspinbox.h> 19#include <qspinbox.h>
20#include <klocale.h>
20 21
21#include <libmailwrapper/nntpwrapper.h> 22#include <libmailwrapper/nntpwrapper.h>
22 23
23using namespace Opie::Core; 24using namespace Opie::Core;
24 25
25AccountListItem::AccountListItem( QListView *parent, Account *a) 26AccountListItem::AccountListItem( QListView *parent, Account *a)
@@ -50,16 +51,16 @@ AccountListItem::AccountListItem( QListView *parent, Account *a)
50 51
51EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 52EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
52 : EditAccountsUI( parent, name, modal, flags ) 53 : EditAccountsUI( parent, name, modal, flags )
53{ 54{
54 settings = s; 55 settings = s;
55 56
56 mailList->addColumn( tr( "Account" ) ); 57 mailList->addColumn( i18n( "Account" ) );
57 mailList->addColumn( tr( "Type" ) ); 58 mailList->addColumn( i18n( "Type" ) );
58 59
59 newsList->addColumn( tr( "Account" ) ); 60 newsList->addColumn( i18n( "Account" ) );
60 61
61 connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); 62 connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) );
62 connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) ); 63 connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) );
63 connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) ); 64 connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) );
64 connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) ); 65 connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) );
65 connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) ); 66 connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) );
@@ -204,42 +205,42 @@ void EditAccounts::slotEditAccount( Account *account )
204 } 205 }
205 } 206 }
206} 207}
207 208
208void EditAccounts::slotDeleteAccount( Account *account ) 209void EditAccounts::slotDeleteAccount( Account *account )
209{ 210{
210 if ( QMessageBox::information( this, tr( "Question" ), 211 if ( QMessageBox::information( this, i18n( "Question" ),
211 tr( "<p>Do you really want to delete the selected Account?</p>" ), 212 i18n( "<p>Do you really want to delete the selected Account?</p>" ),
212 tr( "Yes" ), tr( "No" ) ) == 0 ) 213 i18n( "Yes" ), i18n( "No" ) ) == 0 )
213 { 214 {
214 settings->delAccount( account ); 215 settings->delAccount( account );
215 slotFillLists(); 216 slotFillLists();
216 } 217 }
217} 218}
218 219
219void EditAccounts::slotEditMail() 220void EditAccounts::slotEditMail()
220{ 221{
221 if ( !mailList->currentItem() ) 222 if ( !mailList->currentItem() )
222 { 223 {
223 QMessageBox::information( this, tr( "Error" ), 224 QMessageBox::information( this, i18n( "Error" ),
224 tr( "<p>Please select an account.</p>" ), 225 i18n( "<p>Please select an account.</p>" ),
225 tr( "Ok" ) ); 226 i18n( "Ok" ) );
226 return; 227 return;
227 } 228 }
228 229
229 Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); 230 Account *a = ((AccountListItem *) mailList->currentItem())->getAccount();
230 slotEditAccount( a ); 231 slotEditAccount( a );
231} 232}
232 233
233void EditAccounts::slotDeleteMail() 234void EditAccounts::slotDeleteMail()
234{ 235{
235 if ( !mailList->currentItem() ) 236 if ( !mailList->currentItem() )
236 { 237 {
237 QMessageBox::information( this, tr( "Error" ), 238 QMessageBox::information( this, i18n( "Error" ),
238 tr( "<p>Please select an account.</p>" ), 239 i18n( "<p>Please select an account.</p>" ),
239 tr( "Ok" ) ); 240 i18n( "Ok" ) );
240 return; 241 return;
241 } 242 }
242 243
243 Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); 244 Account *a = ((AccountListItem *) mailList->currentItem())->getAccount();
244 slotDeleteAccount( a ); 245 slotDeleteAccount( a );
245} 246}
@@ -250,29 +251,29 @@ void EditAccounts::slotNewNews()
250} 251}
251 252
252void EditAccounts::slotEditNews() 253void EditAccounts::slotEditNews()
253{ 254{
254 if ( !newsList->currentItem() ) 255 if ( !newsList->currentItem() )
255 { 256 {
256 QMessageBox::information( this, tr( "Error" ), 257 QMessageBox::information( this, i18n( "Error" ),
257 tr( "<p>Please select an account.</p>" ), 258 i18n( "<p>Please select an account.</p>" ),
258 tr( "Ok" ) ); 259 i18n( "Ok" ) );
259 return; 260 return;
260 } 261 }
261 262
262 Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); 263 Account *a = ((AccountListItem *) newsList->currentItem())->getAccount();
263 slotEditAccount( a ); 264 slotEditAccount( a );
264} 265}
265 266
266void EditAccounts::slotDeleteNews() 267void EditAccounts::slotDeleteNews()
267{ 268{
268 if ( !newsList->currentItem() ) 269 if ( !newsList->currentItem() )
269 { 270 {
270 QMessageBox::information( this, tr( "Error" ), 271 QMessageBox::information( this, i18n( "Error" ),
271 tr( "<p>Please select an account.</p>" ), 272 i18n( "<p>Please select an account.</p>" ),
272 tr( "Ok" ) ); 273 i18n( "Ok" ) );
273 return; 274 return;
274 } 275 }
275 276
276 Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); 277 Account *a = ((AccountListItem *) newsList->currentItem())->getAccount();
277 slotDeleteAccount( a ); 278 slotDeleteAccount( a );
278} 279}
@@ -552,13 +553,13 @@ void NNTPconfig::slotShowSub()
552 ListViewGroups->clear(); 553 ListViewGroups->clear();
553 for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { 554 for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) {
554 QCheckListItem *item; 555 QCheckListItem *item;
555 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); 556 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox );
556 item->setOn( true ); 557 item->setOn( true );
557 } 558 }
558 topLevelWidget()->setCaption( tr("%1 groups subscribed").arg( subscribedGroups.count())); 559 topLevelWidget()->setCaption( i18n("%1 groups subscribed").arg( subscribedGroups.count()));
559} 560}
560void NNTPconfig::slotShowFilter() 561void NNTPconfig::slotShowFilter()
561{ 562{
562 save(); 563 save();
563 data->save(); 564 data->save();
564 ListViewGroups->clear(); 565 ListViewGroups->clear();
@@ -570,22 +571,22 @@ void NNTPconfig::slotShowFilter()
570 ++count; 571 ++count;
571 if ( subscribedGroups.contains( (*it) ) >= 1 ) { 572 if ( subscribedGroups.contains( (*it) ) >= 1 ) {
572 item->setOn( true ); 573 item->setOn( true );
573 } 574 }
574 } 575 }
575 } 576 }
576 topLevelWidget()->setCaption( tr("Filter found %1 groups").arg( count)); 577 topLevelWidget()->setCaption( i18n("Filter found %1 groups").arg( count));
577} 578}
578void NNTPconfig::slotGetNG() { 579void NNTPconfig::slotGetNG() {
579 save(); 580 save();
580 data->save(); 581 data->save();
581 topLevelWidget()->setCaption( tr("Fetching group list...")); 582 topLevelWidget()->setCaption( i18n("Fetching group list..."));
582 qApp->processEvents(); 583 qApp->processEvents();
583 NNTPwrapper* tmp = new NNTPwrapper( data ); 584 NNTPwrapper* tmp = new NNTPwrapper( data );
584 allGroups = tmp->listAllNewsgroups(); 585 allGroups = tmp->listAllNewsgroups();
585 topLevelWidget()->setCaption( tr("Downloaded %1 group names").arg( allGroups.count())); 586 topLevelWidget()->setCaption( i18n("Downloaded %1 group names").arg( allGroups.count()));
586 587
587 ListViewGroups->clear(); 588 ListViewGroups->clear();
588 589
589 for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) { 590 for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) {
590 QCheckListItem *item; 591 QCheckListItem *item;
591 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); 592 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox );