-rw-r--r-- | kmicromail/editaccounts.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp index e7d2750..d43d23b 100644 --- a/kmicromail/editaccounts.cpp +++ b/kmicromail/editaccounts.cpp | |||
@@ -332,145 +332,160 @@ IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, | |||
332 | ComboBox1->insertItem( "Connect on secure port", 2 ); | 332 | ComboBox1->insertItem( "Connect on secure port", 2 ); |
333 | ComboBox1->insertItem( "Run command instead", 3 ); | 333 | ComboBox1->insertItem( "Run command instead", 3 ); |
334 | CommandEdit->hide(); | 334 | CommandEdit->hide(); |
335 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 335 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
336 | } | 336 | } |
337 | 337 | ||
338 | void IMAPconfig::slotConnectionToggle( int index ) | 338 | void IMAPconfig::slotConnectionToggle( int index ) |
339 | { | 339 | { |
340 | if ( index == 2 ) | 340 | if ( index == 2 ) |
341 | { | 341 | { |
342 | portLine->setText( IMAP_SSL_PORT ); | 342 | portLine->setText( IMAP_SSL_PORT ); |
343 | } | 343 | } |
344 | else if ( index == 3 ) | 344 | else if ( index == 3 ) |
345 | { | 345 | { |
346 | portLine->setText( IMAP_PORT ); | 346 | portLine->setText( IMAP_PORT ); |
347 | CommandEdit->show(); | 347 | CommandEdit->show(); |
348 | } | 348 | } |
349 | else | 349 | else |
350 | { | 350 | { |
351 | portLine->setText( IMAP_PORT ); | 351 | portLine->setText( IMAP_PORT ); |
352 | } | 352 | } |
353 | } | 353 | } |
354 | 354 | ||
355 | void IMAPconfig::fillValues() | 355 | void IMAPconfig::fillValues() |
356 | { | 356 | { |
357 | accountLine->setText( data->getAccountName() ); | 357 | accountLine->setText( data->getAccountName() ); |
358 | serverLine->setText( data->getServer() ); | 358 | serverLine->setText( data->getServer() ); |
359 | portLine->setText( data->getPort() ); | 359 | portLine->setText( data->getPort() ); |
360 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 360 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
361 | userLine->setText( data->getUser() ); | 361 | userLine->setText( data->getUser() ); |
362 | passLine->setText( data->getPassword() ); | 362 | passLine->setText( data->getPassword() ); |
363 | prefixLine->setText(data->getPrefix()); | 363 | prefixLine->setText(data->getPrefix()); |
364 | localFolder->setText( data->getLocalFolder() ); | ||
365 | int max = data->getMaxMailSize() ; | ||
366 | if ( max ) { | ||
367 | CheckBoxDown->setChecked( true ); | ||
368 | SpinBoxDown->setValue ( max ); | ||
369 | } else { | ||
370 | CheckBoxDown->setChecked( false ); | ||
371 | SpinBoxDown->setValue ( 5 ); | ||
372 | } | ||
373 | CheckBoxLeaveOn->setChecked( data->getLeaveOnServer() ); | ||
364 | } | 374 | } |
365 | 375 | ||
366 | void IMAPconfig::accept() | 376 | void IMAPconfig::accept() |
367 | { | 377 | { |
368 | data->setAccountName( accountLine->text() ); | 378 | data->setAccountName( accountLine->text() ); |
369 | data->setServer( serverLine->text() ); | 379 | data->setServer( serverLine->text() ); |
370 | data->setPort( portLine->text() ); | 380 | data->setPort( portLine->text() ); |
371 | data->setConnectionType( ComboBox1->currentItem() ); | 381 | data->setConnectionType( ComboBox1->currentItem() ); |
372 | data->setUser( userLine->text() ); | 382 | data->setUser( userLine->text() ); |
373 | data->setPassword( passLine->text() ); | 383 | data->setPassword( passLine->text() ); |
374 | data->setPrefix(prefixLine->text()); | 384 | data->setPrefix(prefixLine->text()); |
385 | data->setLocalFolder( localFolder->text() ); | ||
386 | data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; | ||
387 | data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() ); | ||
375 | 388 | ||
376 | QDialog::accept(); | 389 | QDialog::accept(); |
377 | } | 390 | } |
378 | 391 | ||
379 | /** | 392 | /** |
380 | * POP3config | 393 | * POP3config |
381 | */ | 394 | */ |
382 | 395 | ||
383 | POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 396 | POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
384 | : POP3configUI( parent, name, modal, flags ) | 397 | : POP3configUI( parent, name, modal, flags ) |
385 | { | 398 | { |
386 | data = account; | 399 | data = account; |
387 | fillValues(); | 400 | fillValues(); |
388 | 401 | ||
389 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); | 402 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); |
390 | ComboBox1->insertItem( "Only if available", 0 ); | 403 | ComboBox1->insertItem( "Only if available", 0 ); |
391 | ComboBox1->insertItem( "Always, Negotiated", 1 ); | 404 | ComboBox1->insertItem( "Always, Negotiated", 1 ); |
392 | ComboBox1->insertItem( "Connect on secure port", 2 ); | 405 | ComboBox1->insertItem( "Connect on secure port", 2 ); |
393 | ComboBox1->insertItem( "Run command instead", 3 ); | 406 | ComboBox1->insertItem( "Run command instead", 3 ); |
394 | CommandEdit->hide(); | 407 | CommandEdit->hide(); |
395 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 408 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
396 | } | 409 | } |
397 | 410 | ||
398 | void POP3config::slotConnectionToggle( int index ) | 411 | void POP3config::slotConnectionToggle( int index ) |
399 | { | 412 | { |
400 | // 2 is ssl connection | 413 | // 2 is ssl connection |
401 | if ( index == 2 ) | 414 | if ( index == 2 ) |
402 | { | 415 | { |
403 | portLine->setText( POP3_SSL_PORT ); | 416 | portLine->setText( POP3_SSL_PORT ); |
404 | } | 417 | } |
405 | else if ( index == 3 ) | 418 | else if ( index == 3 ) |
406 | { | 419 | { |
407 | portLine->setText( POP3_PORT ); | 420 | portLine->setText( POP3_PORT ); |
408 | CommandEdit->show(); | 421 | CommandEdit->show(); |
409 | } | 422 | } |
410 | else | 423 | else |
411 | { | 424 | { |
412 | portLine->setText( POP3_PORT ); | 425 | portLine->setText( POP3_PORT ); |
413 | } | 426 | } |
414 | } | 427 | } |
415 | 428 | ||
416 | void POP3config::fillValues() | 429 | void POP3config::fillValues() |
417 | { | 430 | { |
418 | accountLine->setText( data->getAccountName() ); | 431 | accountLine->setText( data->getAccountName() ); |
419 | serverLine->setText( data->getServer() ); | 432 | serverLine->setText( data->getServer() ); |
420 | portLine->setText( data->getPort() ); | 433 | portLine->setText( data->getPort() ); |
421 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 434 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
422 | userLine->setText( data->getUser() ); | 435 | userLine->setText( data->getUser() ); |
423 | passLine->setText( data->getPassword() ); | 436 | passLine->setText( data->getPassword() ); |
424 | localFolder->setText( data->getLocalFolder() ); | 437 | localFolder->setText( data->getLocalFolder() ); |
425 | int max = data->getMaxMailSize() ; | 438 | int max = data->getMaxMailSize() ; |
426 | if ( max ) { | 439 | if ( max ) { |
427 | CheckBoxDown->setChecked( true ); | 440 | CheckBoxDown->setChecked( true ); |
428 | SpinBoxDown->setValue ( max ); | 441 | SpinBoxDown->setValue ( max ); |
429 | } else { | 442 | } else { |
430 | CheckBoxDown->setChecked( false ); | 443 | CheckBoxDown->setChecked( false ); |
431 | SpinBoxDown->setValue ( 5 ); | 444 | SpinBoxDown->setValue ( 5 ); |
432 | } | 445 | } |
446 | CheckBoxLeaveOn->setChecked( data->getLeaveOnServer() ); | ||
433 | } | 447 | } |
434 | 448 | ||
435 | void POP3config::accept() | 449 | void POP3config::accept() |
436 | { | 450 | { |
437 | data->setAccountName( accountLine->text() ); | 451 | data->setAccountName( accountLine->text() ); |
438 | data->setServer( serverLine->text() ); | 452 | data->setServer( serverLine->text() ); |
439 | data->setPort( portLine->text() ); | 453 | data->setPort( portLine->text() ); |
440 | data->setConnectionType( ComboBox1->currentItem() ); | 454 | data->setConnectionType( ComboBox1->currentItem() ); |
441 | data->setUser( userLine->text() ); | 455 | data->setUser( userLine->text() ); |
442 | data->setPassword( passLine->text() ); | 456 | data->setPassword( passLine->text() ); |
443 | data->setLocalFolder( localFolder->text() ); | 457 | data->setLocalFolder( localFolder->text() ); |
444 | data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; | 458 | data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; |
459 | data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() ); | ||
445 | 460 | ||
446 | QDialog::accept(); | 461 | QDialog::accept(); |
447 | } | 462 | } |
448 | 463 | ||
449 | /** | 464 | /** |
450 | * SMTPconfig | 465 | * SMTPconfig |
451 | */ | 466 | */ |
452 | 467 | ||
453 | SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) | 468 | SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) |
454 | : SMTPconfigUI( parent, name, modal, flags ) | 469 | : SMTPconfigUI( parent, name, modal, flags ) |
455 | { | 470 | { |
456 | data = account; | 471 | data = account; |
457 | 472 | ||
458 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); | 473 | connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); |
459 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); | 474 | connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); |
460 | 475 | ||
461 | fillValues(); | 476 | fillValues(); |
462 | 477 | ||
463 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); | 478 | connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); |
464 | ComboBox1->insertItem( "Only if available", 0 ); | 479 | ComboBox1->insertItem( "Only if available", 0 ); |
465 | ComboBox1->insertItem( "Always, Negotiated", 1 ); | 480 | ComboBox1->insertItem( "Always, Negotiated", 1 ); |
466 | ComboBox1->insertItem( "Connect on secure port", 2 ); | 481 | ComboBox1->insertItem( "Connect on secure port", 2 ); |
467 | ComboBox1->insertItem( "Run command instead", 3 ); | 482 | ComboBox1->insertItem( "Run command instead", 3 ); |
468 | CommandEdit->hide(); | 483 | CommandEdit->hide(); |
469 | ComboBox1->setCurrentItem( data->ConnectionType() ); | 484 | ComboBox1->setCurrentItem( data->ConnectionType() ); |
470 | } | 485 | } |
471 | 486 | ||
472 | void SMTPconfig::slotConnectionToggle( int index ) | 487 | void SMTPconfig::slotConnectionToggle( int index ) |
473 | { | 488 | { |
474 | // 2 is ssl connection | 489 | // 2 is ssl connection |
475 | if ( index == 2 ) | 490 | if ( index == 2 ) |
476 | { | 491 | { |