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 | |||
@@ -9,4 +9,8 @@ | |||
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 ) |
@@ -489,5 +493,5 @@ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, | |||
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 | ||
@@ -495,4 +499,24 @@ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, | |||
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 | { |
@@ -518,5 +542,5 @@ void NNTPconfig::fillValues() | |||
518 | } | 542 | } |
519 | 543 | ||
520 | void NNTPconfig::accept() | 544 | void NNTPconfig::save() |
521 | { | 545 | { |
522 | data->setAccountName( accountLine->text() ); | 546 | data->setAccountName( accountLine->text() ); |
@@ -528,4 +552,15 @@ void NNTPconfig::accept() | |||
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 | } |