Diffstat (limited to 'noncore/net/mail/editaccounts.cpp') (more/less context) (show 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 | |||
@@ -5,12 +5,16 @@ | |||
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() ); |
@@ -485,18 +489,38 @@ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, | |||
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 | } |
@@ -514,19 +538,30 @@ void NNTPconfig::fillValues() | |||
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 | ||