summaryrefslogtreecommitdiffabout
path: root/kmicromail
Unidiff
Diffstat (limited to 'kmicromail') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/editaccounts.cpp12
-rw-r--r--kmicromail/libmailwrapper/pop3wrapper.cpp2
-rw-r--r--kmicromail/libmailwrapper/settings.cpp10
-rw-r--r--kmicromail/libmailwrapper/settings.h9
-rw-r--r--kmicromail/pop3configui.ui94
5 files changed, 122 insertions, 5 deletions
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp
index d272c3b..e7d2750 100644
--- a/kmicromail/editaccounts.cpp
+++ b/kmicromail/editaccounts.cpp
@@ -13,12 +13,13 @@
13#include <qmessagebox.h> 13#include <qmessagebox.h>
14#include <qpushbutton.h> 14#include <qpushbutton.h>
15#include <qlineedit.h> 15#include <qlineedit.h>
16#include <qlabel.h> 16#include <qlabel.h>
17#include <qtabwidget.h> 17#include <qtabwidget.h>
18#include <qlistview.h> 18#include <qlistview.h>
19#include <qspinbox.h>
19 20
20#include <libmailwrapper/nntpwrapper.h> 21#include <libmailwrapper/nntpwrapper.h>
21 22
22using namespace Opie::Core; 23using namespace Opie::Core;
23 24
24AccountListItem::AccountListItem( QListView *parent, Account *a) 25AccountListItem::AccountListItem( QListView *parent, Account *a)
@@ -417,22 +418,33 @@ void POP3config::fillValues()
417 accountLine->setText( data->getAccountName() ); 418 accountLine->setText( data->getAccountName() );
418 serverLine->setText( data->getServer() ); 419 serverLine->setText( data->getServer() );
419 portLine->setText( data->getPort() ); 420 portLine->setText( data->getPort() );
420 ComboBox1->setCurrentItem( data->ConnectionType() ); 421 ComboBox1->setCurrentItem( data->ConnectionType() );
421 userLine->setText( data->getUser() ); 422 userLine->setText( data->getUser() );
422 passLine->setText( data->getPassword() ); 423 passLine->setText( data->getPassword() );
424 localFolder->setText( data->getLocalFolder() );
425 int max = data->getMaxMailSize() ;
426 if ( max ) {
427 CheckBoxDown->setChecked( true );
428 SpinBoxDown->setValue ( max );
429 } else {
430 CheckBoxDown->setChecked( false );
431 SpinBoxDown->setValue ( 5 );
432 }
423} 433}
424 434
425void POP3config::accept() 435void POP3config::accept()
426{ 436{
427 data->setAccountName( accountLine->text() ); 437 data->setAccountName( accountLine->text() );
428 data->setServer( serverLine->text() ); 438 data->setServer( serverLine->text() );
429 data->setPort( portLine->text() ); 439 data->setPort( portLine->text() );
430 data->setConnectionType( ComboBox1->currentItem() ); 440 data->setConnectionType( ComboBox1->currentItem() );
431 data->setUser( userLine->text() ); 441 data->setUser( userLine->text() );
432 data->setPassword( passLine->text() ); 442 data->setPassword( passLine->text() );
443 data->setLocalFolder( localFolder->text() );
444 data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ;
433 445
434 QDialog::accept(); 446 QDialog::accept();
435} 447}
436 448
437/** 449/**
438 * SMTPconfig 450 * SMTPconfig
diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp
index 8d2f778..1edec9e 100644
--- a/kmicromail/libmailwrapper/pop3wrapper.cpp
+++ b/kmicromail/libmailwrapper/pop3wrapper.cpp
@@ -119,13 +119,13 @@ void POP3wrapper::login()
119 return; 119 return;
120 120
121 QString server,user, pass; 121 QString server,user, pass;
122 uint16_t port; 122 uint16_t port;
123 int err = MAILPOP3_NO_ERROR; 123 int err = MAILPOP3_NO_ERROR;
124 124
125 server = account->getServer().latin1(); 125 server = account->getServer();
126 port = account->getPort().toUInt(); 126 port = account->getPort().toUInt();
127 127
128 if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { 128 if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) {
129 qApp->processEvents(); 129 qApp->processEvents();
130 LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); 130 LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true );
131 login.show(); 131 login.show();
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp
index b0a539e..90e32fa 100644
--- a/kmicromail/libmailwrapper/settings.cpp
+++ b/kmicromail/libmailwrapper/settings.cpp
@@ -252,12 +252,17 @@ void POP3account::read()
252 port = conf->readEntry( "Port" ); 252 port = conf->readEntry( "Port" );
253 ssl = conf->readBoolEntry( "SSL" ); 253 ssl = conf->readBoolEntry( "SSL" );
254 connectionType = conf->readNumEntry( "ConnectionType" ); 254 connectionType = conf->readNumEntry( "ConnectionType" );
255 user = conf->readEntry( "User" ); 255 user = conf->readEntry( "User" );
256 password = conf->readEntryCrypt( "Password" ); 256 password = conf->readEntryCrypt( "Password" );
257 offline = conf->readBoolEntry("Offline",false); 257 offline = conf->readBoolEntry("Offline",false);
258 localFolder = conf->readEntry( "LocalFolder" );
259 maxMailSize = conf->readNumEntry( "MaxSize",0 );
260 int lf = conf->readNumEntry( "LastFetch",0 );
261 QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) );
262 lastFetch = dt.addSecs( lf );
258 delete conf; 263 delete conf;
259} 264}
260 265
261void POP3account::save() 266void POP3account::save()
262{ 267{
263 Settings::checkDirectory(); 268 Settings::checkDirectory();
@@ -269,12 +274,17 @@ void POP3account::save()
269 conf->writeEntry( "Port", port ); 274 conf->writeEntry( "Port", port );
270 conf->writeEntry( "SSL", ssl ); 275 conf->writeEntry( "SSL", ssl );
271 conf->writeEntry( "ConnectionType", connectionType ); 276 conf->writeEntry( "ConnectionType", connectionType );
272 conf->writeEntry( "User", user ); 277 conf->writeEntry( "User", user );
273 conf->writeEntryCrypt( "Password", password ); 278 conf->writeEntryCrypt( "Password", password );
274 conf->writeEntry( "Offline",offline); 279 conf->writeEntry( "Offline",offline);
280 conf->writeEntry( "LocalFolder", localFolder );
281 conf->writeEntry( "MaxSize", maxMailSize );
282 QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) );
283 int lf = dt.secsTo ( lastFetch );
284 conf->writeEntry( "LastFetch", lf );
275 conf->write(); 285 conf->write();
276 delete conf; 286 delete conf;
277} 287}
278 288
279 289
280QString POP3account::getFileName() 290QString POP3account::getFileName()
diff --git a/kmicromail/libmailwrapper/settings.h b/kmicromail/libmailwrapper/settings.h
index ba3ec89..c33c403 100644
--- a/kmicromail/libmailwrapper/settings.h
+++ b/kmicromail/libmailwrapper/settings.h
@@ -5,12 +5,13 @@
5 5
6/* OPIE */ 6/* OPIE */
7 7
8/* QT */ 8/* QT */
9#include <qobject.h> 9#include <qobject.h>
10#include <qlist.h> 10#include <qlist.h>
11#include <qdatetime.h>
11 12
12class Account 13class Account
13{ 14{
14 15
15public: 16public:
16 Account(); 17 Account();
@@ -21,12 +22,15 @@ public:
21 const QString&getAccountName()const{ return accountName; } 22 const QString&getAccountName()const{ return accountName; }
22 MAILLIB::ATYPE getType()const{ return type; } 23 MAILLIB::ATYPE getType()const{ return type; }
23 24
24 void setServer(const QString&str){ server = str; } 25 void setServer(const QString&str){ server = str; }
25 const QString&getServer()const{ return server; } 26 const QString&getServer()const{ return server; }
26 27
28 void setLocalFolder( QString name ) { localFolder = name; }
29 const QString& getLocalFolder()const{ return localFolder; }
30
27 void setPort(const QString&str) { port = str; } 31 void setPort(const QString&str) { port = str; }
28 const QString&getPort()const{ return port; } 32 const QString&getPort()const{ return port; }
29 33
30 void setUser(const QString&str){ user = str; } 34 void setUser(const QString&str){ user = str; }
31 const QString&getUser()const{ return user; } 35 const QString&getUser()const{ return user; }
32 36
@@ -36,12 +40,14 @@ public:
36 void setSSL( bool b ) { ssl = b; } 40 void setSSL( bool b ) { ssl = b; }
37 bool getSSL() { return ssl; } 41 bool getSSL() { return ssl; }
38 42
39 void setConnectionType( int x ) { connectionType = x; } 43 void setConnectionType( int x ) { connectionType = x; }
40 int ConnectionType() { return connectionType; } 44 int ConnectionType() { return connectionType; }
41 45
46 void setMaxMailSize( int x ) { maxMailSize = x; }
47 int getMaxMailSize() { return maxMailSize; }
42 48
43 void setOffline(bool b) {offline = b;} 49 void setOffline(bool b) {offline = b;}
44 bool getOffline()const{return offline;} 50 bool getOffline()const{return offline;}
45 51
46 virtual QString getFileName() { return accountName; } 52 virtual QString getFileName() { return accountName; }
47 virtual void read() { ; } 53 virtual void read() { ; }
@@ -50,12 +56,15 @@ public:
50protected: 56protected:
51 QString accountName, server, port, user, password; 57 QString accountName, server, port, user, password;
52 bool ssl; 58 bool ssl;
53 int connectionType; 59 int connectionType;
54 bool offline; 60 bool offline;
55 MAILLIB::ATYPE type; 61 MAILLIB::ATYPE type;
62 QString localFolder;
63 int maxMailSize;
64 QDateTime lastFetch;
56}; 65};
57 66
58class IMAPaccount : public Account 67class IMAPaccount : public Account
59{ 68{
60 69
61public: 70public:
diff --git a/kmicromail/pop3configui.ui b/kmicromail/pop3configui.ui
index 1014ef4..a2d43bd 100644
--- a/kmicromail/pop3configui.ui
+++ b/kmicromail/pop3configui.ui
@@ -8,14 +8,14 @@
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>314</width> 14 <width>322</width>
15 <height>410</height> 15 <height>404</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 POP3</string> 20 <string>Configure POP3</string>
21 </property> 21 </property>
@@ -25,17 +25,17 @@
25 <property> 25 <property>
26 <name>layoutSpacing</name> 26 <name>layoutSpacing</name>
27 </property> 27 </property>
28 <vbox> 28 <vbox>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>margin</name> 30 <name>margin</name>
31 <number>3</number> 31 <number>11</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>6</number>
36 </property> 36 </property>
37 <widget> 37 <widget>
38 <class>QLayoutWidget</class> 38 <class>QLayoutWidget</class>
39 <property stdset="1"> 39 <property stdset="1">
40 <name>name</name> 40 <name>name</name>
41 <cstring>Layout12</cstring> 41 <cstring>Layout12</cstring>
@@ -316,12 +316,98 @@
316 </property> 316 </property>
317 </widget> 317 </widget>
318 </vbox> 318 </vbox>
319 </widget> 319 </widget>
320 </hbox> 320 </hbox>
321 </widget> 321 </widget>
322 <widget>
323 <class>QLayoutWidget</class>
324 <property stdset="1">
325 <name>name</name>
326 <cstring>Layout9</cstring>
327 </property>
328 <hbox>
329 <property stdset="1">
330 <name>margin</name>
331 <number>0</number>
332 </property>
333 <property stdset="1">
334 <name>spacing</name>
335 <number>6</number>
336 </property>
337 <widget>
338 <class>QLabel</class>
339 <property stdset="1">
340 <name>name</name>
341 <cstring>TextLabel1_2</cstring>
342 </property>
343 <property stdset="1">
344 <name>text</name>
345 <string>Local storage folder:</string>
346 </property>
347 </widget>
348 <widget>
349 <class>QLineEdit</class>
350 <property stdset="1">
351 <name>name</name>
352 <cstring>localFolder</cstring>
353 </property>
354 <property stdset="1">
355 <name>text</name>
356 <string></string>
357 </property>
358 </widget>
359 </hbox>
360 </widget>
361 <widget>
362 <class>QLayoutWidget</class>
363 <property stdset="1">
364 <name>name</name>
365 <cstring>Layout10</cstring>
366 </property>
367 <hbox>
368 <property stdset="1">
369 <name>margin</name>
370 <number>0</number>
371 </property>
372 <property stdset="1">
373 <name>spacing</name>
374 <number>6</number>
375 </property>
376 <widget>
377 <class>QCheckBox</class>
378 <property stdset="1">
379 <name>name</name>
380 <cstring>CheckBoxDown</cstring>
381 </property>
382 <property stdset="1">
383 <name>text</name>
384 <string>Download only messages smaller</string>
385 </property>
386 </widget>
387 <widget>
388 <class>QSpinBox</class>
389 <property stdset="1">
390 <name>name</name>
391 <cstring>SpinBoxDown</cstring>
392 </property>
393 <property stdset="1">
394 <name>suffix</name>
395 <string>kB</string>
396 </property>
397 <property stdset="1">
398 <name>maxValue</name>
399 <number>99999</number>
400 </property>
401 <property stdset="1">
402 <name>minValue</name>
403 <number>1</number>
404 </property>
405 </widget>
406 </hbox>
407 </widget>
322 <spacer> 408 <spacer>
323 <property> 409 <property>
324 <name>name</name> 410 <name>name</name>
325 <cstring>spacer</cstring> 411 <cstring>spacer</cstring>
326 </property> 412 </property>
327 <property stdset="1"> 413 <property stdset="1">