author | zautrix <zautrix> | 2004-09-10 22:52:50 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-10 22:52:50 (UTC) |
commit | 1b41a0e3bf63364940daf132446939e3570c57ad (patch) (unidiff) | |
tree | 81db8e427beadcf3bbd5356962b5d08b970a87e4 /kmicromail/editaccounts.cpp | |
parent | c280882f788b31f874f928e23fc29c2aaca991eb (diff) | |
download | kdepimpi-1b41a0e3bf63364940daf132446939e3570c57ad.zip kdepimpi-1b41a0e3bf63364940daf132446939e3570c57ad.tar.gz kdepimpi-1b41a0e3bf63364940daf132446939e3570c57ad.tar.bz2 |
Added pop3 settings
-rw-r--r-- | kmicromail/editaccounts.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp index d272c3b..e7d2750 100644 --- a/kmicromail/editaccounts.cpp +++ b/kmicromail/editaccounts.cpp | |||
@@ -1,42 +1,43 @@ | |||
1 | 1 | ||
2 | #include "defines.h" | 2 | #include "defines.h" |
3 | #include "editaccounts.h" | 3 | #include "editaccounts.h" |
4 | #include "kapplication.h" | 4 | #include "kapplication.h" |
5 | /* OPIE */ | 5 | /* OPIE */ |
6 | #include <qpe/qpeapplication.h> | 6 | #include <qpe/qpeapplication.h> |
7 | 7 | ||
8 | /* QT */ | 8 | /* QT */ |
9 | #include <qstringlist.h> | 9 | #include <qstringlist.h> |
10 | 10 | ||
11 | #include <qcombobox.h> | 11 | #include <qcombobox.h> |
12 | #include <qcheckbox.h> | 12 | #include <qcheckbox.h> |
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 | ||
22 | using namespace Opie::Core; | 23 | using namespace Opie::Core; |
23 | 24 | ||
24 | AccountListItem::AccountListItem( QListView *parent, Account *a) | 25 | AccountListItem::AccountListItem( QListView *parent, Account *a) |
25 | : QListViewItem( parent ) | 26 | : QListViewItem( parent ) |
26 | { | 27 | { |
27 | account = a; | 28 | account = a; |
28 | setText( 0, account->getAccountName() ); | 29 | setText( 0, account->getAccountName() ); |
29 | QString ttext = ""; | 30 | QString ttext = ""; |
30 | switch (account->getType()) { | 31 | switch (account->getType()) { |
31 | case MAILLIB::A_NNTP: | 32 | case MAILLIB::A_NNTP: |
32 | ttext="NNTP"; | 33 | ttext="NNTP"; |
33 | break; | 34 | break; |
34 | case MAILLIB::A_POP3: | 35 | case MAILLIB::A_POP3: |
35 | ttext = "POP3"; | 36 | ttext = "POP3"; |
36 | break; | 37 | break; |
37 | case MAILLIB::A_IMAP: | 38 | case MAILLIB::A_IMAP: |
38 | ttext = "IMAP"; | 39 | ttext = "IMAP"; |
39 | break; | 40 | break; |
40 | case MAILLIB::A_SMTP: | 41 | case MAILLIB::A_SMTP: |
41 | ttext = "SMTP"; | 42 | ttext = "SMTP"; |
42 | break; | 43 | break; |
@@ -399,58 +400,69 @@ void POP3config::slotConnectionToggle( int index ) | |||
399 | // 2 is ssl connection | 400 | // 2 is ssl connection |
400 | if ( index == 2 ) | 401 | if ( index == 2 ) |
401 | { | 402 | { |
402 | portLine->setText( POP3_SSL_PORT ); | 403 | portLine->setText( POP3_SSL_PORT ); |
403 | } | 404 | } |
404 | else if ( index == 3 ) | 405 | else if ( index == 3 ) |
405 | { | 406 | { |
406 | portLine->setText( POP3_PORT ); | 407 | portLine->setText( POP3_PORT ); |
407 | CommandEdit->show(); | 408 | CommandEdit->show(); |
408 | } | 409 | } |
409 | else | 410 | else |
410 | { | 411 | { |
411 | portLine->setText( POP3_PORT ); | 412 | portLine->setText( POP3_PORT ); |
412 | } | 413 | } |
413 | } | 414 | } |
414 | 415 | ||
415 | void POP3config::fillValues() | 416 | void POP3config::fillValues() |
416 | { | 417 | { |
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 | ||
425 | void POP3config::accept() | 435 | void 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 |
439 | */ | 451 | */ |
440 | 452 | ||
441 | SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 453 | SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
442 | : SMTPconfigUI( parent, name, modal, flags ) | 454 | : SMTPconfigUI( parent, name, modal, flags ) |
443 | { | 455 | { |
444 | data = account; | 456 | data = account; |
445 | 457 | ||
446 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); | 458 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); |
447 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); | 459 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); |
448 | 460 | ||
449 | fillValues(); | 461 | fillValues(); |
450 | 462 | ||
451 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); | 463 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); |
452 | ComboBox1->insertItem( "Only if available", 0 ); | 464 | ComboBox1->insertItem( "Only if available", 0 ); |
453 | ComboBox1->insertItem( "Always, Negotiated", 1 ); | 465 | ComboBox1->insertItem( "Always, Negotiated", 1 ); |
454 | ComboBox1->insertItem( "Connect on secure port", 2 ); | 466 | ComboBox1->insertItem( "Connect on secure port", 2 ); |
455 | ComboBox1->insertItem( "Run command instead", 3 ); | 467 | ComboBox1->insertItem( "Run command instead", 3 ); |
456 | CommandEdit->hide(); | 468 | CommandEdit->hide(); |