summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-06-29 16:14:46 (UTC)
committer zautrix <zautrix>2005-06-29 16:14:46 (UTC)
commit77aa480c9891a90c9b492618ebfd2b20f2d0727a (patch) (unidiff)
tree4f2c278d016fe21f280f8ee6abbca34685aada96 /kaddressbook
parente0fa858c284dddf0d47146e666c4ece7158487be (diff)
downloadkdepimpi-77aa480c9891a90c9b492618ebfd2b20f2d0727a.zip
kdepimpi-77aa480c9891a90c9b492618ebfd2b20f2d0727a.tar.gz
kdepimpi-77aa480c9891a90c9b492618ebfd2b20f2d0727a.tar.bz2
many sync fixes
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp6
-rw-r--r--kaddressbook/kabcore.cpp5
-rw-r--r--kaddressbook/kabcore.h1
3 files changed, 8 insertions, 4 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index bd32859..5334a0e 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -470,407 +470,407 @@ qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
470 layout->addMultiCellWidget( bar, 8, 8, 0, 3 ); 470 layout->addMultiCellWidget( bar, 8, 8, 0, 3 );
471 471
472 label = new QLabel( tab1_1 ); 472 label = new QLabel( tab1_1 );
473//US loadIcon call is ambiguous. Add one more parameter 473//US loadIcon call is ambiguous. Add one more parameter
474//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); 474//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) );
475 label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); 475 label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) );
476//US layout->addMultiCellWidget( label, 8, 9, 3, 3 ); 476//US layout->addMultiCellWidget( label, 8, 9, 3, 3 );
477 layout->addMultiCellWidget( label, 9, 10, 0, 0 ); 477 layout->addMultiCellWidget( label, 9, 10, 0, 0 );
478 */ 478 */
479 label = new QLabel( i18n( "URL:" ), tab1_1 ); 479 label = new QLabel( i18n( "URL:" ), tab1_1 );
480 mURLEdit = new KLineEdit( tab1_1 ); 480 mURLEdit = new KLineEdit( tab1_1 );
481 connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), 481 connect( mURLEdit, SIGNAL( textChanged( const QString& ) ),
482 SLOT( textChanged( const QString& ) ) ); 482 SLOT( textChanged( const QString& ) ) );
483 label->setBuddy( mURLEdit ); 483 label->setBuddy( mURLEdit );
484//US layout->addWidget( label, 8, 4 ); 484//US layout->addWidget( label, 8, 4 );
485 layout->addWidget( label, 7,0 ); 485 layout->addWidget( label, 7,0 );
486//US layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); 486//US layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 );
487 layout->addWidget( mURLEdit, 7, 1); 487 layout->addWidget( mURLEdit, 7, 1);
488 488
489 label = new QLabel( i18n( "&IM address:" ), tab1_1 ); 489 label = new QLabel( i18n( "&IM address:" ), tab1_1 );
490 mIMAddressEdit = new KLineEdit( tab1_1 ); 490 mIMAddressEdit = new KLineEdit( tab1_1 );
491 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), 491 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ),
492 SLOT( textChanged( const QString& ) ) ); 492 SLOT( textChanged( const QString& ) ) );
493 label->setBuddy( mIMAddressEdit ); 493 label->setBuddy( mIMAddressEdit );
494//US layout->addWidget( label, 9, 4 ); 494//US layout->addWidget( label, 9, 4 );
495 layout->addWidget( label, 8, 0 ); 495 layout->addWidget( label, 8, 0 );
496//US layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); 496//US layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 );
497 layout->addWidget( mIMAddressEdit, 8,1 ); 497 layout->addWidget( mIMAddressEdit, 8,1 );
498 498
499//US layout->addColSpacing( 6, 50 ); 499//US layout->addColSpacing( 6, 50 );
500 500
501//US bar = new KSeparator( KSeparator::HLine, tab1_1 ); 501//US bar = new KSeparator( KSeparator::HLine, tab1_1 );
502//US layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); 502//US layout->addMultiCellWidget( bar, 10, 10, 0, 6 );
503 503
504/*US 504/*US
505 /////////////////////////////////////// 505 ///////////////////////////////////////
506 QHBox *categoryBox = new QHBox( tab1 ); 506 QHBox *categoryBox = new QHBox( tab1 );
507 categoryBox->setSpacing( KDialogBase::spacingHintSmall() ); 507 categoryBox->setSpacing( KDialogBase::spacingHintSmall() );
508 508
509 // Categories 509 // Categories
510 button = new QPushButton( i18n( "Categories" ), categoryBox ); 510 button = new QPushButton( i18n( "Categories" ), categoryBox );
511 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); 511 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) );
512 512
513 mCategoryEdit = new KLineEdit( categoryBox ); 513 mCategoryEdit = new KLineEdit( categoryBox );
514 mCategoryEdit->setReadOnly( true ); 514 mCategoryEdit->setReadOnly( true );
515 connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), 515 connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ),
516 SLOT( textChanged( const QString& ) ) ); 516 SLOT( textChanged( const QString& ) ) );
517 517
518 mSecrecyWidget = new SecrecyWidget( categoryBox ); 518 mSecrecyWidget = new SecrecyWidget( categoryBox );
519 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 519 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
520 520
521 layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); 521 layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 );
522*/ 522*/
523 // Build the layout and add to the tab widget 523 // Build the layout and add to the tab widget
524 layout->activate(); // required 524 layout->activate(); // required
525 525
526 mTabWidget->addTab( tab1_1, i18n( "&Address" ) ); 526 mTabWidget->addTab( tab1_1, i18n( "&Address" ) );
527} 527}
528 528
529 529
530 530
531void AddresseeEditorWidget::setupTab2() 531void AddresseeEditorWidget::setupTab2()
532{ 532{
533 // This is the Details tab 533 // This is the Details tab
534 QWidget *tab2 = new QWidget( mTabWidget ); 534 QWidget *tab2 = new QWidget( mTabWidget );
535 535
536 QGridLayout *layout = new QGridLayout( tab2, 8, 3 ); 536 QGridLayout *layout = new QGridLayout( tab2, 8, 3 );
537 layout->setMargin( KDialogBase::marginHintSmall() ); 537 layout->setMargin( KDialogBase::marginHintSmall() );
538 layout->setSpacing( KDialogBase::spacingHintSmall() ); 538 layout->setSpacing( KDialogBase::spacingHintSmall() );
539 539
540 QLabel *label; 540 QLabel *label;
541 KSeparator* bar; 541 KSeparator* bar;
542 542
543 /////////////////////// 543 ///////////////////////
544 // Office info 544 // Office info
545 545
546 // Department 546 // Department
547 label = new QLabel( tab2 ); 547 label = new QLabel( tab2 );
548//US loadIcon call is ambiguous. Add one more parameter 548//US loadIcon call is ambiguous. Add one more parameter
549//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); 549//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) );
550 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); 550 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) );
551 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 551 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
552 552
553 label = new QLabel( i18n( "Department:" ), tab2 ); 553 label = new QLabel( i18n( "Department:" ), tab2 );
554 layout->addWidget( label, 0, 1 ); 554 layout->addWidget( label, 0, 1 );
555 mDepartmentEdit = new KLineEdit( tab2 ); 555 mDepartmentEdit = new KLineEdit( tab2 );
556 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), 556 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ),
557 SLOT( textChanged( const QString& ) ) ); 557 SLOT( textChanged( const QString& ) ) );
558 label->setBuddy( mDepartmentEdit ); 558 label->setBuddy( mDepartmentEdit );
559 layout->addWidget( mDepartmentEdit, 0, 2 ); 559 layout->addWidget( mDepartmentEdit, 0, 2 );
560 560
561 label = new QLabel( i18n( "Office:" ), tab2 ); 561 label = new QLabel( i18n( "Office:" ), tab2 );
562 layout->addWidget( label, 1, 1 ); 562 layout->addWidget( label, 1, 1 );
563 mOfficeEdit = new KLineEdit( tab2 ); 563 mOfficeEdit = new KLineEdit( tab2 );
564 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), 564 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ),
565 SLOT( textChanged( const QString& ) ) ); 565 SLOT( textChanged( const QString& ) ) );
566 label->setBuddy( mOfficeEdit ); 566 label->setBuddy( mOfficeEdit );
567 layout->addWidget( mOfficeEdit, 1, 2 ); 567 layout->addWidget( mOfficeEdit, 1, 2 );
568 568
569 label = new QLabel( i18n( "Profession:" ), tab2 ); 569 label = new QLabel( i18n( "Profession:" ), tab2 );
570 layout->addWidget( label, 2, 1 ); 570 layout->addWidget( label, 2, 1 );
571 mProfessionEdit = new KLineEdit( tab2 ); 571 mProfessionEdit = new KLineEdit( tab2 );
572 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), 572 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ),
573 SLOT( textChanged( const QString& ) ) ); 573 SLOT( textChanged( const QString& ) ) );
574 label->setBuddy( mProfessionEdit ); 574 label->setBuddy( mProfessionEdit );
575 layout->addWidget( mProfessionEdit, 2, 2 ); 575 layout->addWidget( mProfessionEdit, 2, 2 );
576 576
577 label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); 577 label = new QLabel( i18n( "Manager\'s name:" ), tab2 );
578//US layout->addWidget( label, 0, 3 ); 578//US layout->addWidget( label, 0, 3 );
579 layout->addWidget( label, 3, 1 ); 579 layout->addWidget( label, 3, 1 );
580 mManagerEdit = new KLineEdit( tab2 ); 580 mManagerEdit = new KLineEdit( tab2 );
581 connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), 581 connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ),
582 SLOT( textChanged( const QString& ) ) ); 582 SLOT( textChanged( const QString& ) ) );
583 label->setBuddy( mManagerEdit ); 583 label->setBuddy( mManagerEdit );
584//US layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); 584//US layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 );
585 layout->addWidget( mManagerEdit, 3, 2 ); 585 layout->addWidget( mManagerEdit, 3, 2 );
586 586
587 label = new QLabel( i18n( "Assistant's name:" ), tab2 ); 587 label = new QLabel( i18n( "Assistant's name:" ), tab2 );
588//US layout->addWidget( label, 1, 3 ); 588//US layout->addWidget( label, 1, 3 );
589 layout->addWidget( label, 4, 1 ); 589 layout->addWidget( label, 4, 1 );
590 mAssistantEdit = new KLineEdit( tab2 ); 590 mAssistantEdit = new KLineEdit( tab2 );
591 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), 591 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ),
592 SLOT( textChanged( const QString& ) ) ); 592 SLOT( textChanged( const QString& ) ) );
593 label->setBuddy( mAssistantEdit ); 593 label->setBuddy( mAssistantEdit );
594//US layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); 594//US layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 );
595 layout->addWidget( mAssistantEdit, 4, 2 ); 595 layout->addWidget( mAssistantEdit, 4, 2 );
596 596
597 bar = new KSeparator( KSeparator::HLine, tab2 ); 597 bar = new KSeparator( KSeparator::HLine, tab2 );
598//US layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); 598//US layout->addMultiCellWidget( bar, 3, 3, 0, 5 );
599 layout->addMultiCellWidget( bar, 5, 5, 0, 2 ); 599 layout->addMultiCellWidget( bar, 5, 5, 0, 2 );
600 600
601 ///////////////////////////////////////////////// 601 /////////////////////////////////////////////////
602 // Personal info 602 // Personal info
603 603
604 //label = new QLabel( tab2 ); 604 //label = new QLabel( tab2 );
605//US loadIcon call is ambiguous. Add one more parameter 605//US loadIcon call is ambiguous. Add one more parameter
606//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 606//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
607 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 607 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
608//US layout->addMultiCellWidget( label, 4, 5, 0, 0 ); 608//US layout->addMultiCellWidget( label, 4, 5, 0, 0 );
609 //layout->addMultiCellWidget( label, 6, 7, 0, 0 ); 609 //layout->addMultiCellWidget( label, 6, 7, 0, 0 );
610 610
611 611
612 int iii = 6; 612 int iii = 6;
613 613
614 if ( QApplication::desktop()->width() == 640 ) { 614 if ( QApplication::desktop()->width() == 640 ) {
615 QHBox * nbox = new QHBox ( tab2 ); 615 QHBox * nbox = new QHBox ( tab2 );
616 label = new QLabel( i18n( "Nick name:" )+" ", nbox ); 616 label = new QLabel( i18n( "Nick name:" )+" ", nbox );
617 mNicknameEdit = new KLineEdit( nbox ); 617 mNicknameEdit = new KLineEdit( nbox );
618 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 618 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
619 SLOT( textChanged( const QString& ) ) ); 619 SLOT( textChanged( const QString& ) ) );
620 label->setBuddy( mNicknameEdit ); 620 label->setBuddy( mNicknameEdit );
621 621
622 label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox ); 622 label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox );
623 mSpouseEdit = new KLineEdit( nbox ); 623 mSpouseEdit = new KLineEdit( nbox );
624 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), 624 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
625 SLOT( textChanged( const QString& ) ) ); 625 SLOT( textChanged( const QString& ) ) );
626 label->setBuddy( mSpouseEdit ); 626 label->setBuddy( mSpouseEdit );
627 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); 627 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 );
628 ++iii; 628 ++iii;
629 629
630 } else { 630 } else {
631 label = new QLabel( i18n( "Nick name:" ), tab2 ); 631 label = new QLabel( i18n( "Nick name:" ), tab2 );
632 layout->addWidget( label, iii, 1 ); 632 layout->addWidget( label, iii, 1 );
633 mNicknameEdit = new KLineEdit( tab2 ); 633 mNicknameEdit = new KLineEdit( tab2 );
634 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 634 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
635 SLOT( textChanged( const QString& ) ) ); 635 SLOT( textChanged( const QString& ) ) );
636 label->setBuddy( mNicknameEdit ); 636 label->setBuddy( mNicknameEdit );
637 layout->addWidget( mNicknameEdit, iii, 2 ); 637 layout->addWidget( mNicknameEdit, iii, 2 );
638 ++iii; 638 ++iii;
639 639
640 label = new QLabel( i18n( "Spouse's name:" ), tab2 ); 640 label = new QLabel( i18n( "Spouse's name:" ), tab2 );
641 layout->addWidget( label, iii, 1 ); 641 layout->addWidget( label, iii, 1 );
642 mSpouseEdit = new KLineEdit( tab2 ); 642 mSpouseEdit = new KLineEdit( tab2 );
643 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), 643 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
644 SLOT( textChanged( const QString& ) ) ); 644 SLOT( textChanged( const QString& ) ) );
645 label->setBuddy( mSpouseEdit ); 645 label->setBuddy( mSpouseEdit );
646 layout->addWidget( mSpouseEdit, iii, 2 ); 646 layout->addWidget( mSpouseEdit, iii, 2 );
647 ++iii; 647 ++iii;
648 } 648 }
649 649
650 label = new QLabel( i18n( "Children's names:" ), tab2 ); 650 label = new QLabel( i18n( "Children's names:" ), tab2 );
651 layout->addWidget( label, iii, 1 ); 651 layout->addWidget( label, iii, 1 );
652 mChildEdit = new KLineEdit( tab2 ); 652 mChildEdit = new KLineEdit( tab2 );
653 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ), 653 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ),
654 SLOT( textChanged( const QString& ) ) ); 654 SLOT( textChanged( const QString& ) ) );
655 label->setBuddy( mChildEdit ); 655 label->setBuddy( mChildEdit );
656 layout->addWidget( mChildEdit, iii, 2 ); 656 layout->addWidget( mChildEdit, iii, 2 );
657 ++iii; 657 ++iii;
658 if ( QApplication::desktop()->width() == 640 ) { 658 if ( QApplication::desktop()->width() == 640 ) {
659 QHBox * nbox = new QHBox ( tab2 ); 659 QHBox * nbox = new QHBox ( tab2 );
660 label = new QLabel( i18n( "Birthday:" )+" ", nbox ); 660 label = new QLabel( i18n( "Birthday:" )+" ", nbox );
661 mBirthdayPicker = new KDateEdit( nbox ); 661 mBirthdayPicker = new KDateEdit( nbox );
662 mBirthdayPicker->toggleDateFormat(); 662 //mBirthdayPicker->toggleDateFormat();
663 mBirthdayPicker->setHandleInvalid( true ); 663 mBirthdayPicker->setHandleInvalid( true );
664 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 664 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
665 SLOT( dateChanged( QDate ) ) ); 665 SLOT( dateChanged( QDate ) ) );
666 666
667 label->setBuddy( mBirthdayPicker ); 667 label->setBuddy( mBirthdayPicker );
668 668
669 label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox ); 669 label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox );
670 mAnniversaryPicker = new KDateEdit( nbox ); 670 mAnniversaryPicker = new KDateEdit( nbox );
671 mAnniversaryPicker->setHandleInvalid( true ); 671 mAnniversaryPicker->setHandleInvalid( true );
672 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), 672 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
673 SLOT( dateChanged( QDate ) ) ); 673 SLOT( dateChanged( QDate ) ) );
674 674
675 label->setBuddy( mAnniversaryPicker ); 675 label->setBuddy( mAnniversaryPicker );
676 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); 676 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 );
677 ++iii; 677 ++iii;
678 678
679 } else { 679 } else {
680 680
681 label = new QLabel( i18n( "Birthday:" ), tab2 ); 681 label = new QLabel( i18n( "Birthday:" ), tab2 );
682 layout->addWidget( label, iii, 1 ); 682 layout->addWidget( label, iii, 1 );
683 mBirthdayPicker = new KDateEdit( tab2 ); 683 mBirthdayPicker = new KDateEdit( tab2 );
684 mBirthdayPicker->toggleDateFormat(); 684 //mBirthdayPicker->toggleDateFormat();
685 mBirthdayPicker->setHandleInvalid( true ); 685 mBirthdayPicker->setHandleInvalid( true );
686 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 686 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
687 SLOT( dateChanged( QDate ) ) ); 687 SLOT( dateChanged( QDate ) ) );
688 688
689 label->setBuddy( mBirthdayPicker ); 689 label->setBuddy( mBirthdayPicker );
690 layout->addWidget( mBirthdayPicker, iii, 2 ); 690 layout->addWidget( mBirthdayPicker, iii, 2 );
691 ++iii; 691 ++iii;
692 692
693 label = new QLabel( i18n( "Anniversary:" ), tab2 ); 693 label = new QLabel( i18n( "Anniversary:" ), tab2 );
694 layout->addWidget( label, iii, 1 ); 694 layout->addWidget( label, iii, 1 );
695 mAnniversaryPicker = new KDateEdit( tab2 ); 695 mAnniversaryPicker = new KDateEdit( tab2 );
696 mAnniversaryPicker->setHandleInvalid( true ); 696 mAnniversaryPicker->setHandleInvalid( true );
697 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), 697 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
698 SLOT( dateChanged( QDate ) ) ); 698 SLOT( dateChanged( QDate ) ) );
699 699
700 label->setBuddy( mAnniversaryPicker ); 700 label->setBuddy( mAnniversaryPicker );
701 layout->addWidget( mAnniversaryPicker, iii, 2 ); 701 layout->addWidget( mAnniversaryPicker, iii, 2 );
702 ++iii; 702 ++iii;
703 703
704 } 704 }
705 705
706 label = new QLabel( i18n( "Gender:" ), tab2 ); 706 label = new QLabel( i18n( "Gender:" ), tab2 );
707 layout->addWidget( label, iii, 1 ); 707 layout->addWidget( label, iii, 1 );
708 mGenderBox = new QComboBox ( tab2 ); 708 mGenderBox = new QComboBox ( tab2 );
709 mGenderBox->insertItem ( i18n( "ALIEN (gender undefined)" )); 709 mGenderBox->insertItem ( i18n( "ALIEN (gender undefined)" ));
710 mGenderBox->insertItem ( i18n( "female" )); 710 mGenderBox->insertItem ( i18n( "female" ));
711 mGenderBox->insertItem ( i18n( "male" )); 711 mGenderBox->insertItem ( i18n( "male" ));
712 connect( mGenderBox, SIGNAL( activated ( const QString & ) ), 712 connect( mGenderBox, SIGNAL( activated ( const QString & ) ),
713 SLOT( textChanged( const QString& ) ) ); 713 SLOT( textChanged( const QString& ) ) );
714 label->setBuddy( mGenderBox ); 714 label->setBuddy( mGenderBox );
715 layout->addWidget( mGenderBox, iii, 2 ); 715 layout->addWidget( mGenderBox, iii, 2 );
716 ++iii; 716 ++iii;
717 // Build the layout and add to the tab widget 717 // Build the layout and add to the tab widget
718 layout->activate(); // required 718 layout->activate(); // required
719 719
720 mTabWidget->addTab( tab2, i18n( "&Details" ) ); 720 mTabWidget->addTab( tab2, i18n( "&Details" ) );
721} 721}
722 722
723void AddresseeEditorWidget::setupTab2_1() 723void AddresseeEditorWidget::setupTab2_1()
724{ 724{
725 // This is the Details tab 725 // This is the Details tab
726 QWidget *tab2_2 = new QWidget( mTabWidget ); 726 QWidget *tab2_2 = new QWidget( mTabWidget );
727 727
728 QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 ); 728 QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 );
729 layout->setMargin( KDialogBase::marginHintSmall() ); 729 layout->setMargin( KDialogBase::marginHintSmall() );
730 layout->setSpacing( KDialogBase::spacingHintSmall() ); 730 layout->setSpacing( KDialogBase::spacingHintSmall() );
731 731
732 QLabel *label; 732 QLabel *label;
733 KSeparator* bar; 733 KSeparator* bar;
734 734
735/*US 735/*US
736 /////////////////////// 736 ///////////////////////
737 // Office info 737 // Office info
738 738
739 // Department 739 // Department
740 label = new QLabel( tab2 ); 740 label = new QLabel( tab2 );
741//US loadIcon call is ambiguous. Add one more parameter 741//US loadIcon call is ambiguous. Add one more parameter
742//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); 742//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) );
743 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); 743 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) );
744 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 744 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
745 745
746 label = new QLabel( i18n( "Department:" ), tab2 ); 746 label = new QLabel( i18n( "Department:" ), tab2 );
747 layout->addWidget( label, 0, 1 ); 747 layout->addWidget( label, 0, 1 );
748 mDepartmentEdit = new KLineEdit( tab2 ); 748 mDepartmentEdit = new KLineEdit( tab2 );
749 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), 749 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ),
750 SLOT( textChanged( const QString& ) ) ); 750 SLOT( textChanged( const QString& ) ) );
751 label->setBuddy( mDepartmentEdit ); 751 label->setBuddy( mDepartmentEdit );
752 layout->addWidget( mDepartmentEdit, 0, 2 ); 752 layout->addWidget( mDepartmentEdit, 0, 2 );
753 753
754 label = new QLabel( i18n( "Office:" ), tab2 ); 754 label = new QLabel( i18n( "Office:" ), tab2 );
755 layout->addWidget( label, 1, 1 ); 755 layout->addWidget( label, 1, 1 );
756 mOfficeEdit = new KLineEdit( tab2 ); 756 mOfficeEdit = new KLineEdit( tab2 );
757 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), 757 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ),
758 SLOT( textChanged( const QString& ) ) ); 758 SLOT( textChanged( const QString& ) ) );
759 label->setBuddy( mOfficeEdit ); 759 label->setBuddy( mOfficeEdit );
760 layout->addWidget( mOfficeEdit, 1, 2 ); 760 layout->addWidget( mOfficeEdit, 1, 2 );
761 761
762 label = new QLabel( i18n( "Profession:" ), tab2 ); 762 label = new QLabel( i18n( "Profession:" ), tab2 );
763 layout->addWidget( label, 2, 1 ); 763 layout->addWidget( label, 2, 1 );
764 mProfessionEdit = new KLineEdit( tab2 ); 764 mProfessionEdit = new KLineEdit( tab2 );
765 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), 765 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ),
766 SLOT( textChanged( const QString& ) ) ); 766 SLOT( textChanged( const QString& ) ) );
767 label->setBuddy( mProfessionEdit ); 767 label->setBuddy( mProfessionEdit );
768 layout->addWidget( mProfessionEdit, 2, 2 ); 768 layout->addWidget( mProfessionEdit, 2, 2 );
769 769
770 label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); 770 label = new QLabel( i18n( "Manager\'s name:" ), tab2 );
771 layout->addWidget( label, 0, 3 ); 771 layout->addWidget( label, 0, 3 );
772 mManagerEdit = new KLineEdit( tab2 ); 772 mManagerEdit = new KLineEdit( tab2 );
773 connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), 773 connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ),
774 SLOT( textChanged( const QString& ) ) ); 774 SLOT( textChanged( const QString& ) ) );
775 label->setBuddy( mManagerEdit ); 775 label->setBuddy( mManagerEdit );
776 layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); 776 layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 );
777 777
778 label = new QLabel( i18n( "Assistant's name:" ), tab2 ); 778 label = new QLabel( i18n( "Assistant's name:" ), tab2 );
779 layout->addWidget( label, 1, 3 ); 779 layout->addWidget( label, 1, 3 );
780 mAssistantEdit = new KLineEdit( tab2 ); 780 mAssistantEdit = new KLineEdit( tab2 );
781 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), 781 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ),
782 SLOT( textChanged( const QString& ) ) ); 782 SLOT( textChanged( const QString& ) ) );
783 label->setBuddy( mAssistantEdit ); 783 label->setBuddy( mAssistantEdit );
784 layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); 784 layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 );
785 785
786 bar = new KSeparator( KSeparator::HLine, tab2 ); 786 bar = new KSeparator( KSeparator::HLine, tab2 );
787 layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); 787 layout->addMultiCellWidget( bar, 3, 3, 0, 5 );
788 788
789 ///////////////////////////////////////////////// 789 /////////////////////////////////////////////////
790 // Personal info 790 // Personal info
791 791
792 label = new QLabel( tab2 ); 792 label = new QLabel( tab2 );
793//US loadIcon call is ambiguous. Add one more parameter 793//US loadIcon call is ambiguous. Add one more parameter
794//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 794//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
795 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 795 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
796 layout->addMultiCellWidget( label, 4, 5, 0, 0 ); 796 layout->addMultiCellWidget( label, 4, 5, 0, 0 );
797 797
798 label = new QLabel( i18n( "Nick name:" ), tab2 ); 798 label = new QLabel( i18n( "Nick name:" ), tab2 );
799 layout->addWidget( label, 4, 1 ); 799 layout->addWidget( label, 4, 1 );
800 mNicknameEdit = new KLineEdit( tab2 ); 800 mNicknameEdit = new KLineEdit( tab2 );
801 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 801 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
802 SLOT( textChanged( const QString& ) ) ); 802 SLOT( textChanged( const QString& ) ) );
803 label->setBuddy( mNicknameEdit ); 803 label->setBuddy( mNicknameEdit );
804 layout->addWidget( mNicknameEdit, 4, 2 ); 804 layout->addWidget( mNicknameEdit, 4, 2 );
805 805
806 label = new QLabel( i18n( "Spouse's name:" ), tab2 ); 806 label = new QLabel( i18n( "Spouse's name:" ), tab2 );
807 layout->addWidget( label, 5, 1 ); 807 layout->addWidget( label, 5, 1 );
808 mSpouseEdit = new KLineEdit( tab2 ); 808 mSpouseEdit = new KLineEdit( tab2 );
809 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), 809 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
810 SLOT( textChanged( const QString& ) ) ); 810 SLOT( textChanged( const QString& ) ) );
811 label->setBuddy( mSpouseEdit ); 811 label->setBuddy( mSpouseEdit );
812 layout->addWidget( mSpouseEdit, 5, 2 ); 812 layout->addWidget( mSpouseEdit, 5, 2 );
813 813
814 label = new QLabel( i18n( "Birthday:" ), tab2 ); 814 label = new QLabel( i18n( "Birthday:" ), tab2 );
815 layout->addWidget( label, 4, 3 ); 815 layout->addWidget( label, 4, 3 );
816 mBirthdayPicker = new KDateEdit( tab2 ); 816 mBirthdayPicker = new KDateEdit( tab2 );
817 mBirthdayPicker->setHandleInvalid( true ); 817 mBirthdayPicker->setHandleInvalid( true );
818 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 818 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
819 SLOT( dateChanged( QDate ) ) ); 819 SLOT( dateChanged( QDate ) ) );
820 connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ), 820 connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ),
821 SLOT( invalidDate() ) ); 821 SLOT( invalidDate() ) );
822 connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ), 822 connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ),
823 SLOT( emitModified() ) ); 823 SLOT( emitModified() ) );
824 label->setBuddy( mBirthdayPicker ); 824 label->setBuddy( mBirthdayPicker );
825 layout->addWidget( mBirthdayPicker, 4, 4 ); 825 layout->addWidget( mBirthdayPicker, 4, 4 );
826 826
827 label = new QLabel( i18n( "Anniversary:" ), tab2 ); 827 label = new QLabel( i18n( "Anniversary:" ), tab2 );
828 layout->addWidget( label, 5, 3 ); 828 layout->addWidget( label, 5, 3 );
829 mAnniversaryPicker = new KDateEdit( tab2 ); 829 mAnniversaryPicker = new KDateEdit( tab2 );
830 mAnniversaryPicker->setHandleInvalid( true ); 830 mAnniversaryPicker->setHandleInvalid( true );
831 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), 831 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
832 SLOT( dateChanged( QDate ) ) ); 832 SLOT( dateChanged( QDate ) ) );
833 connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ), 833 connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ),
834 SLOT( invalidDate() ) ); 834 SLOT( invalidDate() ) );
835 connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ), 835 connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ),
836 SLOT( emitModified() ) ); 836 SLOT( emitModified() ) );
837 label->setBuddy( mAnniversaryPicker ); 837 label->setBuddy( mAnniversaryPicker );
838 layout->addWidget( mAnniversaryPicker, 5, 4 ); 838 layout->addWidget( mAnniversaryPicker, 5, 4 );
839 839
840 bar = new KSeparator( KSeparator::HLine, tab2 ); 840 bar = new KSeparator( KSeparator::HLine, tab2 );
841 layout->addMultiCellWidget( bar, 6, 6, 0, 5 ); 841 layout->addMultiCellWidget( bar, 6, 6, 0, 5 );
842*/ 842*/
843 ////////////////////////////////////// 843 //////////////////////////////////////
844 // Notes 844 // Notes
845 label = new QLabel( i18n( "Note:" ), tab2_2 ); 845 label = new QLabel( i18n( "Note:" ), tab2_2 );
846 label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); 846 label->setAlignment( Qt::AlignTop | Qt::AlignLeft );
847//US layout->addWidget( label, 7, 0 ); 847//US layout->addWidget( label, 7, 0 );
848 layout->addWidget( label, 0, 0 ); 848 layout->addWidget( label, 0, 0 );
849#ifndef KAB_EMBEDDED 849#ifndef KAB_EMBEDDED
850 mNoteEdit = new QTextEdit( tab2_2 ); 850 mNoteEdit = new QTextEdit( tab2_2 );
851 mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); 851 mNoteEdit->setWordWrap( QTextEdit::WidgetWidth );
852 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); 852 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
853#else //KAB_EMBEDDED 853#else //KAB_EMBEDDED
854 mNoteEdit = new QMultiLineEdit( tab2_2 ); 854 mNoteEdit = new QMultiLineEdit( tab2_2 );
855 mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth ); 855 mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth );
856 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); 856 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
857#endif //KAB_EMBEDDED 857#endif //KAB_EMBEDDED
858 858
859 connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); 859 connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) );
860 label->setBuddy( mNoteEdit ); 860 label->setBuddy( mNoteEdit );
861//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); 861//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 );
862 layout->addWidget( mNoteEdit, 1, 0); 862 layout->addWidget( mNoteEdit, 1, 0);
863 863
864 // Build the layout and add to the tab widget 864 // Build the layout and add to the tab widget
865 layout->activate(); // required 865 layout->activate(); // required
866 866
867 mTabWidget->addTab( tab2_2, i18n( "&Notes" ) ); 867 mTabWidget->addTab( tab2_2, i18n( "&Notes" ) );
868} 868}
869 869
870 870
871 871
872void AddresseeEditorWidget::setupTab3() 872void AddresseeEditorWidget::setupTab3()
873{ 873{
874 // This is the Misc tab 874 // This is the Misc tab
875 QWidget *tab3 = new QWidget( mTabWidget ); 875 QWidget *tab3 = new QWidget( mTabWidget );
876 876
@@ -890,386 +890,384 @@ void AddresseeEditorWidget::setupTab3()
890 // Sound 890 // Sound
891#ifndef KAB_EMBEDDED 891#ifndef KAB_EMBEDDED
892 mSoundWidget = new SoundWidget( tab3 ); 892 mSoundWidget = new SoundWidget( tab3 );
893 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); 893 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() );
894 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 894 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
895 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); 895 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop );
896#else //KAB_EMBEDDED 896#else //KAB_EMBEDDED
897qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); 897qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed");
898#endif //KAB_EMBEDDED 898#endif //KAB_EMBEDDED
899 899
900 ////////////////////////////////////// 900 //////////////////////////////////////
901 // Images 901 // Images
902 mImageWidget = new ImageWidget( tab3 ); 902 mImageWidget = new ImageWidget( tab3 );
903 mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); 903 mImageWidget->setMinimumSize( mImageWidget->sizeHint() );
904 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 904 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
905 layout->addWidget( mImageWidget, 1, 0, Qt::AlignTop ); 905 layout->addWidget( mImageWidget, 1, 0, Qt::AlignTop );
906*/ 906*/
907//US 907//US
908/* 908/*
909 KSeparator* bar = new KSeparator( KSeparator::HLine, tab3 ); 909 KSeparator* bar = new KSeparator( KSeparator::HLine, tab3 );
910 layout->addMultiCellWidget( bar, 1, 1, 0, 0 ); 910 layout->addMultiCellWidget( bar, 1, 1, 0, 0 );
911*/ 911*/
912 ////////////////////////////////////// 912 //////////////////////////////////////
913 // Keys 913 // Keys
914 mKeyWidget = new KeyWidget( tab3 ); 914 mKeyWidget = new KeyWidget( tab3 );
915 //mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); 915 //mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() );
916 connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 916 connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
917//US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); 917//US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop );
918 layout->addWidget( mKeyWidget, 1, 0 ); 918 layout->addWidget( mKeyWidget, 1, 0 );
919 919
920 mTabWidget->addTab( tab3, i18n( "&Misc" ) ); 920 mTabWidget->addTab( tab3, i18n( "&Misc" ) );
921} 921}
922 922
923void AddresseeEditorWidget::setupTab3_1() 923void AddresseeEditorWidget::setupTab3_1()
924{ 924{
925 // This is the Misc tab 925 // This is the Misc tab
926 QWidget *tab3 = new QWidget( mTabWidget ); 926 QWidget *tab3 = new QWidget( mTabWidget );
927 927
928//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); 928//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 );
929 QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); 929 QGridLayout *layout = new QGridLayout( tab3, 1, 1 );
930 layout->setMargin( KDialogBase::marginHint() ); 930 layout->setMargin( KDialogBase::marginHint() );
931 layout->setSpacing( KDialogBase::spacingHint() ); 931 layout->setSpacing( KDialogBase::spacingHint() );
932//US layout->setColStretch( 2, 1 ); 932//US layout->setColStretch( 2, 1 );
933 933
934/*US 934/*US
935 ////////////////////////////////////// 935 //////////////////////////////////////
936 // Geo 936 // Geo
937 mGeoWidget = new GeoWidget( tab3 ); 937 mGeoWidget = new GeoWidget( tab3 );
938 mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); 938 mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() );
939 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 939 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
940 layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop ); 940 layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop );
941*/ 941*/
942 ////////////////////////////////////// 942 //////////////////////////////////////
943 // Sound 943 // Sound
944#ifndef KAB_EMBEDDED 944#ifndef KAB_EMBEDDED
945 mSoundWidget = new SoundWidget( tab3 ); 945 mSoundWidget = new SoundWidget( tab3 );
946 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); 946 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() );
947 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 947 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
948 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); 948 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop );
949#else //KAB_EMBEDDED 949#else //KAB_EMBEDDED
950//US qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); 950//US qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed");
951#endif //KAB_EMBEDDED 951#endif //KAB_EMBEDDED
952 952
953 ////////////////////////////////////// 953 //////////////////////////////////////
954 // Images 954 // Images
955 mImageWidget = new ImageWidget( tab3 ); 955 mImageWidget = new ImageWidget( tab3 );
956 mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); 956 mImageWidget->setMinimumSize( mImageWidget->sizeHint() );
957 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 957 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
958 layout->addWidget( mImageWidget, 0, 0, Qt::AlignTop ); 958 layout->addWidget( mImageWidget, 0, 0, Qt::AlignTop );
959/*US 959/*US
960 ////////////////////////////////////// 960 //////////////////////////////////////
961 // Keys 961 // Keys
962 mKeyWidget = new KeyWidget( tab3 ); 962 mKeyWidget = new KeyWidget( tab3 );
963 mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); 963 mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() );
964 connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 964 connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
965 layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); 965 layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop );
966*/ 966*/
967 mTabWidget->addTab( tab3, i18n( "&Images" ) ); 967 mTabWidget->addTab( tab3, i18n( "&Images" ) );
968} 968}
969 969
970 970
971void AddresseeEditorWidget::load() 971void AddresseeEditorWidget::load()
972{ 972{
973 973
974 // Block signals in case anything tries to emit modified 974 // Block signals in case anything tries to emit modified
975 // CS: This doesn't seem to work. 975 // CS: This doesn't seem to work.
976 bool block = signalsBlocked(); 976 bool block = signalsBlocked();
977 blockSignals( true ); 977 blockSignals( true );
978 mBlockSignals = true; // used for internal signal blocking 978 mBlockSignals = true; // used for internal signal blocking
979 979
980 mNameEdit->setText( mAddressee.assembledName() ); 980 mNameEdit->setText( mAddressee.assembledName() );
981 981
982 if ( mAddressee.formattedName().isEmpty() ) { 982 if ( mAddressee.formattedName().isEmpty() ) {
983//US KConfig config( "kaddressbookrc" ); 983//US KConfig config( "kaddressbookrc" );
984 KConfig config( locateLocal("config", "kabcrc") ); 984 KConfig config( locateLocal("config", "kabcrc") );
985 config.setGroup( "General" ); 985 config.setGroup( "General" );
986 mFormattedNameType = config.readNumEntry( "FormattedNameType", 1 ); 986 mFormattedNameType = config.readNumEntry( "FormattedNameType", 1 );
987 mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); 987 mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) );
988 } else {; 988 } else {;
989 if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::SimpleName ) ) 989 if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::SimpleName ) )
990 mFormattedNameType = NameEditDialog::SimpleName; 990 mFormattedNameType = NameEditDialog::SimpleName;
991 else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::FullName ) ) 991 else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::FullName ) )
992 mFormattedNameType = NameEditDialog::FullName; 992 mFormattedNameType = NameEditDialog::FullName;
993 else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::ReverseName ) ) 993 else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::ReverseName ) )
994 mFormattedNameType = NameEditDialog::ReverseName; 994 mFormattedNameType = NameEditDialog::ReverseName;
995 else 995 else
996 mFormattedNameType = NameEditDialog::CustomName; 996 mFormattedNameType = NameEditDialog::CustomName;
997 } 997 }
998 998
999 mFormattedNameLabel->setText( mAddressee.formattedName() ); 999 mFormattedNameLabel->setText( mAddressee.formattedName() );
1000 1000
1001 mAConfig->setUid( mAddressee.uid() ); 1001 mAConfig->setUid( mAddressee.uid() );
1002 if ( mAConfig->automaticNameParsing() ) { 1002 if ( mAConfig->automaticNameParsing() ) {
1003 mNameLabel->hide(); 1003 mNameLabel->hide();
1004 mNameEdit->show(); 1004 mNameEdit->show();
1005 } else { 1005 } else {
1006 mNameEdit->hide(); 1006 mNameEdit->hide();
1007 mNameLabel->setText( mNameEdit->text() ); 1007 mNameLabel->setText( mNameEdit->text() );
1008 mNameLabel->show(); 1008 mNameLabel->show();
1009 } 1009 }
1010 1010
1011 mRoleEdit->setText( mAddressee.role() ); 1011 mRoleEdit->setText( mAddressee.role() );
1012 mOrgEdit->setText( mAddressee.organization() ); 1012 mOrgEdit->setText( mAddressee.organization() );
1013 1013
1014//US mURLEdit->setURL( mAddressee.url().url() ); 1014//US mURLEdit->setURL( mAddressee.url().url() );
1015 mURLEdit->setText( mAddressee.url().prettyURL() ); 1015 mURLEdit->setText( mAddressee.url().prettyURL() );
1016//US?? mURLEdit->home( false ); 1016//US?? mURLEdit->home( false );
1017 1017
1018 // mNoteEdit->setText( mAddressee.note() ); 1018 // mNoteEdit->setText( mAddressee.note() );
1019 mNoteEdit->setText( mAddressee.note() ); 1019 mNoteEdit->setText( mAddressee.note() );
1020 mEmailWidget->setEmails( mAddressee.emails() ); 1020 mEmailWidget->setEmails( mAddressee.emails() );
1021 mPhoneEditWidget->setPhoneNumbers( mAddressee.phoneNumbers() ); 1021 mPhoneEditWidget->setPhoneNumbers( mAddressee.phoneNumbers() );
1022 mAddressEditWidget->setAddresses( mAddressee, mAddressee.addresses() ); 1022 mAddressEditWidget->setAddresses( mAddressee, mAddressee.addresses() );
1023 mBirthdayPicker->setDate( mAddressee.birthday().date() ); 1023 mBirthdayPicker->setDate( mAddressee.birthday().date() );
1024 1024
1025//US mAnniversaryPicker->setDate( QDate::fromString( mAddressee.custom( 1025//US mAnniversaryPicker->setDate( QDate::fromString( mAddressee.custom(
1026//US "KADDRESSBOOK", "X-Anniversary" ), Qt::ISODate) ); 1026//US "KADDRESSBOOK", "X-Anniversary" ), Qt::ISODate) );
1027 QDate dt = KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), 1027 QDate dt = KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ),
1028 "%Y-%m-%d"); // = Qt::ISODate 1028 "%Y-%m-%d"); // = Qt::ISODate
1029 mAnniversaryPicker->setDate( dt ); 1029 mAnniversaryPicker->setDate( dt );
1030 1030
1031 1031
1032 mNicknameEdit->setText( mAddressee.nickName() ); 1032 mNicknameEdit->setText( mAddressee.nickName() );
1033 mCategoryEdit->setText( mAddressee.categories().join( "," ) ); 1033 mCategoryEdit->setText( mAddressee.categories().join( "," ) );
1034 1034
1035 mGeoWidget->setGeo( mAddressee.geo() ); 1035 mGeoWidget->setGeo( mAddressee.geo() );
1036 mImageWidget->setPhoto( mAddressee.photo() ); 1036 mImageWidget->setPhoto( mAddressee.photo() );
1037 mImageWidget->setLogo( mAddressee.logo() ); 1037 mImageWidget->setLogo( mAddressee.logo() );
1038 mKeyWidget->setKeys( mAddressee.keys() ); 1038 mKeyWidget->setKeys( mAddressee.keys() );
1039 mSecrecyWidget->setSecrecy( mAddressee.secrecy() ); 1039 mSecrecyWidget->setSecrecy( mAddressee.secrecy() );
1040#ifndef KAB_EMBEDDED 1040#ifndef KAB_EMBEDDED
1041 mSoundWidget->setSound( mAddressee.sound() ); 1041 mSoundWidget->setSound( mAddressee.sound() );
1042#else //KAB_EMBEDDED 1042#else //KAB_EMBEDDED
1043//US qDebug("AddresseeEditorWidget::load has to be changed 2"); 1043//US qDebug("AddresseeEditorWidget::load has to be changed 2");
1044#endif //KAB_EMBEDDED 1044#endif //KAB_EMBEDDED
1045 1045
1046 // Load customs 1046 // Load customs
1047 mIMAddressEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-IMAddress" ) ); 1047 mIMAddressEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-IMAddress" ) );
1048 mSpouseEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ) ); 1048 mSpouseEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ) );
1049 mChildEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Children" ) ); 1049 mChildEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Children" ) );
1050 mManagerEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-ManagersName" ) ); 1050 mManagerEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-ManagersName" ) );
1051 mAssistantEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-AssistantsName" ) ); 1051 mAssistantEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-AssistantsName" ) );
1052 mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) ); 1052 mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) );
1053 mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) ); 1053 mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) );
1054 mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) ); 1054 mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) );
1055 QString gen = mAddressee.custom( "KADDRESSBOOK", "X-Gender" ); 1055 QString gen = mAddressee.custom( "KADDRESSBOOK", "X-Gender" );
1056 if ( gen == "female" ) 1056 if ( gen == "female" )
1057 mGenderBox->setCurrentItem ( 1 ); 1057 mGenderBox->setCurrentItem ( 1 );
1058 else if ( gen == "male" ) 1058 else if ( gen == "male" )
1059 mGenderBox->setCurrentItem ( 2 ); 1059 mGenderBox->setCurrentItem ( 2 );
1060 else 1060 else
1061 mGenderBox->setCurrentItem ( 0 ); 1061 mGenderBox->setCurrentItem ( 0 );
1062 blockSignals( block ); 1062 blockSignals( block );
1063 mBlockSignals = false; 1063 mBlockSignals = false;
1064 1064
1065 mDirty = false; 1065 mDirty = false;
1066} 1066}
1067 1067
1068void AddresseeEditorWidget::save() 1068void AddresseeEditorWidget::save()
1069{ 1069{
1070 if ( !dirty() ) { 1070 if ( !dirty() ) {
1071 return; 1071 return;
1072 } 1072 }
1073 1073
1074 mAddressee.setRevision( QDateTime::currentDateTime() ); 1074 mAddressee.setRevision( QDateTime::currentDateTime() );
1075 1075
1076 mAddressee.setRole( mRoleEdit->text() ); 1076 mAddressee.setRole( mRoleEdit->text() );
1077 mAddressee.setOrganization( mOrgEdit->text() ); 1077 mAddressee.setOrganization( mOrgEdit->text() );
1078 mAddressee.setUrl( KURL( mURLEdit->text() ) ); 1078 mAddressee.setUrl( KURL( mURLEdit->text() ) );
1079 mAddressee.setNote( mNoteEdit->text() ); 1079 mAddressee.setNote( mNoteEdit->text() );
1080 if ( mBirthdayPicker->inputIsValid() ) { 1080 if ( mBirthdayPicker->inputIsValid() ) {
1081 QDate da = mBirthdayPicker->date(); 1081 QDate da = mBirthdayPicker->date();
1082 if ( da > QDate::currentDate() )
1083 da.setYMD(da.year()-100, da.month(), da.day() );
1084 mAddressee.setBirthday( QDateTime( da ) ); 1082 mAddressee.setBirthday( QDateTime( da ) );
1085 //qDebug("bday %s ",da.toString().latin1()); 1083 //qDebug("bday %s ",da.toString().latin1());
1086 } 1084 }
1087 else { 1085 else {
1088 mAddressee.setBirthday( QDateTime() ); 1086 mAddressee.setBirthday( QDateTime() );
1089 mBirthdayPicker->clear(); 1087 mBirthdayPicker->clear();
1090 } 1088 }
1091 mAddressee.setNickName( mNicknameEdit->text() ); 1089 mAddressee.setNickName( mNicknameEdit->text() );
1092 mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) ); 1090 mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) );
1093 1091
1094 mAddressee.setGeo( mGeoWidget->geo() ); 1092 mAddressee.setGeo( mGeoWidget->geo() );
1095 mAddressee.setPhoto( mImageWidget->photo() ); 1093 mAddressee.setPhoto( mImageWidget->photo() );
1096 mAddressee.setLogo( mImageWidget->logo() ); 1094 mAddressee.setLogo( mImageWidget->logo() );
1097 mAddressee.setKeys( mKeyWidget->keys() ); 1095 mAddressee.setKeys( mKeyWidget->keys() );
1098#ifndef KAB_EMBEDDED 1096#ifndef KAB_EMBEDDED
1099 mAddressee.setSound( mSoundWidget->sound() ); 1097 mAddressee.setSound( mSoundWidget->sound() );
1100#else //KAB_EMBEDDED 1098#else //KAB_EMBEDDED
1101//US qDebug("AddresseeEditorWidget::save sound not supported"); 1099//US qDebug("AddresseeEditorWidget::save sound not supported");
1102#endif //KAB_EMBEDDED 1100#endif //KAB_EMBEDDED
1103 mAddressee.setSecrecy( mSecrecyWidget->secrecy() ); 1101 mAddressee.setSecrecy( mSecrecyWidget->secrecy() );
1104 1102
1105 // save custom fields 1103 // save custom fields
1106 mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() ); 1104 mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() );
1107 mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() ); 1105 mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() );
1108 mAddressee.insertCustom( "KADDRESSBOOK", "X-Children", mChildEdit->text() ); 1106 mAddressee.insertCustom( "KADDRESSBOOK", "X-Children", mChildEdit->text() );
1109 mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() ); 1107 mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() );
1110 mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() ); 1108 mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() );
1111 mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() ); 1109 mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() );
1112 mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() ); 1110 mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() );
1113 mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() ); 1111 mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() );
1114 if ( mAnniversaryPicker->inputIsValid() ) { 1112 if ( mAnniversaryPicker->inputIsValid() ) {
1115 QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate); 1113 QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate);
1116 mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); 1114 mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt);
1117 } 1115 }
1118 else { 1116 else {
1119 mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" ); 1117 mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" );
1120 mAnniversaryPicker->clear(); 1118 mAnniversaryPicker->clear();
1121 } 1119 }
1122 int gen = mGenderBox->currentItem (); 1120 int gen = mGenderBox->currentItem ();
1123 if ( gen == 1 ) 1121 if ( gen == 1 )
1124 mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "female"); 1122 mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "female");
1125 else if ( gen == 2 ) 1123 else if ( gen == 2 )
1126 mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "male"); 1124 mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "male");
1127 else 1125 else
1128 mAddressee.removeCustom( "KADDRESSBOOK", "X-Gender" ); 1126 mAddressee.removeCustom( "KADDRESSBOOK", "X-Gender" );
1129 1127
1130 // Save the email addresses 1128 // Save the email addresses
1131 QStringList emails = mAddressee.emails(); 1129 QStringList emails = mAddressee.emails();
1132 QStringList::Iterator iter; 1130 QStringList::Iterator iter;
1133 for ( iter = emails.begin(); iter != emails.end(); ++iter ) 1131 for ( iter = emails.begin(); iter != emails.end(); ++iter )
1134 mAddressee.removeEmail( *iter ); 1132 mAddressee.removeEmail( *iter );
1135 1133
1136 emails = mEmailWidget->emails(); 1134 emails = mEmailWidget->emails();
1137 bool first = true; 1135 bool first = true;
1138 for ( iter = emails.begin(); iter != emails.end(); ++iter ) { 1136 for ( iter = emails.begin(); iter != emails.end(); ++iter ) {
1139 mAddressee.insertEmail( *iter, first ); 1137 mAddressee.insertEmail( *iter, first );
1140 first = false; 1138 first = false;
1141 } 1139 }
1142 1140
1143 // Save the phone numbers 1141 // Save the phone numbers
1144 KABC::PhoneNumber::List phoneNumbers; 1142 KABC::PhoneNumber::List phoneNumbers;
1145 KABC::PhoneNumber::List::Iterator phoneIter; 1143 KABC::PhoneNumber::List::Iterator phoneIter;
1146 phoneNumbers = mAddressee.phoneNumbers(); 1144 phoneNumbers = mAddressee.phoneNumbers();
1147 for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end(); 1145 for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end();
1148 ++phoneIter ) 1146 ++phoneIter )
1149 mAddressee.removePhoneNumber( *phoneIter ); 1147 mAddressee.removePhoneNumber( *phoneIter );
1150 1148
1151 phoneNumbers = mPhoneEditWidget->phoneNumbers(); 1149 phoneNumbers = mPhoneEditWidget->phoneNumbers();
1152 for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end(); 1150 for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end();
1153 ++phoneIter ) 1151 ++phoneIter )
1154 mAddressee.insertPhoneNumber( *phoneIter ); 1152 mAddressee.insertPhoneNumber( *phoneIter );
1155 1153
1156 // Save the addresses 1154 // Save the addresses
1157 KABC::Address::List addresses; 1155 KABC::Address::List addresses;
1158 KABC::Address::List::Iterator addressIter; 1156 KABC::Address::List::Iterator addressIter;
1159 addresses = mAddressee.addresses(); 1157 addresses = mAddressee.addresses();
1160 for ( addressIter = addresses.begin(); addressIter != addresses.end(); 1158 for ( addressIter = addresses.begin(); addressIter != addresses.end();
1161 ++addressIter ) 1159 ++addressIter )
1162 mAddressee.removeAddress( *addressIter ); 1160 mAddressee.removeAddress( *addressIter );
1163 1161
1164 addresses = mAddressEditWidget->addresses(); 1162 addresses = mAddressEditWidget->addresses();
1165 for ( addressIter = addresses.begin(); addressIter != addresses.end(); 1163 for ( addressIter = addresses.begin(); addressIter != addresses.end();
1166 ++addressIter ) 1164 ++addressIter )
1167 mAddressee.insertAddress( *addressIter ); 1165 mAddressee.insertAddress( *addressIter );
1168 mDirty = false; 1166 mDirty = false;
1169} 1167}
1170 1168
1171bool AddresseeEditorWidget::dirty() 1169bool AddresseeEditorWidget::dirty()
1172{ 1170{
1173 1171
1174 if ( ! mDirty ) { 1172 if ( ! mDirty ) {
1175 if ( mBirthdayPicker->inputIsValid() ) { 1173 if ( mBirthdayPicker->inputIsValid() ) {
1176 QDate da = mBirthdayPicker->date(); 1174 QDate da = mBirthdayPicker->date();
1177 if ( !(da == mAddressee.birthday().date())) 1175 if ( !(da == mAddressee.birthday().date()))
1178 mDirty = true; 1176 mDirty = true;
1179 } 1177 }
1180 else { 1178 else {
1181 mBirthdayPicker->clear(); 1179 mBirthdayPicker->clear();
1182 } 1180 }
1183 if ( mAnniversaryPicker->inputIsValid() ) { 1181 if ( mAnniversaryPicker->inputIsValid() ) {
1184 QDate da = mAnniversaryPicker->date(); 1182 QDate da = mAnniversaryPicker->date();
1185 if ( da != KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), 1183 if ( da != KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ),
1186 "%Y-%m-%d")) 1184 "%Y-%m-%d"))
1187 mDirty = true; 1185 mDirty = true;
1188 } 1186 }
1189 else { 1187 else {
1190 mAnniversaryPicker->clear(); 1188 mAnniversaryPicker->clear();
1191 } 1189 }
1192 } 1190 }
1193 return mDirty; 1191 return mDirty;
1194} 1192}
1195 1193
1196void AddresseeEditorWidget::nameTextChanged( const QString &text ) 1194void AddresseeEditorWidget::nameTextChanged( const QString &text )
1197{ 1195{
1198 if ( mBlockSignals ) 1196 if ( mBlockSignals )
1199 return; 1197 return;
1200 // use the addressee class to parse the name for us 1198 // use the addressee class to parse the name for us
1201 mAConfig->setUid( mAddressee.uid() ); 1199 mAConfig->setUid( mAddressee.uid() );
1202 if ( mAConfig->automaticNameParsing() ) { 1200 if ( mAConfig->automaticNameParsing() ) {
1203 if ( !mAddressee.formattedName().isEmpty() ) { 1201 if ( !mAddressee.formattedName().isEmpty() ) {
1204 QString fn = mAddressee.formattedName(); 1202 QString fn = mAddressee.formattedName();
1205 mAddressee.setNameFromString( text ); 1203 mAddressee.setNameFromString( text );
1206 mAddressee.setFormattedName( fn ); 1204 mAddressee.setFormattedName( fn );
1207 } else { 1205 } else {
1208 // use extra addressee to avoid a formatted name assignment 1206 // use extra addressee to avoid a formatted name assignment
1209 Addressee addr; 1207 Addressee addr;
1210 addr.setNameFromString( text ); 1208 addr.setNameFromString( text );
1211 mAddressee.setPrefix( addr.prefix() ); 1209 mAddressee.setPrefix( addr.prefix() );
1212 mAddressee.setGivenName( addr.givenName() ); 1210 mAddressee.setGivenName( addr.givenName() );
1213 mAddressee.setAdditionalName( addr.additionalName() ); 1211 mAddressee.setAdditionalName( addr.additionalName() );
1214 mAddressee.setFamilyName( addr.familyName() ); 1212 mAddressee.setFamilyName( addr.familyName() );
1215 mAddressee.setSuffix( addr.suffix() ); 1213 mAddressee.setSuffix( addr.suffix() );
1216 } 1214 }
1217 } 1215 }
1218 nameBoxChanged(); 1216 nameBoxChanged();
1219 1217
1220 1218
1221 emitModified(); 1219 emitModified();
1222} 1220}
1223 1221
1224void AddresseeEditorWidget::nameBoxChanged() 1222void AddresseeEditorWidget::nameBoxChanged()
1225{ 1223{
1226 KABC::Addressee addr; 1224 KABC::Addressee addr;
1227 mAConfig->setUid( mAddressee.uid() ); 1225 mAConfig->setUid( mAddressee.uid() );
1228 if ( mAConfig->automaticNameParsing() ) { 1226 if ( mAConfig->automaticNameParsing() ) {
1229 addr.setNameFromString( mNameEdit->text() ); 1227 addr.setNameFromString( mNameEdit->text() );
1230 mNameLabel->hide(); 1228 mNameLabel->hide();
1231 mNameEdit->show(); 1229 mNameEdit->show();
1232 } else { 1230 } else {
1233 addr = mAddressee; 1231 addr = mAddressee;
1234 mNameEdit->hide(); 1232 mNameEdit->hide();
1235 mNameLabel->setText( mNameEdit->text() ); 1233 mNameLabel->setText( mNameEdit->text() );
1236 mNameLabel->show(); 1234 mNameLabel->show();
1237 } 1235 }
1238 1236
1239 if ( mFormattedNameType != NameEditDialog::CustomName ) { 1237 if ( mFormattedNameType != NameEditDialog::CustomName ) {
1240 mFormattedNameLabel->setText( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); 1238 mFormattedNameLabel->setText( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) );
1241 mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); 1239 mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) );
1242 } 1240 }
1243} 1241}
1244 1242
1245void AddresseeEditorWidget::nameButtonClicked() 1243void AddresseeEditorWidget::nameButtonClicked()
1246{ 1244{
1247 // show the name dialog. 1245 // show the name dialog.
1248 NameEditDialog dialog( mAddressee, mFormattedNameType, this ); 1246 NameEditDialog dialog( mAddressee, mFormattedNameType, this );
1249 1247
1250 if ( KApplication::execDialog( &dialog) ) { 1248 if ( KApplication::execDialog( &dialog) ) {
1251 if ( dialog.changed() ) { 1249 if ( dialog.changed() ) {
1252 mAddressee.setFamilyName( dialog.familyName() ); 1250 mAddressee.setFamilyName( dialog.familyName() );
1253 mAddressee.setGivenName( dialog.givenName() ); 1251 mAddressee.setGivenName( dialog.givenName() );
1254 mAddressee.setPrefix( dialog.prefix() ); 1252 mAddressee.setPrefix( dialog.prefix() );
1255 mAddressee.setSuffix( dialog.suffix() ); 1253 mAddressee.setSuffix( dialog.suffix() );
1256 mAddressee.setAdditionalName( dialog.additionalName() ); 1254 mAddressee.setAdditionalName( dialog.additionalName() );
1257 mFormattedNameType = dialog.formattedNameType(); 1255 mFormattedNameType = dialog.formattedNameType();
1258 if ( mFormattedNameType == NameEditDialog::CustomName ) { 1256 if ( mFormattedNameType == NameEditDialog::CustomName ) {
1259 mFormattedNameLabel->setText( dialog.customFormattedName() ); 1257 mFormattedNameLabel->setText( dialog.customFormattedName() );
1260 mAddressee.setFormattedName( dialog.customFormattedName() ); 1258 mAddressee.setFormattedName( dialog.customFormattedName() );
1261 } 1259 }
1262 // Update the name edit. 1260 // Update the name edit.
1263 bool block = mNameEdit->signalsBlocked(); 1261 bool block = mNameEdit->signalsBlocked();
1264 mNameEdit->blockSignals( true ); 1262 mNameEdit->blockSignals( true );
1265 mNameEdit->setText( mAddressee.assembledName() ); 1263 mNameEdit->setText( mAddressee.assembledName() );
1266 mNameEdit->blockSignals( block ); 1264 mNameEdit->blockSignals( block );
1267 1265
1268 // Update the combo box. 1266 // Update the combo box.
1269 nameBoxChanged(); 1267 nameBoxChanged();
1270 1268
1271 emitModified(); 1269 emitModified();
1272 } 1270 }
1273 } 1271 }
1274} 1272}
1275 1273
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 3715786..046cb63 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -186,384 +186,385 @@ class KABCatPrefs : public QDialog
186 new QRadioButton(i18n("Remove from addressees"), format ); 186 new QRadioButton(i18n("Remove from addressees"), format );
187 addCatBut->setChecked( true ); 187 addCatBut->setChecked( true );
188 QPushButton * ok = new QPushButton( i18n("OK"), this ); 188 QPushButton * ok = new QPushButton( i18n("OK"), this );
189 lay->addWidget( ok ); 189 lay->addWidget( ok );
190 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 190 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
191 lay->addWidget( cancel ); 191 lay->addWidget( cancel );
192 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 192 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
193 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 193 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
194 resize( 200, 200 ); 194 resize( 200, 200 );
195 } 195 }
196 196
197 bool addCat() { return addCatBut->isChecked(); } 197 bool addCat() { return addCatBut->isChecked(); }
198private: 198private:
199 QRadioButton* addCatBut; 199 QRadioButton* addCatBut;
200}; 200};
201 201
202class KABFormatPrefs : public QDialog 202class KABFormatPrefs : public QDialog
203{ 203{
204 public: 204 public:
205 KABFormatPrefs( QWidget *parent=0, const char *name=0 ) : 205 KABFormatPrefs( QWidget *parent=0, const char *name=0 ) :
206 QDialog( parent, name, true ) 206 QDialog( parent, name, true )
207 { 207 {
208 setCaption( i18n("Set formatted name") ); 208 setCaption( i18n("Set formatted name") );
209 QVBoxLayout* lay = new QVBoxLayout( this ); 209 QVBoxLayout* lay = new QVBoxLayout( this );
210 lay->setSpacing( 3 ); 210 lay->setSpacing( 3 );
211 lay->setMargin( 3 ); 211 lay->setMargin( 3 );
212 QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this ); 212 QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this );
213 lay->addWidget( lab ); 213 lay->addWidget( lab );
214 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this ); 214 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this );
215 lay->addWidget( format ); 215 lay->addWidget( format );
216 format->setExclusive ( true ) ; 216 format->setExclusive ( true ) ;
217 simple = new QRadioButton(i18n("Simple: James Bond"), format ); 217 simple = new QRadioButton(i18n("Simple: James Bond"), format );
218 full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format ); 218 full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format );
219 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format ); 219 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format );
220 company = new QRadioButton(i18n("Organization: MI6"), format ); 220 company = new QRadioButton(i18n("Organization: MI6"), format );
221 simple->setChecked( true ); 221 simple->setChecked( true );
222 setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this); 222 setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this);
223 lay->addWidget( setCompany ); 223 lay->addWidget( setCompany );
224 QPushButton * ok = new QPushButton( i18n("Select contact list"), this ); 224 QPushButton * ok = new QPushButton( i18n("Select contact list"), this );
225 lay->addWidget( ok ); 225 lay->addWidget( ok );
226 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 226 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
227 lay->addWidget( cancel ); 227 lay->addWidget( cancel );
228 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 228 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
229 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 229 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
230 //resize( 200, 200 ); 230 //resize( 200, 200 );
231 231
232 } 232 }
233public: 233public:
234 QRadioButton* simple, *full, *reverse, *company; 234 QRadioButton* simple, *full, *reverse, *company;
235 QCheckBox* setCompany; 235 QCheckBox* setCompany;
236}; 236};
237 237
238 238
239 239
240class KAex2phonePrefs : public QDialog 240class KAex2phonePrefs : public QDialog
241{ 241{
242 public: 242 public:
243 KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 243 KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
244 QDialog( parent, name, true ) 244 QDialog( parent, name, true )
245 { 245 {
246 setCaption( i18n("Export to phone options") ); 246 setCaption( i18n("Export to phone options") );
247 QVBoxLayout* lay = new QVBoxLayout( this ); 247 QVBoxLayout* lay = new QVBoxLayout( this );
248 lay->setSpacing( 3 ); 248 lay->setSpacing( 3 );
249 lay->setMargin( 3 ); 249 lay->setMargin( 3 );
250 QLabel *lab; 250 QLabel *lab;
251 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 251 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
252 lab->setAlignment (AlignHCenter ); 252 lab->setAlignment (AlignHCenter );
253 QHBox* temphb; 253 QHBox* temphb;
254 temphb = new QHBox( this ); 254 temphb = new QHBox( this );
255 new QLabel( i18n("I/O device: "), temphb ); 255 new QLabel( i18n("I/O device: "), temphb );
256 mPhoneDevice = new QLineEdit( temphb); 256 mPhoneDevice = new QLineEdit( temphb);
257 lay->addWidget( temphb ); 257 lay->addWidget( temphb );
258 temphb = new QHBox( this ); 258 temphb = new QHBox( this );
259 new QLabel( i18n("Connection: "), temphb ); 259 new QLabel( i18n("Connection: "), temphb );
260 mPhoneConnection = new QLineEdit( temphb); 260 mPhoneConnection = new QLineEdit( temphb);
261 lay->addWidget( temphb ); 261 lay->addWidget( temphb );
262 temphb = new QHBox( this ); 262 temphb = new QHBox( this );
263 new QLabel( i18n("Model(opt.): "), temphb ); 263 new QLabel( i18n("Model(opt.): "), temphb );
264 mPhoneModel = new QLineEdit( temphb); 264 mPhoneModel = new QLineEdit( temphb);
265 lay->addWidget( temphb ); 265 lay->addWidget( temphb );
266 // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); 266 // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this );
267 // lay->addWidget( mWriteToSim ); 267 // lay->addWidget( mWriteToSim );
268 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); 268 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) );
269 lab->setAlignment (AlignHCenter); 269 lab->setAlignment (AlignHCenter);
270 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 270 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
271 lay->addWidget( ok ); 271 lay->addWidget( ok );
272 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 272 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
273 lay->addWidget( cancel ); 273 lay->addWidget( cancel );
274 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 274 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
275 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 275 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
276 resize( 220, 240 ); 276 resize( 220, 240 );
277 277
278 } 278 }
279 279
280public: 280public:
281 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 281 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
282 QCheckBox* mWriteToSim; 282 QCheckBox* mWriteToSim;
283}; 283};
284 284
285 285
286bool pasteWithNewUid = true; 286bool pasteWithNewUid = true;
287 287
288#ifdef KAB_EMBEDDED 288#ifdef KAB_EMBEDDED
289KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) 289KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name )
290 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 290 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
291 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ 291 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/
292 mReadWrite( readWrite ), mModified( false ), mMainWindow(client) 292 mReadWrite( readWrite ), mModified( false ), mMainWindow(client)
293#else //KAB_EMBEDDED 293#else //KAB_EMBEDDED
294KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) 294KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name )
295 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 295 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
296 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), 296 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ),
297 mReadWrite( readWrite ), mModified( false ) 297 mReadWrite( readWrite ), mModified( false )
298#endif //KAB_EMBEDDED 298#endif //KAB_EMBEDDED
299{ 299{
300 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 300 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
301 // syncManager->setBlockSave(false); 301 // syncManager->setBlockSave(false);
302 mIncSearchWidget = 0; 302 mIncSearchWidget = 0;
303 mMiniSplitter = 0; 303 mMiniSplitter = 0;
304 mExtensionBarSplitter = 0; 304 mExtensionBarSplitter = 0;
305 mIsPart = !parent->inherits( "KAddressBookMain" ); 305 mIsPart = !parent->inherits( "KAddressBookMain" );
306 mAddressBook = KABC::StdAddressBook::self(); 306 mAddressBook = KABC::StdAddressBook::self();
307 KABC::StdAddressBook::setAutomaticSave( false ); 307 KABC::StdAddressBook::setAutomaticSave( false );
308 308
309#ifndef KAB_EMBEDDED 309#ifndef KAB_EMBEDDED
310 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); 310 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler );
311#endif //KAB_EMBEDDED 311#endif //KAB_EMBEDDED
312 312
313 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), 313 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ),
314 SLOT( addressBookChanged() ) ); 314 SLOT( addressBookChanged() ) );
315 315
316#if 0 316#if 0
317 // LR moved to addressbook init method 317 // LR moved to addressbook init method
318 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, 318 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization,
319 "X-Department", "KADDRESSBOOK" ); 319 "X-Department", "KADDRESSBOOK" );
320 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, 320 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization,
321 "X-Profession", "KADDRESSBOOK" ); 321 "X-Profession", "KADDRESSBOOK" );
322 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, 322 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization,
323 "X-AssistantsName", "KADDRESSBOOK" ); 323 "X-AssistantsName", "KADDRESSBOOK" );
324 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, 324 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization,
325 "X-ManagersName", "KADDRESSBOOK" ); 325 "X-ManagersName", "KADDRESSBOOK" );
326 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, 326 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal,
327 "X-SpousesName", "KADDRESSBOOK" ); 327 "X-SpousesName", "KADDRESSBOOK" );
328 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, 328 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal,
329 "X-Office", "KADDRESSBOOK" ); 329 "X-Office", "KADDRESSBOOK" );
330 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, 330 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal,
331 "X-IMAddress", "KADDRESSBOOK" ); 331 "X-IMAddress", "KADDRESSBOOK" );
332 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, 332 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal,
333 "X-Anniversary", "KADDRESSBOOK" ); 333 "X-Anniversary", "KADDRESSBOOK" );
334 334
335 //US added this field to become compatible with Opie/qtopia addressbook 335 //US added this field to become compatible with Opie/qtopia addressbook
336 // values can be "female" or "male" or "". An empty field represents undefined. 336 // values can be "female" or "male" or "". An empty field represents undefined.
337 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, 337 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal,
338 "X-Gender", "KADDRESSBOOK" ); 338 "X-Gender", "KADDRESSBOOK" );
339 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, 339 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal,
340 "X-Children", "KADDRESSBOOK" ); 340 "X-Children", "KADDRESSBOOK" );
341 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, 341 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal,
342 "X-FreeBusyUrl", "KADDRESSBOOK" ); 342 "X-FreeBusyUrl", "KADDRESSBOOK" );
343#endif 343#endif
344 initGUI(); 344 initGUI();
345 345
346 mIncSearchWidget->setFocus(); 346 mIncSearchWidget->setFocus();
347 347
348 348
349 connect( mViewManager, SIGNAL( selected( const QString& ) ), 349 connect( mViewManager, SIGNAL( selected( const QString& ) ),
350 SLOT( setContactSelected( const QString& ) ) ); 350 SLOT( setContactSelected( const QString& ) ) );
351 connect( mViewManager, SIGNAL( executed( const QString& ) ), 351 connect( mViewManager, SIGNAL( executed( const QString& ) ),
352 SLOT( executeContact( const QString& ) ) ); 352 SLOT( executeContact( const QString& ) ) );
353 353
354 connect( mViewManager, SIGNAL( deleteRequest( ) ), 354 connect( mViewManager, SIGNAL( deleteRequest( ) ),
355 SLOT( deleteContacts( ) ) ); 355 SLOT( deleteContacts( ) ) );
356 connect( mViewManager, SIGNAL( modified() ), 356 connect( mViewManager, SIGNAL( modified() ),
357 SLOT( setModified() ) ); 357 SLOT( setModified() ) );
358 358
359 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); 359 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) );
360 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); 360 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) );
361 361
362 connect( mXXPortManager, SIGNAL( modified() ), 362 connect( mXXPortManager, SIGNAL( modified() ),
363 SLOT( setModified() ) ); 363 SLOT( setModified() ) );
364 364
365 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), 365 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ),
366 SLOT( incrementalSearchJump( const QString& ) ) ); 366 SLOT( incrementalSearchJump( const QString& ) ) );
367 connect( mIncSearchWidget, SIGNAL( fieldChanged() ), 367 connect( mIncSearchWidget, SIGNAL( fieldChanged() ),
368 mJumpButtonBar, SLOT( recreateButtons() ) ); 368 mJumpButtonBar, SLOT( recreateButtons() ) );
369 369
370 connect( mDetails, SIGNAL( sendEmail( const QString& ) ), 370 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
371 SLOT( sendMail( const QString& ) ) ); 371 SLOT( sendMail( const QString& ) ) );
372 372
373 373
374 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); 374 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&)));
375 connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); 375 connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)));
376 connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); 376 connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&)));
377 connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); 377 connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle()));
378 connect( ExternalAppHandler::instance(), SIGNAL (doRingSync()),this, SLOT( doRingSync()));
378 connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog())); 379 connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog()));
379 380
380 381
381#ifndef KAB_EMBEDDED 382#ifndef KAB_EMBEDDED
382 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), 383 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
383 mXXPortManager, SLOT( importVCard( const KURL& ) ) ); 384 mXXPortManager, SLOT( importVCard( const KURL& ) ) );
384 385
385 connect( mDetails, SIGNAL( browse( const QString& ) ), 386 connect( mDetails, SIGNAL( browse( const QString& ) ),
386 SLOT( browse( const QString& ) ) ); 387 SLOT( browse( const QString& ) ) );
387 388
388 389
389 mAddressBookService = new KAddressBookService( this ); 390 mAddressBookService = new KAddressBookService( this );
390 391
391#endif //KAB_EMBEDDED 392#endif //KAB_EMBEDDED
392 393
393 mMessageTimer = new QTimer( this ); 394 mMessageTimer = new QTimer( this );
394 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); 395 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) );
395 mEditorDialog = 0; 396 mEditorDialog = 0;
396 createAddresseeEditorDialog( this ); 397 createAddresseeEditorDialog( this );
397 setModified( false ); 398 setModified( false );
398 mBRdisabled = false; 399 mBRdisabled = false;
399#ifndef DESKTOP_VERSION 400#ifndef DESKTOP_VERSION
400 infrared = 0; 401 infrared = 0;
401#endif 402#endif
402 //toggleBeamReceive( ); 403 //toggleBeamReceive( );
403 mMainWindow->toolBar()->show(); 404 mMainWindow->toolBar()->show();
404 // we have a toolbar repainting error on the Zaurus when starting KA/Pi 405 // we have a toolbar repainting error on the Zaurus when starting KA/Pi
405 QTimer::singleShot( 10, this , SLOT ( updateToolBar())); 406 QTimer::singleShot( 10, this , SLOT ( updateToolBar()));
406} 407}
407 408
408void KABCore::updateToolBar() 409void KABCore::updateToolBar()
409{ 410{
410 static int iii = 0; 411 static int iii = 0;
411 ++iii; 412 ++iii;
412 mMainWindow->toolBar()->repaintMe(); 413 mMainWindow->toolBar()->repaintMe();
413 if ( iii < 4 ) 414 if ( iii < 4 )
414 QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar())); 415 QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar()));
415} 416}
416KABCore::~KABCore() 417KABCore::~KABCore()
417{ 418{
418 // save(); 419 // save();
419 //saveSettings(); 420 //saveSettings();
420 //KABPrefs::instance()->writeConfig(); 421 //KABPrefs::instance()->writeConfig();
421 delete AddresseeConfig::instance(); 422 delete AddresseeConfig::instance();
422 mAddressBook = 0; 423 mAddressBook = 0;
423 KABC::StdAddressBook::close(); 424 KABC::StdAddressBook::close();
424 425
425 delete syncManager; 426 delete syncManager;
426#ifndef DESKTOP_VERSION 427#ifndef DESKTOP_VERSION
427 if ( infrared ) 428 if ( infrared )
428 delete infrared; 429 delete infrared;
429#endif 430#endif
430} 431}
431void KABCore::receive( const QCString& cmsg, const QByteArray& data ) 432void KABCore::receive( const QCString& cmsg, const QByteArray& data )
432{ 433{
433 //qDebug("KA: QCOP message received: %s ", cmsg.data() ); 434 //qDebug("KA: QCOP message received: %s ", cmsg.data() );
434 if ( cmsg == "setDocument(QString)" ) { 435 if ( cmsg == "setDocument(QString)" ) {
435 QDataStream stream( data, IO_ReadOnly ); 436 QDataStream stream( data, IO_ReadOnly );
436 QString fileName; 437 QString fileName;
437 stream >> fileName; 438 stream >> fileName;
438 recieve( fileName ); 439 recieve( fileName );
439 return; 440 return;
440 } 441 }
441} 442}
442void KABCore::toggleBeamReceive( ) 443void KABCore::toggleBeamReceive( )
443{ 444{
444 if ( mBRdisabled ) 445 if ( mBRdisabled )
445 return; 446 return;
446#ifndef DESKTOP_VERSION 447#ifndef DESKTOP_VERSION
447 if ( infrared ) { 448 if ( infrared ) {
448 qDebug("KA: AB disable BeamReceive "); 449 qDebug("KA: AB disable BeamReceive ");
449 delete infrared; 450 delete infrared;
450 infrared = 0; 451 infrared = 0;
451 mActionBR->setChecked(false); 452 mActionBR->setChecked(false);
452 return; 453 return;
453 } 454 }
454 qDebug("KA: AB enable BeamReceive "); 455 qDebug("KA: AB enable BeamReceive ");
455 mActionBR->setChecked(true); 456 mActionBR->setChecked(true);
456 457
457 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; 458 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ;
458 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); 459 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& )));
459#endif 460#endif
460} 461}
461 462
462 463
463void KABCore::disableBR(bool b) 464void KABCore::disableBR(bool b)
464{ 465{
465#ifndef DESKTOP_VERSION 466#ifndef DESKTOP_VERSION
466 if ( b ) { 467 if ( b ) {
467 if ( infrared ) { 468 if ( infrared ) {
468 toggleBeamReceive( ); 469 toggleBeamReceive( );
469 } 470 }
470 mBRdisabled = true; 471 mBRdisabled = true;
471 } else { 472 } else {
472 if ( mBRdisabled ) { 473 if ( mBRdisabled ) {
473 mBRdisabled = false; 474 mBRdisabled = false;
474 //toggleBeamReceive( ); 475 //toggleBeamReceive( );
475 } 476 }
476 } 477 }
477#endif 478#endif
478 479
479} 480}
480void KABCore::recieve( QString fn ) 481void KABCore::recieve( QString fn )
481{ 482{
482 //qDebug("KABCore::recieve "); 483 //qDebug("KABCore::recieve ");
483 int count = mAddressBook->importFromFile( fn, true ); 484 int count = mAddressBook->importFromFile( fn, true );
484 if ( count ) 485 if ( count )
485 setModified( true ); 486 setModified( true );
486 mViewManager->refreshView(); 487 mViewManager->refreshView();
487 message(i18n("%1 contact(s) received!").arg( count )); 488 message(i18n("%1 contact(s) received!").arg( count ));
488 topLevelWidget()->showMaximized(); 489 topLevelWidget()->showMaximized();
489 topLevelWidget()->raise(); 490 topLevelWidget()->raise();
490} 491}
491void KABCore::restoreSettings() 492void KABCore::restoreSettings()
492{ 493{
493 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; 494 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce;
494 495
495 bool state; 496 bool state;
496 497
497 if (mMultipleViewsAtOnce) 498 if (mMultipleViewsAtOnce)
498 state = KABPrefs::instance()->mDetailsPageVisible; 499 state = KABPrefs::instance()->mDetailsPageVisible;
499 else 500 else
500 state = false; 501 state = false;
501 502
502 mActionDetails->setChecked( state ); 503 mActionDetails->setChecked( state );
503 setDetailsVisible( state ); 504 setDetailsVisible( state );
504 505
505 state = KABPrefs::instance()->mJumpButtonBarVisible; 506 state = KABPrefs::instance()->mJumpButtonBarVisible;
506 507
507 mActionJumpBar->setChecked( state ); 508 mActionJumpBar->setChecked( state );
508 setJumpButtonBarVisible( state ); 509 setJumpButtonBarVisible( state );
509/*US 510/*US
510 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; 511 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter;
511 if ( splitterSize.count() == 0 ) { 512 if ( splitterSize.count() == 0 ) {
512 splitterSize.append( width() / 2 ); 513 splitterSize.append( width() / 2 );
513 splitterSize.append( width() / 2 ); 514 splitterSize.append( width() / 2 );
514 } 515 }
515 mMiniSplitter->setSizes( splitterSize ); 516 mMiniSplitter->setSizes( splitterSize );
516 if ( mExtensionBarSplitter ) { 517 if ( mExtensionBarSplitter ) {
517 splitterSize = KABPrefs::instance()->mExtensionsSplitter; 518 splitterSize = KABPrefs::instance()->mExtensionsSplitter;
518 if ( splitterSize.count() == 0 ) { 519 if ( splitterSize.count() == 0 ) {
519 splitterSize.append( width() / 2 ); 520 splitterSize.append( width() / 2 );
520 splitterSize.append( width() / 2 ); 521 splitterSize.append( width() / 2 );
521 } 522 }
522 mExtensionBarSplitter->setSizes( splitterSize ); 523 mExtensionBarSplitter->setSizes( splitterSize );
523 524
524 } 525 }
525*/ 526*/
526 mViewManager->restoreSettings(); 527 mViewManager->restoreSettings();
527 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); 528 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField );
528 mExtensionManager->restoreSettings(); 529 mExtensionManager->restoreSettings();
529#ifdef DESKTOP_VERSION 530#ifdef DESKTOP_VERSION
530 int wid = width(); 531 int wid = width();
531 if ( wid < 10 ) 532 if ( wid < 10 )
532 wid = 400; 533 wid = 400;
533#else 534#else
534 int wid = QApplication::desktop()->width(); 535 int wid = QApplication::desktop()->width();
535 if ( wid < 640 ) 536 if ( wid < 640 )
536 wid = QApplication::desktop()->height(); 537 wid = QApplication::desktop()->height();
537#endif 538#endif
538 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; 539 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter;
539 if ( true /*splitterSize.count() == 0*/ ) { 540 if ( true /*splitterSize.count() == 0*/ ) {
540 splitterSize.append( wid / 2 ); 541 splitterSize.append( wid / 2 );
541 splitterSize.append( wid / 2 ); 542 splitterSize.append( wid / 2 );
542 } 543 }
543 mMiniSplitter->setSizes( splitterSize ); 544 mMiniSplitter->setSizes( splitterSize );
544 if ( mExtensionBarSplitter ) { 545 if ( mExtensionBarSplitter ) {
545 //splitterSize = KABPrefs::instance()->mExtensionsSplitter; 546 //splitterSize = KABPrefs::instance()->mExtensionsSplitter;
546 if ( true /*splitterSize.count() == 0*/ ) { 547 if ( true /*splitterSize.count() == 0*/ ) {
547 splitterSize.append( wid / 2 ); 548 splitterSize.append( wid / 2 );
548 splitterSize.append( wid / 2 ); 549 splitterSize.append( wid / 2 );
549 } 550 }
550 mExtensionBarSplitter->setSizes( splitterSize ); 551 mExtensionBarSplitter->setSizes( splitterSize );
551 552
552 } 553 }
553#ifdef DESKTOP_VERSION 554#ifdef DESKTOP_VERSION
554 KConfig *config = KABPrefs::instance()->getConfig(); 555 KConfig *config = KABPrefs::instance()->getConfig();
555 config->setGroup("WidgetLayout"); 556 config->setGroup("WidgetLayout");
556 QStringList list; 557 QStringList list;
557 list = config->readListEntry("MainLayout"); 558 list = config->readListEntry("MainLayout");
558 int x,y,w,h; 559 int x,y,w,h;
559 if ( ! list.isEmpty() ) { 560 if ( ! list.isEmpty() ) {
560 x = list[0].toInt(); 561 x = list[0].toInt();
561 y = list[1].toInt(); 562 y = list[1].toInt();
562 w = list[2].toInt(); 563 w = list[2].toInt();
563 h = list[3].toInt(); 564 h = list[3].toInt();
564 KApplication::testCoords( &x,&y,&w,&h ); 565 KApplication::testCoords( &x,&y,&w,&h );
565 topLevelWidget()->setGeometry(x,y,w,h); 566 topLevelWidget()->setGeometry(x,y,w,h);
566 567
567 } else { 568 } else {
568 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 569 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
569 } 570 }
@@ -2391,384 +2392,388 @@ void KABCore::manageCategories( )
2391 if ( cc %10 == 0) 2392 if ( cc %10 == 0)
2392 message(i18n("Processing contact #%1").arg(cc)); 2393 message(i18n("Processing contact #%1").arg(cc));
2393 QStringList catIncList = (*it).categories(); 2394 QStringList catIncList = (*it).categories();
2394 int i; 2395 int i;
2395 if ( catIncList.count() ) { 2396 if ( catIncList.count() ) {
2396 newCatList.clear(); 2397 newCatList.clear();
2397 for( i = 0; i< catIncList.count(); ++i ) { 2398 for( i = 0; i< catIncList.count(); ++i ) {
2398 if ( catList.contains (catIncList[i])) { 2399 if ( catList.contains (catIncList[i])) {
2399 newCatList.append( catIncList[i] ); 2400 newCatList.append( catIncList[i] );
2400 } 2401 }
2401 } 2402 }
2402 newCatList.sort(); 2403 newCatList.sort();
2403 (*it).setCategories( newCatList ); 2404 (*it).setCategories( newCatList );
2404 mAddressBook->insertAddressee( (*it) ); 2405 mAddressBook->insertAddressee( (*it) );
2405 } 2406 }
2406 } 2407 }
2407 setModified( true ); 2408 setModified( true );
2408 mViewManager->refreshView(); 2409 mViewManager->refreshView();
2409 message( i18n("Removing categories done!")); 2410 message( i18n("Removing categories done!"));
2410 } 2411 }
2411 delete cp; 2412 delete cp;
2412} 2413}
2413void KABCore::removeVoice() 2414void KABCore::removeVoice()
2414{ 2415{
2415 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) 2416 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No )
2416 return; 2417 return;
2417 XXPortSelectDialog dlg( this, false, this ); 2418 XXPortSelectDialog dlg( this, false, this );
2418 if ( !dlg.exec() ) 2419 if ( !dlg.exec() )
2419 return; 2420 return;
2420 mAddressBook->setUntagged(); 2421 mAddressBook->setUntagged();
2421 dlg.tagSelected(); 2422 dlg.tagSelected();
2422 message(i18n("Removing voice..."), false ); 2423 message(i18n("Removing voice..."), false );
2423 KABC::AddressBook::Iterator it; 2424 KABC::AddressBook::Iterator it;
2424 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2425 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2425 if ( (*it).tagged() ) { 2426 if ( (*it).tagged() ) {
2426 (*it).removeVoice(); 2427 (*it).removeVoice();
2427 } 2428 }
2428 } 2429 }
2429 message(i18n("Refreshing view...") ); 2430 message(i18n("Refreshing view...") );
2430 qApp->processEvents(); 2431 qApp->processEvents();
2431 mViewManager->refreshView( "" ); 2432 mViewManager->refreshView( "" );
2432 Addressee add; 2433 Addressee add;
2433 mDetails->setAddressee( add ); 2434 mDetails->setAddressee( add );
2434 message(i18n("Remove voice completed!") ); 2435 message(i18n("Remove voice completed!") );
2435 2436
2436 2437
2437 2438
2438} 2439}
2439 2440
2440void KABCore::setFormattedName() 2441void KABCore::setFormattedName()
2441{ 2442{
2442 KABFormatPrefs setpref; 2443 KABFormatPrefs setpref;
2443 if ( !setpref.exec() ) { 2444 if ( !setpref.exec() ) {
2444 return; 2445 return;
2445 } 2446 }
2446 XXPortSelectDialog dlg( this, false, this ); 2447 XXPortSelectDialog dlg( this, false, this );
2447 if ( !dlg.exec() ) 2448 if ( !dlg.exec() )
2448 return; 2449 return;
2449 mAddressBook->setUntagged(); 2450 mAddressBook->setUntagged();
2450 dlg.tagSelected(); 2451 dlg.tagSelected();
2451 int count = 0; 2452 int count = 0;
2452 KABC::AddressBook::Iterator it; 2453 KABC::AddressBook::Iterator it;
2453 bool modified = false; 2454 bool modified = false;
2454 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2455 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2455 if ( (*it).tagged() ) { 2456 if ( (*it).tagged() ) {
2456 if ( (*it).uid().left( 2 ) == "la" ) 2457 if ( (*it).uid().left( 2 ) == "la" )
2457 if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) 2458 if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") )
2458 continue; 2459 continue;
2459 ++count; 2460 ++count;
2460 if ( count %10 == 0 ) 2461 if ( count %10 == 0 )
2461 message(i18n("Changing contact #%1").arg( count ) ); 2462 message(i18n("Changing contact #%1").arg( count ) );
2462 qApp->processEvents(); 2463 qApp->processEvents();
2463 QString fName; 2464 QString fName;
2464 if ( setpref.simple->isChecked() ) 2465 if ( setpref.simple->isChecked() )
2465 fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName ); 2466 fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName );
2466 else if ( setpref.full->isChecked() ) 2467 else if ( setpref.full->isChecked() )
2467 fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName ); 2468 fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName );
2468 else if ( setpref.reverse->isChecked() ) 2469 else if ( setpref.reverse->isChecked() )
2469 fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName ); 2470 fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName );
2470 else 2471 else
2471 fName = (*it).organization(); 2472 fName = (*it).organization();
2472 if ( setpref.setCompany->isChecked() ) 2473 if ( setpref.setCompany->isChecked() )
2473 if ( fName.isEmpty() || fName =="," ) 2474 if ( fName.isEmpty() || fName =="," )
2474 fName = (*it).organization(); 2475 fName = (*it).organization();
2475 (*it).setFormattedName( fName ); 2476 (*it).setFormattedName( fName );
2476 (*it).setChanged( true ); 2477 (*it).setChanged( true );
2477 modified = true; 2478 modified = true;
2478 (*it).setRevision( QDateTime::currentDateTime() ); 2479 (*it).setRevision( QDateTime::currentDateTime() );
2479 } 2480 }
2480 } 2481 }
2481 message(i18n("Refreshing view...") ); 2482 message(i18n("Refreshing view...") );
2482 qApp->processEvents(); 2483 qApp->processEvents();
2483 if ( modified ) 2484 if ( modified )
2484 setModified( true ); 2485 setModified( true );
2485 Addressee add; 2486 Addressee add;
2486 mDetails->setAddressee( add ); 2487 mDetails->setAddressee( add );
2487 if ( count == 0 ) 2488 if ( count == 0 )
2488 message(i18n("No contact changed!") ); 2489 message(i18n("No contact changed!") );
2489 else 2490 else
2490 message(i18n("%1 contacts changed!").arg( count ) ); 2491 message(i18n("%1 contacts changed!").arg( count ) );
2491} 2492}
2492 2493
2493void KABCore::clipboardDataChanged() 2494void KABCore::clipboardDataChanged()
2494{ 2495{
2495 2496
2496 if ( mReadWrite ) 2497 if ( mReadWrite )
2497 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); 2498 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
2498 2499
2499} 2500}
2500 2501
2501void KABCore::updateActionMenu() 2502void KABCore::updateActionMenu()
2502{ 2503{
2503 UndoStack *undo = UndoStack::instance(); 2504 UndoStack *undo = UndoStack::instance();
2504 RedoStack *redo = RedoStack::instance(); 2505 RedoStack *redo = RedoStack::instance();
2505 2506
2506 if ( undo->isEmpty() ) 2507 if ( undo->isEmpty() )
2507 mActionUndo->setText( i18n( "Undo" ) ); 2508 mActionUndo->setText( i18n( "Undo" ) );
2508 else 2509 else
2509 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); 2510 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
2510 2511
2511 mActionUndo->setEnabled( !undo->isEmpty() ); 2512 mActionUndo->setEnabled( !undo->isEmpty() );
2512 2513
2513 if ( !redo->top() ) 2514 if ( !redo->top() )
2514 mActionRedo->setText( i18n( "Redo" ) ); 2515 mActionRedo->setText( i18n( "Redo" ) );
2515 else 2516 else
2516 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); 2517 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
2517 2518
2518 mActionRedo->setEnabled( !redo->isEmpty() ); 2519 mActionRedo->setEnabled( !redo->isEmpty() );
2519} 2520}
2520 2521
2521void KABCore::configureKeyBindings() 2522void KABCore::configureKeyBindings()
2522{ 2523{
2523#ifndef KAB_EMBEDDED 2524#ifndef KAB_EMBEDDED
2524 KKeyDialog::configure( actionCollection(), true ); 2525 KKeyDialog::configure( actionCollection(), true );
2525#else //KAB_EMBEDDED 2526#else //KAB_EMBEDDED
2526 qDebug("KABCore::configureKeyBindings() not implemented"); 2527 qDebug("KABCore::configureKeyBindings() not implemented");
2527#endif //KAB_EMBEDDED 2528#endif //KAB_EMBEDDED
2528} 2529}
2529 2530
2530#ifdef KAB_EMBEDDED 2531#ifdef KAB_EMBEDDED
2531void KABCore::configureResources() 2532void KABCore::configureResources()
2532{ 2533{
2533 KRES::KCMKResources dlg( this, "" , 0 ); 2534 KRES::KCMKResources dlg( this, "" , 0 );
2534 2535
2535 if ( !dlg.exec() ) 2536 if ( !dlg.exec() )
2536 return; 2537 return;
2537 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 2538 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
2538} 2539}
2539#endif //KAB_EMBEDDED 2540#endif //KAB_EMBEDDED
2540 2541
2541 2542
2542/* this method will be called through the QCop interface from Ko/Pi to select addresses 2543/* this method will be called through the QCop interface from Ko/Pi to select addresses
2543 * for the attendees list of an event. 2544 * for the attendees list of an event.
2544 */ 2545 */
2545void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) 2546void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid)
2546{ 2547{
2547 qDebug("KABCore::requestForNameEmailUidList "); 2548 qDebug("KABCore::requestForNameEmailUidList ");
2548 bool ok = false; 2549 bool ok = false;
2549 mEmailSourceChannel = sourceChannel; 2550 mEmailSourceChannel = sourceChannel;
2550 mEmailSourceUID = uid; 2551 mEmailSourceUID = uid;
2551 QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) ); 2552 QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) );
2552 //callContactdialog(); 2553 //callContactdialog();
2553#if 0 2554#if 0
2554 int wid = uid.toInt( &ok ); 2555 int wid = uid.toInt( &ok );
2555 qDebug("UID %s ", uid.latin1()); 2556 qDebug("UID %s ", uid.latin1());
2556 if ( ok ) { 2557 if ( ok ) {
2557 if ( wid != QApplication::desktop()->width() ) { 2558 if ( wid != QApplication::desktop()->width() ) {
2558 qDebug("KA/Pi: Request from different desktop geometry. Resizing ..."); 2559 qDebug("KA/Pi: Request from different desktop geometry. Resizing ...");
2559 message( i18n("Resizing, please wait...") ); 2560 message( i18n("Resizing, please wait...") );
2560 mMainWindow->showMinimized(); 2561 mMainWindow->showMinimized();
2561 /* 2562 /*
2562 { 2563 {
2563 QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); 2564 QCopEnvelope e("QPE/Application/kapi", "callContactdialog()");
2564 } 2565 }
2565 */ 2566 */
2566 QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) ); 2567 QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) );
2567 return; 2568 return;
2568 } 2569 }
2569 2570
2570 } else { 2571 } else {
2571 qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid "); 2572 qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid ");
2572 } 2573 }
2573 callContactdialog(); 2574 callContactdialog();
2574 //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); 2575 //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()");
2575#endif 2576#endif
2576} 2577}
2577void KABCore::resizeAndCallContactdialog() 2578void KABCore::resizeAndCallContactdialog()
2578{ 2579{
2579 updateMainWindow(); 2580 updateMainWindow();
2580 QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) ); 2581 QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) );
2581} 2582}
2582 2583
2584void KABCore::doRingSync()
2585{
2586 syncManager->multiSync( false );
2587}
2583void KABCore::callContactdialog() 2588void KABCore::callContactdialog()
2584{ 2589{
2585 static bool running = false; 2590 static bool running = false;
2586 if (running) return; 2591 if (running) return;
2587 running = true; 2592 running = true;
2588 QStringList nameList; 2593 QStringList nameList;
2589 QStringList emailList; 2594 QStringList emailList;
2590 QStringList uidList; 2595 QStringList uidList;
2591 qDebug(" KABCore::callContactdialog:DESKTOP WIDTH %d ", QApplication::desktop()->width() ); 2596 qDebug(" KABCore::callContactdialog:DESKTOP WIDTH %d ", QApplication::desktop()->width() );
2592 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 2597 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
2593 uint i=0; 2598 uint i=0;
2594 for (i=0; i < list.count(); i++) 2599 for (i=0; i < list.count(); i++)
2595 { 2600 {
2596 nameList.append(list[i].realName()); 2601 nameList.append(list[i].realName());
2597 emailList.append(list[i].preferredEmail()); 2602 emailList.append(list[i].preferredEmail());
2598 uidList.append(list[i].uid()); 2603 uidList.append(list[i].uid());
2599 } 2604 }
2600 QString uid = mEmailSourceUID; 2605 QString uid = mEmailSourceUID;
2601 //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1()); 2606 //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1());
2602 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList); 2607 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList);
2603 running = false; 2608 running = false;
2604} 2609}
2605/* this method will be called through the QCop interface from Ko/Pi to select birthdays 2610/* this method will be called through the QCop interface from Ko/Pi to select birthdays
2606 * to put them into the calendar. 2611 * to put them into the calendar.
2607 */ 2612 */
2608void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) 2613void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid)
2609{ 2614{
2610 // qDebug("KABCore::requestForBirthdayList"); 2615 // qDebug("KABCore::requestForBirthdayList");
2611 QStringList birthdayList; 2616 QStringList birthdayList;
2612 QStringList anniversaryList; 2617 QStringList anniversaryList;
2613 QStringList realNameList; 2618 QStringList realNameList;
2614 QStringList preferredEmailList; 2619 QStringList preferredEmailList;
2615 QStringList assembledNameList; 2620 QStringList assembledNameList;
2616 QStringList uidList; 2621 QStringList uidList;
2617 2622
2618 KABC::AddressBook::Iterator it; 2623 KABC::AddressBook::Iterator it;
2619 2624
2620 int count = 0; 2625 int count = 0;
2621 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2626 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2622 ++count; 2627 ++count;
2623 } 2628 }
2624 QProgressBar bar(count,0 ); 2629 QProgressBar bar(count,0 );
2625 int w = 300; 2630 int w = 300;
2626 if ( QApplication::desktop()->width() < 320 ) 2631 if ( QApplication::desktop()->width() < 320 )
2627 w = 220; 2632 w = 220;
2628 int h = bar.sizeHint().height() ; 2633 int h = bar.sizeHint().height() ;
2629 int dw = QApplication::desktop()->width(); 2634 int dw = QApplication::desktop()->width();
2630 int dh = QApplication::desktop()->height(); 2635 int dh = QApplication::desktop()->height();
2631 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2636 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2632 bar.show(); 2637 bar.show();
2633 bar.setCaption (i18n("Collecting birthdays - close to abort!") ); 2638 bar.setCaption (i18n("Collecting birthdays - close to abort!") );
2634 qApp->processEvents(); 2639 qApp->processEvents();
2635 2640
2636 QDate bday; 2641 QDate bday;
2637 QString anni; 2642 QString anni;
2638 QString formattedbday; 2643 QString formattedbday;
2639 2644
2640 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) 2645 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it )
2641 { 2646 {
2642 if ( ! bar.isVisible() ) 2647 if ( ! bar.isVisible() )
2643 return; 2648 return;
2644 bar.setProgress( count++ ); 2649 bar.setProgress( count++ );
2645 qApp->processEvents(); 2650 qApp->processEvents();
2646 bday = (*it).birthday().date(); 2651 bday = (*it).birthday().date();
2647 anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); 2652 anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" );
2648 2653
2649 if ( bday.isValid() || !anni.isEmpty()) 2654 if ( bday.isValid() || !anni.isEmpty())
2650 { 2655 {
2651 if (bday.isValid()) 2656 if (bday.isValid())
2652 formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); 2657 formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate);
2653 else 2658 else
2654 formattedbday = "NOTVALID"; 2659 formattedbday = "NOTVALID";
2655 if (anni.isEmpty()) 2660 if (anni.isEmpty())
2656 anni = "INVALID"; 2661 anni = "INVALID";
2657 2662
2658 birthdayList.append(formattedbday); 2663 birthdayList.append(formattedbday);
2659 anniversaryList.append(anni); //should be ISODate 2664 anniversaryList.append(anni); //should be ISODate
2660 realNameList.append((*it).realName()); 2665 realNameList.append((*it).realName());
2661 preferredEmailList.append((*it).preferredEmail()); 2666 preferredEmailList.append((*it).preferredEmail());
2662 assembledNameList.append((*it).assembledName()); 2667 assembledNameList.append((*it).assembledName());
2663 uidList.append((*it).uid()); 2668 uidList.append((*it).uid());
2664 2669
2665 //qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() ); 2670 //qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() );
2666 } 2671 }
2667 } 2672 }
2668 2673
2669 bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); 2674 bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList);
2670 2675
2671} 2676}
2672 2677
2673/* this method will be called through the QCop interface from other apps to show details of a contact. 2678/* this method will be called through the QCop interface from other apps to show details of a contact.
2674 */ 2679 */
2675void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) 2680void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
2676{ 2681{
2677 //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); 2682 //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1());
2678 2683
2679 QString foundUid = QString::null; 2684 QString foundUid = QString::null;
2680 if ( ! uid.isEmpty() ) { 2685 if ( ! uid.isEmpty() ) {
2681 Addressee adrr = mAddressBook->findByUid( uid ); 2686 Addressee adrr = mAddressBook->findByUid( uid );
2682 if ( !adrr.isEmpty() ) { 2687 if ( !adrr.isEmpty() ) {
2683 foundUid = uid; 2688 foundUid = uid;
2684 } 2689 }
2685 if ( email == "sendbacklist" ) { 2690 if ( email == "sendbacklist" ) {
2686 //qDebug("ssssssssssssssssssssssend "); 2691 //qDebug("ssssssssssssssssssssssend ");
2687 QStringList nameList; 2692 QStringList nameList;
2688 QStringList emailList; 2693 QStringList emailList;
2689 QStringList uidList; 2694 QStringList uidList;
2690 nameList.append(adrr.realName()); 2695 nameList.append(adrr.realName());
2691 emailList = adrr.emails(); 2696 emailList = adrr.emails();
2692 uidList.append( adrr.preferredEmail()); 2697 uidList.append( adrr.preferredEmail());
2693 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); 2698 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
2694 return; 2699 return;
2695 } 2700 }
2696 2701
2697 } 2702 }
2698 2703
2699 if ( email == "sendbacklist" ) 2704 if ( email == "sendbacklist" )
2700 return; 2705 return;
2701 if (foundUid.isEmpty()) 2706 if (foundUid.isEmpty())
2702 { 2707 {
2703 //find the uid of the person first 2708 //find the uid of the person first
2704 Addressee::List namelist; 2709 Addressee::List namelist;
2705 Addressee::List emaillist; 2710 Addressee::List emaillist;
2706 2711
2707 if (!name.isEmpty()) 2712 if (!name.isEmpty())
2708 namelist = mAddressBook->findByName( name ); 2713 namelist = mAddressBook->findByName( name );
2709 2714
2710 if (!email.isEmpty()) 2715 if (!email.isEmpty())
2711 emaillist = mAddressBook->findByEmail( email ); 2716 emaillist = mAddressBook->findByEmail( email );
2712 //qDebug("count %d %d ", namelist.count(),emaillist.count() ); 2717 //qDebug("count %d %d ", namelist.count(),emaillist.count() );
2713 //check if we have a match in Namelist and Emaillist 2718 //check if we have a match in Namelist and Emaillist
2714 if ((namelist.count() == 0) && (emaillist.count() > 0)) { 2719 if ((namelist.count() == 0) && (emaillist.count() > 0)) {
2715 foundUid = emaillist[0].uid(); 2720 foundUid = emaillist[0].uid();
2716 } 2721 }
2717 else if ((namelist.count() > 0) && (emaillist.count() == 0)) 2722 else if ((namelist.count() > 0) && (emaillist.count() == 0))
2718 foundUid = namelist[0].uid(); 2723 foundUid = namelist[0].uid();
2719 else 2724 else
2720 { 2725 {
2721 for (int i = 0; i < namelist.count(); i++) 2726 for (int i = 0; i < namelist.count(); i++)
2722 { 2727 {
2723 for (int j = 0; j < emaillist.count(); j++) 2728 for (int j = 0; j < emaillist.count(); j++)
2724 { 2729 {
2725 if (namelist[i] == emaillist[j]) 2730 if (namelist[i] == emaillist[j])
2726 { 2731 {
2727 foundUid = namelist[i].uid(); 2732 foundUid = namelist[i].uid();
2728 } 2733 }
2729 } 2734 }
2730 } 2735 }
2731 } 2736 }
2732 } 2737 }
2733 else 2738 else
2734 { 2739 {
2735 foundUid = uid; 2740 foundUid = uid;
2736 } 2741 }
2737 2742
2738 if (!foundUid.isEmpty()) 2743 if (!foundUid.isEmpty())
2739 { 2744 {
2740 2745
2741 // raise Ka/Pi if it is in the background 2746 // raise Ka/Pi if it is in the background
2742#ifndef DESKTOP_VERSION 2747#ifndef DESKTOP_VERSION
2743#ifndef KORG_NODCOP 2748#ifndef KORG_NODCOP
2744 //QCopEnvelope e("QPE/Application/kapi", "raise()"); 2749 //QCopEnvelope e("QPE/Application/kapi", "raise()");
2745#endif 2750#endif
2746#endif 2751#endif
2747 2752
2748 mMainWindow->showMaximized(); 2753 mMainWindow->showMaximized();
2749 mMainWindow-> raise(); 2754 mMainWindow-> raise();
2750 2755
2751 mViewManager->setSelected( "", false); 2756 mViewManager->setSelected( "", false);
2752 mViewManager->refreshView( "" ); 2757 mViewManager->refreshView( "" );
2753 mViewManager->setSelected( foundUid, true ); 2758 mViewManager->setSelected( foundUid, true );
2754 mViewManager->refreshView( foundUid ); 2759 mViewManager->refreshView( foundUid );
2755 2760
2756 if ( !mMultipleViewsAtOnce ) 2761 if ( !mMultipleViewsAtOnce )
2757 { 2762 {
2758 setDetailsVisible( true ); 2763 setDetailsVisible( true );
2759 mActionDetails->setChecked(true); 2764 mActionDetails->setChecked(true);
2760 } 2765 }
2761 } 2766 }
2762} 2767}
2763void KABCore::storagehowto() 2768void KABCore::storagehowto()
2764{ 2769{
2765 KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); 2770 KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" );
2766} 2771}
2767void KABCore::whatsnew() 2772void KABCore::whatsnew()
2768{ 2773{
2769 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 2774 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
2770} 2775}
2771void KABCore::synchowto() 2776void KABCore::synchowto()
2772{ 2777{
2773 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 2778 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
2774} 2779}
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index 6479a58..ceeeda7 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -184,347 +184,348 @@ class KABCore : public QWidget, public KSyncInterface
184 void export2phone(); 184 void export2phone();
185 void beamVCard(const QStringList& uids); 185 void beamVCard(const QStringList& uids);
186 void beamDone( Ir *ir ); 186 void beamDone( Ir *ir );
187 187
188 188
189 /** 189 /**
190 Starts the preferred web browser with the given URL as argument. 190 Starts the preferred web browser with the given URL as argument.
191 */ 191 */
192 void browse( const QString& url ); 192 void browse( const QString& url );
193 193
194 /** 194 /**
195 Select all contacts in the view. 195 Select all contacts in the view.
196 */ 196 */
197 void selectAllContacts(); 197 void selectAllContacts();
198 198
199 /** 199 /**
200 Deletes all selected contacts from the address book. 200 Deletes all selected contacts from the address book.
201 */ 201 */
202 void deleteContacts(); 202 void deleteContacts();
203 203
204 /** 204 /**
205 Deletes given contacts from the address book. 205 Deletes given contacts from the address book.
206 206
207 @param uids The uids of the contacts, which shall be deleted. 207 @param uids The uids of the contacts, which shall be deleted.
208 */ 208 */
209 void deleteContacts( const QStringList &uids ); 209 void deleteContacts( const QStringList &uids );
210 210
211 /** 211 /**
212 Copys the selected contacts into clipboard for later pasting. 212 Copys the selected contacts into clipboard for later pasting.
213 */ 213 */
214 void copyContacts(); 214 void copyContacts();
215 215
216 /** 216 /**
217 Cuts the selected contacts and stores them for later pasting. 217 Cuts the selected contacts and stores them for later pasting.
218 */ 218 */
219 void cutContacts(); 219 void cutContacts();
220 220
221 /** 221 /**
222 Paste contacts from clipboard into the address book. 222 Paste contacts from clipboard into the address book.
223 */ 223 */
224 void pasteContacts(); 224 void pasteContacts();
225 225
226 /** 226 /**
227 Paste given contacts into the address book. 227 Paste given contacts into the address book.
228 228
229 @param list The list of addressee, which shall be pasted. 229 @param list The list of addressee, which shall be pasted.
230 */ 230 */
231 void pasteContacts( KABC::Addressee::List &list ); 231 void pasteContacts( KABC::Addressee::List &list );
232 232
233 /** 233 /**
234 Sets the whoAmI contact, that is used by many other programs to 234 Sets the whoAmI contact, that is used by many other programs to
235 get personal information about the current user. 235 get personal information about the current user.
236 */ 236 */
237 void setWhoAmI(); 237 void setWhoAmI();
238 238
239 /** 239 /**
240 Displays the category dialog and applies the result to all 240 Displays the category dialog and applies the result to all
241 selected contacts. 241 selected contacts.
242 */ 242 */
243 void setCategories(); 243 void setCategories();
244 void manageCategories(); 244 void manageCategories();
245 void editCategories(); 245 void editCategories();
246 246
247 /** 247 /**
248 Sets the field list of the Incremental Search Widget. 248 Sets the field list of the Incremental Search Widget.
249 */ 249 */
250 void setSearchFields( const KABC::Field::List &fields ); 250 void setSearchFields( const KABC::Field::List &fields );
251 251
252 /** 252 /**
253 Search with the current search field for a contact, that matches 253 Search with the current search field for a contact, that matches
254 the given text, and selects it in the view. 254 the given text, and selects it in the view.
255 */ 255 */
256 void incrementalSearch( const QString& text ); 256 void incrementalSearch( const QString& text );
257 void incrementalSearchJump( const QString& text ); 257 void incrementalSearchJump( const QString& text );
258 258
259 /** 259 /**
260 Marks the address book as modified. 260 Marks the address book as modified.
261 */ 261 */
262 void setModified(); 262 void setModified();
263 /** 263 /**
264 Marks the address book as modified without refreshing the view. 264 Marks the address book as modified without refreshing the view.
265 */ 265 */
266 void setModifiedWOrefresh(); 266 void setModifiedWOrefresh();
267 267
268 /** 268 /**
269 Marks the address book as modified concerning the argument. 269 Marks the address book as modified concerning the argument.
270 */ 270 */
271 void setModified( bool modified ); 271 void setModified( bool modified );
272 272
273 /** 273 /**
274 Returns whether the address book is modified. 274 Returns whether the address book is modified.
275 */ 275 */
276 bool modified() const; 276 bool modified() const;
277 277
278 /** 278 /**
279 Called whenever an contact is modified in the contact editor 279 Called whenever an contact is modified in the contact editor
280 dialog or the quick edit. 280 dialog or the quick edit.
281 */ 281 */
282 void contactModified( const KABC::Addressee &addr ); 282 void contactModified( const KABC::Addressee &addr );
283 void addrModified( const KABC::Addressee &addr, bool updateDetails = true ); 283 void addrModified( const KABC::Addressee &addr, bool updateDetails = true );
284 284
285 /** 285 /**
286 DCOP METHODS. 286 DCOP METHODS.
287 */ 287 */
288 void addEmail( QString addr ); 288 void addEmail( QString addr );
289 void importVCard( const KURL& url, bool showPreview ); 289 void importVCard( const KURL& url, bool showPreview );
290 void importVCard( const QString& vCard, bool showPreview ); 290 void importVCard( const QString& vCard, bool showPreview );
291 void newContact(); 291 void newContact();
292 QString getNameByPhone( const QString& phone ); 292 QString getNameByPhone( const QString& phone );
293 /** 293 /**
294 END DCOP METHODS 294 END DCOP METHODS
295 */ 295 */
296 296
297 /** 297 /**
298 Saves the contents of the AddressBook back to disk. 298 Saves the contents of the AddressBook back to disk.
299 */ 299 */
300 void save(); 300 void save();
301 301
302 /** 302 /**
303 Undos the last command using the undo stack. 303 Undos the last command using the undo stack.
304 */ 304 */
305 void undo(); 305 void undo();
306 306
307 /** 307 /**
308 Redos the last command that was undone, using the redo stack. 308 Redos the last command that was undone, using the redo stack.
309 */ 309 */
310 void redo(); 310 void redo();
311 311
312 /** 312 /**
313 Shows the edit dialog for the given uid. If the uid is QString::null, 313 Shows the edit dialog for the given uid. If the uid is QString::null,
314 the method will try to find a selected addressee in the view. 314 the method will try to find a selected addressee in the view.
315 */ 315 */
316 void editContact( const QString &uid /*US = QString::null*/ ); 316 void editContact( const QString &uid /*US = QString::null*/ );
317//US added a second method without defaultparameter 317//US added a second method without defaultparameter
318 void editContact2(); 318 void editContact2();
319 319
320 /** 320 /**
321 Shows or edits the detail view for the given uid. If the uid is QString::null, 321 Shows or edits the detail view for the given uid. If the uid is QString::null,
322 the method will try to find a selected addressee in the view. 322 the method will try to find a selected addressee in the view.
323 */ 323 */
324 void executeContact( const QString &uid /*US = QString::null*/ ); 324 void executeContact( const QString &uid /*US = QString::null*/ );
325 325
326 /** 326 /**
327 Launches the configuration dialog. 327 Launches the configuration dialog.
328 */ 328 */
329 void openConfigDialog(); 329 void openConfigDialog();
330 void openConfigGlobalDialog(); 330 void openConfigGlobalDialog();
331 331
332 /** 332 /**
333 Launches the ldap search dialog. 333 Launches the ldap search dialog.
334 */ 334 */
335 void openLDAPDialog(); 335 void openLDAPDialog();
336 336
337 /** 337 /**
338 Creates a KAddressBookPrinter, which will display the print 338 Creates a KAddressBookPrinter, which will display the print
339 dialog and do the printing. 339 dialog and do the printing.
340 */ 340 */
341 void print(); 341 void print();
342 342
343 /** 343 /**
344 Registers a new GUI client, so plugins can register its actions. 344 Registers a new GUI client, so plugins can register its actions.
345 */ 345 */
346 void addGUIClient( KXMLGUIClient *client ); 346 void addGUIClient( KXMLGUIClient *client );
347 347
348 void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); 348 void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid);
349 void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); 349 void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid);
350 void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); 350 void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid);
351 351
352 352
353 signals: 353 signals:
354 void contactSelected( const QString &name ); 354 void contactSelected( const QString &name );
355 void contactSelected( const QPixmap &pixmap ); 355 void contactSelected( const QPixmap &pixmap );
356 public slots: 356 public slots:
357 void recieve(QString cmsg ); 357 void recieve(QString cmsg );
358 void getFile( bool success ); 358 void getFile( bool success );
359 void syncFileRequest(); 359 void syncFileRequest();
360 void setDetailsVisible( bool visible ); 360 void setDetailsVisible( bool visible );
361 void setDetailsToState(); 361 void setDetailsToState();
362 362
363 void saveSettings(); 363 void saveSettings();
364 364
365 private slots: 365 private slots:
366 void updateToolBar(); 366 void updateToolBar();
367 void updateMainWindow(); 367 void updateMainWindow();
368 void receive( const QCString& cmsg, const QByteArray& data ); 368 void receive( const QCString& cmsg, const QByteArray& data );
369 void toggleBeamReceive( ); 369 void toggleBeamReceive( );
370 void disableBR(bool); 370 void disableBR(bool);
371 void setJumpButtonBarVisible( bool visible ); 371 void setJumpButtonBarVisible( bool visible );
372 void setJumpButtonBar( bool visible ); 372 void setJumpButtonBar( bool visible );
373 void setCaptionBack(); 373 void setCaptionBack();
374 void resizeAndCallContactdialog(); 374 void resizeAndCallContactdialog();
375 void callContactdialog(); 375 void callContactdialog();
376 void doRingSync();
376 377
377 void importFromOL(); 378 void importFromOL();
378 void extensionModified( const KABC::Addressee::List &list ); 379 void extensionModified( const KABC::Addressee::List &list );
379 void extensionChanged( int id ); 380 void extensionChanged( int id );
380 void clipboardDataChanged(); 381 void clipboardDataChanged();
381 void updateActionMenu(); 382 void updateActionMenu();
382 void configureKeyBindings(); 383 void configureKeyBindings();
383 void removeVoice(); 384 void removeVoice();
384 void setFormattedName(); 385 void setFormattedName();
385#ifdef KAB_EMBEDDED 386#ifdef KAB_EMBEDDED
386 void configureResources(); 387 void configureResources();
387#endif //KAB_EMBEDDED 388#endif //KAB_EMBEDDED
388 389
389 void slotEditorDestroyed( const QString &uid ); 390 void slotEditorDestroyed( const QString &uid );
390 void configurationChanged(); 391 void configurationChanged();
391 void addressBookChanged(); 392 void addressBookChanged();
392 393
393 private: 394 private:
394 QString mEmailSourceChannel; 395 QString mEmailSourceChannel;
395 QString mEmailSourceUID; 396 QString mEmailSourceUID;
396 void resizeEvent(QResizeEvent* e ); 397 void resizeEvent(QResizeEvent* e );
397 bool mBRdisabled; 398 bool mBRdisabled;
398#ifndef DESKTOP_VERSION 399#ifndef DESKTOP_VERSION
399 QCopChannel* infrared; 400 QCopChannel* infrared;
400#endif 401#endif
401 QTimer *mMessageTimer; 402 QTimer *mMessageTimer;
402 void initGUI(); 403 void initGUI();
403 void initActions(); 404 void initActions();
404 QString getPhoneFile(); 405 QString getPhoneFile();
405 406
406 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, 407 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent,
407 const char *name = 0 ); 408 const char *name = 0 );
408 409
409 KXMLGUIClient *mGUIClient; 410 KXMLGUIClient *mGUIClient;
410 411
411 KABC::AddressBook *mAddressBook; 412 KABC::AddressBook *mAddressBook;
412 413
413 ViewManager *mViewManager; 414 ViewManager *mViewManager;
414 // QSplitter *mDetailsSplitter; 415 // QSplitter *mDetailsSplitter;
415 KDGanttMinimizeSplitter *mExtensionBarSplitter; 416 KDGanttMinimizeSplitter *mExtensionBarSplitter;
416 ViewContainer *mDetails; 417 ViewContainer *mDetails;
417 KDGanttMinimizeSplitter* mMiniSplitter; 418 KDGanttMinimizeSplitter* mMiniSplitter;
418 XXPortManager *mXXPortManager; 419 XXPortManager *mXXPortManager;
419 JumpButtonBar *mJumpButtonBar; 420 JumpButtonBar *mJumpButtonBar;
420 IncSearchWidget *mIncSearchWidget; 421 IncSearchWidget *mIncSearchWidget;
421 ExtensionManager *mExtensionManager; 422 ExtensionManager *mExtensionManager;
422 423
423 KCMultiDialog *mConfigureDialog; 424 KCMultiDialog *mConfigureDialog;
424 425
425#ifndef KAB_EMBEDDED 426#ifndef KAB_EMBEDDED
426 LDAPSearchDialog *mLdapSearchDialog; 427 LDAPSearchDialog *mLdapSearchDialog;
427#endif //KAB_EMBEDDED 428#endif //KAB_EMBEDDED
428 // QDict<AddresseeEditorDialog> mEditorDict; 429 // QDict<AddresseeEditorDialog> mEditorDict;
429 AddresseeEditorDialog *mEditorDialog; 430 AddresseeEditorDialog *mEditorDialog;
430 bool mReadWrite; 431 bool mReadWrite;
431 bool mModified; 432 bool mModified;
432 bool mIsPart; 433 bool mIsPart;
433 bool mMultipleViewsAtOnce; 434 bool mMultipleViewsAtOnce;
434 435
435 436
436 //US file menu 437 //US file menu
437 KAction *mActionMail; 438 KAction *mActionMail;
438 KAction *mActionBeam; 439 KAction *mActionBeam;
439 KToggleAction *mActionBR; 440 KToggleAction *mActionBR;
440 KAction *mActionExport2phone; 441 KAction *mActionExport2phone;
441 KAction* mActionPrint; 442 KAction* mActionPrint;
442 KAction* mActionPrintDetails; 443 KAction* mActionPrintDetails;
443 KAction* mActionNewContact; 444 KAction* mActionNewContact;
444 KAction *mActionSave; 445 KAction *mActionSave;
445 KAction *mActionEditAddressee; 446 KAction *mActionEditAddressee;
446 KAction *mActionMailVCard; 447 KAction *mActionMailVCard;
447 KAction *mActionBeamVCard; 448 KAction *mActionBeamVCard;
448 449
449 KAction *mActionQuit; 450 KAction *mActionQuit;
450 451
451 //US edit menu 452 //US edit menu
452 KAction *mActionCopy; 453 KAction *mActionCopy;
453 KAction *mActionCut; 454 KAction *mActionCut;
454 KAction *mActionPaste; 455 KAction *mActionPaste;
455 KAction *mActionSelectAll; 456 KAction *mActionSelectAll;
456 KAction *mActionUndo; 457 KAction *mActionUndo;
457 KAction *mActionRedo; 458 KAction *mActionRedo;
458 KAction *mActionDelete; 459 KAction *mActionDelete;
459 460
460 //US settings menu 461 //US settings menu
461 KAction *mActionConfigResources; 462 KAction *mActionConfigResources;
462 KAction *mActionConfigGlobal; 463 KAction *mActionConfigGlobal;
463 KAction *mActionConfigKAddressbook; 464 KAction *mActionConfigKAddressbook;
464 KAction *mActionConfigShortcuts; 465 KAction *mActionConfigShortcuts;
465 KAction *mActionConfigureToolbars; 466 KAction *mActionConfigureToolbars;
466 KAction *mActionKeyBindings; 467 KAction *mActionKeyBindings;
467 KToggleAction *mActionJumpBar; 468 KToggleAction *mActionJumpBar;
468 KToggleAction *mActionDetails; 469 KToggleAction *mActionDetails;
469 KAction *mActionWhoAmI; 470 KAction *mActionWhoAmI;
470 KAction *mActionCategories; 471 KAction *mActionCategories;
471 KAction *mActionEditCategories; 472 KAction *mActionEditCategories;
472 KAction *mActionManageCategories; 473 KAction *mActionManageCategories;
473 KAction *mActionAboutKAddressbook; 474 KAction *mActionAboutKAddressbook;
474 KAction *mActionLicence; 475 KAction *mActionLicence;
475 KAction *mActionFaq; 476 KAction *mActionFaq;
476 KAction *mActionWN; 477 KAction *mActionWN;
477 KAction *mActionSyncHowto; 478 KAction *mActionSyncHowto;
478 KAction *mActionStorageHowto; 479 KAction *mActionStorageHowto;
479 KAction *mActionKdeSyncHowto; 480 KAction *mActionKdeSyncHowto;
480 KAction *mActionMultiSyncHowto; 481 KAction *mActionMultiSyncHowto;
481 482
482 KAction *mActionDeleteView; 483 KAction *mActionDeleteView;
483 484
484 QPopupMenu *viewMenu; 485 QPopupMenu *viewMenu;
485 QPopupMenu *filterMenu; 486 QPopupMenu *filterMenu;
486 QPopupMenu *settingsMenu; 487 QPopupMenu *settingsMenu;
487 QPopupMenu *changeMenu; 488 QPopupMenu *changeMenu;
488 QPopupMenu *beamMenu; 489 QPopupMenu *beamMenu;
489//US QAction *mActionSave; 490//US QAction *mActionSave;
490 QPopupMenu *ImportMenu; 491 QPopupMenu *ImportMenu;
491 QPopupMenu *ExportMenu; 492 QPopupMenu *ExportMenu;
492 //LR additional methods 493 //LR additional methods
493 KAction *mActionRemoveVoice; 494 KAction *mActionRemoveVoice;
494 KAction *mActionSetFormattedName; 495 KAction *mActionSetFormattedName;
495 KAction * mActionImportOL; 496 KAction * mActionImportOL;
496 497
497#ifndef KAB_EMBEDDED 498#ifndef KAB_EMBEDDED
498 KAddressBookService *mAddressBookService; 499 KAddressBookService *mAddressBookService;
499#endif //KAB_EMBEDDED 500#endif //KAB_EMBEDDED
500 501
501 class KABCorePrivate; 502 class KABCorePrivate;
502 KABCorePrivate *d; 503 KABCorePrivate *d;
503 //US bool mBlockSaveFlag; 504 //US bool mBlockSaveFlag;
504 505
505#ifdef KAB_EMBEDDED 506#ifdef KAB_EMBEDDED
506 KAddressBookMain *mMainWindow; // should be the same like mGUIClient 507 KAddressBookMain *mMainWindow; // should be the same like mGUIClient
507#endif //KAB_EMBEDDED 508#endif //KAB_EMBEDDED
508 509
509 //this are the overwritten callbackmethods from the syncinterface 510 //this are the overwritten callbackmethods from the syncinterface
510 virtual bool sync(KSyncManager* manager, QString filename, int mode); 511 virtual bool sync(KSyncManager* manager, QString filename, int mode);
511 virtual bool syncExternal(KSyncManager* manager, QString resource); 512 virtual bool syncExternal(KSyncManager* manager, QString resource);
512 virtual void removeSyncInfo( QString syncProfile); 513 virtual void removeSyncInfo( QString syncProfile);
513 bool syncPhone(); 514 bool syncPhone();
514 void message( QString m , bool startTimer = true); 515 void message( QString m , bool startTimer = true);
515 516
516 // LR ******************************* 517 // LR *******************************
517 // sync stuff! 518 // sync stuff!
518 QString sentSyncFile(); 519 QString sentSyncFile();
519 QPopupMenu *syncMenu; 520 QPopupMenu *syncMenu;
520 KSyncManager* syncManager; 521 KSyncManager* syncManager;
521 int mGlobalSyncMode; 522 int mGlobalSyncMode;
522 bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); 523 bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode);
523 KABC::Addressee getLastSyncAddressee(); 524 KABC::Addressee getLastSyncAddressee();
524 QDateTime mLastAddressbookSync; 525 QDateTime mLastAddressbookSync;
525 int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); 526 int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full );
526 // ********************* 527 // *********************
527 528
528}; 529};
529 530
530#endif 531#endif