summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/accountitem.cpp190
-rw-r--r--noncore/net/mail/accountitem.h40
-rw-r--r--noncore/net/mail/accountview.cpp9
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.cpp10
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.h1
-rw-r--r--noncore/net/mail/libmailwrapper/libmailwrapper.pro6
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.cpp241
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.h48
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.cpp6
-rw-r--r--noncore/net/mail/nntpconfigui.ui503
10 files changed, 842 insertions, 212 deletions
diff --git a/noncore/net/mail/accountitem.cpp b/noncore/net/mail/accountitem.cpp
index c8f6ec4..32a96ff 100644
--- a/noncore/net/mail/accountitem.cpp
+++ b/noncore/net/mail/accountitem.cpp
@@ -164,96 +164,286 @@ void POP3folderItem::refresh(QList<RecMail>&target)
164} 164}
165 165
166RecBody POP3folderItem::fetchBody(const RecMail&aMail) 166RecBody POP3folderItem::fetchBody(const RecMail&aMail)
167{ 167{
168 return pop3->getWrapper()->fetchBody(aMail); 168 return pop3->getWrapper()->fetchBody(aMail);
169} 169}
170 170
171QPopupMenu * POP3folderItem::getContextMenu() 171QPopupMenu * POP3folderItem::getContextMenu()
172{ 172{
173 QPopupMenu *m = new QPopupMenu(0); 173 QPopupMenu *m = new QPopupMenu(0);
174 if (m) 174 if (m)
175 { 175 {
176 m->insertItem(QObject::tr("Refresh header list",contextName),0); 176 m->insertItem(QObject::tr("Refresh header list",contextName),0);
177 m->insertItem(QObject::tr("Delete all mails",contextName),1); 177 m->insertItem(QObject::tr("Delete all mails",contextName),1);
178 m->insertItem(QObject::tr("Move/Copie all mails",contextName),2); 178 m->insertItem(QObject::tr("Move/Copie all mails",contextName),2);
179 } 179 }
180 return m; 180 return m;
181} 181}
182 182
183void POP3folderItem::downloadMails() 183void POP3folderItem::downloadMails()
184{ 184{
185 AccountView*bl = pop3->accountView(); 185 AccountView*bl = pop3->accountView();
186 if (!bl) return; 186 if (!bl) return;
187 bl->downloadMails(folder,pop3->getWrapper()); 187 bl->downloadMails(folder,pop3->getWrapper());
188} 188}
189 189
190void POP3folderItem::contextMenuSelected(int which) 190void POP3folderItem::contextMenuSelected(int which)
191{ 191{
192 AccountView * view = (AccountView*)listView(); 192 AccountView * view = (AccountView*)listView();
193 switch (which) 193 switch (which)
194 { 194 {
195 case 0: 195 case 0:
196 /* must be 'cause pop3 lists are cached */ 196 /* must be 'cause pop3 lists are cached */
197 pop3->getWrapper()->logout(); 197 pop3->getWrapper()->logout();
198 view->refreshCurrent(); 198 view->refreshCurrent();
199 break; 199 break;
200 case 1: 200 case 1:
201 deleteAllMail(pop3->getWrapper(),folder); 201 deleteAllMail(pop3->getWrapper(),folder);
202 break; 202 break;
203 case 2: 203 case 2:
204 downloadMails(); 204 downloadMails();
205 break; 205 break;
206 default: 206 default:
207 break; 207 break;
208 } 208 }
209} 209}
210 210
211/** 211/**
212 * NNTP Account stuff
213 */
214NNTPviewItem::NNTPviewItem( NNTPaccount *a, AccountView *parent )
215 : AccountViewItem( parent )
216{
217 account = a;
218 wrapper = AbstractMail::getWrapper( account );
219 //FIXME
220 SETPIX(PIXMAP_POP3FOLDER);
221#if 0
222 if (!account->getOffline())
223 {
224 setPixmap( 0, );
225 }
226 else
227 {
228 setPixmap( 0, PIXMAP_OFFLINE );
229 }
230#endif
231 setText( 0, account->getAccountName() );
232 setOpen( true );
233}
234
235NNTPviewItem::~NNTPviewItem()
236{
237 delete wrapper;
238}
239
240AbstractMail *NNTPviewItem::getWrapper()
241{
242 return wrapper;
243}
244
245void NNTPviewItem::refresh( QList<RecMail> & )
246{
247 refresh();
248}
249
250void NNTPviewItem::refresh()
251{
252 if (account->getOffline()) return;
253 QList<Folder> *folders = wrapper->listFolders();
254 QListViewItem *child = firstChild();
255 while ( child )
256 {
257 QListViewItem *tmp = child;
258 child = child->nextSibling();
259 delete tmp;
260 }
261 Folder *it;
262 QListViewItem*item = 0;
263 for ( it = folders->first(); it; it = folders->next() )
264 {
265 item = new NNTPfolderItem( it, this , item );
266 item->setSelectable(it->may_select());
267 }
268 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
269 folders->setAutoDelete(false);
270 delete folders;
271}
272
273RecBody NNTPviewItem::fetchBody( const RecMail &mail )
274{
275 qDebug( "NNTP fetchBody" );
276 return wrapper->fetchBody( mail );
277}
278
279QPopupMenu * NNTPviewItem::getContextMenu()
280{
281 QPopupMenu *m = new QPopupMenu(0);
282 if (m)
283 {
284 if (!account->getOffline())
285 {
286 m->insertItem(QObject::tr("Disconnect",contextName),0);
287 m->insertItem(QObject::tr("Set offline",contextName),1);
288 }
289 else
290 {
291 m->insertItem(QObject::tr("Set online",contextName),1);
292 }
293 }
294 return m;
295}
296
297void NNTPviewItem::disconnect()
298{
299 QListViewItem *child = firstChild();
300 while ( child )
301 {
302 QListViewItem *tmp = child;
303 child = child->nextSibling();
304 delete tmp;
305 }
306 wrapper->logout();
307}
308
309void NNTPviewItem::setOnOffline()
310{
311 if (!account->getOffline())
312 {
313 disconnect();
314 }
315 account->setOffline(!account->getOffline());
316 account->save();
317 //FIXME
318 SETPIX(PIXMAP_POP3FOLDER);
319 refresh();
320}
321
322void NNTPviewItem::contextMenuSelected(int which)
323{
324 switch (which)
325 {
326 case 0:
327 disconnect();
328 break;
329 case 1:
330 setOnOffline();
331 break;
332 }
333}
334
335NNTPfolderItem::~NNTPfolderItem()
336{}
337
338NNTPfolderItem::NNTPfolderItem( Folder *folderInit, NNTPviewItem *parent , QListViewItem*after )
339 : AccountViewItem( parent,after )
340{
341 folder = folderInit;
342 nntp = parent;
343 if (folder->getDisplayName().lower()!="inbox")
344 {
345 setPixmap( 0, PIXMAP_POP3FOLDER );
346 }
347 else
348 {
349 setPixmap( 0, PIXMAP_INBOXFOLDER);
350 }
351 setText( 0, folder->getDisplayName() );
352}
353
354void NNTPfolderItem::refresh(QList<RecMail>&target)
355{
356 if (folder->may_select())
357 nntp->getWrapper()->listMessages( folder->getName(),target );
358}
359
360RecBody NNTPfolderItem::fetchBody(const RecMail&aMail)
361{
362 return nntp->getWrapper()->fetchBody(aMail);
363}
364
365QPopupMenu * NNTPfolderItem::getContextMenu()
366{
367 QPopupMenu *m = new QPopupMenu(0);
368 if (m)
369 {
370 m->insertItem(QObject::tr("Refresh header list",contextName),0);
371 m->insertItem(QObject::tr("Move/Copie all mails",contextName),1);
372 }
373 return m;
374}
375
376void NNTPfolderItem::downloadMails()
377{
378 AccountView*bl = nntp->accountView();
379 if (!bl) return;
380 bl->downloadMails(folder,nntp->getWrapper());
381}
382
383void NNTPfolderItem::contextMenuSelected(int which)
384{
385 AccountView * view = (AccountView*)listView();
386 switch (which)
387 {
388 case 0:
389 /* must be 'cause pop3 lists are cached */
390 nntp->getWrapper()->logout();
391 view->refreshCurrent();
392 break;
393 case 1:
394 downloadMails();
395 break;
396 default:
397 break;
398 }
399}
400
401/**
212 * IMAP Account stuff 402 * IMAP Account stuff
213 */ 403 */
214IMAPviewItem::IMAPviewItem( IMAPaccount *a, AccountView *parent ) 404IMAPviewItem::IMAPviewItem( IMAPaccount *a, AccountView *parent )
215 : AccountViewItem( parent ) 405 : AccountViewItem( parent )
216{ 406{
217 account = a; 407 account = a;
218 wrapper = AbstractMail::getWrapper( account ); 408 wrapper = AbstractMail::getWrapper( account );
219 SETPIX(PIXMAP_IMAPFOLDER); 409 SETPIX(PIXMAP_IMAPFOLDER);
220 setText( 0, account->getAccountName() ); 410 setText( 0, account->getAccountName() );
221 setOpen( true ); 411 setOpen( true );
222} 412}
223 413
224IMAPviewItem::~IMAPviewItem() 414IMAPviewItem::~IMAPviewItem()
225{ 415{
226 delete wrapper; 416 delete wrapper;
227} 417}
228 418
229AbstractMail *IMAPviewItem::getWrapper() 419AbstractMail *IMAPviewItem::getWrapper()
230{ 420{
231 return wrapper; 421 return wrapper;
232} 422}
233 423
234void IMAPviewItem::refresh(QList<RecMail>&) 424void IMAPviewItem::refresh(QList<RecMail>&)
235{ 425{
236 refreshFolders(false); 426 refreshFolders(false);
237} 427}
238 428
239const QStringList&IMAPviewItem::subFolders() 429const QStringList&IMAPviewItem::subFolders()
240{ 430{
241 return currentFolders; 431 return currentFolders;
242} 432}
243 433
244void IMAPviewItem::refreshFolders(bool force) 434void IMAPviewItem::refreshFolders(bool force)
245{ 435{
246 if (childCount()>0 && force==false) return; 436 if (childCount()>0 && force==false) return;
247 if (account->getOffline()) return; 437 if (account->getOffline()) return;
248 438
249 removeChilds(); 439 removeChilds();
250 currentFolders.clear(); 440 currentFolders.clear();
251 QList<Folder> *folders = wrapper->listFolders(); 441 QList<Folder> *folders = wrapper->listFolders();
252 442
253 Folder *it; 443 Folder *it;
254 QListViewItem*item = 0; 444 QListViewItem*item = 0;
255 QListViewItem*titem = 0; 445 QListViewItem*titem = 0;
256 QString fname,del,search; 446 QString fname,del,search;
257 int pos; 447 int pos;
258 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 448 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
259 folders->setAutoDelete(false); 449 folders->setAutoDelete(false);
diff --git a/noncore/net/mail/accountitem.h b/noncore/net/mail/accountitem.h
index 99208b6..a138c9b 100644
--- a/noncore/net/mail/accountitem.h
+++ b/noncore/net/mail/accountitem.h
@@ -1,126 +1,166 @@
1#ifndef __ACCOUNT_ITEM 1#ifndef __ACCOUNT_ITEM
2#define __ACCOUNT_ITEM 2#define __ACCOUNT_ITEM
3 3
4#include <qlistview.h> 4#include <qlistview.h>
5#include <qlist.h> 5#include <qlist.h>
6 6
7class POP3wrapper; 7class POP3wrapper;
8class RecMail; 8class RecMail;
9class RecBody; 9class RecBody;
10class QPopupMenu; 10class QPopupMenu;
11class Selectstore; 11class Selectstore;
12class AccountView; 12class AccountView;
13class POP3account; 13class POP3account;
14class NNTPaccount;
14class IMAPaccount; 15class IMAPaccount;
15class AbstractMail; 16class AbstractMail;
16class Folder; 17class Folder;
17 18
18class AccountViewItem : public QListViewItem 19class AccountViewItem : public QListViewItem
19{ 20{
20 21
21public: 22public:
22 AccountViewItem( AccountView *parent ); 23 AccountViewItem( AccountView *parent );
23 AccountViewItem( QListViewItem *parent); 24 AccountViewItem( QListViewItem *parent);
24 AccountViewItem( QListViewItem *parent , QListViewItem*after ); 25 AccountViewItem( QListViewItem *parent , QListViewItem*after );
25 virtual ~AccountViewItem(); 26 virtual ~AccountViewItem();
26 virtual void refresh(QList<RecMail>&)=0; 27 virtual void refresh(QList<RecMail>&)=0;
27 virtual RecBody fetchBody(const RecMail&)=0; 28 virtual RecBody fetchBody(const RecMail&)=0;
28 virtual QPopupMenu * getContextMenu(){return 0;}; 29 virtual QPopupMenu * getContextMenu(){return 0;};
29 virtual void contextMenuSelected(int){} 30 virtual void contextMenuSelected(int){}
30 virtual AccountView*accountView(); 31 virtual AccountView*accountView();
31 virtual bool matchName(const QString&name)const; 32 virtual bool matchName(const QString&name)const;
32 33
33protected: 34protected:
34 AccountViewItem*findSubItem(const QString&path,AccountViewItem*start=0); 35 AccountViewItem*findSubItem(const QString&path,AccountViewItem*start=0);
35 virtual void init(); 36 virtual void init();
36 virtual void removeChilds(); 37 virtual void removeChilds();
37 virtual void deleteAllMail(AbstractMail*wrapper,Folder*f); 38 virtual void deleteAllMail(AbstractMail*wrapper,Folder*f);
38 static const QString contextName; 39 static const QString contextName;
39 AccountView*m_Backlink; 40 AccountView*m_Backlink;
40 Folder *folder; 41 Folder *folder;
41}; 42};
42 43
43class POP3viewItem : public AccountViewItem 44class POP3viewItem : public AccountViewItem
44{ 45{
45 46
46public: 47public:
47 POP3viewItem( POP3account *a, AccountView *parent ); 48 POP3viewItem( POP3account *a, AccountView *parent );
48 virtual ~POP3viewItem(); 49 virtual ~POP3viewItem();
49 virtual void refresh( QList<RecMail> &target ); 50 virtual void refresh( QList<RecMail> &target );
50 virtual RecBody fetchBody( const RecMail &mail ); 51 virtual RecBody fetchBody( const RecMail &mail );
51 AbstractMail *getWrapper(); 52 AbstractMail *getWrapper();
52 virtual QPopupMenu * getContextMenu(); 53 virtual QPopupMenu * getContextMenu();
53 virtual void contextMenuSelected(int); 54 virtual void contextMenuSelected(int);
54 55
55protected: 56protected:
56 POP3account *account; 57 POP3account *account;
57 virtual void refresh(); 58 virtual void refresh();
58 AbstractMail *wrapper; 59 AbstractMail *wrapper;
59 void disconnect(); 60 void disconnect();
60 void setOnOffline(); 61 void setOnOffline();
61}; 62};
62 63
63class POP3folderItem : public AccountViewItem 64class POP3folderItem : public AccountViewItem
64{ 65{
65 66
66public: 67public:
67 POP3folderItem( Folder *folder, POP3viewItem *parent , QListViewItem*after ); 68 POP3folderItem( Folder *folder, POP3viewItem *parent , QListViewItem*after );
68 virtual ~POP3folderItem(); 69 virtual ~POP3folderItem();
69 virtual void refresh(QList<RecMail>&); 70 virtual void refresh(QList<RecMail>&);
70 virtual RecBody fetchBody(const RecMail&); 71 virtual RecBody fetchBody(const RecMail&);
71 virtual QPopupMenu * getContextMenu(); 72 virtual QPopupMenu * getContextMenu();
72 virtual void contextMenuSelected(int); 73 virtual void contextMenuSelected(int);
73 74
74protected: 75protected:
75 void downloadMails(); 76 void downloadMails();
76 POP3viewItem *pop3; 77 POP3viewItem *pop3;
77}; 78};
78 79
80
81class NNTPviewItem : public AccountViewItem
82{
83
84public:
85 NNTPviewItem( NNTPaccount *a, AccountView *parent );
86 virtual ~NNTPviewItem();
87 virtual void refresh( QList<RecMail> &target );
88 virtual RecBody fetchBody( const RecMail &mail );
89 AbstractMail *getWrapper();
90 virtual QPopupMenu * getContextMenu();
91 virtual void contextMenuSelected(int);
92
93protected:
94 NNTPaccount *account;
95 virtual void refresh();
96 AbstractMail *wrapper;
97 void disconnect();
98 void setOnOffline();
99};
100
101class NNTPfolderItem : public AccountViewItem
102{
103
104public:
105 NNTPfolderItem( Folder *folder, NNTPviewItem *parent , QListViewItem*after );
106 virtual ~NNTPfolderItem();
107 virtual void refresh(QList<RecMail>&);
108 virtual RecBody fetchBody(const RecMail&);
109 virtual QPopupMenu * getContextMenu();
110 virtual void contextMenuSelected(int);
111
112protected:
113 void downloadMails();
114 NNTPviewItem *nntp;
115};
116
117
118
79class IMAPviewItem : public AccountViewItem 119class IMAPviewItem : public AccountViewItem
80{ 120{
81 friend class IMAPfolderItem; 121 friend class IMAPfolderItem;
82public: 122public:
83 IMAPviewItem( IMAPaccount *a, AccountView *parent ); 123 IMAPviewItem( IMAPaccount *a, AccountView *parent );
84 virtual ~IMAPviewItem(); 124 virtual ~IMAPviewItem();
85 virtual void refresh(QList<RecMail>&); 125 virtual void refresh(QList<RecMail>&);
86 virtual RecBody fetchBody(const RecMail&); 126 virtual RecBody fetchBody(const RecMail&);
87 AbstractMail *getWrapper(); 127 AbstractMail *getWrapper();
88 virtual QPopupMenu * getContextMenu(); 128 virtual QPopupMenu * getContextMenu();
89 virtual void contextMenuSelected(int); 129 virtual void contextMenuSelected(int);
90 const QStringList&subFolders(); 130 const QStringList&subFolders();
91 virtual void refreshFolders(bool force=false); 131 virtual void refreshFolders(bool force=false);
92 bool offline(); 132 bool offline();
93 133
94protected: 134protected:
95 virtual void createNewFolder(); 135 virtual void createNewFolder();
96 IMAPaccount *account; 136 IMAPaccount *account;
97 AbstractMail *wrapper; 137 AbstractMail *wrapper;
98 QStringList currentFolders; 138 QStringList currentFolders;
99}; 139};
100 140
101class IMAPfolderItem : public AccountViewItem 141class IMAPfolderItem : public AccountViewItem
102{ 142{
103 143
104public: 144public:
105 IMAPfolderItem( Folder *folder, IMAPviewItem *parent , QListViewItem*after ); 145 IMAPfolderItem( Folder *folder, IMAPviewItem *parent , QListViewItem*after );
106 IMAPfolderItem( Folder *folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); 146 IMAPfolderItem( Folder *folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master );
107 virtual ~IMAPfolderItem(); 147 virtual ~IMAPfolderItem();
108 virtual void refresh(QList<RecMail>&); 148 virtual void refresh(QList<RecMail>&);
109 virtual RecBody fetchBody(const RecMail&); 149 virtual RecBody fetchBody(const RecMail&);
110 virtual QPopupMenu * getContextMenu(); 150 virtual QPopupMenu * getContextMenu();
111 virtual void contextMenuSelected(int); 151 virtual void contextMenuSelected(int);
112 virtual const QString& Delemiter()const; 152 virtual const QString& Delemiter()const;
113protected: 153protected:
114 virtual void createNewFolder(); 154 virtual void createNewFolder();
115 virtual void deleteFolder(); 155 virtual void deleteFolder();
116 virtual void downloadMails(); 156 virtual void downloadMails();
117 IMAPviewItem *imap; 157 IMAPviewItem *imap;
118}; 158};
119 159
120class MHviewItem : public AccountViewItem 160class MHviewItem : public AccountViewItem
121{ 161{
122 friend class MHfolderItem; 162 friend class MHfolderItem;
123 163
124public: 164public:
125 MHviewItem( const QString&aMboxPath, AccountView *parent ); 165 MHviewItem( const QString&aMboxPath, AccountView *parent );
126 virtual ~MHviewItem(); 166 virtual ~MHviewItem();
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index 2ddf834..c2185f2 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -30,97 +30,104 @@ AccountView::~AccountView()
30 mhAccounts.clear(); 30 mhAccounts.clear();
31} 31}
32 32
33void AccountView::slotContextMenu(int id) 33void AccountView::slotContextMenu(int id)
34{ 34{
35 AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); 35 AccountViewItem *view = static_cast<AccountViewItem *>(currentItem());
36 if (!view) return; 36 if (!view) return;
37 view->contextMenuSelected(id); 37 view->contextMenuSelected(id);
38} 38}
39 39
40void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) 40void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int)
41{ 41{
42 if (button==1) {return;} 42 if (button==1) {return;}
43 if (!item) return; 43 if (!item) return;
44 AccountViewItem *view = static_cast<AccountViewItem *>(item); 44 AccountViewItem *view = static_cast<AccountViewItem *>(item);
45 QPopupMenu*m = view->getContextMenu(); 45 QPopupMenu*m = view->getContextMenu();
46 if (!m) return; 46 if (!m) return;
47 connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); 47 connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int)));
48 m->setFocus(); 48 m->setFocus();
49 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); 49 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
50 delete m; 50 delete m;
51} 51}
52 52
53void AccountView::populate( QList<Account> list ) 53void AccountView::populate( QList<Account> list )
54{ 54{
55 clear(); 55 clear();
56 56
57 imapAccounts.clear(); 57 imapAccounts.clear();
58 mhAccounts.clear(); 58 mhAccounts.clear();
59 59
60 mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); 60 mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this));
61 61
62 Account *it; 62 Account *it;
63 for ( it = list.first(); it; it = list.next() ) 63 for ( it = list.first(); it; it = list.next() )
64 { 64 {
65 if ( it->getType().compare( "IMAP" ) == 0 ) 65 if ( it->getType().compare( "IMAP" ) == 0 )
66 { 66 {
67 IMAPaccount *imap = static_cast<IMAPaccount *>(it); 67 IMAPaccount *imap = static_cast<IMAPaccount *>(it);
68 qDebug( "added IMAP " + imap->getAccountName() ); 68 qDebug( "added IMAP " + imap->getAccountName() );
69 imapAccounts.append(new IMAPviewItem( imap, this )); 69 imapAccounts.append(new IMAPviewItem( imap, this ));
70 } 70 }
71 else if ( it->getType().compare( "POP3" ) == 0 ) 71 else if ( it->getType().compare( "POP3" ) == 0 )
72 { 72 {
73 POP3account *pop3 = static_cast<POP3account *>(it); 73 POP3account *pop3 = static_cast<POP3account *>(it);
74 qDebug( "added POP3 " + pop3->getAccountName() ); 74 qDebug( "added POP3 " + pop3->getAccountName() );
75 /* must not be hold 'cause it isn't required */ 75 /* must not be hold 'cause it isn't required */
76 (void) new POP3viewItem( pop3, this ); 76 (void) new POP3viewItem( pop3, this );
77 } 77 }
78 } 78 else if ( it->getType().compare( "NNTP" ) == 0 )
79 {
80 NNTPaccount *nntp = static_cast<NNTPaccount *>(it);
81 qDebug( "added NNTP " + nntp->getAccountName() );
82 /* must not be hold 'cause it isn't required */
83 (void) new NNTPviewItem( nntp, this );
84 }
85 }
79} 86}
80 87
81void AccountView::refresh(QListViewItem *item) 88void AccountView::refresh(QListViewItem *item)
82{ 89{
83 90
84 qDebug("AccountView refresh..."); 91 qDebug("AccountView refresh...");
85 if ( item ) 92 if ( item )
86 { 93 {
87 m_currentItem = item; 94 m_currentItem = item;
88 QList<RecMail> headerlist; 95 QList<RecMail> headerlist;
89 headerlist.setAutoDelete(true); 96 headerlist.setAutoDelete(true);
90 AccountViewItem *view = static_cast<AccountViewItem *>(item); 97 AccountViewItem *view = static_cast<AccountViewItem *>(item);
91 view->refresh(headerlist); 98 view->refresh(headerlist);
92 emit refreshMailview(&headerlist); 99 emit refreshMailview(&headerlist);
93 } 100 }
94} 101}
95 102
96void AccountView::refreshCurrent() 103void AccountView::refreshCurrent()
97{ 104{
98 m_currentItem = currentItem(); 105 m_currentItem = currentItem();
99 if ( !m_currentItem ) return; 106 if ( !m_currentItem ) return;
100 QList<RecMail> headerlist; 107 QList<RecMail> headerlist;
101 headerlist.setAutoDelete(true); 108 headerlist.setAutoDelete(true);
102 AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); 109 AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem);
103 view->refresh(headerlist); 110 view->refresh(headerlist);
104 emit refreshMailview(&headerlist); 111 emit refreshMailview(&headerlist);
105} 112}
106 113
107void AccountView::refreshAll() 114void AccountView::refreshAll()
108{ 115{
109} 116}
110 117
111RecBody AccountView::fetchBody(const RecMail&aMail) 118RecBody AccountView::fetchBody(const RecMail&aMail)
112{ 119{
113 QListViewItem*item = selectedItem (); 120 QListViewItem*item = selectedItem ();
114 if (!item) return RecBody(); 121 if (!item) return RecBody();
115 AccountViewItem *view = static_cast<AccountViewItem *>(item); 122 AccountViewItem *view = static_cast<AccountViewItem *>(item);
116 return view->fetchBody(aMail); 123 return view->fetchBody(aMail);
117} 124}
118 125
119void AccountView::setupFolderselect(Selectstore*sels) 126void AccountView::setupFolderselect(Selectstore*sels)
120{ 127{
121 QPEApplication::showDialog( sels ); 128 QPEApplication::showDialog( sels );
122 QStringList sFolders; 129 QStringList sFolders;
123 unsigned int i = 0; 130 unsigned int i = 0;
124 for (i=0; i < mhAccounts.count();++i) 131 for (i=0; i < mhAccounts.count();++i)
125 { 132 {
126 mhAccounts[i]->refresh(false); 133 mhAccounts[i]->refresh(false);
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp
index 592cd5e..741a8e1 100644
--- a/noncore/net/mail/libmailwrapper/abstractmail.cpp
+++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp
@@ -1,112 +1,118 @@
1#include "abstractmail.h" 1#include "abstractmail.h"
2#include "imapwrapper.h" 2#include "imapwrapper.h"
3#include "pop3wrapper.h" 3#include "pop3wrapper.h"
4#include "nntpwrapper.h"
4#include "mhwrapper.h" 5#include "mhwrapper.h"
5#include "mboxwrapper.h" 6#include "mboxwrapper.h"
6#include "mailtypes.h" 7#include "mailtypes.h"
7 8
8#include <qstring.h> 9#include <qstring.h>
9#include <qfile.h> 10#include <qfile.h>
10#include <qtextstream.h> 11#include <qtextstream.h>
11#include <stdlib.h> 12#include <stdlib.h>
12#include <libetpan/mailmime_content.h> 13#include <libetpan/mailmime_content.h>
13#include <libetpan/mailmime.h> 14#include <libetpan/mailmime.h>
14 15
15AbstractMail* AbstractMail::getWrapper(IMAPaccount *a) 16AbstractMail* AbstractMail::getWrapper(IMAPaccount *a)
16{ 17{
17 return new IMAPwrapper(a); 18 return new IMAPwrapper(a);
18} 19}
19 20
20AbstractMail* AbstractMail::getWrapper(POP3account *a) 21AbstractMail* AbstractMail::getWrapper(POP3account *a)
21{ 22{
22 return new POP3wrapper(a); 23 return new POP3wrapper(a);
23} 24}
24 25
26AbstractMail* AbstractMail::getWrapper(NNTPaccount *a)
27{
28 return new NNTPwrapper(a);
29}
30
25AbstractMail* AbstractMail::getWrapper(const QString&a,const QString&name) 31AbstractMail* AbstractMail::getWrapper(const QString&a,const QString&name)
26{ 32{
27 return new MHwrapper(a,name); 33 return new MHwrapper(a,name);
28} 34}
29 35
30encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc) 36encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc)
31{ 37{
32 qDebug("Decode string start"); 38 qDebug("Decode string start");
33 char*result_text; 39 char*result_text;
34 size_t index = 0; 40 size_t index = 0;
35 /* reset for recursive use! */ 41 /* reset for recursive use! */
36 size_t target_length = 0; 42 size_t target_length = 0;
37 result_text = 0; 43 result_text = 0;
38 int mimetype = MAILMIME_MECHANISM_7BIT; 44 int mimetype = MAILMIME_MECHANISM_7BIT;
39 if (enc.lower()=="quoted-printable") { 45 if (enc.lower()=="quoted-printable") {
40 mimetype = MAILMIME_MECHANISM_QUOTED_PRINTABLE; 46 mimetype = MAILMIME_MECHANISM_QUOTED_PRINTABLE;
41 } else if (enc.lower()=="base64") { 47 } else if (enc.lower()=="base64") {
42 mimetype = MAILMIME_MECHANISM_BASE64; 48 mimetype = MAILMIME_MECHANISM_BASE64;
43 } else if (enc.lower()=="8bit") { 49 } else if (enc.lower()=="8bit") {
44 mimetype = MAILMIME_MECHANISM_8BIT; 50 mimetype = MAILMIME_MECHANISM_8BIT;
45 } else if (enc.lower()=="binary") { 51 } else if (enc.lower()=="binary") {
46 mimetype = MAILMIME_MECHANISM_BINARY; 52 mimetype = MAILMIME_MECHANISM_BINARY;
47 } 53 }
48 54
49 int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype, 55 int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype,
50 &result_text,&target_length); 56 &result_text,&target_length);
51 57
52 encodedString* result = new encodedString(); 58 encodedString* result = new encodedString();
53 if (err == MAILIMF_NO_ERROR) { 59 if (err == MAILIMF_NO_ERROR) {
54 result->setContent(result_text,target_length); 60 result->setContent(result_text,target_length);
55 } 61 }
56 qDebug("Decode string finished"); 62 qDebug("Decode string finished");
57 return result; 63 return result;
58} 64}
59 65
60QString AbstractMail::convert_String(const char*text) 66QString AbstractMail::convert_String(const char*text)
61{ 67{
62 size_t index = 0; 68 size_t index = 0;
63 char*res = 0; 69 char*res = 0;
64 70
65 /* attention - doesn't work with arm systems! */ 71 /* attention - doesn't work with arm systems! */
66 int err = mailmime_encoded_phrase_parse("iso-8859-1", 72 int err = mailmime_encoded_phrase_parse("iso-8859-1",
67 text, strlen(text),&index, "iso-8859-1",&res); 73 text, strlen(text),&index, "iso-8859-1",&res);
68 if (err != MAILIMF_NO_ERROR) { 74 if (err != MAILIMF_NO_ERROR) {
69 if (res) free(res); 75 if (res) free(res);
70 return QString(text); 76 return QString(text);
71 } 77 }
72 if (res) { 78 if (res) {
73 QString result(res); 79 QString result(res);
74 free(res); 80 free(res);
75 return result; 81 return result;
76 } 82 }
77 return QString(text); 83 return QString(text);
78} 84}
79 85
80/* cp & paste from launcher */ 86/* cp & paste from launcher */
81QString AbstractMail::gen_attachment_id() 87QString AbstractMail::gen_attachment_id()
82{ 88{
83 QFile file( "/proc/sys/kernel/random/uuid" ); 89 QFile file( "/proc/sys/kernel/random/uuid" );
84 if (!file.open(IO_ReadOnly ) ) 90 if (!file.open(IO_ReadOnly ) )
85 return QString::null; 91 return QString::null;
86 92
87 QTextStream stream(&file); 93 QTextStream stream(&file);
88 94
89 return "{" + stream.read().stripWhiteSpace() + "}"; 95 return "{" + stream.read().stripWhiteSpace() + "}";
90} 96}
91 97
92int AbstractMail::createMbox(const QString&,const Folder*,const QString& delemiter,bool) 98int AbstractMail::createMbox(const QString&,const Folder*,const QString& delemiter,bool)
93{ 99{
94 return 0; 100 return 0;
95} 101}
96 102
97QString AbstractMail::defaultLocalfolder() 103QString AbstractMail::defaultLocalfolder()
98{ 104{
99 QString f = getenv( "HOME" ); 105 QString f = getenv( "HOME" );
100 f += "/Applications/opiemail/localmail"; 106 f += "/Applications/opiemail/localmail";
101 return f; 107 return f;
102} 108}
103 109
104/* temporary - will be removed when implemented in all classes */ 110/* temporary - will be removed when implemented in all classes */
105void AbstractMail::deleteMails(const QString &,QList<RecMail> &) 111void AbstractMail::deleteMails(const QString &,QList<RecMail> &)
106{ 112{
107} 113}
108 114
109void AbstractMail::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 115void AbstractMail::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
110{ 116{
111 QList<RecMail> t; 117 QList<RecMail> t;
112 listMessages(fromFolder->getName(),t); 118 listMessages(fromFolder->getName(),t);
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h
index f93bab4..b6e1538 100644
--- a/noncore/net/mail/libmailwrapper/abstractmail.h
+++ b/noncore/net/mail/libmailwrapper/abstractmail.h
@@ -4,62 +4,63 @@
4#include <qobject.h> 4#include <qobject.h>
5#include "settings.h" 5#include "settings.h"
6 6
7class RecMail; 7class RecMail;
8class RecBody; 8class RecBody;
9class RecPart; 9class RecPart;
10class IMAPwrapper; 10class IMAPwrapper;
11class POP3wrapper; 11class POP3wrapper;
12class Folder; 12class Folder;
13class encodedString; 13class encodedString;
14struct folderStat; 14struct folderStat;
15 15
16class AbstractMail:public QObject 16class AbstractMail:public QObject
17{ 17{
18 Q_OBJECT 18 Q_OBJECT
19public: 19public:
20 AbstractMail(){}; 20 AbstractMail(){};
21 virtual ~AbstractMail(){} 21 virtual ~AbstractMail(){}
22 virtual QList<Folder>* listFolders()=0; 22 virtual QList<Folder>* listFolders()=0;
23 virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; 23 virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0;
24 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; 24 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0;
25 virtual RecBody fetchBody(const RecMail&mail)=0; 25 virtual RecBody fetchBody(const RecMail&mail)=0;
26 virtual QString fetchTextPart(const RecMail&mail,const RecPart&part)=0; 26 virtual QString fetchTextPart(const RecMail&mail,const RecPart&part)=0;
27 virtual encodedString* fetchDecodedPart(const RecMail&mail,const RecPart&part)=0; 27 virtual encodedString* fetchDecodedPart(const RecMail&mail,const RecPart&part)=0;
28 virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part)=0; 28 virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part)=0;
29 virtual encodedString* fetchRawBody(const RecMail&mail)=0; 29 virtual encodedString* fetchRawBody(const RecMail&mail)=0;
30 30
31 virtual void deleteMail(const RecMail&mail)=0; 31 virtual void deleteMail(const RecMail&mail)=0;
32 virtual void answeredMail(const RecMail&mail)=0; 32 virtual void answeredMail(const RecMail&mail)=0;
33 virtual int deleteAllMail(const Folder*)=0; 33 virtual int deleteAllMail(const Folder*)=0;
34 virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); 34 virtual void deleteMails(const QString & FolderName,QList<RecMail> &target);
35 virtual int deleteMbox(const Folder*)=0; 35 virtual int deleteMbox(const Folder*)=0;
36 virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; 36 virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0;
37 37
38 virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 38 virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
39 virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 39 virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
40 40
41 virtual void cleanMimeCache(){}; 41 virtual void cleanMimeCache(){};
42 /* mail box methods */ 42 /* mail box methods */
43 /* parameter is the box to create. 43 /* parameter is the box to create.
44 * if the implementing subclass has prefixes, 44 * if the implementing subclass has prefixes,
45 * them has to be appended automatic. 45 * them has to be appended automatic.
46 */ 46 */
47 virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); 47 virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false);
48 virtual void logout()=0; 48 virtual void logout()=0;
49 49
50 static AbstractMail* getWrapper(IMAPaccount *a); 50 static AbstractMail* getWrapper(IMAPaccount *a);
51 static AbstractMail* getWrapper(POP3account *a); 51 static AbstractMail* getWrapper(POP3account *a);
52 static AbstractMail* getWrapper(NNTPaccount *a);
52 /* mbox only! */ 53 /* mbox only! */
53 static AbstractMail* getWrapper(const QString&a,const QString&name="Local Folders"); 54 static AbstractMail* getWrapper(const QString&a,const QString&name="Local Folders");
54 55
55 static QString defaultLocalfolder(); 56 static QString defaultLocalfolder();
56 57
57 virtual const QString&getType()const=0; 58 virtual const QString&getType()const=0;
58 virtual const QString&getName()const=0; 59 virtual const QString&getName()const=0;
59 60
60protected: 61protected:
61 static encodedString*decode_String(const encodedString*text,const QString&enc); 62 static encodedString*decode_String(const encodedString*text,const QString&enc);
62 static QString convert_String(const char*text); 63 static QString convert_String(const char*text);
63 static QString gen_attachment_id(); 64 static QString gen_attachment_id();
64}; 65};
65#endif 66#endif
diff --git a/noncore/net/mail/libmailwrapper/libmailwrapper.pro b/noncore/net/mail/libmailwrapper/libmailwrapper.pro
index 71f6cca..8ea04a4 100644
--- a/noncore/net/mail/libmailwrapper/libmailwrapper.pro
+++ b/noncore/net/mail/libmailwrapper/libmailwrapper.pro
@@ -1,48 +1,50 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on debug 2CONFIG += qt warn_on debug
3 3
4HEADERS = mailwrapper.h \ 4HEADERS = mailwrapper.h \
5 imapwrapper.h \ 5 imapwrapper.h \
6 mailtypes.h \ 6 mailtypes.h \
7 pop3wrapper.h \ 7 pop3wrapper.h \
8 abstractmail.h \ 8 abstractmail.h \
9 smtpwrapper.h \ 9 smtpwrapper.h \
10 genericwrapper.h \ 10 genericwrapper.h \
11 mboxwrapper.h \ 11 mboxwrapper.h \
12 settings.h \ 12 settings.h \
13 logindialog.h \ 13 logindialog.h \
14 sendmailprogress.h \ 14 sendmailprogress.h \
15 statusmail.h \ 15 statusmail.h \
16 mhwrapper.h 16 mhwrapper.h \
17 nntpwrapper.h
17 18
18SOURCES = imapwrapper.cpp \ 19SOURCES = imapwrapper.cpp \
19 mailwrapper.cpp \ 20 mailwrapper.cpp \
20 mailtypes.cpp \ 21 mailtypes.cpp \
21 pop3wrapper.cpp \ 22 pop3wrapper.cpp \
22 abstractmail.cpp \ 23 abstractmail.cpp \
23 smtpwrapper.cpp \ 24 smtpwrapper.cpp \
24 genericwrapper.cpp \ 25 genericwrapper.cpp \
25 mboxwrapper.cpp \ 26 mboxwrapper.cpp \
26 settings.cpp \ 27 settings.cpp \
27 logindialog.cpp \ 28 logindialog.cpp \
28 sendmailprogress.cpp \ 29 sendmailprogress.cpp \
29 statusmail.cpp \ 30 statusmail.cpp \
30 mhwrapper.cpp 31 mhwrapper.cpp \
32 nntpwrapper.cpp
31 33
32 INTERFACES = logindialogui.ui \ 34 INTERFACES = logindialogui.ui \
33 sendmailprogressui.ui 35 sendmailprogressui.ui
34 36
35 37
36INCLUDEPATH += $(OPIEDIR)/include 38INCLUDEPATH += $(OPIEDIR)/include
37 39
38CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) 40CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX )
39contains( CONFTEST, y ){ 41contains( CONFTEST, y ){
40 LIBS += -lqpe -letpan -lssl -lcrypto -liconv 42 LIBS += -lqpe -letpan -lssl -lcrypto -liconv
41}else{ 43}else{
42 LIBS += -lqpe -letpan -lssl -lcrypto 44 LIBS += -lqpe -letpan -lssl -lcrypto
43} 45}
44 46
45DESTDIR = $(OPIEDIR)/lib$(PROJMAK) 47DESTDIR = $(OPIEDIR)/lib$(PROJMAK)
46TARGET = mailwrapper 48TARGET = mailwrapper
47 49
48include ( $(OPIEDIR)/include.pro ) 50include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
new file mode 100644
index 0000000..e73a890
--- a/dev/null
+++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
@@ -0,0 +1,241 @@
1#include "nntpwrapper.h"
2#include "logindialog.h"
3#include "mailtypes.h"
4
5#include <qfile.h>
6
7#include <stdlib.h>
8
9#include <libetpan/libetpan.h>
10#include <libetpan/nntpdriver.h>
11
12
13
14#define HARD_MSG_SIZE_LIMIT 5242880
15
16NNTPwrapper::NNTPwrapper( NNTPaccount *a )
17: Genericwrapper() {
18 account = a;
19 m_nntp = NULL;
20 msgTempName = a->getFileName()+"_msg_cache";
21 last_msg_id = 0;
22}
23
24NNTPwrapper::~NNTPwrapper() {
25 logout();
26 QFile msg_cache(msgTempName);
27 if (msg_cache.exists()) {
28 msg_cache.remove();
29 }
30}
31
32void NNTPwrapper::nntp_progress( size_t current, size_t maximum ) {
33 qDebug( "NNTP: %i of %i", current, maximum );
34}
35
36
37RecBody NNTPwrapper::fetchBody( const RecMail &mail ) {
38 int err = NEWSNNTP_NO_ERROR;
39 char *message = 0;
40 size_t length = 0;
41
42 login();
43 if ( !m_nntp ) {
44 return RecBody();
45 }
46
47 RecBody body;
48 mailmessage * mailmsg;
49 if (mail.Msgsize()>HARD_MSG_SIZE_LIMIT) {
50 qDebug("Message to large: %i",mail.Msgsize());
51 return body;
52 }
53
54 QFile msg_cache(msgTempName);
55
56 cleanMimeCache();
57
58 if (mail.getNumber()!=last_msg_id) {
59 if (msg_cache.exists()) {
60 msg_cache.remove();
61 }
62 msg_cache.open(IO_ReadWrite|IO_Truncate);
63 last_msg_id = mail.getNumber();
64 err = mailsession_get_message(m_nntp->sto_session, mail.getNumber(), &mailmsg);
65 err = mailmessage_fetch(mailmsg,&message,&length);
66 msg_cache.writeBlock(message,length);
67 } else {
68 QString msg="";
69 msg_cache.open(IO_ReadOnly);
70 message = new char[4096];
71 memset(message,0,4096);
72 while (msg_cache.readBlock(message,4095)>0) {
73 msg+=message;
74 memset(message,0,4096);
75 }
76 delete message;
77 message = (char*)malloc(msg.length()+1*sizeof(char));
78 memset(message,0,msg.length()+1);
79 memcpy(message,msg.latin1(),msg.length());
80 /* transform to libetpan stuff */
81 mailmsg = mailmessage_new();
82 mailmessage_init(mailmsg, NULL, data_message_driver, 0, strlen(message));
83 generic_message_t * msg_data;
84 msg_data = (generic_message_t *)mailmsg->msg_data;
85 msg_data->msg_fetched = 1;
86 msg_data->msg_message = message;
87 msg_data->msg_length = strlen(message);
88 }
89 body = parseMail(mailmsg);
90
91 /* clean up */
92 if (mailmsg)
93 mailmessage_free(mailmsg);
94 if (message)
95 free(message);
96
97 return body;
98}
99
100
101void NNTPwrapper::listMessages(const QString &, QList<RecMail> &target )
102{
103 login();
104 if (!m_nntp)
105 return;
106 uint32_t res_messages,res_recent,res_unseen;
107 mailsession_status_folder(m_nntp->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen);
108 parseList(target,m_nntp->sto_session,"INBOX");
109}
110
111void NNTPwrapper::login()
112{
113 if (account->getOffline())
114 return;
115 /* we'll hold the line */
116 if ( m_nntp != NULL )
117 return;
118
119 const char *server, *user, *pass;
120 uint16_t port;
121 int err = NEWSNNTP_NO_ERROR;
122
123 server = account->getServer().latin1();
124 port = account->getPort().toUInt();
125
126 if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) {
127 LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true );
128 login.show();
129 if ( QDialog::Accepted == login.exec() ) {
130 // ok
131 user = login.getUser().latin1();
132 pass = login.getPassword().latin1();
133 } else {
134 // cancel
135 qDebug( "NNTP: Login canceled" );
136 return;
137 }
138 } else {
139 user = account->getUser().latin1();
140 pass = account->getPassword().latin1();
141 }
142
143 // bool ssl = account->getSSL();
144
145 m_nntp=mailstorage_new(NULL);
146
147 int conntypeset = account->ConnectionType();
148 int conntype = 0;
149 if ( conntypeset == 3 ) {
150 conntype = CONNECTION_TYPE_COMMAND;
151 } else if ( conntypeset == 2 ) {
152 conntype = CONNECTION_TYPE_TLS;
153 } else if ( conntypeset == 1 ) {
154 conntype = CONNECTION_TYPE_STARTTLS;
155 } else if ( conntypeset == 0 ) {
156 conntype = CONNECTION_TYPE_TRY_STARTTLS;
157 }
158
159 nntp_mailstorage_init(m_nntp,(char*)server, port, NULL, conntype, NNTP_AUTH_TYPE_PLAIN,
160 (char*)user,(char*)pass,0,0,0);
161
162 err = mailstorage_connect(m_nntp);
163
164 if (err != NEWSNNTP_NO_ERROR) {
165 qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) );
166 // Global::statusMessage(tr("Error initializing folder"));
167 mailstorage_free(m_nntp);
168 m_nntp = 0;
169 }
170}
171
172void NNTPwrapper::logout()
173{
174 int err = NEWSNNTP_NO_ERROR;
175 if ( m_nntp == NULL )
176 return;
177 mailstorage_free(m_nntp);
178 m_nntp = 0;
179}
180
181QList<Folder>* NNTPwrapper::listFolders() {
182 QList<Folder> * folders = new QList<Folder>();
183 folders->setAutoDelete( false );
184 clist *result = 0;
185
186 // int err =
187// if ( err == _NO_ERROR ) {
188// current = result->first;
189// for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) {
190
191
192// Folder*inb=new Folder("INBOX","/");
193
194
195// folders->append(inb);
196 return folders;
197}
198
199
200void NNTPwrapper::answeredMail(const RecMail&) {}
201
202void NNTPwrapper::statusFolder(folderStat&target_stat,const QString&) {
203 login();
204 target_stat.message_count = 0;
205 target_stat.message_unseen = 0;
206 target_stat.message_recent = 0;
207 if (!m_nntp)
208 return;
209 int r = mailsession_status_folder(m_nntp->sto_session,0,&target_stat.message_count,
210 &target_stat.message_recent,&target_stat.message_unseen);
211}
212
213
214encodedString* NNTPwrapper::fetchRawBody(const RecMail&mail) {
215 char*target=0;
216 size_t length=0;
217 encodedString*res = 0;
218 mailmessage * mailmsg = 0;
219 int err = mailsession_get_message(m_nntp->sto_session, mail.getNumber(), &mailmsg);
220 err = mailmessage_fetch(mailmsg,&target,&length);
221 if (mailmsg)
222 mailmessage_free(mailmsg);
223 if (target) {
224 res = new encodedString(target,length);
225 }
226 return res;
227}
228
229const QString&NNTPwrapper::getType()const {
230 return account->getType();
231}
232
233const QString&NNTPwrapper::getName()const{
234 return account->getAccountName();
235}
236
237void NNTPwrapper::deleteMail(const RecMail&mail) {
238}
239
240int NNTPwrapper::deleteAllMail(const Folder*) {
241}
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.h b/noncore/net/mail/libmailwrapper/nntpwrapper.h
new file mode 100644
index 0000000..e47e68f
--- a/dev/null
+++ b/noncore/net/mail/libmailwrapper/nntpwrapper.h
@@ -0,0 +1,48 @@
1#ifndef __NNTPWRAPPER
2#define __NNTPWRAPPER
3
4#include "mailwrapper.h"
5#include "genericwrapper.h"
6#include <qstring.h>
7#include <libetpan/clist.h>
8
9class encodedString;
10struct mailstorage;
11struct mailfolder;
12
13class NNTPwrapper : public Genericwrapper
14{
15
16 Q_OBJECT
17
18public:
19 NNTPwrapper( NNTPaccount *a );
20 virtual ~NNTPwrapper();
21
22 /* mailbox will be ignored */
23 virtual void listMessages(const QString & mailbox, QList<RecMail> &target );
24 /* should only get the subscribed one */
25 virtual QList<Folder>* listFolders();
26 /* mailbox will be ignored */
27 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
28
29 virtual void deleteMail(const RecMail&mail);
30 virtual void answeredMail(const RecMail&mail);
31 virtual int deleteAllMail(const Folder*);
32
33 virtual RecBody fetchBody( const RecMail &mail );
34 virtual encodedString* fetchRawBody(const RecMail&mail);
35 virtual void logout();
36 virtual const QString&getType()const;
37 virtual const QString&getName()const;
38 static void nntp_progress( size_t current, size_t maximum );
39
40protected:
41 void login();
42 NNTPaccount *account;
43 mailstorage* m_nntp;
44
45
46};
47
48#endif
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
index 14c2059..6fab401 100644
--- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
@@ -1,218 +1,218 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include "pop3wrapper.h" 2#include "pop3wrapper.h"
3#include "mailtypes.h" 3#include "mailtypes.h"
4#include "logindialog.h" 4#include "logindialog.h"
5#include <libetpan/libetpan.h> 5#include <libetpan/libetpan.h>
6#include <qpe/global.h> 6#include <qpe/global.h>
7#include <qfile.h> 7#include <qfile.h>
8#include <qstring.h> 8//#include <qstring.h>
9 9
10/* we don't fetch messages larger than 5 MB */ 10/* we don't fetch messages larger than 5 MB */
11#define HARD_MSG_SIZE_LIMIT 5242880 11#define HARD_MSG_SIZE_LIMIT 5242880
12 12
13POP3wrapper::POP3wrapper( POP3account *a ) 13POP3wrapper::POP3wrapper( POP3account *a )
14: Genericwrapper() { 14: Genericwrapper() {
15 account = a; 15 account = a;
16 m_pop3 = NULL; 16 m_pop3 = NULL;
17 msgTempName = a->getFileName()+"_msg_cache"; 17 msgTempName = a->getFileName()+"_msg_cache";
18 last_msg_id = 0; 18 last_msg_id = 0;
19} 19}
20 20
21POP3wrapper::~POP3wrapper() { 21POP3wrapper::~POP3wrapper() {
22 logout(); 22 logout();
23 QFile msg_cache(msgTempName); 23 QFile msg_cache(msgTempName);
24 if (msg_cache.exists()) { 24 if (msg_cache.exists()) {
25 msg_cache.remove(); 25 msg_cache.remove();
26 } 26 }
27} 27}
28 28
29void POP3wrapper::pop3_progress( size_t current, size_t maximum ) { 29void POP3wrapper::pop3_progress( size_t current, size_t maximum ) {
30 qDebug( "POP3: %i of %i", current, maximum ); 30 qDebug( "POP3: %i of %i", current, maximum );
31} 31}
32 32
33RecBody POP3wrapper::fetchBody( const RecMail &mail ) { 33RecBody POP3wrapper::fetchBody( const RecMail &mail ) {
34 int err = MAILPOP3_NO_ERROR; 34 int err = MAILPOP3_NO_ERROR;
35 char *message = 0; 35 char *message = 0;
36 size_t length = 0; 36 size_t length = 0;
37 37
38 login(); 38 login();
39 if ( !m_pop3 ) { 39 if ( !m_pop3 ) {
40 return RecBody(); 40 return RecBody();
41 } 41 }
42 42
43 RecBody body; 43 RecBody body;
44 mailmessage * mailmsg; 44 mailmessage * mailmsg;
45 if (mail.Msgsize()>HARD_MSG_SIZE_LIMIT) { 45 if (mail.Msgsize()>HARD_MSG_SIZE_LIMIT) {
46 qDebug("Message to large: %i",mail.Msgsize()); 46 qDebug("Message to large: %i",mail.Msgsize());
47 return body; 47 return body;
48 } 48 }
49 49
50 QFile msg_cache(msgTempName); 50 QFile msg_cache(msgTempName);
51 51
52 cleanMimeCache(); 52 cleanMimeCache();
53 53
54 if (mail.getNumber()!=last_msg_id) { 54 if (mail.getNumber()!=last_msg_id) {
55 if (msg_cache.exists()) { 55 if (msg_cache.exists()) {
56 msg_cache.remove(); 56 msg_cache.remove();
57 } 57 }
58 msg_cache.open(IO_ReadWrite|IO_Truncate); 58 msg_cache.open(IO_ReadWrite|IO_Truncate);
59 last_msg_id = mail.getNumber(); 59 last_msg_id = mail.getNumber();
60 err = mailsession_get_message(m_pop3->sto_session, mail.getNumber(), &mailmsg); 60 err = mailsession_get_message(m_pop3->sto_session, mail.getNumber(), &mailmsg);
61 err = mailmessage_fetch(mailmsg,&message,&length); 61 err = mailmessage_fetch(mailmsg,&message,&length);
62 msg_cache.writeBlock(message,length); 62 msg_cache.writeBlock(message,length);
63 } else { 63 } else {
64 QString msg=""; 64 QString msg="";
65 msg_cache.open(IO_ReadOnly); 65 msg_cache.open(IO_ReadOnly);
66 message = new char[4096]; 66 message = new char[4096];
67 memset(message,0,4096); 67 memset(message,0,4096);
68 while (msg_cache.readBlock(message,4095)>0) { 68 while (msg_cache.readBlock(message,4095)>0) {
69 msg+=message; 69 msg+=message;
70 memset(message,0,4096); 70 memset(message,0,4096);
71 } 71 }
72 delete message; 72 delete message;
73 message = (char*)malloc(msg.length()+1*sizeof(char)); 73 message = (char*)malloc(msg.length()+1*sizeof(char));
74 memset(message,0,msg.length()+1); 74 memset(message,0,msg.length()+1);
75 memcpy(message,msg.latin1(),msg.length()); 75 memcpy(message,msg.latin1(),msg.length());
76 /* transform to libetpan stuff */ 76 /* transform to libetpan stuff */
77 mailmsg = mailmessage_new(); 77 mailmsg = mailmessage_new();
78 mailmessage_init(mailmsg, NULL, data_message_driver, 0, strlen(message)); 78 mailmessage_init(mailmsg, NULL, data_message_driver, 0, strlen(message));
79 generic_message_t * msg_data; 79 generic_message_t * msg_data;
80 msg_data = (generic_message_t *)mailmsg->msg_data; 80 msg_data = (generic_message_t *)mailmsg->msg_data;
81 msg_data->msg_fetched = 1; 81 msg_data->msg_fetched = 1;
82 msg_data->msg_message = message; 82 msg_data->msg_message = message;
83 msg_data->msg_length = strlen(message); 83 msg_data->msg_length = strlen(message);
84 } 84 }
85 body = parseMail(mailmsg); 85 body = parseMail(mailmsg);
86 86
87 /* clean up */ 87 /* clean up */
88 if (mailmsg) 88 if (mailmsg)
89 mailmessage_free(mailmsg); 89 mailmessage_free(mailmsg);
90 if (message) 90 if (message)
91 free(message); 91 free(message);
92 92
93 return body; 93 return body;
94} 94}
95 95
96void POP3wrapper::listMessages(const QString &, QList<RecMail> &target ) 96void POP3wrapper::listMessages(const QString &, QList<RecMail> &target )
97{ 97{
98 login(); 98 login();
99 if (!m_pop3) 99 if (!m_pop3)
100 return; 100 return;
101 uint32_t res_messages,res_recent,res_unseen; 101 uint32_t res_messages,res_recent,res_unseen;
102 mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); 102 mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen);
103 parseList(target,m_pop3->sto_session,"INBOX"); 103 parseList(target,m_pop3->sto_session,"INBOX");
104 Global::statusMessage( tr("Mailbox contains %1 mail(s)").arg(res_messages)); 104 Global::statusMessage( tr("Mailbox contains %1 mail(s)").arg(res_messages));
105} 105}
106 106
107void POP3wrapper::login() 107void POP3wrapper::login()
108{ 108{
109 if (account->getOffline()) 109 if (account->getOffline())
110 return; 110 return;
111 /* we'll hold the line */ 111 /* we'll hold the line */
112 if ( m_pop3 != NULL ) 112 if ( m_pop3 != NULL )
113 return; 113 return;
114 114
115 const char *server, *user, *pass; 115 const char *server, *user, *pass;
116 uint16_t port; 116 uint16_t port;
117 int err = MAILPOP3_NO_ERROR; 117 int err = MAILPOP3_NO_ERROR;
118 118
119 server = account->getServer().latin1(); 119 server = account->getServer().latin1();
120 port = account->getPort().toUInt(); 120 port = account->getPort().toUInt();
121 121
122 if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { 122 if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) {
123 LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); 123 LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true );
124 login.show(); 124 login.show();
125 if ( QDialog::Accepted == login.exec() ) { 125 if ( QDialog::Accepted == login.exec() ) {
126 // ok 126 // ok
127 user = login.getUser().latin1(); 127 user = login.getUser().latin1();
128 pass = login.getPassword().latin1(); 128 pass = login.getPassword().latin1();
129 } else { 129 } else {
130 // cancel 130 // cancel
131 qDebug( "POP3: Login canceled" ); 131 qDebug( "POP3: Login canceled" );
132 return; 132 return;
133 } 133 }
134 } else { 134 } else {
135 user = account->getUser().latin1(); 135 user = account->getUser().latin1();
136 pass = account->getPassword().latin1(); 136 pass = account->getPassword().latin1();
137 } 137 }
138 138
139 // bool ssl = account->getSSL(); 139 // bool ssl = account->getSSL();
140 140
141 m_pop3=mailstorage_new(NULL); 141 m_pop3=mailstorage_new(NULL);
142 142
143 int conntypeset = account->ConnectionType(); 143 int conntypeset = account->ConnectionType();
144 int conntype = 0; 144 int conntype = 0;
145 if ( conntypeset == 3 ) { 145 if ( conntypeset == 3 ) {
146 conntype = CONNECTION_TYPE_COMMAND; 146 conntype = CONNECTION_TYPE_COMMAND;
147 } else if ( conntypeset == 2 ) { 147 } else if ( conntypeset == 2 ) {
148 conntype = CONNECTION_TYPE_TLS; 148 conntype = CONNECTION_TYPE_TLS;
149 } else if ( conntypeset == 1 ) { 149 } else if ( conntypeset == 1 ) {
150 conntype = CONNECTION_TYPE_STARTTLS; 150 conntype = CONNECTION_TYPE_STARTTLS;
151 } else if ( conntypeset == 0 ) { 151 } else if ( conntypeset == 0 ) {
152 conntype = CONNECTION_TYPE_TRY_STARTTLS; 152 conntype = CONNECTION_TYPE_TRY_STARTTLS;
153 } 153 }
154 154
155 //(ssl?CONNECTION_TYPE_TLS:CONNECTION_TYPE_PLAIN); 155 //(ssl?CONNECTION_TYPE_TLS:CONNECTION_TYPE_PLAIN);
156 156
157 pop3_mailstorage_init(m_pop3,(char*)server, port, NULL, conntype, POP3_AUTH_TYPE_PLAIN, 157 pop3_mailstorage_init(m_pop3,(char*)server, port, NULL, conntype, POP3_AUTH_TYPE_PLAIN,
158 (char*)user,(char*)pass,0,0,0); 158 (char*)user,(char*)pass,0,0,0);
159 159
160 160
161 err = mailstorage_connect(m_pop3); 161 err = mailstorage_connect(m_pop3);
162 if (err != MAIL_NO_ERROR) { 162 if (err != MAIL_NO_ERROR) {
163 qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) ); 163 qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) );
164 Global::statusMessage(tr("Error initializing folder")); 164 Global::statusMessage(tr("Error initializing folder"));
165 mailstorage_free(m_pop3); 165 mailstorage_free(m_pop3);
166 m_pop3 = 0; 166 m_pop3 = 0;
167 } 167 }
168} 168}
169 169
170void POP3wrapper::logout() 170void POP3wrapper::logout()
171{ 171{
172 int err = MAILPOP3_NO_ERROR; 172 int err = MAILPOP3_NO_ERROR;
173 if ( m_pop3 == NULL ) 173 if ( m_pop3 == NULL )
174 return; 174 return;
175 mailstorage_free(m_pop3); 175 mailstorage_free(m_pop3);
176 m_pop3 = 0; 176 m_pop3 = 0;
177} 177}
178 178
179 179
180QList<Folder>* POP3wrapper::listFolders() { 180QList<Folder>* POP3wrapper::listFolders() {
181 QList<Folder> * folders = new QList<Folder>(); 181 QList<Folder> * folders = new QList<Folder>();
182 folders->setAutoDelete( false ); 182 folders->setAutoDelete( false );
183 Folder*inb=new Folder("INBOX","/"); 183 Folder*inb=new Folder("INBOX","/");
184 folders->append(inb); 184 folders->append(inb);
185 return folders; 185 return folders;
186} 186}
187 187
188void POP3wrapper::deleteMail(const RecMail&mail) { 188void POP3wrapper::deleteMail(const RecMail&mail) {
189 login(); 189 login();
190 if (!m_pop3) 190 if (!m_pop3)
191 return; 191 return;
192 int err = mailsession_remove_message(m_pop3->sto_session,mail.getNumber()); 192 int err = mailsession_remove_message(m_pop3->sto_session,mail.getNumber());
193 if (err != MAIL_NO_ERROR) { 193 if (err != MAIL_NO_ERROR) {
194 Global::statusMessage(tr("error deleting mail")); 194 Global::statusMessage(tr("error deleting mail"));
195 } 195 }
196} 196}
197 197
198void POP3wrapper::answeredMail(const RecMail&) {} 198void POP3wrapper::answeredMail(const RecMail&) {}
199 199
200int POP3wrapper::deleteAllMail(const Folder*) { 200int POP3wrapper::deleteAllMail(const Folder*) {
201 login(); 201 login();
202 if (!m_pop3) 202 if (!m_pop3)
203 return 0; 203 return 0;
204 int res = 1; 204 int res = 1;
205 205
206 uint32_t result = 0; 206 uint32_t result = 0;
207 int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result); 207 int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result);
208 if (err != MAIL_NO_ERROR) { 208 if (err != MAIL_NO_ERROR) {
209 Global::statusMessage(tr("Error getting folder info")); 209 Global::statusMessage(tr("Error getting folder info"));
210 return 0; 210 return 0;
211 } 211 }
212 for (unsigned int i = 0; i < result; ++i) { 212 for (unsigned int i = 0; i < result; ++i) {
213 err = mailsession_remove_message(m_pop3->sto_session,i+1); 213 err = mailsession_remove_message(m_pop3->sto_session,i+1);
214 if (err != MAIL_NO_ERROR) { 214 if (err != MAIL_NO_ERROR) {
215 Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); 215 Global::statusMessage(tr("Error deleting mail %1").arg(i+1));
216 res=0; 216 res=0;
217 } 217 }
218 break; 218 break;
diff --git a/noncore/net/mail/nntpconfigui.ui b/noncore/net/mail/nntpconfigui.ui
index cc439f4..7769804 100644
--- a/noncore/net/mail/nntpconfigui.ui
+++ b/noncore/net/mail/nntpconfigui.ui
@@ -1,257 +1,352 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>NNTPconfigUI</class> 2<class>NNTPconfigUI</class>
3<widget> 3<widget>
4 <class>QDialog</class> 4 <class>QDialog</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>NNTPconfigUI</cstring> 7 <cstring>NNTPconfigUI</cstring>
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>228</width> 14 <width>413</width>
15 <height>320</height> 15 <height>520</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>Configure NNTP</string> 20 <string>Configure NNTP</string>
21 </property> 21 </property>
22 <property> 22 <property>
23 <name>layoutMargin</name> 23 <name>layoutMargin</name>
24 </property> 24 </property>
25 <property> 25 <property>
26 <name>layoutSpacing</name> 26 <name>layoutSpacing</name>
27 </property> 27 </property>
28 <grid> 28 <vbox>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>margin</name> 30 <name>margin</name>
31 <number>4</number> 31 <number>3</number>
32 </property> 32 </property>
33 <property stdset="1"> 33 <property stdset="1">
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>3</number> 35 <number>3</number>
36 </property> 36 </property>
37 <widget row="2" column="1" > 37 <widget>
38 <class>QLineEdit</class> 38 <class>QTabWidget</class>
39 <property stdset="1">
40 <name>name</name>
41 <cstring>serverLine</cstring>
42 </property>
43 </widget>
44 <widget row="3" column="0" >
45 <class>QLabel</class>
46 <property stdset="1">
47 <name>name</name>
48 <cstring>portLabel</cstring>
49 </property>
50 <property stdset="1">
51 <name>text</name>
52 <string>Port</string>
53 </property>
54 </widget>
55 <widget row="3" column="1" >
56 <class>QLineEdit</class>
57 <property stdset="1">
58 <name>name</name>
59 <cstring>portLine</cstring>
60 </property>
61 </widget>
62 <widget row="0" column="1" >
63 <class>QLineEdit</class>
64 <property stdset="1">
65 <name>name</name>
66 <cstring>accountLine</cstring>
67 </property>
68 <property>
69 <name>toolTip</name>
70 <string>Name of the Account</string>
71 </property>
72 </widget>
73 <widget row="0" column="0" >
74 <class>QLabel</class>
75 <property stdset="1">
76 <name>name</name>
77 <cstring>accountLabel</cstring>
78 </property>
79 <property stdset="1">
80 <name>text</name>
81 <string>Account</string>
82 </property>
83 </widget>
84 <widget row="2" column="0" >
85 <class>QLabel</class>
86 <property stdset="1">
87 <name>name</name>
88 <cstring>serverLabel</cstring>
89 </property>
90 <property stdset="1">
91 <name>enabled</name>
92 <bool>true</bool>
93 </property>
94 <property stdset="1">
95 <name>caption</name>
96 <string></string>
97 </property>
98 <property stdset="1">
99 <name>text</name>
100 <string>Server</string>
101 </property>
102 <property>
103 <name>layoutMargin</name>
104 </property>
105 <property>
106 <name>layoutSpacing</name>
107 </property>
108 </widget>
109 <widget row="1" column="0" rowspan="1" colspan="2" >
110 <class>Line</class>
111 <property stdset="1">
112 <name>name</name>
113 <cstring>line1</cstring>
114 </property>
115 <property stdset="1">
116 <name>caption</name>
117 <string></string>
118 </property>
119 <property stdset="1">
120 <name>orientation</name>
121 <enum>Horizontal</enum>
122 </property>
123 <property>
124 <name>layoutMargin</name>
125 </property>
126 <property>
127 <name>layoutSpacing</name>
128 </property>
129 </widget>
130 <widget row="4" column="1" >
131 <class>QCheckBox</class>
132 <property stdset="1">
133 <name>name</name>
134 <cstring>sslBox</cstring>
135 </property>
136 <property stdset="1">
137 <name>text</name>
138 <string>Use SSL</string>
139 </property>
140 </widget>
141 <widget row="5" column="0" rowspan="1" colspan="2" >
142 <class>Line</class>
143 <property stdset="1"> 39 <property stdset="1">
144 <name>name</name> 40 <name>name</name>
145 <cstring>line2</cstring> 41 <cstring>TabWidget2</cstring>
146 </property>
147 <property stdset="1">
148 <name>enabled</name>
149 <bool>true</bool>
150 </property>
151 <property stdset="1">
152 <name>caption</name>
153 <string></string>
154 </property>
155 <property stdset="1">
156 <name>orientation</name>
157 <enum>Horizontal</enum>
158 </property> 42 </property>
159 <property> 43 <property>
160 <name>layoutMargin</name> 44 <name>layoutMargin</name>
161 </property> 45 </property>
162 <property> 46 <property>
163 <name>layoutSpacing</name> 47 <name>layoutSpacing</name>
164 </property> 48 </property>
49 <widget>
50 <class>QWidget</class>
51 <property stdset="1">
52 <name>name</name>
53 <cstring>tab</cstring>
54 </property>
55 <attribute>
56 <name>title</name>
57 <string>Account</string>
58 </attribute>
59 <grid>
60 <property stdset="1">
61 <name>margin</name>
62 <number>3</number>
63 </property>
64 <property stdset="1">
65 <name>spacing</name>
66 <number>3</number>
67 </property>
68 <widget row="2" column="1" >
69 <class>QLineEdit</class>
70 <property stdset="1">
71 <name>name</name>
72 <cstring>serverLine</cstring>
73 </property>
74 </widget>
75 <widget row="3" column="0" >
76 <class>QLabel</class>
77 <property stdset="1">
78 <name>name</name>
79 <cstring>portLabel</cstring>
80 </property>
81 <property stdset="1">
82 <name>text</name>
83 <string>Port</string>
84 </property>
85 </widget>
86 <widget row="3" column="1" >
87 <class>QLineEdit</class>
88 <property stdset="1">
89 <name>name</name>
90 <cstring>portLine</cstring>
91 </property>
92 </widget>
93 <widget row="0" column="1" >
94 <class>QLineEdit</class>
95 <property stdset="1">
96 <name>name</name>
97 <cstring>accountLine</cstring>
98 </property>
99 <property>
100 <name>toolTip</name>
101 <string>Name of the Account</string>
102 </property>
103 </widget>
104 <widget row="0" column="0" >
105 <class>QLabel</class>
106 <property stdset="1">
107 <name>name</name>
108 <cstring>accountLabel</cstring>
109 </property>
110 <property stdset="1">
111 <name>text</name>
112 <string>Account</string>
113 </property>
114 </widget>
115 <widget row="2" column="0" >
116 <class>QLabel</class>
117 <property stdset="1">
118 <name>name</name>
119 <cstring>serverLabel</cstring>
120 </property>
121 <property stdset="1">
122 <name>enabled</name>
123 <bool>true</bool>
124 </property>
125 <property stdset="1">
126 <name>caption</name>
127 <string></string>
128 </property>
129 <property stdset="1">
130 <name>text</name>
131 <string>Server</string>
132 </property>
133 <property>
134 <name>layoutMargin</name>
135 </property>
136 <property>
137 <name>layoutSpacing</name>
138 </property>
139 </widget>
140 <widget row="1" column="0" rowspan="1" colspan="2" >
141 <class>Line</class>
142 <property stdset="1">
143 <name>name</name>
144 <cstring>line1</cstring>
145 </property>
146 <property stdset="1">
147 <name>caption</name>
148 <string></string>
149 </property>
150 <property stdset="1">
151 <name>orientation</name>
152 <enum>Horizontal</enum>
153 </property>
154 <property>
155 <name>layoutMargin</name>
156 </property>
157 <property>
158 <name>layoutSpacing</name>
159 </property>
160 </widget>
161 <widget row="4" column="1" >
162 <class>QCheckBox</class>
163 <property stdset="1">
164 <name>name</name>
165 <cstring>sslBox</cstring>
166 </property>
167 <property stdset="1">
168 <name>text</name>
169 <string>Use SSL</string>
170 </property>
171 </widget>
172 <widget row="5" column="0" rowspan="2" colspan="2" >
173 <class>Line</class>
174 <property stdset="1">
175 <name>name</name>
176 <cstring>line2</cstring>
177 </property>
178 <property stdset="1">
179 <name>enabled</name>
180 <bool>true</bool>
181 </property>
182 <property stdset="1">
183 <name>caption</name>
184 <string></string>
185 </property>
186 <property stdset="1">
187 <name>orientation</name>
188 <enum>Horizontal</enum>
189 </property>
190 <property>
191 <name>layoutMargin</name>
192 </property>
193 <property>
194 <name>layoutSpacing</name>
195 </property>
196 </widget>
197 <widget row="7" column="0" >
198 <class>QLabel</class>
199 <property stdset="1">
200 <name>name</name>
201 <cstring>userLabel</cstring>
202 </property>
203 <property stdset="1">
204 <name>text</name>
205 <string>User</string>
206 </property>
207 </widget>
208 <widget row="8" column="0" >
209 <class>QLabel</class>
210 <property stdset="1">
211 <name>name</name>
212 <cstring>passLabel</cstring>
213 </property>
214 <property stdset="1">
215 <name>text</name>
216 <string>Password</string>
217 </property>
218 </widget>
219 <spacer row="9" column="1" >
220 <property>
221 <name>name</name>
222 <cstring>spacer</cstring>
223 </property>
224 <property stdset="1">
225 <name>orientation</name>
226 <enum>Vertical</enum>
227 </property>
228 <property stdset="1">
229 <name>sizeType</name>
230 <enum>Expanding</enum>
231 </property>
232 <property>
233 <name>sizeHint</name>
234 <size>
235 <width>20</width>
236 <height>20</height>
237 </size>
238 </property>
239 </spacer>
240 <widget row="6" column="1" >
241 <class>QCheckBox</class>
242 <property stdset="1">
243 <name>name</name>
244 <cstring>loginBox</cstring>
245 </property>
246 <property stdset="1">
247 <name>text</name>
248 <string>Use Login</string>
249 </property>
250 </widget>
251 <widget row="7" column="1" >
252 <class>QLineEdit</class>
253 <property stdset="1">
254 <name>name</name>
255 <cstring>userLine</cstring>
256 </property>
257 <property stdset="1">
258 <name>enabled</name>
259 <bool>false</bool>
260 </property>
261 </widget>
262 <widget row="8" column="1" >
263 <class>QLineEdit</class>
264 <property stdset="1">
265 <name>name</name>
266 <cstring>passLine</cstring>
267 </property>
268 <property stdset="1">
269 <name>enabled</name>
270 <bool>false</bool>
271 </property>
272 <property stdset="1">
273 <name>echoMode</name>
274 <enum>Password</enum>
275 </property>
276 </widget>
277 </grid>
278 </widget>
279 <widget>
280 <class>QWidget</class>
281 <property stdset="1">
282 <name>name</name>
283 <cstring>tab</cstring>
284 </property>
285 <attribute>
286 <name>title</name>
287 <string>Groups</string>
288 </attribute>
289 <vbox>
290 <property stdset="1">
291 <name>margin</name>
292 <number>3</number>
293 </property>
294 <property stdset="1">
295 <name>spacing</name>
296 <number>3</number>
297 </property>
298 <widget>
299 <class>QListView</class>
300 <property stdset="1">
301 <name>name</name>
302 <cstring>ListViewGroups</cstring>
303 </property>
304 </widget>
305 <widget>
306 <class>QPushButton</class>
307 <property stdset="1">
308 <name>name</name>
309 <cstring>GetNGButton</cstring>
310 </property>
311 <property stdset="1">
312 <name>text</name>
313 <string>Get newsgroup list from server</string>
314 </property>
315 </widget>
316 </vbox>
317 </widget>
165 </widget> 318 </widget>
166 <widget row="7" column="0" > 319 </vbox>
167 <class>QLabel</class>
168 <property stdset="1">
169 <name>name</name>
170 <cstring>userLabel</cstring>
171 </property>
172 <property stdset="1">
173 <name>text</name>
174 <string>User</string>
175 </property>
176 </widget>
177 <widget row="8" column="0" >
178 <class>QLabel</class>
179 <property stdset="1">
180 <name>name</name>
181 <cstring>passLabel</cstring>
182 </property>
183 <property stdset="1">
184 <name>text</name>
185 <string>Password</string>
186 </property>
187 </widget>
188 <spacer row="9" column="1" >
189 <property>
190 <name>name</name>
191 <cstring>spacer</cstring>
192 </property>
193 <property stdset="1">
194 <name>orientation</name>
195 <enum>Vertical</enum>
196 </property>
197 <property stdset="1">
198 <name>sizeType</name>
199 <enum>Expanding</enum>
200 </property>
201 <property>
202 <name>sizeHint</name>
203 <size>
204 <width>20</width>
205 <height>20</height>
206 </size>
207 </property>
208 </spacer>
209 <widget row="6" column="1" >
210 <class>QCheckBox</class>
211 <property stdset="1">
212 <name>name</name>
213 <cstring>loginBox</cstring>
214 </property>
215 <property stdset="1">
216 <name>text</name>
217 <string>Use Login</string>
218 </property>
219 </widget>
220 <widget row="7" column="1" >
221 <class>QLineEdit</class>
222 <property stdset="1">
223 <name>name</name>
224 <cstring>userLine</cstring>
225 </property>
226 <property stdset="1">
227 <name>enabled</name>
228 <bool>false</bool>
229 </property>
230 </widget>
231 <widget row="8" column="1" >
232 <class>QLineEdit</class>
233 <property stdset="1">
234 <name>name</name>
235 <cstring>passLine</cstring>
236 </property>
237 <property stdset="1">
238 <name>enabled</name>
239 <bool>false</bool>
240 </property>
241 <property stdset="1">
242 <name>echoMode</name>
243 <enum>Password</enum>
244 </property>
245 </widget>
246 </grid>
247</widget> 320</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>
248<tabstops> 343<tabstops>
249 <tabstop>accountLine</tabstop> 344 <tabstop>accountLine</tabstop>
250 <tabstop>serverLine</tabstop> 345 <tabstop>serverLine</tabstop>
251 <tabstop>portLine</tabstop> 346 <tabstop>portLine</tabstop>
252 <tabstop>sslBox</tabstop> 347 <tabstop>sslBox</tabstop>
253 <tabstop>loginBox</tabstop> 348 <tabstop>loginBox</tabstop>
254 <tabstop>userLine</tabstop> 349 <tabstop>userLine</tabstop>
255 <tabstop>passLine</tabstop> 350 <tabstop>passLine</tabstop>
256</tabstops> 351</tabstops>
257</UI> 352</UI>