-rw-r--r-- | kmicromail/editaccounts.cpp | 12 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/pop3wrapper.cpp | 2 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/settings.cpp | 10 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/settings.h | 9 | ||||
-rw-r--r-- | kmicromail/pop3configui.ui | 94 |
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 | |||
@@ -15,8 +15,9 @@ | |||
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 | ||
22 | using namespace Opie::Core; | 23 | using namespace Opie::Core; |
@@ -419,8 +420,17 @@ void POP3config::fillValues() | |||
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 | ||
425 | void POP3config::accept() | 435 | void POP3config::accept() |
426 | { | 436 | { |
@@ -429,8 +439,10 @@ void POP3config::accept() | |||
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 | ||
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 | |||
@@ -121,9 +121,9 @@ void POP3wrapper::login() | |||
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(); |
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 | |||
@@ -254,8 +254,13 @@ void POP3account::read() | |||
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 | ||
261 | void POP3account::save() | 266 | void POP3account::save() |
@@ -271,8 +276,13 @@ void POP3account::save() | |||
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 | ||
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 | |||
@@ -7,8 +7,9 @@ | |||
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 | ||
12 | class Account | 13 | class Account |
13 | { | 14 | { |
14 | 15 | ||
@@ -23,8 +24,11 @@ public: | |||
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; } |
@@ -38,8 +42,10 @@ public: | |||
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 | ||
@@ -52,8 +58,11 @@ protected: | |||
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 | ||
58 | class IMAPaccount : public Account | 67 | class IMAPaccount : public Account |
59 | { | 68 | { |
diff --git a/kmicromail/pop3configui.ui b/kmicromail/pop3configui.ui index 1014ef4..a2d43bd 100644 --- a/kmicromail/pop3configui.ui +++ b/kmicromail/pop3configui.ui | |||
@@ -10,10 +10,10 @@ | |||
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> |
@@ -27,13 +27,13 @@ | |||
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"> |
@@ -318,8 +318,94 @@ | |||
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> |