summaryrefslogtreecommitdiff
path: root/noncore/net/mail/editaccounts.cpp
authorharlekin <harlekin>2004-03-05 23:08:46 (UTC)
committer harlekin <harlekin>2004-03-05 23:08:46 (UTC)
commit6afcd375a640d5c6888bc111cd1d80a08f554136 (patch) (side-by-side diff)
tree520b12836ea13ee6e58f36a8851994fcfbe16051 /noncore/net/mail/editaccounts.cpp
parentb4ec902435df4e3c834b7790c1dc70a235157477 (diff)
downloadopie-6afcd375a640d5c6888bc111cd1d80a08f554136.zip
opie-6afcd375a640d5c6888bc111cd1d80a08f554136.tar.gz
opie-6afcd375a640d5c6888bc111cd1d80a08f554136.tar.bz2
list newsgroups in nntp config
Diffstat (limited to 'noncore/net/mail/editaccounts.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/editaccounts.cpp39
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
@@ -8,6 +8,10 @@
/* QT */
#include <qt.h>
+#include <libmailwrapper/nntpwrapper.h>
+
+#include <libetpan/nntpdriver.h>
+
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();
}