summaryrefslogtreecommitdiff
Unidiff
Diffstat (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
@@ -1,532 +1,567 @@
1 1
2#include "defines.h" 2#include "defines.h"
3#include "editaccounts.h" 3#include "editaccounts.h"
4 4
5/* OPIE */ 5/* OPIE */
6#include <qpe/qpeapplication.h> 6#include <qpe/qpeapplication.h>
7 7
8/* QT */ 8/* QT */
9#include <qt.h> 9#include <qt.h>
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)
12 : QListViewItem( parent ) 16 : QListViewItem( parent )
13{ 17{
14 account = a; 18 account = a;
15 setText( 0, account->getAccountName() ); 19 setText( 0, account->getAccountName() );
16 setText( 1, account->getType() ); 20 setText( 1, account->getType() );
17} 21}
18 22
19EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 23EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
20 : EditAccountsUI( parent, name, modal, flags ) 24 : EditAccountsUI( parent, name, modal, flags )
21{ 25{
22 qDebug( "New Account Configuration Widget" ); 26 qDebug( "New Account Configuration Widget" );
23 settings = s; 27 settings = s;
24 28
25 mailList->addColumn( tr( "Account" ) ); 29 mailList->addColumn( tr( "Account" ) );
26 mailList->addColumn( tr( "Type" ) ); 30 mailList->addColumn( tr( "Type" ) );
27 31
28 newsList->addColumn( tr( "Account" ) ); 32 newsList->addColumn( tr( "Account" ) );
29 33
30 connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); 34 connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) );
31 connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) ); 35 connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) );
32 connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) ); 36 connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) );
33 connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) ); 37 connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) );
34 connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) ); 38 connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) );
35 connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) ); 39 connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) );
36 40
37 slotFillLists(); 41 slotFillLists();
38} 42}
39 43
40void EditAccounts::slotFillLists() 44void EditAccounts::slotFillLists()
41{ 45{
42 mailList->clear(); 46 mailList->clear();
43 newsList->clear(); 47 newsList->clear();
44 48
45 QList<Account> accounts = settings->getAccounts(); 49 QList<Account> accounts = settings->getAccounts();
46 Account *it; 50 Account *it;
47 for ( it = accounts.first(); it; it = accounts.next() ) 51 for ( it = accounts.first(); it; it = accounts.next() )
48 { 52 {
49 if ( it->getType().compare( "NNTP" ) == 0 ) 53 if ( it->getType().compare( "NNTP" ) == 0 )
50 { 54 {
51 (void) new AccountListItem( newsList, it ); 55 (void) new AccountListItem( newsList, it );
52 } 56 }
53 else 57 else
54 { 58 {
55 (void) new AccountListItem( mailList, it ); 59 (void) new AccountListItem( mailList, it );
56 } 60 }
57 } 61 }
58} 62}
59 63
60void EditAccounts::slotNewMail() 64void EditAccounts::slotNewMail()
61{ 65{
62 qDebug( "New Mail Account" ); 66 qDebug( "New Mail Account" );
63 QString *selection = new QString(); 67 QString *selection = new QString();
64 SelectMailType selType( selection, this, 0, true ); 68 SelectMailType selType( selection, this, 0, true );
65 selType.show(); 69 selType.show();
66 if ( QDialog::Accepted == selType.exec() ) 70 if ( QDialog::Accepted == selType.exec() )
67 { 71 {
68 slotNewAccount( *selection ); 72 slotNewAccount( *selection );
69 } 73 }
70} 74}
71 75
72void EditAccounts::slotNewAccount( const QString &type ) 76void EditAccounts::slotNewAccount( const QString &type )
73{ 77{
74 if ( type.compare( "IMAP" ) == 0 ) 78 if ( type.compare( "IMAP" ) == 0 )
75 { 79 {
76 qDebug( "-> config IMAP" ); 80 qDebug( "-> config IMAP" );
77 IMAPaccount *account = new IMAPaccount(); 81 IMAPaccount *account = new IMAPaccount();
78 IMAPconfig imap( account, this, 0, true ); 82 IMAPconfig imap( account, this, 0, true );
79 if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) ) 83 if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) )
80 { 84 {
81 settings->addAccount( account ); 85 settings->addAccount( account );
82 account->save(); 86 account->save();
83 slotFillLists(); 87 slotFillLists();
84 } 88 }
85 else 89 else
86 { 90 {
87 account->remove(); 91 account->remove();
88 } 92 }
89 } 93 }
90 else if ( type.compare( "POP3" ) == 0 ) 94 else if ( type.compare( "POP3" ) == 0 )
91 { 95 {
92 qDebug( "-> config POP3" ); 96 qDebug( "-> config POP3" );
93 POP3account *account = new POP3account(); 97 POP3account *account = new POP3account();
94 POP3config pop3( account, this, 0, true, WStyle_ContextHelp ); 98 POP3config pop3( account, this, 0, true, WStyle_ContextHelp );
95 if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) ) 99 if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) )
96 { 100 {
97 settings->addAccount( account ); 101 settings->addAccount( account );
98 account->save(); 102 account->save();
99 slotFillLists(); 103 slotFillLists();
100 } 104 }
101 else 105 else
102 { 106 {
103 account->remove(); 107 account->remove();
104 } 108 }
105 } 109 }
106 else if ( type.compare( "SMTP" ) == 0 ) 110 else if ( type.compare( "SMTP" ) == 0 )
107 { 111 {
108 qDebug( "-> config SMTP" ); 112 qDebug( "-> config SMTP" );
109 SMTPaccount *account = new SMTPaccount(); 113 SMTPaccount *account = new SMTPaccount();
110 SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp ); 114 SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp );
111 if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) ) 115 if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) )
112 { 116 {
113 settings->addAccount( account ); 117 settings->addAccount( account );
114 account->save(); 118 account->save();
115 slotFillLists(); 119 slotFillLists();
116 120
117 } 121 }
118 else 122 else
119 { 123 {
120 account->remove(); 124 account->remove();
121 } 125 }
122 } 126 }
123 else if ( type.compare( "NNTP" ) == 0 ) 127 else if ( type.compare( "NNTP" ) == 0 )
124 { 128 {
125 qDebug( "-> config NNTP" ); 129 qDebug( "-> config NNTP" );
126 NNTPaccount *account = new NNTPaccount(); 130 NNTPaccount *account = new NNTPaccount();
127 NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp ); 131 NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp );
128 if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) ) 132 if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) )
129 { 133 {
130 settings->addAccount( account ); 134 settings->addAccount( account );
131 account->save(); 135 account->save();
132 slotFillLists(); 136 slotFillLists();
133 } 137 }
134 else 138 else
135 { 139 {
136 account->remove(); 140 account->remove();
137 } 141 }
138 } 142 }
139} 143}
140 144
141void EditAccounts::slotEditAccount( Account *account ) 145void EditAccounts::slotEditAccount( Account *account )
142{ 146{
143 if ( account->getType().compare( "IMAP" ) == 0 ) 147 if ( account->getType().compare( "IMAP" ) == 0 )
144 { 148 {
145 IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account); 149 IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account);
146 IMAPconfig imap( imapAcc, this, 0, true, WStyle_ContextHelp ); 150 IMAPconfig imap( imapAcc, this, 0, true, WStyle_ContextHelp );
147 if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) ) 151 if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) )
148 { 152 {
149 slotFillLists(); 153 slotFillLists();
150 } 154 }
151 } 155 }
152 else if ( account->getType().compare( "POP3" ) == 0 ) 156 else if ( account->getType().compare( "POP3" ) == 0 )
153 { 157 {
154 POP3account *pop3Acc = static_cast<POP3account *>(account); 158 POP3account *pop3Acc = static_cast<POP3account *>(account);
155 POP3config pop3( pop3Acc, this, 0, true, WStyle_ContextHelp ); 159 POP3config pop3( pop3Acc, this, 0, true, WStyle_ContextHelp );
156 if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) ) 160 if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) )
157 { 161 {
158 slotFillLists(); 162 slotFillLists();
159 } 163 }
160 } 164 }
161 else if ( account->getType().compare( "SMTP" ) == 0 ) 165 else if ( account->getType().compare( "SMTP" ) == 0 )
162 { 166 {
163 SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account); 167 SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account);
164 SMTPconfig smtp( smtpAcc, this, 0, true, WStyle_ContextHelp ); 168 SMTPconfig smtp( smtpAcc, this, 0, true, WStyle_ContextHelp );
165 if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) ) 169 if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) )
166 { 170 {
167 slotFillLists(); 171 slotFillLists();
168 } 172 }
169 } 173 }
170 else if ( account->getType().compare( "NNTP" ) == 0 ) 174 else if ( account->getType().compare( "NNTP" ) == 0 )
171 { 175 {
172 NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account); 176 NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account);
173 NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp ); 177 NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp );
174 if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) ) 178 if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) )
175 { 179 {
176 slotFillLists(); 180 slotFillLists();
177 } 181 }
178 } 182 }
179} 183}
180 184
181void EditAccounts::slotDeleteAccount( Account *account ) 185void EditAccounts::slotDeleteAccount( Account *account )
182{ 186{
183 if ( QMessageBox::information( this, tr( "Question" ), 187 if ( QMessageBox::information( this, tr( "Question" ),
184 tr( "<p>Do you really want to delete the selected Account?</p>" ), 188 tr( "<p>Do you really want to delete the selected Account?</p>" ),
185 tr( "Yes" ), tr( "No" ) ) == 0 ) 189 tr( "Yes" ), tr( "No" ) ) == 0 )
186 { 190 {
187 settings->delAccount( account ); 191 settings->delAccount( account );
188 slotFillLists(); 192 slotFillLists();
189 } 193 }
190} 194}
191 195
192void EditAccounts::slotEditMail() 196void EditAccounts::slotEditMail()
193{ 197{
194 qDebug( "Edit Mail Account" ); 198 qDebug( "Edit Mail Account" );
195 if ( !mailList->currentItem() ) 199 if ( !mailList->currentItem() )
196 { 200 {
197 QMessageBox::information( this, tr( "Error" ), 201 QMessageBox::information( this, tr( "Error" ),
198 tr( "<p>Please select an account.</p>" ), 202 tr( "<p>Please select an account.</p>" ),
199 tr( "Ok" ) ); 203 tr( "Ok" ) );
200 return; 204 return;
201 } 205 }
202 206
203 Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); 207 Account *a = ((AccountListItem *) mailList->currentItem())->getAccount();
204 slotEditAccount( a ); 208 slotEditAccount( a );
205} 209}
206 210
207void EditAccounts::slotDeleteMail() 211void EditAccounts::slotDeleteMail()
208{ 212{
209 if ( !mailList->currentItem() ) 213 if ( !mailList->currentItem() )
210 { 214 {
211 QMessageBox::information( this, tr( "Error" ), 215 QMessageBox::information( this, tr( "Error" ),
212 tr( "<p>Please select an account.</p>" ), 216 tr( "<p>Please select an account.</p>" ),
213 tr( "Ok" ) ); 217 tr( "Ok" ) );
214 return; 218 return;
215 } 219 }
216 220
217 Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); 221 Account *a = ((AccountListItem *) mailList->currentItem())->getAccount();
218 slotDeleteAccount( a ); 222 slotDeleteAccount( a );
219} 223}
220 224
221void EditAccounts::slotNewNews() 225void EditAccounts::slotNewNews()
222{ 226{
223 qDebug( "New News Account" ); 227 qDebug( "New News Account" );
224 slotNewAccount( "NNTP" ); 228 slotNewAccount( "NNTP" );
225} 229}
226 230
227void EditAccounts::slotEditNews() 231void EditAccounts::slotEditNews()
228{ 232{
229 qDebug( "Edit News Account" ); 233 qDebug( "Edit News Account" );
230 if ( !newsList->currentItem() ) 234 if ( !newsList->currentItem() )
231 { 235 {
232 QMessageBox::information( this, tr( "Error" ), 236 QMessageBox::information( this, tr( "Error" ),
233 tr( "<p>Please select an account.</p>" ), 237 tr( "<p>Please select an account.</p>" ),
234 tr( "Ok" ) ); 238 tr( "Ok" ) );
235 return; 239 return;
236 } 240 }
237 241
238 Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); 242 Account *a = ((AccountListItem *) newsList->currentItem())->getAccount();
239 slotEditAccount( a ); 243 slotEditAccount( a );
240} 244}
241 245
242void EditAccounts::slotDeleteNews() 246void EditAccounts::slotDeleteNews()
243{ 247{
244 qDebug( "Delete News Account" ); 248 qDebug( "Delete News Account" );
245 if ( !newsList->currentItem() ) 249 if ( !newsList->currentItem() )
246 { 250 {
247 QMessageBox::information( this, tr( "Error" ), 251 QMessageBox::information( this, tr( "Error" ),
248 tr( "<p>Please select an account.</p>" ), 252 tr( "<p>Please select an account.</p>" ),
249 tr( "Ok" ) ); 253 tr( "Ok" ) );
250 return; 254 return;
251 } 255 }
252 256
253 Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); 257 Account *a = ((AccountListItem *) newsList->currentItem())->getAccount();
254 slotDeleteAccount( a ); 258 slotDeleteAccount( a );
255} 259}
256 260
257void EditAccounts::slotAdjustColumns() 261void EditAccounts::slotAdjustColumns()
258{ 262{
259 int currPage = configTab->currentPageIndex(); 263 int currPage = configTab->currentPageIndex();
260 264
261 configTab->showPage( mailTab ); 265 configTab->showPage( mailTab );
262 mailList->setColumnWidth( 0, mailList->visibleWidth() - 50 ); 266 mailList->setColumnWidth( 0, mailList->visibleWidth() - 50 );
263 mailList->setColumnWidth( 1, 50 ); 267 mailList->setColumnWidth( 1, 50 );
264 268
265 configTab->showPage( newsTab ); 269 configTab->showPage( newsTab );
266 newsList->setColumnWidth( 0, newsList->visibleWidth() ); 270 newsList->setColumnWidth( 0, newsList->visibleWidth() );
267 271
268 configTab->setCurrentPage( currPage ); 272 configTab->setCurrentPage( currPage );
269} 273}
270 274
271void EditAccounts::accept() 275void EditAccounts::accept()
272{ 276{
273 settings->saveAccounts(); 277 settings->saveAccounts();
274 278
275 QDialog::accept(); 279 QDialog::accept();
276} 280}
277 281
278/** 282/**
279 * SelectMailType 283 * SelectMailType
280 */ 284 */
281 285
282SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags ) 286SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags )
283 : SelectMailTypeUI( parent, name, modal, flags ) 287 : SelectMailTypeUI( parent, name, modal, flags )
284{ 288{
285 selected = selection; 289 selected = selection;
286 selected->replace( 0, selected->length(), typeBox->currentText() ); 290 selected->replace( 0, selected->length(), typeBox->currentText() );
287 connect( typeBox, SIGNAL( activated(const QString&) ), SLOT( slotSelection(const QString&) ) ); 291 connect( typeBox, SIGNAL( activated(const QString&) ), SLOT( slotSelection(const QString&) ) );
288} 292}
289 293
290void SelectMailType::slotSelection( const QString &sel ) 294void SelectMailType::slotSelection( const QString &sel )
291{ 295{
292 selected->replace( 0, selected->length(), sel ); 296 selected->replace( 0, selected->length(), sel );
293} 297}
294 298
295/** 299/**
296 * IMAPconfig 300 * IMAPconfig
297 */ 301 */
298 302
299IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 303IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags )
300 : IMAPconfigUI( parent, name, modal, flags ) 304 : IMAPconfigUI( parent, name, modal, flags )
301{ 305{
302 data = account; 306 data = account;
303 307
304 fillValues(); 308 fillValues();
305 309
306 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); 310 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) );
307 ComboBox1->insertItem( "Only if available", 0 ); 311 ComboBox1->insertItem( "Only if available", 0 );
308 ComboBox1->insertItem( "Always, Negotiated", 1 ); 312 ComboBox1->insertItem( "Always, Negotiated", 1 );
309 ComboBox1->insertItem( "Connect on secure port", 2 ); 313 ComboBox1->insertItem( "Connect on secure port", 2 );
310 ComboBox1->insertItem( "Run command instead", 3 ); 314 ComboBox1->insertItem( "Run command instead", 3 );
311 CommandEdit->hide(); 315 CommandEdit->hide();
312 ComboBox1->setCurrentItem( data->ConnectionType() ); 316 ComboBox1->setCurrentItem( data->ConnectionType() );
313} 317}
314 318
315void IMAPconfig::slotConnectionToggle( int index ) 319void IMAPconfig::slotConnectionToggle( int index )
316{ 320{
317 if ( index == 2 ) 321 if ( index == 2 )
318 { 322 {
319 portLine->setText( IMAP_SSL_PORT ); 323 portLine->setText( IMAP_SSL_PORT );
320 } 324 }
321 else if ( index == 3 ) 325 else if ( index == 3 )
322 { 326 {
323 portLine->setText( IMAP_PORT ); 327 portLine->setText( IMAP_PORT );
324 CommandEdit->show(); 328 CommandEdit->show();
325 } 329 }
326 else 330 else
327 { 331 {
328 portLine->setText( IMAP_PORT ); 332 portLine->setText( IMAP_PORT );
329 } 333 }
330} 334}
331 335
332void IMAPconfig::fillValues() 336void IMAPconfig::fillValues()
333{ 337{
334 accountLine->setText( data->getAccountName() ); 338 accountLine->setText( data->getAccountName() );
335 serverLine->setText( data->getServer() ); 339 serverLine->setText( data->getServer() );
336 portLine->setText( data->getPort() ); 340 portLine->setText( data->getPort() );
337 ComboBox1->setCurrentItem( data->ConnectionType() ); 341 ComboBox1->setCurrentItem( data->ConnectionType() );
338 userLine->setText( data->getUser() ); 342 userLine->setText( data->getUser() );
339 passLine->setText( data->getPassword() ); 343 passLine->setText( data->getPassword() );
340 prefixLine->setText(data->getPrefix()); 344 prefixLine->setText(data->getPrefix());
341} 345}
342 346
343void IMAPconfig::accept() 347void IMAPconfig::accept()
344{ 348{
345 data->setAccountName( accountLine->text() ); 349 data->setAccountName( accountLine->text() );
346 data->setServer( serverLine->text() ); 350 data->setServer( serverLine->text() );
347 data->setPort( portLine->text() ); 351 data->setPort( portLine->text() );
348 data->setConnectionType( ComboBox1->currentItem() ); 352 data->setConnectionType( ComboBox1->currentItem() );
349 data->setUser( userLine->text() ); 353 data->setUser( userLine->text() );
350 data->setPassword( passLine->text() ); 354 data->setPassword( passLine->text() );
351 data->setPrefix(prefixLine->text()); 355 data->setPrefix(prefixLine->text());
352 356
353 QDialog::accept(); 357 QDialog::accept();
354} 358}
355 359
356/** 360/**
357 * POP3config 361 * POP3config
358 */ 362 */
359 363
360POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 364POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags )
361 : POP3configUI( parent, name, modal, flags ) 365 : POP3configUI( parent, name, modal, flags )
362{ 366{
363 data = account; 367 data = account;
364 fillValues(); 368 fillValues();
365 369
366 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); 370 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) );
367 ComboBox1->insertItem( "Only if available", 0 ); 371 ComboBox1->insertItem( "Only if available", 0 );
368 ComboBox1->insertItem( "Always, Negotiated", 1 ); 372 ComboBox1->insertItem( "Always, Negotiated", 1 );
369 ComboBox1->insertItem( "Connect on secure port", 2 ); 373 ComboBox1->insertItem( "Connect on secure port", 2 );
370 ComboBox1->insertItem( "Run command instead", 3 ); 374 ComboBox1->insertItem( "Run command instead", 3 );
371 CommandEdit->hide(); 375 CommandEdit->hide();
372 ComboBox1->setCurrentItem( data->ConnectionType() ); 376 ComboBox1->setCurrentItem( data->ConnectionType() );
373} 377}
374 378
375void POP3config::slotConnectionToggle( int index ) 379void POP3config::slotConnectionToggle( int index )
376{ 380{
377 // 2 is ssl connection 381 // 2 is ssl connection
378 if ( index == 2 ) 382 if ( index == 2 )
379 { 383 {
380 portLine->setText( POP3_SSL_PORT ); 384 portLine->setText( POP3_SSL_PORT );
381 } 385 }
382 else if ( index == 3 ) 386 else if ( index == 3 )
383 { 387 {
384 portLine->setText( POP3_PORT ); 388 portLine->setText( POP3_PORT );
385 CommandEdit->show(); 389 CommandEdit->show();
386 } 390 }
387 else 391 else
388 { 392 {
389 portLine->setText( POP3_PORT ); 393 portLine->setText( POP3_PORT );
390 } 394 }
391} 395}
392 396
393void POP3config::fillValues() 397void POP3config::fillValues()
394{ 398{
395 accountLine->setText( data->getAccountName() ); 399 accountLine->setText( data->getAccountName() );
396 serverLine->setText( data->getServer() ); 400 serverLine->setText( data->getServer() );
397 portLine->setText( data->getPort() ); 401 portLine->setText( data->getPort() );
398 ComboBox1->setCurrentItem( data->ConnectionType() ); 402 ComboBox1->setCurrentItem( data->ConnectionType() );
399 userLine->setText( data->getUser() ); 403 userLine->setText( data->getUser() );
400 passLine->setText( data->getPassword() ); 404 passLine->setText( data->getPassword() );
401} 405}
402 406
403void POP3config::accept() 407void POP3config::accept()
404{ 408{
405 data->setAccountName( accountLine->text() ); 409 data->setAccountName( accountLine->text() );
406 data->setServer( serverLine->text() ); 410 data->setServer( serverLine->text() );
407 data->setPort( portLine->text() ); 411 data->setPort( portLine->text() );
408 data->setConnectionType( ComboBox1->currentItem() ); 412 data->setConnectionType( ComboBox1->currentItem() );
409 data->setUser( userLine->text() ); 413 data->setUser( userLine->text() );
410 data->setPassword( passLine->text() ); 414 data->setPassword( passLine->text() );
411 415
412 QDialog::accept(); 416 QDialog::accept();
413} 417}
414 418
415/** 419/**
416 * SMTPconfig 420 * SMTPconfig
417 */ 421 */
418 422
419SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 423SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags )
420 : SMTPconfigUI( parent, name, modal, flags ) 424 : SMTPconfigUI( parent, name, modal, flags )
421{ 425{
422 data = account; 426 data = account;
423 427
424 connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); 428 connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) );
425 connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); 429 connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) );
426 430
427 fillValues(); 431 fillValues();
428 432
429 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); 433 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) );
430 ComboBox1->insertItem( "Only if available", 0 ); 434 ComboBox1->insertItem( "Only if available", 0 );
431 ComboBox1->insertItem( "Always, Negotiated", 1 ); 435 ComboBox1->insertItem( "Always, Negotiated", 1 );
432 ComboBox1->insertItem( "Connect on secure port", 2 ); 436 ComboBox1->insertItem( "Connect on secure port", 2 );
433 ComboBox1->insertItem( "Run command instead", 3 ); 437 ComboBox1->insertItem( "Run command instead", 3 );
434 CommandEdit->hide(); 438 CommandEdit->hide();
435 ComboBox1->setCurrentItem( data->ConnectionType() ); 439 ComboBox1->setCurrentItem( data->ConnectionType() );
436} 440}
437 441
438void SMTPconfig::slotConnectionToggle( int index ) 442void SMTPconfig::slotConnectionToggle( int index )
439{ 443{
440 // 2 is ssl connection 444 // 2 is ssl connection
441 if ( index == 2 ) 445 if ( index == 2 )
442 { 446 {
443 portLine->setText( SMTP_SSL_PORT ); 447 portLine->setText( SMTP_SSL_PORT );
444 } 448 }
445 else if ( index == 3 ) 449 else if ( index == 3 )
446 { 450 {
447 portLine->setText( SMTP_PORT ); 451 portLine->setText( SMTP_PORT );
448 CommandEdit->show(); 452 CommandEdit->show();
449 } 453 }
450 else 454 else
451 { 455 {
452 portLine->setText( SMTP_PORT ); 456 portLine->setText( SMTP_PORT );
453 } 457 }
454} 458}
455 459
456void SMTPconfig::fillValues() 460void SMTPconfig::fillValues()
457{ 461{
458 accountLine->setText( data->getAccountName() ); 462 accountLine->setText( data->getAccountName() );
459 serverLine->setText( data->getServer() ); 463 serverLine->setText( data->getServer() );
460 portLine->setText( data->getPort() ); 464 portLine->setText( data->getPort() );
461 ComboBox1->setCurrentItem( data->ConnectionType() ); 465 ComboBox1->setCurrentItem( data->ConnectionType() );
462 loginBox->setChecked( data->getLogin() ); 466 loginBox->setChecked( data->getLogin() );
463 userLine->setText( data->getUser() ); 467 userLine->setText( data->getUser() );
464 passLine->setText( data->getPassword() ); 468 passLine->setText( data->getPassword() );
465} 469}
466 470
467void SMTPconfig::accept() 471void SMTPconfig::accept()
468{ 472{
469 data->setAccountName( accountLine->text() ); 473 data->setAccountName( accountLine->text() );
470 data->setServer( serverLine->text() ); 474 data->setServer( serverLine->text() );
471 data->setPort( portLine->text() ); 475 data->setPort( portLine->text() );
472 data->setConnectionType( ComboBox1->currentItem() ); 476 data->setConnectionType( ComboBox1->currentItem() );
473 data->setLogin( loginBox->isChecked() ); 477 data->setLogin( loginBox->isChecked() );
474 data->setUser( userLine->text() ); 478 data->setUser( userLine->text() );
475 data->setPassword( passLine->text() ); 479 data->setPassword( passLine->text() );
476 480
477 QDialog::accept(); 481 QDialog::accept();
478} 482}
479 483
480/** 484/**
481 * NNTPconfig 485 * NNTPconfig
482 */ 486 */
483 487
484NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 488NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags )
485 : NNTPconfigUI( parent, name, modal, flags ) 489 : NNTPconfigUI( parent, name, modal, flags )
486{ 490{
487 data = account; 491 data = account;
488 492
489 connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); 493 connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) );
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();
493 497
494 connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) ); 498 connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) );
495} 499}
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 )
498{ 522{
499 if ( enabled ) 523 if ( enabled )
500 { 524 {
501 portLine->setText( NNTP_SSL_PORT ); 525 portLine->setText( NNTP_SSL_PORT );
502 } 526 }
503 else 527 else
504 { 528 {
505 portLine->setText( NNTP_PORT ); 529 portLine->setText( NNTP_PORT );
506 } 530 }
507} 531}
508 532
509void NNTPconfig::fillValues() 533void NNTPconfig::fillValues()
510{ 534{
511 accountLine->setText( data->getAccountName() ); 535 accountLine->setText( data->getAccountName() );
512 serverLine->setText( data->getServer() ); 536 serverLine->setText( data->getServer() );
513 portLine->setText( data->getPort() ); 537 portLine->setText( data->getPort() );
514 sslBox->setChecked( data->getSSL() ); 538 sslBox->setChecked( data->getSSL() );
515 loginBox->setChecked( data->getLogin() ); 539 loginBox->setChecked( data->getLogin() );
516 userLine->setText( data->getUser() ); 540 userLine->setText( data->getUser() );
517 passLine->setText( data->getPassword() ); 541 passLine->setText( data->getPassword() );
518} 542}
519 543
520void NNTPconfig::accept() 544void NNTPconfig::save()
521{ 545{
522 data->setAccountName( accountLine->text() ); 546 data->setAccountName( accountLine->text() );
523 data->setServer( serverLine->text() ); 547 data->setServer( serverLine->text() );
524 data->setPort( portLine->text() ); 548 data->setPort( portLine->text() );
525 data->setSSL( sslBox->isChecked() ); 549 data->setSSL( sslBox->isChecked() );
526 data->setLogin( loginBox->isChecked() ); 550 data->setLogin( loginBox->isChecked() );
527 data->setUser( userLine->text() ); 551 data->setUser( userLine->text() );
528 data->setPassword( passLine->text() ); 552 data->setPassword( passLine->text() );
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();
531} 566}
532 567
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
@@ -1,147 +1,152 @@
1#ifndef EDITACCOUNTS_H 1#ifndef EDITACCOUNTS_H
2#define EDITACCOUNTS_H 2#define EDITACCOUNTS_H
3 3
4#include <qstring.h> 4#include <qstring.h>
5#include <qlistview.h> 5#include <qlistview.h>
6 6
7#include "editaccountsui.h" 7#include "editaccountsui.h"
8#include "selectmailtypeui.h" 8#include "selectmailtypeui.h"
9#include "imapconfigui.h" 9#include "imapconfigui.h"
10#include "pop3configui.h" 10#include "pop3configui.h"
11#include "smtpconfigui.h" 11#include "smtpconfigui.h"
12#include "nntpconfigui.h" 12#include "nntpconfigui.h"
13
14#include <libetpan/clist.h>
13#include <libmailwrapper/settings.h> 15#include <libmailwrapper/settings.h>
14 16
15 17
16class AccountListItem : public QListViewItem 18class AccountListItem : public QListViewItem
17{ 19{
18 20
19public: 21public:
20 AccountListItem( QListView *parent, Account *a); 22 AccountListItem( QListView *parent, Account *a);
21 Account *getAccount() { return account; } 23 Account *getAccount() { return account; }
22 24
23private: 25private:
24 Account *account; 26 Account *account;
25 27
26}; 28};
27 29
28class EditAccounts : public EditAccountsUI 30class EditAccounts : public EditAccountsUI
29{ 31{
30 Q_OBJECT 32 Q_OBJECT
31 33
32public: 34public:
33 EditAccounts( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); 35 EditAccounts( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 );
34 36
35public slots: 37public slots:
36 void slotNewAccount( const QString &type ); 38 void slotNewAccount( const QString &type );
37 void slotEditAccount( Account *account ); 39 void slotEditAccount( Account *account );
38 void slotDeleteAccount( Account * account ); 40 void slotDeleteAccount( Account * account );
39 void slotAdjustColumns(); 41 void slotAdjustColumns();
40 42
41protected slots: 43protected slots:
42 void slotFillLists(); 44 void slotFillLists();
43 void slotNewMail(); 45 void slotNewMail();
44 void slotEditMail(); 46 void slotEditMail();
45 void slotDeleteMail(); 47 void slotDeleteMail();
46 void slotNewNews(); 48 void slotNewNews();
47 void slotEditNews(); 49 void slotEditNews();
48 void slotDeleteNews(); 50 void slotDeleteNews();
49 void accept(); 51 void accept();
50 52
51private: 53private:
52 Settings *settings; 54 Settings *settings;
53 55
54}; 56};
55 57
56class SelectMailType : public SelectMailTypeUI 58class SelectMailType : public SelectMailTypeUI
57{ 59{
58 Q_OBJECT 60 Q_OBJECT
59 61
60public: 62public:
61 SelectMailType( QString *selection = 0, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); 63 SelectMailType( QString *selection = 0, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 );
62 64
63private slots: 65private slots:
64 void slotSelection( const QString &sel ); 66 void slotSelection( const QString &sel );
65 67
66private: 68private:
67 QString *selected; 69 QString *selected;
68 70
69}; 71};
70 72
71class IMAPconfig : public IMAPconfigUI 73class IMAPconfig : public IMAPconfigUI
72{ 74{
73 Q_OBJECT 75 Q_OBJECT
74 76
75public: 77public:
76 IMAPconfig( IMAPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); 78 IMAPconfig( IMAPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 );
77 79
78public slots: 80public slots:
79 void fillValues(); 81 void fillValues();
80 82
81protected slots: 83protected slots:
82 void slotConnectionToggle( int index ); 84 void slotConnectionToggle( int index );
83 void accept(); 85 void accept();
84 86
85private: 87private:
86 IMAPaccount *data; 88 IMAPaccount *data;
87 89
88}; 90};
89 91
90class POP3config : public POP3configUI 92class POP3config : public POP3configUI
91{ 93{
92 Q_OBJECT 94 Q_OBJECT
93 95
94public: 96public:
95 POP3config( POP3account *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); 97 POP3config( POP3account *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 );
96 98
97public slots: 99public slots:
98 void fillValues(); 100 void fillValues();
99 101
100protected slots: 102protected slots:
101 void slotConnectionToggle( int index ); 103 void slotConnectionToggle( int index );
102 void accept(); 104 void accept();
103 105
104private: 106private:
105 POP3account *data; 107 POP3account *data;
106 108
107}; 109};
108 110
109class SMTPconfig : public SMTPconfigUI 111class SMTPconfig : public SMTPconfigUI
110{ 112{
111 Q_OBJECT 113 Q_OBJECT
112 114
113public: 115public:
114 SMTPconfig( SMTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); 116 SMTPconfig( SMTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 );
115 117
116public slots: 118public slots:
117 void fillValues(); 119 void fillValues();
118 120
119protected slots: 121protected slots:
120 void slotConnectionToggle( int index ); 122 void slotConnectionToggle( int index );
121 void accept(); 123 void accept();
122 124
123private: 125private:
124 SMTPaccount *data; 126 SMTPaccount *data;
125 127
126}; 128};
127 129
128class NNTPconfig : public NNTPconfigUI 130class NNTPconfig : public NNTPconfigUI
129{ 131{
130 Q_OBJECT 132 Q_OBJECT
131 133
132public: 134public:
133 NNTPconfig( NNTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); 135 NNTPconfig( NNTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 );
134 136
135public slots: 137public slots:
136 void fillValues(); 138 void fillValues();
137 139
138protected slots: 140protected slots:
139 void slotSSL( bool enabled ); 141 void slotSSL( bool enabled );
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
145}; 150};
146 151
147#endif 152#endif
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
@@ -1,265 +1,257 @@
1#include "nntpwrapper.h" 1#include "nntpwrapper.h"
2#include "logindialog.h" 2#include "logindialog.h"
3#include "mailtypes.h" 3#include "mailtypes.h"
4 4
5#include <qfile.h> 5#include <qfile.h>
6 6
7#include <stdlib.h> 7#include <stdlib.h>
8 8
9#include <libetpan/libetpan.h> 9#include <libetpan/libetpan.h>
10#include <libetpan/nntpdriver.h>
11
12 10
13 11
14#define HARD_MSG_SIZE_LIMIT 5242880 12#define HARD_MSG_SIZE_LIMIT 5242880
15 13
16NNTPwrapper::NNTPwrapper( NNTPaccount *a ) 14NNTPwrapper::NNTPwrapper( NNTPaccount *a )
17: Genericwrapper() { 15: Genericwrapper() {
18 account = a; 16 account = a;
19 m_nntp = NULL; 17 m_nntp = NULL;
20 msgTempName = a->getFileName()+"_msg_cache"; 18 msgTempName = a->getFileName()+"_msg_cache";
21 last_msg_id = 0; 19 last_msg_id = 0;
22} 20}
23 21
24NNTPwrapper::~NNTPwrapper() { 22NNTPwrapper::~NNTPwrapper() {
25 logout(); 23 logout();
26 QFile msg_cache(msgTempName); 24 QFile msg_cache(msgTempName);
27 if (msg_cache.exists()) { 25 if (msg_cache.exists()) {
28 msg_cache.remove(); 26 msg_cache.remove();
29 } 27 }
30} 28}
31 29
32void NNTPwrapper::nntp_progress( size_t current, size_t maximum ) { 30void NNTPwrapper::nntp_progress( size_t current, size_t maximum ) {
33 qDebug( "NNTP: %i of %i", current, maximum ); 31 qDebug( "NNTP: %i of %i", current, maximum );
34} 32}
35 33
36 34
37RecBody NNTPwrapper::fetchBody( const RecMail &mail ) { 35RecBody NNTPwrapper::fetchBody( const RecMail &mail ) {
38 int err = NEWSNNTP_NO_ERROR; 36 int err = NEWSNNTP_NO_ERROR;
39 char *message = 0; 37 char *message = 0;
40 size_t length = 0; 38 size_t length = 0;
41 39
42 login(); 40 login();
43 if ( !m_nntp ) { 41 if ( !m_nntp ) {
44 return RecBody(); 42 return RecBody();
45 } 43 }
46 44
47 RecBody body; 45 RecBody body;
48 mailmessage * mailmsg; 46 mailmessage * mailmsg;
49 if (mail.Msgsize()>HARD_MSG_SIZE_LIMIT) { 47 if (mail.Msgsize()>HARD_MSG_SIZE_LIMIT) {
50 qDebug("Message to large: %i",mail.Msgsize()); 48 qDebug("Message to large: %i",mail.Msgsize());
51 return body; 49 return body;
52 } 50 }
53 51
54 QFile msg_cache(msgTempName); 52 QFile msg_cache(msgTempName);
55 53
56 cleanMimeCache(); 54 cleanMimeCache();
57 55
58 if (mail.getNumber()!=last_msg_id) { 56 if (mail.getNumber()!=last_msg_id) {
59 if (msg_cache.exists()) { 57 if (msg_cache.exists()) {
60 msg_cache.remove(); 58 msg_cache.remove();
61 } 59 }
62 msg_cache.open(IO_ReadWrite|IO_Truncate); 60 msg_cache.open(IO_ReadWrite|IO_Truncate);
63 last_msg_id = mail.getNumber(); 61 last_msg_id = mail.getNumber();
64 err = mailsession_get_message(m_nntp->sto_session, mail.getNumber(), &mailmsg); 62 err = mailsession_get_message(m_nntp->sto_session, mail.getNumber(), &mailmsg);
65 err = mailmessage_fetch(mailmsg,&message,&length); 63 err = mailmessage_fetch(mailmsg,&message,&length);
66 msg_cache.writeBlock(message,length); 64 msg_cache.writeBlock(message,length);
67 } else { 65 } else {
68 QString msg=""; 66 QString msg="";
69 msg_cache.open(IO_ReadOnly); 67 msg_cache.open(IO_ReadOnly);
70 message = new char[4096]; 68 message = new char[4096];
71 memset(message,0,4096); 69 memset(message,0,4096);
72 while (msg_cache.readBlock(message,4095)>0) { 70 while (msg_cache.readBlock(message,4095)>0) {
73 msg+=message; 71 msg+=message;
74 memset(message,0,4096); 72 memset(message,0,4096);
75 } 73 }
76 delete message; 74 delete message;
77 message = (char*)malloc(msg.length()+1*sizeof(char)); 75 message = (char*)malloc(msg.length()+1*sizeof(char));
78 memset(message,0,msg.length()+1); 76 memset(message,0,msg.length()+1);
79 memcpy(message,msg.latin1(),msg.length()); 77 memcpy(message,msg.latin1(),msg.length());
80 /* transform to libetpan stuff */ 78 /* transform to libetpan stuff */
81 mailmsg = mailmessage_new(); 79 mailmsg = mailmessage_new();
82 mailmessage_init(mailmsg, NULL, data_message_driver, 0, strlen(message)); 80 mailmessage_init(mailmsg, NULL, data_message_driver, 0, strlen(message));
83 generic_message_t * msg_data; 81 generic_message_t * msg_data;
84 msg_data = (generic_message_t *)mailmsg->msg_data; 82 msg_data = (generic_message_t *)mailmsg->msg_data;
85 msg_data->msg_fetched = 1; 83 msg_data->msg_fetched = 1;
86 msg_data->msg_message = message; 84 msg_data->msg_message = message;
87 msg_data->msg_length = strlen(message); 85 msg_data->msg_length = strlen(message);
88 } 86 }
89 body = parseMail(mailmsg); 87 body = parseMail(mailmsg);
90 88
91 /* clean up */ 89 /* clean up */
92 if (mailmsg) 90 if (mailmsg)
93 mailmessage_free(mailmsg); 91 mailmessage_free(mailmsg);
94 if (message) 92 if (message)
95 free(message); 93 free(message);
96 94
97 return body; 95 return body;
98} 96}
99 97
100 98
101void NNTPwrapper::listMessages(const QString &, QList<RecMail> &target ) 99void NNTPwrapper::listMessages(const QString &, QList<RecMail> &target )
102{ 100{
103 login(); 101 login();
104 if (!m_nntp) 102 if (!m_nntp)
105 return; 103 return;
106 uint32_t res_messages,res_recent,res_unseen; 104 uint32_t res_messages,res_recent,res_unseen;
107 mailsession_status_folder(m_nntp->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); 105 mailsession_status_folder(m_nntp->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen);
108 parseList(target,m_nntp->sto_session,"INBOX"); 106 parseList(target,m_nntp->sto_session,"INBOX");
109} 107}
110 108
111void NNTPwrapper::login() 109void NNTPwrapper::login()
112{ 110{
113 if (account->getOffline()) 111 if (account->getOffline())
114 return; 112 return;
115 /* we'll hold the line */ 113 /* we'll hold the line */
116 if ( m_nntp != NULL ) 114 if ( m_nntp != NULL )
117 return; 115 return;
118 116
119 const char *server, *user, *pass; 117 const char *server, *user, *pass;
120 QString User,Pass; 118 QString User,Pass;
121 uint16_t port; 119 uint16_t port;
122 int err = NEWSNNTP_NO_ERROR; 120 int err = NEWSNNTP_NO_ERROR;
123 121
124 server = account->getServer().latin1(); 122 server = account->getServer().latin1();
125 port = account->getPort().toUInt(); 123 port = account->getPort().toUInt();
126 124
127 user = pass = 0; 125 user = pass = 0;
128 126
129 if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { 127 if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) {
130 LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); 128 LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true );
131 login.show(); 129 login.show();
132 if ( QDialog::Accepted == login.exec() ) { 130 if ( QDialog::Accepted == login.exec() ) {
133 // ok 131 // ok
134 User = login.getUser().latin1(); 132 User = login.getUser().latin1();
135 Pass = login.getPassword().latin1(); 133 Pass = login.getPassword().latin1();
136 } else { 134 } else {
137 // cancel 135 // cancel
138 qDebug( "NNTP: Login canceled" ); 136 qDebug( "NNTP: Login canceled" );
139 return; 137 return;
140 } 138 }
141 } else { 139 } else {
142 User = account->getUser().latin1(); 140 User = account->getUser().latin1();
143 Pass = account->getPassword().latin1(); 141 Pass = account->getPassword().latin1();
144 } 142 }
145 143
146 if (User.isEmpty()) { 144 if (User.isEmpty()) {
147 user=0; 145 user=0;
148 pass = 0; 146 pass = 0;
149 } else { 147 } else {
150 user=User.latin1(); 148 user=User.latin1();
151 pass=Pass.latin1(); 149 pass=Pass.latin1();
152 } 150 }
153 // bool ssl = account->getSSL(); 151 // bool ssl = account->getSSL();
154 152
155 m_nntp=mailstorage_new(NULL); 153 m_nntp=mailstorage_new(NULL);
156 154
157 int conntypeset = account->ConnectionType(); 155 int conntypeset = account->ConnectionType();
158 int conntype = 0; 156 int conntype = 0;
159 if ( conntypeset == 3 ) { 157 if ( conntypeset == 3 ) {
160 conntype = CONNECTION_TYPE_COMMAND; 158 conntype = CONNECTION_TYPE_COMMAND;
161 } else if ( conntypeset == 2 ) { 159 } else if ( conntypeset == 2 ) {
162 conntype = CONNECTION_TYPE_TLS; 160 conntype = CONNECTION_TYPE_TLS;
163 } else if ( conntypeset == 1 ) { 161 } else if ( conntypeset == 1 ) {
164 conntype = CONNECTION_TYPE_STARTTLS; 162 conntype = CONNECTION_TYPE_STARTTLS;
165 } else if ( conntypeset == 0 ) { 163 } else if ( conntypeset == 0 ) {
166 conntype = CONNECTION_TYPE_TRY_STARTTLS; 164 conntype = CONNECTION_TYPE_TRY_STARTTLS;
167 } 165 }
168 166
169 nntp_mailstorage_init(m_nntp,(char*)server, port, NULL, CONNECTION_TYPE_PLAIN, NNTP_AUTH_TYPE_PLAIN, 167 nntp_mailstorage_init(m_nntp,(char*)server, port, NULL, CONNECTION_TYPE_PLAIN, NNTP_AUTH_TYPE_PLAIN,
170 (char*)user,(char*)pass,0,0,0); 168 (char*)user,(char*)pass,0,0,0);
171 169
172 err = mailstorage_connect( m_nntp ); 170 err = mailstorage_connect( m_nntp );
173 171
174 if (err != NEWSNNTP_NO_ERROR) { 172 if (err != NEWSNNTP_NO_ERROR) {
175 qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) ); 173 qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) );
176 // Global::statusMessage(tr("Error initializing folder")); 174 // Global::statusMessage(tr("Error initializing folder"));
177 mailstorage_free(m_nntp); 175 mailstorage_free(m_nntp);
178 m_nntp = 0; 176 m_nntp = 0;
179 177
180 } 178 }
181 179
182} 180}
183 181
184void NNTPwrapper::logout() 182void NNTPwrapper::logout()
185{ 183{
186 int err = NEWSNNTP_NO_ERROR; 184 int err = NEWSNNTP_NO_ERROR;
187 if ( m_nntp == NULL ) 185 if ( m_nntp == NULL )
188 return; 186 return;
189 mailstorage_free(m_nntp); 187 mailstorage_free(m_nntp);
190 m_nntp = 0; 188 m_nntp = 0;
191} 189}
192 190
193QList<Folder>* NNTPwrapper::listFolders() { 191QList<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;
201 clistcell *current; 203 clistcell *current;
202 newsnntp_group_description *list; 204 newsnntp_group_description *list;
203
204 login();
205 if ( m_nntp ) { 205 if ( m_nntp ) {
206 mailsession * session = m_nntp->sto_session; 206 mailsession * session = m_nntp->sto_session;
207 newsnntp * news = ( ( nntp_session_state_data * )session->sess_data )->nntp_session; 207 newsnntp * news = ( ( nntp_session_state_data * )session->sess_data )->nntp_session;
208 int err = newsnntp_list_newsgroups(news, NULL, &result); 208 int err = newsnntp_list_newsgroups(news, NULL, &result);
209 209
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&) {}
225 217
226void NNTPwrapper::statusFolder(folderStat&target_stat,const QString&) { 218void NNTPwrapper::statusFolder(folderStat&target_stat,const QString&) {
227 login(); 219 login();
228 target_stat.message_count = 0; 220 target_stat.message_count = 0;
229 target_stat.message_unseen = 0; 221 target_stat.message_unseen = 0;
230 target_stat.message_recent = 0; 222 target_stat.message_recent = 0;
231 if (!m_nntp) 223 if (!m_nntp)
232 return; 224 return;
233 int r = mailsession_status_folder(m_nntp->sto_session,0,&target_stat.message_count, 225 int r = mailsession_status_folder(m_nntp->sto_session,0,&target_stat.message_count,
234 &target_stat.message_recent,&target_stat.message_unseen); 226 &target_stat.message_recent,&target_stat.message_unseen);
235} 227}
236 228
237 229
238encodedString* NNTPwrapper::fetchRawBody(const RecMail&mail) { 230encodedString* NNTPwrapper::fetchRawBody(const RecMail&mail) {
239 char*target=0; 231 char*target=0;
240 size_t length=0; 232 size_t length=0;
241 encodedString*res = 0; 233 encodedString*res = 0;
242 mailmessage * mailmsg = 0; 234 mailmessage * mailmsg = 0;
243 int err = mailsession_get_message(m_nntp->sto_session, mail.getNumber(), &mailmsg); 235 int err = mailsession_get_message(m_nntp->sto_session, mail.getNumber(), &mailmsg);
244 err = mailmessage_fetch(mailmsg,&target,&length); 236 err = mailmessage_fetch(mailmsg,&target,&length);
245 if (mailmsg) 237 if (mailmsg)
246 mailmessage_free(mailmsg); 238 mailmessage_free(mailmsg);
247 if (target) { 239 if (target) {
248 res = new encodedString(target,length); 240 res = new encodedString(target,length);
249 } 241 }
250 return res; 242 return res;
251} 243}
252 244
253const QString&NNTPwrapper::getType()const { 245const QString&NNTPwrapper::getType()const {
254 return account->getType(); 246 return account->getType();
255} 247}
256 248
257const QString&NNTPwrapper::getName()const{ 249const QString&NNTPwrapper::getName()const{
258 return account->getAccountName(); 250 return account->getAccountName();
259} 251}
260 252
261void NNTPwrapper::deleteMail(const RecMail&mail) { 253void NNTPwrapper::deleteMail(const RecMail&mail) {
262} 254}
263 255
264int NNTPwrapper::deleteAllMail(const Folder*) { 256int NNTPwrapper::deleteAllMail(const Folder*) {
265} 257}
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
@@ -1,48 +1,48 @@
1#ifndef __NNTPWRAPPER 1#ifndef __NNTPWRAPPER
2#define __NNTPWRAPPER 2#define __NNTPWRAPPER
3 3
4#include "mailwrapper.h" 4#include "mailwrapper.h"
5#include "genericwrapper.h" 5#include "genericwrapper.h"
6#include <qstring.h> 6#include <qstring.h>
7#include <libetpan/clist.h> 7#include <libetpan/clist.h>
8 8
9class encodedString; 9class encodedString;
10struct mailstorage; 10struct mailstorage;
11struct mailfolder; 11struct mailfolder;
12 12
13class NNTPwrapper : public Genericwrapper 13class NNTPwrapper : public Genericwrapper
14{ 14{
15 15
16 Q_OBJECT 16 Q_OBJECT
17 17
18public: 18public:
19 NNTPwrapper( NNTPaccount *a ); 19 NNTPwrapper( NNTPaccount *a );
20 virtual ~NNTPwrapper(); 20 virtual ~NNTPwrapper();
21 21
22 /* mailbox will be ignored */ 22 /* mailbox will be ignored */
23 virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); 23 virtual void listMessages(const QString & mailbox, QList<RecMail> &target );
24 /* should only get the subscribed one */ 24 /* should only get the subscribed one */
25 virtual QList<Folder>* listFolders(); 25 virtual QList<Folder>* listFolders();
26 /* mailbox will be ignored */ 26 /* mailbox will be ignored */
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);
30 virtual void answeredMail(const RecMail&mail); 30 virtual void answeredMail(const RecMail&mail);
31 virtual int deleteAllMail(const Folder*); 31 virtual int deleteAllMail(const Folder*);
32 32
33 virtual RecBody fetchBody( const RecMail &mail ); 33 virtual RecBody fetchBody( const RecMail &mail );
34 virtual encodedString* fetchRawBody(const RecMail&mail); 34 virtual encodedString* fetchRawBody(const RecMail&mail);
35 virtual void logout(); 35 virtual void logout();
36 virtual const QString&getType()const; 36 virtual const QString&getType()const;
37 virtual const QString&getName()const; 37 virtual const QString&getName()const;
38 static void nntp_progress( size_t current, size_t maximum ); 38 static void nntp_progress( size_t current, size_t maximum );
39 39
40protected: 40protected:
41 void login(); 41 void login();
42 NNTPaccount *account; 42 NNTPaccount *account;
43 mailstorage* m_nntp; 43 mailstorage* m_nntp;
44 44
45 45
46}; 46};
47 47
48#endif 48#endif
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
@@ -1,352 +1,344 @@
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>413</width> 14 <width>409</width>
15 <height>520</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 <vbox> 28 <vbox>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>margin</name> 30 <name>margin</name>
31 <number>3</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> 37 <widget>
38 <class>QTabWidget</class> 38 <class>QTabWidget</class>
39 <property stdset="1"> 39 <property stdset="1">
40 <name>name</name> 40 <name>name</name>
41 <cstring>TabWidget2</cstring> 41 <cstring>TabWidget2</cstring>
42 </property> 42 </property>
43 <property> 43 <property>
44 <name>layoutMargin</name> 44 <name>layoutMargin</name>
45 </property> 45 </property>
46 <property> 46 <property>
47 <name>layoutSpacing</name> 47 <name>layoutSpacing</name>
48 </property> 48 </property>
49 <widget> 49 <widget>
50 <class>QWidget</class> 50 <class>QWidget</class>
51 <property stdset="1"> 51 <property stdset="1">
52 <name>name</name> 52 <name>name</name>
53 <cstring>tab</cstring> 53 <cstring>tab</cstring>
54 </property> 54 </property>
55 <attribute> 55 <attribute>
56 <name>title</name> 56 <name>title</name>
57 <string>Account</string> 57 <string>Account</string>
58 </attribute> 58 </attribute>
59 <grid> 59 <grid>
60 <property stdset="1"> 60 <property stdset="1">
61 <name>margin</name> 61 <name>margin</name>
62 <number>3</number> 62 <number>3</number>
63 </property> 63 </property>
64 <property stdset="1"> 64 <property stdset="1">
65 <name>spacing</name> 65 <name>spacing</name>
66 <number>3</number> 66 <number>3</number>
67 </property> 67 </property>
68 <widget row="2" column="1" > 68 <widget row="2" column="1" >
69 <class>QLineEdit</class> 69 <class>QLineEdit</class>
70 <property stdset="1"> 70 <property stdset="1">
71 <name>name</name> 71 <name>name</name>
72 <cstring>serverLine</cstring> 72 <cstring>serverLine</cstring>
73 </property> 73 </property>
74 </widget> 74 </widget>
75 <widget row="3" column="0" > 75 <widget row="3" column="0" >
76 <class>QLabel</class> 76 <class>QLabel</class>
77 <property stdset="1"> 77 <property stdset="1">
78 <name>name</name> 78 <name>name</name>
79 <cstring>portLabel</cstring> 79 <cstring>portLabel</cstring>
80 </property> 80 </property>
81 <property stdset="1"> 81 <property stdset="1">
82 <name>text</name> 82 <name>text</name>
83 <string>Port</string> 83 <string>Port</string>
84 </property> 84 </property>
85 </widget> 85 </widget>
86 <widget row="3" column="1" > 86 <widget row="3" column="1" >
87 <class>QLineEdit</class> 87 <class>QLineEdit</class>
88 <property stdset="1"> 88 <property stdset="1">
89 <name>name</name> 89 <name>name</name>
90 <cstring>portLine</cstring> 90 <cstring>portLine</cstring>
91 </property> 91 </property>
92 </widget> 92 </widget>
93 <widget row="0" column="1" > 93 <widget row="0" column="1" >
94 <class>QLineEdit</class> 94 <class>QLineEdit</class>
95 <property stdset="1"> 95 <property stdset="1">
96 <name>name</name> 96 <name>name</name>
97 <cstring>accountLine</cstring> 97 <cstring>accountLine</cstring>
98 </property> 98 </property>
99 <property> 99 <property>
100 <name>toolTip</name> 100 <name>toolTip</name>
101 <string>Name of the Account</string> 101 <string>Name of the Account</string>
102 </property> 102 </property>
103 </widget> 103 </widget>
104 <widget row="0" column="0" > 104 <widget row="0" column="0" >
105 <class>QLabel</class> 105 <class>QLabel</class>
106 <property stdset="1"> 106 <property stdset="1">
107 <name>name</name> 107 <name>name</name>
108 <cstring>accountLabel</cstring> 108 <cstring>accountLabel</cstring>
109 </property> 109 </property>
110 <property stdset="1"> 110 <property stdset="1">
111 <name>text</name> 111 <name>text</name>
112 <string>Account</string> 112 <string>Account</string>
113 </property> 113 </property>
114 </widget> 114 </widget>
115 <widget row="2" column="0" > 115 <widget row="2" column="0" >
116 <class>QLabel</class> 116 <class>QLabel</class>
117 <property stdset="1"> 117 <property stdset="1">
118 <name>name</name> 118 <name>name</name>
119 <cstring>serverLabel</cstring> 119 <cstring>serverLabel</cstring>
120 </property> 120 </property>
121 <property stdset="1"> 121 <property stdset="1">
122 <name>enabled</name> 122 <name>enabled</name>
123 <bool>true</bool> 123 <bool>true</bool>
124 </property> 124 </property>
125 <property stdset="1"> 125 <property stdset="1">
126 <name>caption</name> 126 <name>caption</name>
127 <string></string> 127 <string></string>
128 </property> 128 </property>
129 <property stdset="1"> 129 <property stdset="1">
130 <name>text</name> 130 <name>text</name>
131 <string>Server</string> 131 <string>Server</string>
132 </property> 132 </property>
133 <property> 133 <property>
134 <name>layoutMargin</name> 134 <name>layoutMargin</name>
135 </property> 135 </property>
136 <property> 136 <property>
137 <name>layoutSpacing</name> 137 <name>layoutSpacing</name>
138 </property> 138 </property>
139 </widget> 139 </widget>
140 <widget row="1" column="0" rowspan="1" colspan="2" > 140 <widget row="1" column="0" rowspan="1" colspan="2" >
141 <class>Line</class> 141 <class>Line</class>
142 <property stdset="1"> 142 <property stdset="1">
143 <name>name</name> 143 <name>name</name>
144 <cstring>line1</cstring> 144 <cstring>line1</cstring>
145 </property> 145 </property>
146 <property stdset="1"> 146 <property stdset="1">
147 <name>caption</name> 147 <name>caption</name>
148 <string></string> 148 <string></string>
149 </property> 149 </property>
150 <property stdset="1"> 150 <property stdset="1">
151 <name>orientation</name> 151 <name>orientation</name>
152 <enum>Horizontal</enum> 152 <enum>Horizontal</enum>
153 </property> 153 </property>
154 <property> 154 <property>
155 <name>layoutMargin</name> 155 <name>layoutMargin</name>
156 </property> 156 </property>
157 <property> 157 <property>
158 <name>layoutSpacing</name> 158 <name>layoutSpacing</name>
159 </property> 159 </property>
160 </widget> 160 </widget>
161 <widget row="4" column="1" > 161 <widget row="4" column="1" >
162 <class>QCheckBox</class> 162 <class>QCheckBox</class>
163 <property stdset="1"> 163 <property stdset="1">
164 <name>name</name> 164 <name>name</name>
165 <cstring>sslBox</cstring> 165 <cstring>sslBox</cstring>
166 </property> 166 </property>
167 <property stdset="1"> 167 <property stdset="1">
168 <name>text</name> 168 <name>text</name>
169 <string>Use SSL</string> 169 <string>Use SSL</string>
170 </property> 170 </property>
171 </widget> 171 </widget>
172 <widget row="5" column="0" rowspan="2" colspan="2" > 172 <widget row="5" column="0" rowspan="2" colspan="2" >
173 <class>Line</class> 173 <class>Line</class>
174 <property stdset="1"> 174 <property stdset="1">
175 <name>name</name> 175 <name>name</name>
176 <cstring>line2</cstring> 176 <cstring>line2</cstring>
177 </property> 177 </property>
178 <property stdset="1"> 178 <property stdset="1">
179 <name>enabled</name> 179 <name>enabled</name>
180 <bool>true</bool> 180 <bool>true</bool>
181 </property> 181 </property>
182 <property stdset="1"> 182 <property stdset="1">
183 <name>caption</name> 183 <name>caption</name>
184 <string></string> 184 <string></string>
185 </property> 185 </property>
186 <property stdset="1"> 186 <property stdset="1">
187 <name>orientation</name> 187 <name>orientation</name>
188 <enum>Horizontal</enum> 188 <enum>Horizontal</enum>
189 </property> 189 </property>
190 <property> 190 <property>
191 <name>layoutMargin</name> 191 <name>layoutMargin</name>
192 </property> 192 </property>
193 <property> 193 <property>
194 <name>layoutSpacing</name> 194 <name>layoutSpacing</name>
195 </property> 195 </property>
196 </widget> 196 </widget>
197 <widget row="7" column="0" > 197 <widget row="7" column="0" >
198 <class>QLabel</class> 198 <class>QLabel</class>
199 <property stdset="1"> 199 <property stdset="1">
200 <name>name</name> 200 <name>name</name>
201 <cstring>userLabel</cstring> 201 <cstring>userLabel</cstring>
202 </property> 202 </property>
203 <property stdset="1"> 203 <property stdset="1">
204 <name>text</name> 204 <name>text</name>
205 <string>User</string> 205 <string>User</string>
206 </property> 206 </property>
207 </widget> 207 </widget>
208 <widget row="8" column="0" > 208 <widget row="8" column="0" >
209 <class>QLabel</class> 209 <class>QLabel</class>
210 <property stdset="1"> 210 <property stdset="1">
211 <name>name</name> 211 <name>name</name>
212 <cstring>passLabel</cstring> 212 <cstring>passLabel</cstring>
213 </property> 213 </property>
214 <property stdset="1"> 214 <property stdset="1">
215 <name>text</name> 215 <name>text</name>
216 <string>Password</string> 216 <string>Password</string>
217 </property> 217 </property>
218 </widget> 218 </widget>
219 <spacer row="9" column="1" > 219 <spacer row="9" column="1" >
220 <property> 220 <property>
221 <name>name</name> 221 <name>name</name>
222 <cstring>spacer</cstring> 222 <cstring>spacer</cstring>
223 </property> 223 </property>
224 <property stdset="1"> 224 <property stdset="1">
225 <name>orientation</name> 225 <name>orientation</name>
226 <enum>Vertical</enum> 226 <enum>Vertical</enum>
227 </property> 227 </property>
228 <property stdset="1"> 228 <property stdset="1">
229 <name>sizeType</name> 229 <name>sizeType</name>
230 <enum>Expanding</enum> 230 <enum>Expanding</enum>
231 </property> 231 </property>
232 <property> 232 <property>
233 <name>sizeHint</name> 233 <name>sizeHint</name>
234 <size> 234 <size>
235 <width>20</width> 235 <width>20</width>
236 <height>20</height> 236 <height>20</height>
237 </size> 237 </size>
238 </property> 238 </property>
239 </spacer> 239 </spacer>
240 <widget row="6" column="1" > 240 <widget row="6" column="1" >
241 <class>QCheckBox</class> 241 <class>QCheckBox</class>
242 <property stdset="1"> 242 <property stdset="1">
243 <name>name</name> 243 <name>name</name>
244 <cstring>loginBox</cstring> 244 <cstring>loginBox</cstring>
245 </property> 245 </property>
246 <property stdset="1"> 246 <property stdset="1">
247 <name>text</name> 247 <name>text</name>
248 <string>Use Login</string> 248 <string>Use Login</string>
249 </property> 249 </property>
250 </widget> 250 </widget>
251 <widget row="7" column="1" > 251 <widget row="7" column="1" >
252 <class>QLineEdit</class> 252 <class>QLineEdit</class>
253 <property stdset="1"> 253 <property stdset="1">
254 <name>name</name> 254 <name>name</name>
255 <cstring>userLine</cstring> 255 <cstring>userLine</cstring>
256 </property> 256 </property>
257 <property stdset="1"> 257 <property stdset="1">
258 <name>enabled</name> 258 <name>enabled</name>
259 <bool>false</bool> 259 <bool>false</bool>
260 </property> 260 </property>
261 </widget> 261 </widget>
262 <widget row="8" column="1" > 262 <widget row="8" column="1" >
263 <class>QLineEdit</class> 263 <class>QLineEdit</class>
264 <property stdset="1"> 264 <property stdset="1">
265 <name>name</name> 265 <name>name</name>
266 <cstring>passLine</cstring> 266 <cstring>passLine</cstring>
267 </property> 267 </property>
268 <property stdset="1"> 268 <property stdset="1">
269 <name>enabled</name> 269 <name>enabled</name>
270 <bool>false</bool> 270 <bool>false</bool>
271 </property> 271 </property>
272 <property stdset="1"> 272 <property stdset="1">
273 <name>echoMode</name> 273 <name>echoMode</name>
274 <enum>Password</enum> 274 <enum>Password</enum>
275 </property> 275 </property>
276 </widget> 276 </widget>
277 </grid> 277 </grid>
278 </widget> 278 </widget>
279 <widget> 279 <widget>
280 <class>QWidget</class> 280 <class>QWidget</class>
281 <property stdset="1"> 281 <property stdset="1">
282 <name>name</name> 282 <name>name</name>
283 <cstring>tab</cstring> 283 <cstring>tab</cstring>
284 </property> 284 </property>
285 <attribute> 285 <attribute>
286 <name>title</name> 286 <name>title</name>
287 <string>Groups</string> 287 <string>Groups</string>
288 </attribute> 288 </attribute>
289 <vbox> 289 <vbox>
290 <property stdset="1"> 290 <property stdset="1">
291 <name>margin</name> 291 <name>margin</name>
292 <number>3</number> 292 <number>3</number>
293 </property> 293 </property>
294 <property stdset="1"> 294 <property stdset="1">
295 <name>spacing</name> 295 <name>spacing</name>
296 <number>3</number> 296 <number>3</number>
297 </property> 297 </property>
298 <widget> 298 <widget>
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">
301 <name>name</name> 315 <name>name</name>
302 <cstring>ListViewGroups</cstring> 316 <cstring>ListViewGroups</cstring>
303 </property> 317 </property>
304 </widget> 318 </widget>
305 <widget> 319 <widget>
306 <class>QPushButton</class> 320 <class>QPushButton</class>
307 <property stdset="1"> 321 <property stdset="1">
308 <name>name</name> 322 <name>name</name>
309 <cstring>GetNGButton</cstring> 323 <cstring>GetNGButton</cstring>
310 </property> 324 </property>
311 <property stdset="1"> 325 <property stdset="1">
312 <name>text</name> 326 <name>text</name>
313 <string>Get newsgroup list from server</string> 327 <string>Get newsgroup list from server</string>
314 </property> 328 </property>
315 </widget> 329 </widget>
316 </vbox> 330 </vbox>
317 </widget> 331 </widget>
318 </widget> 332 </widget>
319 </vbox> 333 </vbox>
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>
344 <tabstop>accountLine</tabstop> 336 <tabstop>accountLine</tabstop>
345 <tabstop>serverLine</tabstop> 337 <tabstop>serverLine</tabstop>
346 <tabstop>portLine</tabstop> 338 <tabstop>portLine</tabstop>
347 <tabstop>sslBox</tabstop> 339 <tabstop>sslBox</tabstop>
348 <tabstop>loginBox</tabstop> 340 <tabstop>loginBox</tabstop>
349 <tabstop>userLine</tabstop> 341 <tabstop>userLine</tabstop>
350 <tabstop>passLine</tabstop> 342 <tabstop>passLine</tabstop>
351</tabstops> 343</tabstops>
352</UI> 344</UI>