summaryrefslogtreecommitdiff
path: root/noncore/net/mail
Unidiff
Diffstat (limited to 'noncore/net/mail') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/nntpgroups.cpp7
-rw-r--r--noncore/net/mail/nntpgroups.h2
-rw-r--r--noncore/net/mail/nntpgroupsui.ui49
3 files changed, 52 insertions, 6 deletions
diff --git a/noncore/net/mail/nntpgroups.cpp b/noncore/net/mail/nntpgroups.cpp
index 97b1985..8741c4b 100644
--- a/noncore/net/mail/nntpgroups.cpp
+++ b/noncore/net/mail/nntpgroups.cpp
@@ -1,11 +1,12 @@
1#include "nntpgroups.h" 1#include "nntpgroups.h"
2 2
3#include <libmailwrapper/settings.h> 3#include <libmailwrapper/settings.h>
4 4
5#include <qlistview.h> 5#include <qlistview.h>
6#include <qlineedit.h>
6 7
7NNTPGroups::NNTPGroups(NNTPaccount *account, QWidget* parent, const char* name, WFlags fl) 8NNTPGroups::NNTPGroups(NNTPaccount *account, QWidget* parent, const char* name, WFlags fl)
8 : NNTPGroupsUI(parent,name,fl),subscribedGroups() 9 : NNTPGroupsUI(parent,name,fl),subscribedGroups()
9{ 10{
10 m_Account = account; 11 m_Account = account;
11 fillGroups(); 12 fillGroups();
@@ -18,18 +19,21 @@ NNTPGroups::~NNTPGroups()
18 19
19void NNTPGroups::slotGetNG() 20void NNTPGroups::slotGetNG()
20{ 21{
21 if (!m_Account) return; 22 if (!m_Account) return;
22 GroupListView->clear(); 23 GroupListView->clear();
23 NNTPwrapper tmp( m_Account ); 24 NNTPwrapper tmp( m_Account );
24 QStringList list = tmp.listAllNewsgroups(); 25 QString filter = Groupfilteredit->text();
26 QStringList list = tmp.listAllNewsgroups(filter);
27 subscribedGroupsNotListed = subscribedGroups;
25 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { 28 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
26 QCheckListItem *item; 29 QCheckListItem *item;
27 item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox ); 30 item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox );
28 if ( subscribedGroups.contains( (*it) ) >= 1 ) { 31 if ( subscribedGroups.contains( (*it) ) >= 1 ) {
29 item->setOn( true ); 32 item->setOn( true );
33 subscribedGroupsNotListed.remove((*it));
30 } 34 }
31 } 35 }
32} 36}
33 37
34void NNTPGroups::fillGroups() 38void NNTPGroups::fillGroups()
35{ 39{
@@ -50,8 +54,9 @@ void NNTPGroups::storeValues()
50 for ( ; list_it.current(); ++list_it ) { 54 for ( ; list_it.current(); ++list_it ) {
51 if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { 55 if ( ( (QCheckListItem*)list_it.current() )->isOn() ) {
52 qDebug(list_it.current()->text(0) ); 56 qDebug(list_it.current()->text(0) );
53 subscribedGroups.append( list_it.current()->text(0) ); 57 subscribedGroups.append( list_it.current()->text(0) );
54 } 58 }
55 } 59 }
60 subscribedGroups+=subscribedGroupsNotListed;
56 m_Account->setGroups( subscribedGroups ); 61 m_Account->setGroups( subscribedGroups );
57} 62}
diff --git a/noncore/net/mail/nntpgroups.h b/noncore/net/mail/nntpgroups.h
index 8cc2e8b..e5b7c35 100644
--- a/noncore/net/mail/nntpgroups.h
+++ b/noncore/net/mail/nntpgroups.h
@@ -24,10 +24,10 @@ protected slots:
24 virtual void slotGetNG(); 24 virtual void slotGetNG();
25 25
26protected: 26protected:
27 virtual void fillGroups(); 27 virtual void fillGroups();
28 28
29 NNTPaccount*m_Account; 29 NNTPaccount*m_Account;
30 QStringList subscribedGroups; 30 QStringList subscribedGroups,subscribedGroupsNotListed;
31}; 31};
32 32
33#endif 33#endif
diff --git a/noncore/net/mail/nntpgroupsui.ui b/noncore/net/mail/nntpgroupsui.ui
index 93f487b..2902731 100644
--- a/noncore/net/mail/nntpgroupsui.ui
+++ b/noncore/net/mail/nntpgroupsui.ui
@@ -8,14 +8,14 @@
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>356</width> 14 <width>254</width>
15 <height>406</height> 15 <height>330</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>newsgroupslist</string> 20 <string>newsgroupslist</string>
21 </property> 21 </property>
@@ -25,17 +25,17 @@
25 <property> 25 <property>
26 <name>layoutSpacing</name> 26 <name>layoutSpacing</name>
27 </property> 27 </property>
28 <vbox> 28 <vbox>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>margin</name> 30 <name>margin</name>
31 <number>2</number> 31 <number>1</number>
32 </property> 32 </property>
33 <property stdset="1"> 33 <property stdset="1">
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>2</number> 35 <number>1</number>
36 </property> 36 </property>
37 <widget> 37 <widget>
38 <class>QListView</class> 38 <class>QListView</class>
39 <column> 39 <column>
40 <property> 40 <property>
41 <name>text</name> 41 <name>text</name>
@@ -57,12 +57,53 @@
57 <property> 57 <property>
58 <name>whatsThis</name> 58 <name>whatsThis</name>
59 <string>List of groups from the server. On start, only subscribed groups are listed.</string> 59 <string>List of groups from the server. On start, only subscribed groups are listed.</string>
60 </property> 60 </property>
61 </widget> 61 </widget>
62 <widget> 62 <widget>
63 <class>QLayoutWidget</class>
64 <property stdset="1">
65 <name>name</name>
66 <cstring>Layout1</cstring>
67 </property>
68 <hbox>
69 <property stdset="1">
70 <name>margin</name>
71 <number>0</number>
72 </property>
73 <property stdset="1">
74 <name>spacing</name>
75 <number>6</number>
76 </property>
77 <widget>
78 <class>QLabel</class>
79 <property stdset="1">
80 <name>name</name>
81 <cstring>filterlabel</cstring>
82 </property>
83 <property stdset="1">
84 <name>text</name>
85 <string>Groupfilter:</string>
86 </property>
87 </widget>
88 <widget>
89 <class>QLineEdit</class>
90 <property stdset="1">
91 <name>name</name>
92 <cstring>Groupfilteredit</cstring>
93 </property>
94 <property>
95 <name>whatsThis</name>
96 <string>Enter a filter string here.
97Then hit "get newsgroup list" again and only groups starting
98with that filter will be listet.</string>
99 </property>
100 </widget>
101 </hbox>
102 </widget>
103 <widget>
63 <class>QPushButton</class> 104 <class>QPushButton</class>
64 <property stdset="1"> 105 <property stdset="1">
65 <name>name</name> 106 <name>name</name>
66 <cstring>GetNGButton</cstring> 107 <cstring>GetNGButton</cstring>
67 </property> 108 </property>
68 <property stdset="1"> 109 <property stdset="1">