-rw-r--r-- | kmicromail/editaccounts.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp index 49049f6..2c0f2d8 100644 --- a/kmicromail/editaccounts.cpp +++ b/kmicromail/editaccounts.cpp @@ -334,41 +334,43 @@ IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); ComboBox1->insertItem( "Only if available", 0 ); ComboBox1->insertItem( "Always, Negotiated", 1 ); ComboBox1->insertItem( "Connect on secure port", 2 ); ComboBox1->insertItem( "Run command instead", 3 ); CommandEdit->hide(); fillValues(); // ComboBox1->setCurrentItem( data->ConnectionType() ); } void IMAPconfig::slotConnectionToggle( int index ) { if ( index == 2 ) { portLine->setText( IMAP_SSL_PORT ); + CommandEdit->hide(); } else if ( index == 3 ) { portLine->setText( IMAP_PORT ); CommandEdit->show(); } else { portLine->setText( IMAP_PORT ); + CommandEdit->hide(); } } void IMAPconfig::fillValues() { accountLine->setText( data->getAccountName() ); serverLine->setText( data->getServer() ); portLine->setText( data->getPort() ); ComboBox1->setCurrentItem( data->ConnectionType() ); userLine->setText( data->getUser() ); passLine->setText( data->getPassword() ); prefixLine->setText(data->getPrefix()); localFolder->setText( data->getLocalFolder() ); int max = data->getMaxMailSize() ; if ( max ) { CheckBoxDown->setChecked( true ); @@ -415,41 +417,43 @@ POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); ComboBox1->insertItem( "Only if available", 0 ); ComboBox1->insertItem( "Always, Negotiated", 1 ); ComboBox1->insertItem( "Connect on secure port", 2 ); ComboBox1->insertItem( "Run command instead", 3 ); CommandEdit->hide(); fillValues(); //ComboBox1->setCurrentItem( data->ConnectionType() ); } void POP3config::slotConnectionToggle( int index ) { // 2 is ssl connection if ( index == 2 ) { portLine->setText( POP3_SSL_PORT ); + CommandEdit->hide(); } else if ( index == 3 ) { portLine->setText( POP3_PORT ); CommandEdit->show(); } else { portLine->setText( POP3_PORT ); + CommandEdit->hide(); } } void POP3config::fillValues() { accountLine->setText( data->getAccountName() ); serverLine->setText( data->getServer() ); portLine->setText( data->getPort() ); ComboBox1->setCurrentItem( data->ConnectionType() ); userLine->setText( data->getUser() ); passLine->setText( data->getPassword() ); localFolder->setText( data->getLocalFolder() ); int max = data->getMaxMailSize() ; if ( max ) { CheckBoxDown->setChecked( true ); SpinBoxDown->setValue ( max ); @@ -507,45 +511,47 @@ SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, ComboBox1->insertItem( "Always, use TLS", 2 ); ComboBox1->insertItem( "Connect on secure port (SSL)", 3 ); ComboBox1->insertItem( "Run command instead", 4 ); CommandEdit->hide(); fillValues(); //ComboBox1->setCurrentItem( data->ConnectionType() ); } void SMTPconfig::chooseSig() { QString lnk = KFileDialog::getOpenFileName( "", "Choose Signatur File", this ); if ( !lnk.isEmpty() ) { SignaturEdit->setText( lnk ); } } void SMTPconfig::slotConnectionToggle( int index ) { - // 2 is ssl connection - if ( index == 2 ) + // 3 is ssl connection + if ( index == 3 ) { portLine->setText( SMTP_SSL_PORT ); + CommandEdit->hide(); } - else if ( index == 3 ) + else if ( index == 4 ) { portLine->setText( SMTP_PORT ); CommandEdit->show(); } else { portLine->setText( SMTP_PORT ); + CommandEdit->hide(); } } void SMTPconfig::fillValues() { accountLine->setText( data->getAccountName() ); serverLine->setText( data->getServer() ); portLine->setText( data->getPort() ); ComboBox1->setCurrentItem( data->ConnectionType() ); loginBox->setChecked( data->getLogin() ); userLine->setText( data->getUser() ); passLine->setText( data->getPassword() ); SignaturEdit->setText( data->getSigFile() ); } void SMTPconfig::accept() |