From 6afcd375a640d5c6888bc111cd1d80a08f554136 Mon Sep 17 00:00:00 2001 From: harlekin Date: Fri, 05 Mar 2004 23:08:46 +0000 Subject: list newsgroups in nntp config --- (limited to 'noncore/net/mail/editaccounts.cpp') 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 @@ -8,6 +8,10 @@ /* QT */ #include +#include + +#include + AccountListItem::AccountListItem( QListView *parent, Account *a) : QListViewItem( parent ) { @@ -488,12 +492,32 @@ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); - + connect( GetNGButton, SIGNAL( clicked() ), this, SLOT( slotGetNG() ) ); fillValues(); connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) ); } +void NNTPconfig::slotGetNG() { + save(); + data->save(); + NNTPwrapper* tmp = new NNTPwrapper( data ); + clist* list = tmp->listAllNewsgroups(); + + clistcell *current; + newsnntp_group_description *group; + + // FIXME - test if not empty + current = list->first; + for ( current=clist_begin(list);current!=NULL;current=clist_next(current) ) { + group = ( newsnntp_group_description* ) current->data; + qDebug( group->grp_name ); + + QCheckListItem *item; + item = new QCheckListItem( ListViewGroups, ( QString )group->grp_name, QCheckListItem::CheckBox ); + } +} + void NNTPconfig::slotSSL( bool enabled ) { if ( enabled ) @@ -517,7 +541,7 @@ void NNTPconfig::fillValues() passLine->setText( data->getPassword() ); } -void NNTPconfig::accept() +void NNTPconfig::save() { data->setAccountName( accountLine->text() ); data->setServer( serverLine->text() ); @@ -527,6 +551,17 @@ void NNTPconfig::accept() data->setUser( userLine->text() ); data->setPassword( passLine->text() ); + QListViewItemIterator list_it( ListViewGroups ); + for ( ; list_it.current(); ++list_it ) { + if ( list_it.current()->isSelected() ) { + qDebug( list_it.current()->text(0) ); + } + } +} + +void NNTPconfig::accept() +{ + save(); QDialog::accept(); } -- cgit v0.9.0.2