summaryrefslogtreecommitdiff
path: root/noncore
authorharlekin <harlekin>2004-03-05 23:08:46 (UTC)
committer harlekin <harlekin>2004-03-05 23:08:46 (UTC)
commit6afcd375a640d5c6888bc111cd1d80a08f554136 (patch) (unidiff)
tree520b12836ea13ee6e58f36a8851994fcfbe16051 /noncore
parentb4ec902435df4e3c834b7790c1dc70a235157477 (diff)
downloadopie-6afcd375a640d5c6888bc111cd1d80a08f554136.zip
opie-6afcd375a640d5c6888bc111cd1d80a08f554136.tar.gz
opie-6afcd375a640d5c6888bc111cd1d80a08f554136.tar.bz2
list newsgroups in nntp config
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/editaccounts.cpp39
-rw-r--r--noncore/net/mail/editaccounts.h7
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.cpp24
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.h2
-rw-r--r--noncore/net/mail/nntpconfigui.ui38
5 files changed, 67 insertions, 43 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
@@ -10,2 +10,6 @@
10 10
11#include <libmailwrapper/nntpwrapper.h>
12
13#include <libetpan/nntpdriver.h>
14
11AccountListItem::AccountListItem( QListView *parent, Account *a) 15AccountListItem::AccountListItem( QListView *parent, Account *a)
@@ -490,3 +494,3 @@ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name,
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();
@@ -496,2 +500,22 @@ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name,
496 500
501void 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
497void NNTPconfig::slotSSL( bool enabled ) 521void NNTPconfig::slotSSL( bool enabled )
@@ -519,3 +543,3 @@ void NNTPconfig::fillValues()
519 543
520void NNTPconfig::accept() 544void NNTPconfig::save()
521{ 545{
@@ -529,2 +553,13 @@ void NNTPconfig::accept()
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
562void NNTPconfig::accept()
563{
564 save();
530 QDialog::accept(); 565 QDialog::accept();
diff --git a/noncore/net/mail/editaccounts.h b/noncore/net/mail/editaccounts.h
index d8e1219..438a984 100644
--- a/noncore/net/mail/editaccounts.h
+++ b/noncore/net/mail/editaccounts.h
@@ -12,2 +12,4 @@
12#include "nntpconfigui.h" 12#include "nntpconfigui.h"
13
14#include <libetpan/clist.h>
13#include <libmailwrapper/settings.h> 15#include <libmailwrapper/settings.h>
@@ -83,3 +85,3 @@ protected slots:
83 void accept(); 85 void accept();
84 86
85private: 87private:
@@ -140,5 +142,8 @@ protected slots:
140 void accept(); 142 void accept();
143 void slotGetNG();
141 144
142private: 145private:
146 void save();
143 NNTPaccount *data; 147 NNTPaccount *data;
148 clist* list;
144 149
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
index 54e0ed4..2d6f9a3 100644
--- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
@@ -9,4 +9,2 @@
9#include <libetpan/libetpan.h> 9#include <libetpan/libetpan.h>
10#include <libetpan/nntpdriver.h>
11
12 10
@@ -194,7 +192,11 @@ QList<Folder>* NNTPwrapper::listFolders() {
194 192
195
196
197
198 QList<Folder> * folders = new QList<Folder>(); 193 QList<Folder> * folders = new QList<Folder>();
199 folders->setAutoDelete( false ); 194 folders->setAutoDelete( false );
195
196// folders->append(inb);
197 return folders;
198}
199
200 clist * NNTPwrapper::listAllNewsgroups() {
201 login();
200 clist *result = 0; 202 clist *result = 0;
@@ -202,4 +204,2 @@ QList<Folder>* NNTPwrapper::listFolders() {
202 newsnntp_group_description *list; 204 newsnntp_group_description *list;
203
204 login();
205 if ( m_nntp ) { 205 if ( m_nntp ) {
@@ -210,15 +210,7 @@ QList<Folder>* NNTPwrapper::listFolders() {
210 if ( err == NEWSNNTP_NO_ERROR ) { 210 if ( err == NEWSNNTP_NO_ERROR ) {
211 current = result->first; 211 return result;
212 for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) {
213 list = ( newsnntp_group_description* ) current->data;
214 qDebug( list->grp_name );
215 }
216// Folder*inb=new Folder("INBOX","/");
217 } 212 }
218 } 213 }
219// folders->append(inb);
220 return folders;
221} 214}
222 215
223
224void NNTPwrapper::answeredMail(const RecMail&) {} 216void NNTPwrapper::answeredMail(const RecMail&) {}
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.h b/noncore/net/mail/libmailwrapper/nntpwrapper.h
index e47e68f..e4d4a37 100644
--- a/noncore/net/mail/libmailwrapper/nntpwrapper.h
+++ b/noncore/net/mail/libmailwrapper/nntpwrapper.h
@@ -27,3 +27,3 @@ public:
27 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 27 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
28 28 clist * listAllNewsgroups();
29 virtual void deleteMail(const RecMail&mail); 29 virtual void deleteMail(const RecMail&mail);
diff --git a/noncore/net/mail/nntpconfigui.ui b/noncore/net/mail/nntpconfigui.ui
index 7769804..25d564e 100644
--- a/noncore/net/mail/nntpconfigui.ui
+++ b/noncore/net/mail/nntpconfigui.ui
@@ -13,3 +13,3 @@
13 <y>0</y> 13 <y>0</y>
14 <width>413</width> 14 <width>409</width>
15 <height>520</height> 15 <height>520</height>
@@ -299,2 +299,16 @@
299 <class>QListView</class> 299 <class>QListView</class>
300 <column>
301 <property>
302 <name>text</name>
303 <string>Newsgroup</string>
304 </property>
305 <property>
306 <name>clickable</name>
307 <bool>true</bool>
308 </property>
309 <property>
310 <name>resizeable</name>
311 <bool>true</bool>
312 </property>
313 </column>
300 <property stdset="1"> 314 <property stdset="1">
@@ -320,24 +334,2 @@
320</widget> 334</widget>
321<customwidgets>
322 <customwidget>
323 <class>QListView</class>
324 <header location="global">qlistview.h</header>
325 <sizehint>
326 <width>-1</width>
327 <height>-1</height>
328 </sizehint>
329 <container>0</container>
330 <sizepolicy>
331 <hordata>5</hordata>
332 <verdata>5</verdata>
333 </sizepolicy>
334 <pixmap>image0</pixmap>
335 </customwidget>
336</customwidgets>
337<images>
338 <image>
339 <name>image0</name>
340 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753</data>
341 </image>
342</images>
343<tabstops> 335<tabstops>