Diffstat (limited to 'noncore/net/mail/editaccounts.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/editaccounts.cpp | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp index edeb1de..2a1acc0 100644 --- a/noncore/net/mail/editaccounts.cpp +++ b/noncore/net/mail/editaccounts.cpp | |||
@@ -1,22 +1,26 @@ | |||
1 | 1 | ||
2 | #include "defines.h" | 2 | #include "defines.h" |
3 | #include "editaccounts.h" | 3 | #include "editaccounts.h" |
4 | 4 | ||
5 | /* OPIE */ | 5 | /* OPIE */ |
6 | #include <qpe/qpeapplication.h> | 6 | #include <qpe/qpeapplication.h> |
7 | 7 | ||
8 | /* QT */ | 8 | /* QT */ |
9 | #include <qt.h> | 9 | #include <qt.h> |
10 | 10 | ||
11 | #include <libmailwrapper/nntpwrapper.h> | ||
12 | |||
13 | #include <libetpan/nntpdriver.h> | ||
14 | |||
11 | AccountListItem::AccountListItem( QListView *parent, Account *a) | 15 | AccountListItem::AccountListItem( QListView *parent, Account *a) |
12 | : QListViewItem( parent ) | 16 | : QListViewItem( parent ) |
13 | { | 17 | { |
14 | account = a; | 18 | account = a; |
15 | setText( 0, account->getAccountName() ); | 19 | setText( 0, account->getAccountName() ); |
16 | setText( 1, account->getType() ); | 20 | setText( 1, account->getType() ); |
17 | } | 21 | } |
18 | 22 | ||
19 | EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) | 23 | EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) |
20 | : EditAccountsUI( parent, name, modal, flags ) | 24 | : EditAccountsUI( parent, name, modal, flags ) |
21 | { | 25 | { |
22 | qDebug( "New Account Configuration Widget" ); | 26 | qDebug( "New Account Configuration Widget" ); |
@@ -479,54 +483,85 @@ void SMTPconfig::accept() | |||
479 | 483 | ||
480 | /** | 484 | /** |
481 | * NNTPconfig | 485 | * NNTPconfig |
482 | */ | 486 | */ |
483 | 487 | ||
484 | NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 488 | NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
485 | : NNTPconfigUI( parent, name, modal, flags ) | 489 | : NNTPconfigUI( parent, name, modal, flags ) |
486 | { | 490 | { |
487 | data = account; | 491 | data = account; |
488 | 492 | ||
489 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); | 493 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); |
490 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); | 494 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); |
491 | 495 | connect( GetNGButton, SIGNAL( clicked() ), this, SLOT( slotGetNG() ) ); | |
492 | fillValues(); | 496 | fillValues(); |
493 | 497 | ||
494 | connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) ); | 498 | connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) ); |
495 | } | 499 | } |
496 | 500 | ||
501 | void NNTPconfig::slotGetNG() { | ||
502 | save(); | ||
503 | data->save(); | ||
504 | NNTPwrapper* tmp = new NNTPwrapper( data ); | ||
505 | clist* list = tmp->listAllNewsgroups(); | ||
506 | |||
507 | clistcell *current; | ||
508 | newsnntp_group_description *group; | ||
509 | |||
510 | // FIXME - test if not empty | ||
511 | current = list->first; | ||
512 | for ( current=clist_begin(list);current!=NULL;current=clist_next(current) ) { | ||
513 | group = ( newsnntp_group_description* ) current->data; | ||
514 | qDebug( group->grp_name ); | ||
515 | |||
516 | QCheckListItem *item; | ||
517 | item = new QCheckListItem( ListViewGroups, ( QString )group->grp_name, QCheckListItem::CheckBox ); | ||
518 | } | ||
519 | } | ||
520 | |||
497 | void NNTPconfig::slotSSL( bool enabled ) | 521 | void NNTPconfig::slotSSL( bool enabled ) |
498 | { | 522 | { |
499 | if ( enabled ) | 523 | if ( enabled ) |
500 | { | 524 | { |
501 | portLine->setText( NNTP_SSL_PORT ); | 525 | portLine->setText( NNTP_SSL_PORT ); |
502 | } | 526 | } |
503 | else | 527 | else |
504 | { | 528 | { |
505 | portLine->setText( NNTP_PORT ); | 529 | portLine->setText( NNTP_PORT ); |
506 | } | 530 | } |
507 | } | 531 | } |
508 | 532 | ||
509 | void NNTPconfig::fillValues() | 533 | void NNTPconfig::fillValues() |
510 | { | 534 | { |
511 | accountLine->setText( data->getAccountName() ); | 535 | accountLine->setText( data->getAccountName() ); |
512 | serverLine->setText( data->getServer() ); | 536 | serverLine->setText( data->getServer() ); |
513 | portLine->setText( data->getPort() ); | 537 | portLine->setText( data->getPort() ); |
514 | sslBox->setChecked( data->getSSL() ); | 538 | sslBox->setChecked( data->getSSL() ); |
515 | loginBox->setChecked( data->getLogin() ); | 539 | loginBox->setChecked( data->getLogin() ); |
516 | userLine->setText( data->getUser() ); | 540 | userLine->setText( data->getUser() ); |
517 | passLine->setText( data->getPassword() ); | 541 | passLine->setText( data->getPassword() ); |
518 | } | 542 | } |
519 | 543 | ||
520 | void NNTPconfig::accept() | 544 | void NNTPconfig::save() |
521 | { | 545 | { |
522 | data->setAccountName( accountLine->text() ); | 546 | data->setAccountName( accountLine->text() ); |
523 | data->setServer( serverLine->text() ); | 547 | data->setServer( serverLine->text() ); |
524 | data->setPort( portLine->text() ); | 548 | data->setPort( portLine->text() ); |
525 | data->setSSL( sslBox->isChecked() ); | 549 | data->setSSL( sslBox->isChecked() ); |
526 | data->setLogin( loginBox->isChecked() ); | 550 | data->setLogin( loginBox->isChecked() ); |
527 | data->setUser( userLine->text() ); | 551 | data->setUser( userLine->text() ); |
528 | data->setPassword( passLine->text() ); | 552 | data->setPassword( passLine->text() ); |
529 | 553 | ||
554 | QListViewItemIterator list_it( ListViewGroups ); | ||
555 | for ( ; list_it.current(); ++list_it ) { | ||
556 | if ( list_it.current()->isSelected() ) { | ||
557 | qDebug( list_it.current()->text(0) ); | ||
558 | } | ||
559 | } | ||
560 | } | ||
561 | |||
562 | void NNTPconfig::accept() | ||
563 | { | ||
564 | save(); | ||
530 | QDialog::accept(); | 565 | QDialog::accept(); |
531 | } | 566 | } |
532 | 567 | ||