-rw-r--r-- | kmicromail/editaccounts.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp index 48c3963..8253c91 100644 --- a/kmicromail/editaccounts.cpp +++ b/kmicromail/editaccounts.cpp | |||
@@ -6,32 +6,33 @@ | |||
6 | /* OPIE */ | 6 | /* OPIE */ |
7 | #include <qpe/qpeapplication.h> | 7 | #include <qpe/qpeapplication.h> |
8 | 8 | ||
9 | /* QT */ | 9 | /* QT */ |
10 | #include <qstringlist.h> | 10 | #include <qstringlist.h> |
11 | 11 | ||
12 | #include <qcombobox.h> | 12 | #include <qcombobox.h> |
13 | #include <qcheckbox.h> | 13 | #include <qcheckbox.h> |
14 | #include <qmessagebox.h> | 14 | #include <qmessagebox.h> |
15 | #include <qpushbutton.h> | 15 | #include <qpushbutton.h> |
16 | #include <qlineedit.h> | 16 | #include <qlineedit.h> |
17 | #include <qlabel.h> | 17 | #include <qlabel.h> |
18 | #include <qtabwidget.h> | 18 | #include <qtabwidget.h> |
19 | #include <qlistview.h> | 19 | #include <qlistview.h> |
20 | #include <qspinbox.h> | 20 | #include <qspinbox.h> |
21 | #include <klocale.h> | 21 | #include <klocale.h> |
22 | #include <kfiledialog.h> | ||
22 | 23 | ||
23 | #include <libmailwrapper/nntpwrapper.h> | 24 | #include <libmailwrapper/nntpwrapper.h> |
24 | 25 | ||
25 | using namespace Opie::Core; | 26 | using namespace Opie::Core; |
26 | 27 | ||
27 | AccountListItem::AccountListItem( QListView *parent, Account *a) | 28 | AccountListItem::AccountListItem( QListView *parent, Account *a) |
28 | : QListViewItem( parent ) | 29 | : QListViewItem( parent ) |
29 | { | 30 | { |
30 | account = a; | 31 | account = a; |
31 | setText( 0, account->getAccountName() ); | 32 | setText( 0, account->getAccountName() ); |
32 | QString ttext = ""; | 33 | QString ttext = ""; |
33 | switch (account->getType()) { | 34 | switch (account->getType()) { |
34 | case MAILLIB::A_NNTP: | 35 | case MAILLIB::A_NNTP: |
35 | ttext="NNTP"; | 36 | ttext="NNTP"; |
36 | break; | 37 | break; |
37 | case MAILLIB::A_POP3: | 38 | case MAILLIB::A_POP3: |
@@ -466,80 +467,94 @@ void POP3config::accept() | |||
466 | QDialog::accept(); | 467 | QDialog::accept(); |
467 | } | 468 | } |
468 | 469 | ||
469 | /** | 470 | /** |
470 | * SMTPconfig | 471 | * SMTPconfig |
471 | */ | 472 | */ |
472 | 473 | ||
473 | SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 474 | SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
474 | : SMTPconfigUI( parent, name, modal, flags ) | 475 | : SMTPconfigUI( parent, name, modal, flags ) |
475 | { | 476 | { |
476 | data = account; | 477 | data = account; |
477 | 478 | ||
478 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); | 479 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); |
479 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); | 480 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); |
480 | 481 | ||
481 | fillValues(); | 482 | fillValues(); |
482 | 483 | QIconSet icon; | |
484 | //icon = SmallIcon("fileexport"); | ||
485 | icon = SmallIcon("fileopen"); | ||
486 | SignaturButton->setText(""); | ||
487 | SignaturButton->setIconSet (icon ) ; | ||
488 | SignaturButton->setMaximumSize ( SignaturButton->sizeHint().height()+4,SignaturButton->sizeHint().height()) ; | ||
489 | connect( SignaturButton, SIGNAL( clicked() ), this, SLOT( chooseSig() ) ); | ||
483 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); | 490 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); |
484 | ComboBox1->insertItem( "Only if available", 0 ); | 491 | ComboBox1->insertItem( "Only if available", 0 ); |
485 | ComboBox1->insertItem( "Always, Negotiated", 1 ); | 492 | ComboBox1->insertItem( "Always, Negotiated", 1 ); |
486 | ComboBox1->insertItem( "Connect on secure port", 2 ); | 493 | ComboBox1->insertItem( "Connect on secure port", 2 ); |
487 | ComboBox1->insertItem( "Run command instead", 3 ); | 494 | ComboBox1->insertItem( "Run command instead", 3 ); |
488 | CommandEdit->hide(); | 495 | CommandEdit->hide(); |
489 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 496 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
490 | } | 497 | } |
491 | 498 | void SMTPconfig::chooseSig() | |
499 | { | ||
500 | QString lnk = KFileDialog::getOpenFileName( "", "Choose Signatur File", this ); | ||
501 | if ( !lnk.isEmpty() ) { | ||
502 | SignaturEdit->setText( lnk ); | ||
503 | } | ||
504 | } | ||
492 | void SMTPconfig::slotConnectionToggle( int index ) | 505 | void SMTPconfig::slotConnectionToggle( int index ) |
493 | { | 506 | { |
494 | // 2 is ssl connection | 507 | // 2 is ssl connection |
495 | if ( index == 2 ) | 508 | if ( index == 2 ) |
496 | { | 509 | { |
497 | portLine->setText( SMTP_SSL_PORT ); | 510 | portLine->setText( SMTP_SSL_PORT ); |
498 | } | 511 | } |
499 | else if ( index == 3 ) | 512 | else if ( index == 3 ) |
500 | { | 513 | { |
501 | portLine->setText( SMTP_PORT ); | 514 | portLine->setText( SMTP_PORT ); |
502 | CommandEdit->show(); | 515 | CommandEdit->show(); |
503 | } | 516 | } |
504 | else | 517 | else |
505 | { | 518 | { |
506 | portLine->setText( SMTP_PORT ); | 519 | portLine->setText( SMTP_PORT ); |
507 | } | 520 | } |
508 | } | 521 | } |
509 | 522 | ||
510 | void SMTPconfig::fillValues() | 523 | void SMTPconfig::fillValues() |
511 | { | 524 | { |
512 | accountLine->setText( data->getAccountName() ); | 525 | accountLine->setText( data->getAccountName() ); |
513 | serverLine->setText( data->getServer() ); | 526 | serverLine->setText( data->getServer() ); |
514 | portLine->setText( data->getPort() ); | 527 | portLine->setText( data->getPort() ); |
515 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 528 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
516 | loginBox->setChecked( data->getLogin() ); | 529 | loginBox->setChecked( data->getLogin() ); |
517 | userLine->setText( data->getUser() ); | 530 | userLine->setText( data->getUser() ); |
518 | passLine->setText( data->getPassword() ); | 531 | passLine->setText( data->getPassword() ); |
532 | SignaturEdit->setText( data->getSigFile() ); | ||
519 | } | 533 | } |
520 | 534 | ||
521 | void SMTPconfig::accept() | 535 | void SMTPconfig::accept() |
522 | { | 536 | { |
523 | data->setAccountName( accountLine->text() ); | 537 | data->setAccountName( accountLine->text() ); |
524 | data->setServer( serverLine->text() ); | 538 | data->setServer( serverLine->text() ); |
525 | data->setPort( portLine->text() ); | 539 | data->setPort( portLine->text() ); |
526 | data->setConnectionType( ComboBox1->currentItem() ); | 540 | data->setConnectionType( ComboBox1->currentItem() ); |
527 | data->setLogin( loginBox->isChecked() ); | 541 | data->setLogin( loginBox->isChecked() ); |
528 | data->setUser( userLine->text() ); | 542 | data->setUser( userLine->text() ); |
529 | data->setPassword( passLine->text() ); | 543 | data->setPassword( passLine->text() ); |
544 | data->setSigFile( SignaturEdit->text() ); | ||
530 | 545 | ||
531 | QDialog::accept(); | 546 | QDialog::accept(); |
532 | } | 547 | } |
533 | 548 | ||
534 | /** | 549 | /** |
535 | * NNTPconfig | 550 | * NNTPconfig |
536 | */ | 551 | */ |
537 | 552 | ||
538 | NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 553 | NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
539 | : NNTPconfigUI( parent, name, modal, flags ) | 554 | : NNTPconfigUI( parent, name, modal, flags ) |
540 | { | 555 | { |
541 | data = account; | 556 | data = account; |
542 | 557 | ||
543 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); | 558 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); |
544 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); | 559 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); |
545 | connect( GetNGButton, SIGNAL( clicked() ), this, SLOT( slotGetNG() ) ); | 560 | connect( GetNGButton, SIGNAL( clicked() ), this, SLOT( slotGetNG() ) ); |