Diffstat (limited to 'noncore/net/mail/editaccounts.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/editaccounts.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp index 0c0ecaf..9fc97e8 100644 --- a/noncore/net/mail/editaccounts.cpp +++ b/noncore/net/mail/editaccounts.cpp | |||
@@ -349,77 +349,87 @@ void POP3config::accept() | |||
349 | data->setAccountName( accountLine->text() ); | 349 | data->setAccountName( accountLine->text() ); |
350 | data->setServer( serverLine->text() ); | 350 | data->setServer( serverLine->text() ); |
351 | data->setPort( portLine->text() ); | 351 | data->setPort( portLine->text() ); |
352 | data->setConnectionType( ComboBox1->currentItem() ); | 352 | data->setConnectionType( ComboBox1->currentItem() ); |
353 | data->setUser( userLine->text() ); | 353 | data->setUser( userLine->text() ); |
354 | data->setPassword( passLine->text() ); | 354 | data->setPassword( passLine->text() ); |
355 | 355 | ||
356 | QDialog::accept(); | 356 | QDialog::accept(); |
357 | } | 357 | } |
358 | 358 | ||
359 | /** | 359 | /** |
360 | * SMTPconfig | 360 | * SMTPconfig |
361 | */ | 361 | */ |
362 | 362 | ||
363 | SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 363 | SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
364 | : SMTPconfigUI( parent, name, modal, flags ) | 364 | : SMTPconfigUI( parent, name, modal, flags ) |
365 | { | 365 | { |
366 | data = account; | 366 | data = account; |
367 | 367 | ||
368 | connect( loginBox, SIGNAL( toggled( bool ) ), userLine, SLOT( setEnabled( bool ) ) ); | 368 | connect( loginBox, SIGNAL( toggled( bool ) ), userLine, SLOT( setEnabled( bool ) ) ); |
369 | connect( loginBox, SIGNAL( toggled( bool ) ), passLine, SLOT( setEnabled( bool ) ) ); | 369 | connect( loginBox, SIGNAL( toggled( bool ) ), passLine, SLOT( setEnabled( bool ) ) ); |
370 | 370 | ||
371 | fillValues(); | 371 | fillValues(); |
372 | 372 | ||
373 | connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); | 373 | connect( ComboBox1, SIGNAL( activated( int ) ), SLOT( slotConnectionToggle( int ) ) ); |
374 | ComboBox1->insertItem( "Only if available", 0 ); | ||
375 | ComboBox1->insertItem( "Always, Negotiated", 1 ); | ||
376 | ComboBox1->insertItem( "Connect on secure port", 2 ); | ||
377 | ComboBox1->insertItem( "Run command instead", 3 ); | ||
378 | CommandEdit->hide(); | ||
379 | ComboBox1->setCurrentItem( data->ConnectionType() ); | ||
374 | } | 380 | } |
375 | 381 | ||
376 | void SMTPconfig::slotSSL( bool enabled ) | 382 | void SMTPconfig::slotConnectionToggle( int index ) |
377 | { | 383 | { |
378 | if ( enabled ) { | 384 | // 2 is ssl connection |
379 | portLine->setText( SMTP_SSL_PORT ); | 385 | if ( index == 2 ) { |
386 | portLine->setText( SMTP_SSL_PORT ); | ||
387 | } else if ( index == 3 ) { | ||
388 | portLine->setText( SMTP_PORT ); | ||
389 | CommandEdit->show(); | ||
380 | } else { | 390 | } else { |
381 | portLine->setText( SMTP_PORT ); | 391 | portLine->setText( SMTP_PORT ); |
382 | } | 392 | } |
383 | } | 393 | } |
384 | 394 | ||
385 | void SMTPconfig::fillValues() | 395 | void SMTPconfig::fillValues() |
386 | { | 396 | { |
387 | accountLine->setText( data->getAccountName() ); | 397 | accountLine->setText( data->getAccountName() ); |
388 | serverLine->setText( data->getServer() ); | 398 | serverLine->setText( data->getServer() ); |
389 | portLine->setText( data->getPort() ); | 399 | portLine->setText( data->getPort() ); |
390 | sslBox->setChecked( data->getSSL() ); | 400 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
391 | loginBox->setChecked( data->getLogin() ); | 401 | loginBox->setChecked( data->getLogin() ); |
392 | userLine->setText( data->getUser() ); | 402 | userLine->setText( data->getUser() ); |
393 | passLine->setText( data->getPassword() ); | 403 | passLine->setText( data->getPassword() ); |
394 | } | 404 | } |
395 | 405 | ||
396 | void SMTPconfig::accept() | 406 | void SMTPconfig::accept() |
397 | { | 407 | { |
398 | data->setAccountName( accountLine->text() ); | 408 | data->setAccountName( accountLine->text() ); |
399 | data->setServer( serverLine->text() ); | 409 | data->setServer( serverLine->text() ); |
400 | data->setPort( portLine->text() ); | 410 | data->setPort( portLine->text() ); |
401 | data->setSSL( sslBox->isChecked() ); | 411 | data->setConnectionType( ComboBox1->currentItem() ); |
402 | data->setLogin( loginBox->isChecked() ); | 412 | data->setLogin( loginBox->isChecked() ); |
403 | data->setUser( userLine->text() ); | 413 | data->setUser( userLine->text() ); |
404 | data->setPassword( passLine->text() ); | 414 | data->setPassword( passLine->text() ); |
405 | 415 | ||
406 | QDialog::accept(); | 416 | QDialog::accept(); |
407 | } | 417 | } |
408 | 418 | ||
409 | /** | 419 | /** |
410 | * NNTPconfig | 420 | * NNTPconfig |
411 | */ | 421 | */ |
412 | 422 | ||
413 | NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 423 | NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
414 | : NNTPconfigUI( parent, name, modal, flags ) | 424 | : NNTPconfigUI( parent, name, modal, flags ) |
415 | { | 425 | { |
416 | data = account; | 426 | data = account; |
417 | 427 | ||
418 | connect( loginBox, SIGNAL( toggled( bool ) ), userLine, SLOT( setEnabled( bool ) ) ); | 428 | connect( loginBox, SIGNAL( toggled( bool ) ), userLine, SLOT( setEnabled( bool ) ) ); |
419 | connect( loginBox, SIGNAL( toggled( bool ) ), passLine, SLOT( setEnabled( bool ) ) ); | 429 | connect( loginBox, SIGNAL( toggled( bool ) ), passLine, SLOT( setEnabled( bool ) ) ); |
420 | 430 | ||
421 | fillValues(); | 431 | fillValues(); |
422 | 432 | ||
423 | connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); | 433 | connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); |
424 | } | 434 | } |
425 | 435 | ||