summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-11-08 23:57:27 (UTC)
committer zautrix <zautrix>2004-11-08 23:57:27 (UTC)
commit48b2ccf53b1821598c6f18aab57e6e626047c262 (patch) (unidiff)
tree10e4f0123debd92ed06f037dc9212c88a6046bc3
parenta102330ef5acb7346aa811378eaf9dbcdeabd4c4 (diff)
downloadkdepimpi-48b2ccf53b1821598c6f18aab57e6e626047c262.zip
kdepimpi-48b2ccf53b1821598c6f18aab57e6e626047c262.tar.gz
kdepimpi-48b2ccf53b1821598c6f18aab57e6e626047c262.tar.bz2
more menu cleanup in kapi
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp29
-rw-r--r--kaddressbook/kabcore.h1
2 files changed, 19 insertions, 11 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index a6fc677..3c97ce9 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -583,387 +583,389 @@ KABC::Resource *KABCore::requestResource( QWidget *parent )
583KAboutData *KABCore::createAboutData() 583KAboutData *KABCore::createAboutData()
584#else //KAB_EMBEDDED 584#else //KAB_EMBEDDED
585void KABCore::createAboutData() 585void KABCore::createAboutData()
586#endif //KAB_EMBEDDED 586#endif //KAB_EMBEDDED
587{ 587{
588#ifndef KAB_EMBEDDED 588#ifndef KAB_EMBEDDED
589 KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ), 589 KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ),
590 "3.1", I18N_NOOP( "The KDE Address Book" ), 590 "3.1", I18N_NOOP( "The KDE Address Book" ),
591 KAboutData::License_GPL_V2, 591 KAboutData::License_GPL_V2,
592 I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) ); 592 I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) );
593 about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" ); 593 about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" );
594 about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) ); 594 about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) );
595 about->addAuthor( "Cornelius Schumacher", 595 about->addAuthor( "Cornelius Schumacher",
596 I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ), 596 I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ),
597 "schumacher@kde.org" ); 597 "schumacher@kde.org" );
598 about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ), 598 about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ),
599 "mpilone@slac.com" ); 599 "mpilone@slac.com" );
600 about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) ); 600 about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) );
601 about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) ); 601 about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) );
602 about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ), 602 about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ),
603 "michel@klaralvdalens-datakonsult.se" ); 603 "michel@klaralvdalens-datakonsult.se" );
604 about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ), 604 about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ),
605 "hansen@kde.org" ); 605 "hansen@kde.org" );
606 606
607 return about; 607 return about;
608#endif //KAB_EMBEDDED 608#endif //KAB_EMBEDDED
609 609
610 QString version; 610 QString version;
611#include <../version> 611#include <../version>
612 QMessageBox::about( this, "About KAddressbook/Pi", 612 QMessageBox::about( this, "About KAddressbook/Pi",
613 "KAddressbook/Platform-independent\n" 613 "KAddressbook/Platform-independent\n"
614 "(KA/Pi) " +version + " - " + 614 "(KA/Pi) " +version + " - " +
615#ifdef DESKTOP_VERSION 615#ifdef DESKTOP_VERSION
616 "Desktop Edition\n" 616 "Desktop Edition\n"
617#else 617#else
618 "PDA-Edition\n" 618 "PDA-Edition\n"
619 "for: Zaurus 5500 / 7x0 / 8x0\n" 619 "for: Zaurus 5500 / 7x0 / 8x0\n"
620#endif 620#endif
621 621
622 "(c) 2004 Ulf Schenk\n" 622 "(c) 2004 Ulf Schenk\n"
623 "(c) 2004 Lutz Rogowski\n" 623 "(c) 2004 Lutz Rogowski\n"
624 "(c) 1997-2003, The KDE PIM Team\n" 624 "(c) 1997-2003, The KDE PIM Team\n"
625 "Tobias Koenig Current maintainer\ntokoe@kde.org\n" 625 "Tobias Koenig Current maintainer\ntokoe@kde.org\n"
626 "Don Sanders Original author\n" 626 "Don Sanders Original author\n"
627 "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n" 627 "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n"
628 "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n" 628 "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n"
629 "Greg Stern DCOP interface\n" 629 "Greg Stern DCOP interface\n"
630 "Mark Westcot Contact pinning\n" 630 "Mark Westcot Contact pinning\n"
631 "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n" 631 "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n"
632 "Steffen Hansen LDAP Lookup\nhansen@kde.org\n" 632 "Steffen Hansen LDAP Lookup\nhansen@kde.org\n"
633#ifdef _WIN32_ 633#ifdef _WIN32_
634 "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" 634 "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n"
635#endif 635#endif
636 ); 636 );
637} 637}
638 638
639void KABCore::setContactSelected( const QString &uid ) 639void KABCore::setContactSelected( const QString &uid )
640{ 640{
641 KABC::Addressee addr = mAddressBook->findByUid( uid ); 641 KABC::Addressee addr = mAddressBook->findByUid( uid );
642 if ( !mDetails->isHidden() ) 642 if ( !mDetails->isHidden() )
643 mDetails->setAddressee( addr ); 643 mDetails->setAddressee( addr );
644 644
645 if ( !addr.isEmpty() ) { 645 if ( !addr.isEmpty() ) {
646 emit contactSelected( addr.formattedName() ); 646 emit contactSelected( addr.formattedName() );
647 KABC::Picture pic = addr.photo(); 647 KABC::Picture pic = addr.photo();
648 if ( pic.isIntern() ) { 648 if ( pic.isIntern() ) {
649//US emit contactSelected( pic.data() ); 649//US emit contactSelected( pic.data() );
650//US instead use: 650//US instead use:
651 QPixmap px; 651 QPixmap px;
652 if (pic.data().isNull() != true) 652 if (pic.data().isNull() != true)
653 { 653 {
654 px.convertFromImage(pic.data()); 654 px.convertFromImage(pic.data());
655 } 655 }
656 656
657 emit contactSelected( px ); 657 emit contactSelected( px );
658 } 658 }
659 } 659 }
660 660
661 661
662 mExtensionManager->setSelectionChanged(); 662 mExtensionManager->setSelectionChanged();
663 663
664 // update the actions 664 // update the actions
665 bool selected = !uid.isEmpty(); 665 bool selected = !uid.isEmpty();
666 666
667 if ( mReadWrite ) { 667 if ( mReadWrite ) {
668 mActionCut->setEnabled( selected ); 668 mActionCut->setEnabled( selected );
669 mActionPaste->setEnabled( selected ); 669 mActionPaste->setEnabled( selected );
670 } 670 }
671 671
672 mActionCopy->setEnabled( selected ); 672 mActionCopy->setEnabled( selected );
673 mActionDelete->setEnabled( selected ); 673 mActionDelete->setEnabled( selected );
674 mActionEditAddressee->setEnabled( selected ); 674 mActionEditAddressee->setEnabled( selected );
675 mActionMail->setEnabled( selected ); 675 mActionMail->setEnabled( selected );
676 mActionMailVCard->setEnabled( selected ); 676 mActionMailVCard->setEnabled( selected );
677 //if (mActionBeam) 677 //if (mActionBeam)
678 //mActionBeam->setEnabled( selected ); 678 //mActionBeam->setEnabled( selected );
679
680 if (mActionBeamVCard)
681 mActionBeamVCard->setEnabled( selected );
682
683 mActionWhoAmI->setEnabled( selected ); 679 mActionWhoAmI->setEnabled( selected );
684} 680}
685 681
686void KABCore::sendMail() 682void KABCore::sendMail()
687{ 683{
688 sendMail( mViewManager->selectedEmails().join( ", " ) ); 684 sendMail( mViewManager->selectedEmails().join( ", " ) );
689} 685}
690 686
691void KABCore::sendMail( const QString& emaillist ) 687void KABCore::sendMail( const QString& emaillist )
692{ 688{
693 // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... " 689 // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... "
694 if (emaillist.contains(",") > 0) 690 if (emaillist.contains(",") > 0)
695 ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); 691 ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null );
696 else 692 else
697 ExternalAppHandler::instance()->mailToOneContact( emaillist ); 693 ExternalAppHandler::instance()->mailToOneContact( emaillist );
698} 694}
699 695
700 696
701 697
702void KABCore::mailVCard() 698void KABCore::mailVCard()
703{ 699{
704 QStringList uids = mViewManager->selectedUids(); 700 QStringList uids = mViewManager->selectedUids();
705 if ( !uids.isEmpty() ) 701 if ( !uids.isEmpty() )
706 mailVCard( uids ); 702 mailVCard( uids );
707} 703}
708 704
709void KABCore::mailVCard( const QStringList& uids ) 705void KABCore::mailVCard( const QStringList& uids )
710{ 706{
711 QStringList urls; 707 QStringList urls;
712 708
713// QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); 709// QString tmpdir = locateLocal("tmp", KGlobal::getAppName());
714 710
715 QString dirName = "/tmp/" + KApplication::randomString( 8 ); 711 QString dirName = "/tmp/" + KApplication::randomString( 8 );
716 712
717 713
718 714
719 QDir().mkdir( dirName, true ); 715 QDir().mkdir( dirName, true );
720 716
721 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { 717 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) {
722 KABC::Addressee a = mAddressBook->findByUid( *it ); 718 KABC::Addressee a = mAddressBook->findByUid( *it );
723 719
724 if ( a.isEmpty() ) 720 if ( a.isEmpty() )
725 continue; 721 continue;
726 722
727 QString name = a.givenName() + "_" + a.familyName() + ".vcf"; 723 QString name = a.givenName() + "_" + a.familyName() + ".vcf";
728 724
729 QString fileName = dirName + "/" + name; 725 QString fileName = dirName + "/" + name;
730 726
731 QFile outFile(fileName); 727 QFile outFile(fileName);
732 728
733 if ( outFile.open(IO_WriteOnly) ) { // file opened successfully 729 if ( outFile.open(IO_WriteOnly) ) { // file opened successfully
734 KABC::VCardConverter converter; 730 KABC::VCardConverter converter;
735 QString vcard; 731 QString vcard;
736 732
737 converter.addresseeToVCard( a, vcard ); 733 converter.addresseeToVCard( a, vcard );
738 734
739 QTextStream t( &outFile ); // use a text stream 735 QTextStream t( &outFile ); // use a text stream
740 t.setEncoding( QTextStream::UnicodeUTF8 ); 736 t.setEncoding( QTextStream::UnicodeUTF8 );
741 t << vcard; 737 t << vcard;
742 738
743 outFile.close(); 739 outFile.close();
744 740
745 urls.append( fileName ); 741 urls.append( fileName );
746 } 742 }
747 } 743 }
748 744
749 bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") ); 745 bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") );
750 746
751 747
752/*US 748/*US
753 kapp->invokeMailer( QString::null, QString::null, QString::null, 749 kapp->invokeMailer( QString::null, QString::null, QString::null,
754 QString::null, // subject 750 QString::null, // subject
755 QString::null, // body 751 QString::null, // body
756 QString::null, 752 QString::null,
757 urls ); // attachments 753 urls ); // attachments
758*/ 754*/
759 755
760} 756}
761 757
762/** 758/**
763 Beams the "WhoAmI contact. 759 Beams the "WhoAmI contact.
764*/ 760*/
765void KABCore::beamMySelf() 761void KABCore::beamMySelf()
766{ 762{
767 KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); 763 KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI();
768 if (!a.isEmpty()) 764 if (!a.isEmpty())
769 { 765 {
770 QStringList uids; 766 QStringList uids;
771 uids << a.uid(); 767 uids << a.uid();
772 768
773 beamVCard(uids); 769 beamVCard(uids);
774 } else { 770 } else {
775 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); 771 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) );
776 772
777 773
778 } 774 }
779} 775}
780void KABCore::updateMainWindow() 776void KABCore::updateMainWindow()
781{ 777{
782 778
783 mMainWindow->showMaximized(); 779 mMainWindow->showMaximized();
784 mMainWindow->update(); 780 mMainWindow->update();
785} 781}
786void KABCore::resizeEvent(QResizeEvent* e ) 782void KABCore::resizeEvent(QResizeEvent* e )
787{ 783{
788 if ( !mMiniSplitter ) 784 if ( !mMiniSplitter )
789 return; 785 return;
790 if ( QApplication::desktop()->width() >= 480 ) { 786 if ( QApplication::desktop()->width() >= 480 ) {
791 if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 787 if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480
792 if ( mMiniSplitter->orientation() == Qt::Vertical ) { 788 if ( mMiniSplitter->orientation() == Qt::Vertical ) {
793 mMiniSplitter->setOrientation( Qt::Horizontal); 789 mMiniSplitter->setOrientation( Qt::Horizontal);
794 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 790 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
795 if ( QApplication::desktop()->width() <= 640 ) { 791 if ( QApplication::desktop()->width() <= 640 ) {
796 //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); 792 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
797 mViewManager->getFilterAction()->setComboWidth( 150 ); 793 mViewManager->getFilterAction()->setComboWidth( 150 );
798 QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); 794 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
799 } 795 }
800 } 796 }
801 } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 797 } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640
802 if ( mMiniSplitter->orientation() == Qt::Horizontal ) { 798 if ( mMiniSplitter->orientation() == Qt::Horizontal ) {
803 mMiniSplitter->setOrientation( Qt::Vertical ); 799 mMiniSplitter->setOrientation( Qt::Vertical );
804 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 800 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
805 if ( QApplication::desktop()->width() <= 640 ) { 801 if ( QApplication::desktop()->width() <= 640 ) {
806 //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); 802 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
807 mMainWindow->showMinimized(); 803 mMainWindow->showMinimized();
808 mViewManager->getFilterAction()->setComboWidth( 0 ); 804 mViewManager->getFilterAction()->setComboWidth( 0 );
809 QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); 805 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
810 } 806 }
811 } 807 }
812 } 808 }
813 } 809 }
814 810
815} 811}
816void KABCore::export2phone() 812void KABCore::export2phone()
817{ 813{
818 814
819 QStringList uids; 815 QStringList uids;
820 XXPortSelectDialog dlg( this, false, this ); 816 XXPortSelectDialog dlg( this, false, this );
821 if ( dlg.exec() ) 817 if ( dlg.exec() )
822 uids = dlg.uids(); 818 uids = dlg.uids();
823 else 819 else
824 return; 820 return;
825 if ( uids.isEmpty() ) 821 if ( uids.isEmpty() )
826 return; 822 return;
827 // qDebug("count %d ", uids.count()); 823 // qDebug("count %d ", uids.count());
828 824
829 KAex2phonePrefs ex2phone; 825 KAex2phonePrefs ex2phone;
830 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 826 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
831 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 827 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
832 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 828 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
833 829
834 if ( !ex2phone.exec() ) { 830 if ( !ex2phone.exec() ) {
835 return; 831 return;
836 } 832 }
837 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 833 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
838 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 834 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
839 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 835 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
840 836
841 837
842 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 838 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
843 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 839 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
844 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 840 KPimGlobalPrefs::instance()->mEx2PhoneModel );
845 841
846 QString fileName = getPhoneFile(); 842 QString fileName = getPhoneFile();
847 if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) 843 if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) )
848 return; 844 return;
849 845
850 message(i18n("Exporting to phone...")); 846 message(i18n("Exporting to phone..."));
851 QTimer::singleShot( 1, this , SLOT ( writeToPhone())); 847 QTimer::singleShot( 1, this , SLOT ( writeToPhone()));
852 848
853} 849}
854QString KABCore::getPhoneFile() 850QString KABCore::getPhoneFile()
855{ 851{
856#ifdef DESKTOP_VERSION 852#ifdef DESKTOP_VERSION
857 return locateLocal("tmp", "phonefile.vcf"); 853 return locateLocal("tmp", "phonefile.vcf");
858#else 854#else
859 return "/tmp/phonefile.vcf"; 855 return "/tmp/phonefile.vcf";
860#endif 856#endif
861 857
862} 858}
863void KABCore::writeToPhone( ) 859void KABCore::writeToPhone( )
864{ 860{
865 if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) 861 if ( PhoneAccess::writeToPhone( getPhoneFile() ) )
866 message(i18n("Export to phone finished!")); 862 message(i18n("Export to phone finished!"));
867 else 863 else
868 qDebug(i18n("Error exporting to phone")); 864 qDebug(i18n("Error exporting to phone"));
869} 865}
870void KABCore::beamVCard() 866void KABCore::beamVCard()
871{ 867{
872 QStringList uids = mViewManager->selectedUids(); 868 QStringList uids;
873 if ( !uids.isEmpty() ) 869 XXPortSelectDialog dlg( this, false, this );
870 if ( dlg.exec() )
871 uids = dlg.uids();
872 else
873 return;
874 if ( uids.isEmpty() )
875 return;
874 beamVCard( uids ); 876 beamVCard( uids );
875} 877}
876 878
877 879
878void KABCore::beamVCard(const QStringList& uids) 880void KABCore::beamVCard(const QStringList& uids)
879{ 881{
880 882
881 // LR: we should use the /tmp dir on the Zaurus, 883 // LR: we should use the /tmp dir on the Zaurus,
882 // because: /tmp = RAM, (HOME)/kdepim = flash memory 884 // because: /tmp = RAM, (HOME)/kdepim = flash memory
883 885
884#ifdef DESKTOP_VERSION 886#ifdef DESKTOP_VERSION
885 QString fileName = locateLocal("tmp", "kapibeamfile.vcf"); 887 QString fileName = locateLocal("tmp", "kapibeamfile.vcf");
886#else 888#else
887 QString fileName = "/tmp/kapibeamfile.vcf"; 889 QString fileName = "/tmp/kapibeamfile.vcf";
888#endif 890#endif
889 891
890 KABC::VCardConverter converter; 892 KABC::VCardConverter converter;
891 QString description; 893 QString description;
892 QString datastream; 894 QString datastream;
893 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { 895 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) {
894 KABC::Addressee a = mAddressBook->findByUid( *it ); 896 KABC::Addressee a = mAddressBook->findByUid( *it );
895 897
896 if ( a.isEmpty() ) 898 if ( a.isEmpty() )
897 continue; 899 continue;
898 900
899 if (description.isEmpty()) 901 if (description.isEmpty())
900 description = a.formattedName(); 902 description = a.formattedName();
901 903
902 QString vcard; 904 QString vcard;
903 converter.addresseeToVCard( a, vcard ); 905 converter.addresseeToVCard( a, vcard );
904 int start = 0; 906 int start = 0;
905 int next; 907 int next;
906 while ( (next = vcard.find("TYPE=", start) )>= 0 ) { 908 while ( (next = vcard.find("TYPE=", start) )>= 0 ) {
907 int semi = vcard.find(";", next); 909 int semi = vcard.find(";", next);
908 int dopp = vcard.find(":", next); 910 int dopp = vcard.find(":", next);
909 int sep; 911 int sep;
910 if ( semi < dopp && semi >= 0 ) 912 if ( semi < dopp && semi >= 0 )
911 sep = semi ; 913 sep = semi ;
912 else 914 else
913 sep = dopp; 915 sep = dopp;
914 datastream +=vcard.mid( start, next - start); 916 datastream +=vcard.mid( start, next - start);
915 datastream +=vcard.mid( next+5,sep -next -5 ).upper(); 917 datastream +=vcard.mid( next+5,sep -next -5 ).upper();
916 start = sep; 918 start = sep;
917 } 919 }
918 datastream += vcard.mid( start,vcard.length() ); 920 datastream += vcard.mid( start,vcard.length() );
919 } 921 }
920#ifndef DESKTOP_VERSION 922#ifndef DESKTOP_VERSION
921 QFile outFile(fileName); 923 QFile outFile(fileName);
922 if ( outFile.open(IO_WriteOnly) ) { 924 if ( outFile.open(IO_WriteOnly) ) {
923 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); 925 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" );
924 QTextStream t( &outFile ); // use a text stream 926 QTextStream t( &outFile ); // use a text stream
925 //t.setEncoding( QTextStream::UnicodeUTF8 ); 927 //t.setEncoding( QTextStream::UnicodeUTF8 );
926 t.setEncoding( QTextStream::Latin1 ); 928 t.setEncoding( QTextStream::Latin1 );
927 t <<datastream.latin1(); 929 t <<datastream.latin1();
928 outFile.close(); 930 outFile.close();
929 Ir *ir = new Ir( this ); 931 Ir *ir = new Ir( this );
930 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); 932 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) );
931 ir->send( fileName, description, "text/x-vCard" ); 933 ir->send( fileName, description, "text/x-vCard" );
932 } else { 934 } else {
933 qDebug("Error open temp beam file "); 935 qDebug("Error open temp beam file ");
934 return; 936 return;
935 } 937 }
936#endif 938#endif
937 939
938} 940}
939 941
940void KABCore::beamDone( Ir *ir ) 942void KABCore::beamDone( Ir *ir )
941{ 943{
942#ifndef DESKTOP_VERSION 944#ifndef DESKTOP_VERSION
943 delete ir; 945 delete ir;
944#endif 946#endif
945 topLevelWidget()->raise(); 947 topLevelWidget()->raise();
946 message( i18n("Beaming finished!") ); 948 message( i18n("Beaming finished!") );
947} 949}
948 950
949 951
950void KABCore::browse( const QString& url ) 952void KABCore::browse( const QString& url )
951{ 953{
952#ifndef KAB_EMBEDDED 954#ifndef KAB_EMBEDDED
953 kapp->invokeBrowser( url ); 955 kapp->invokeBrowser( url );
954#else //KAB_EMBEDDED 956#else //KAB_EMBEDDED
955 qDebug("KABCore::browse must be fixed"); 957 qDebug("KABCore::browse must be fixed");
956#endif //KAB_EMBEDDED 958#endif //KAB_EMBEDDED
957} 959}
958 960
959void KABCore::selectAllContacts() 961void KABCore::selectAllContacts()
960{ 962{
961 mViewManager->setSelected( QString::null, true ); 963 mViewManager->setSelected( QString::null, true );
962} 964}
963 965
964void KABCore::deleteContacts() 966void KABCore::deleteContacts()
965{ 967{
966 QStringList uidList = mViewManager->selectedUids(); 968 QStringList uidList = mViewManager->selectedUids();
967 deleteContacts( uidList ); 969 deleteContacts( uidList );
968} 970}
969 971
@@ -1603,358 +1605,359 @@ void KABCore::configurationChanged()
1603void KABCore::addressBookChanged() 1605void KABCore::addressBookChanged()
1604{ 1606{
1605/*US 1607/*US
1606 QDictIterator<AddresseeEditorDialog> it( mEditorDict ); 1608 QDictIterator<AddresseeEditorDialog> it( mEditorDict );
1607 while ( it.current() ) { 1609 while ( it.current() ) {
1608 if ( it.current()->dirty() ) { 1610 if ( it.current()->dirty() ) {
1609 QString text = i18n( "Data has been changed externally. Unsaved " 1611 QString text = i18n( "Data has been changed externally. Unsaved "
1610 "changes will be lost." ); 1612 "changes will be lost." );
1611 KMessageBox::information( this, text ); 1613 KMessageBox::information( this, text );
1612 } 1614 }
1613 it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); 1615 it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) );
1614 ++it; 1616 ++it;
1615 } 1617 }
1616*/ 1618*/
1617 if (mEditorDialog) 1619 if (mEditorDialog)
1618 { 1620 {
1619 if (mEditorDialog->dirty()) 1621 if (mEditorDialog->dirty())
1620 { 1622 {
1621 QString text = i18n( "Data has been changed externally. Unsaved " 1623 QString text = i18n( "Data has been changed externally. Unsaved "
1622 "changes will be lost." ); 1624 "changes will be lost." );
1623 KMessageBox::information( this, text ); 1625 KMessageBox::information( this, text );
1624 } 1626 }
1625 QString currentuid = mEditorDialog->addressee().uid(); 1627 QString currentuid = mEditorDialog->addressee().uid();
1626 mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); 1628 mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) );
1627 } 1629 }
1628 mViewManager->refreshView(); 1630 mViewManager->refreshView();
1629// mDetails->refreshView(); 1631// mDetails->refreshView();
1630 1632
1631 1633
1632} 1634}
1633 1635
1634AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, 1636AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
1635 const char *name ) 1637 const char *name )
1636{ 1638{
1637 1639
1638 if ( mEditorDialog == 0 ) { 1640 if ( mEditorDialog == 0 ) {
1639 mEditorDialog = new AddresseeEditorDialog( this, parent, 1641 mEditorDialog = new AddresseeEditorDialog( this, parent,
1640 name ? name : "editorDialog" ); 1642 name ? name : "editorDialog" );
1641 1643
1642 1644
1643 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ), 1645 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ),
1644 SLOT( contactModified( const KABC::Addressee& ) ) ); 1646 SLOT( contactModified( const KABC::Addressee& ) ) );
1645 //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), 1647 //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ),
1646 // SLOT( slotEditorDestroyed( const QString& ) ) ; 1648 // SLOT( slotEditorDestroyed( const QString& ) ) ;
1647 } 1649 }
1648 1650
1649 return mEditorDialog; 1651 return mEditorDialog;
1650} 1652}
1651 1653
1652void KABCore::slotEditorDestroyed( const QString &uid ) 1654void KABCore::slotEditorDestroyed( const QString &uid )
1653{ 1655{
1654 //mEditorDict.remove( uid ); 1656 //mEditorDict.remove( uid );
1655} 1657}
1656 1658
1657void KABCore::initGUI() 1659void KABCore::initGUI()
1658{ 1660{
1659#ifndef KAB_EMBEDDED 1661#ifndef KAB_EMBEDDED
1660 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1662 QHBoxLayout *topLayout = new QHBoxLayout( this );
1661 topLayout->setSpacing( KDialogBase::spacingHint() ); 1663 topLayout->setSpacing( KDialogBase::spacingHint() );
1662 1664
1663 mExtensionBarSplitter = new QSplitter( this ); 1665 mExtensionBarSplitter = new QSplitter( this );
1664 mExtensionBarSplitter->setOrientation( Qt::Vertical ); 1666 mExtensionBarSplitter->setOrientation( Qt::Vertical );
1665 1667
1666 mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); 1668 mDetailsSplitter = new QSplitter( mExtensionBarSplitter );
1667 1669
1668 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1670 QVBox *viewSpace = new QVBox( mDetailsSplitter );
1669 mIncSearchWidget = new IncSearchWidget( viewSpace ); 1671 mIncSearchWidget = new IncSearchWidget( viewSpace );
1670 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1672 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1671 SLOT( incrementalSearch( const QString& ) ) ); 1673 SLOT( incrementalSearch( const QString& ) ) );
1672 1674
1673 mViewManager = new ViewManager( this, viewSpace ); 1675 mViewManager = new ViewManager( this, viewSpace );
1674 viewSpace->setStretchFactor( mViewManager, 1 ); 1676 viewSpace->setStretchFactor( mViewManager, 1 );
1675 1677
1676 mDetails = new ViewContainer( mDetailsSplitter ); 1678 mDetails = new ViewContainer( mDetailsSplitter );
1677 1679
1678 mJumpButtonBar = new JumpButtonBar( this, this ); 1680 mJumpButtonBar = new JumpButtonBar( this, this );
1679 1681
1680 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1682 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1681 1683
1682 topLayout->addWidget( mExtensionBarSplitter ); 1684 topLayout->addWidget( mExtensionBarSplitter );
1683 topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); 1685 topLayout->setStretchFactor( mExtensionBarSplitter, 100 );
1684 topLayout->addWidget( mJumpButtonBar ); 1686 topLayout->addWidget( mJumpButtonBar );
1685 topLayout->setStretchFactor( mJumpButtonBar, 1 ); 1687 topLayout->setStretchFactor( mJumpButtonBar, 1 );
1686 1688
1687 mXXPortManager = new XXPortManager( this, this ); 1689 mXXPortManager = new XXPortManager( this, this );
1688 1690
1689#else //KAB_EMBEDDED 1691#else //KAB_EMBEDDED
1690 //US initialize viewMenu before settingup viewmanager. 1692 //US initialize viewMenu before settingup viewmanager.
1691 // Viewmanager needs this menu to plugin submenues. 1693 // Viewmanager needs this menu to plugin submenues.
1692 viewMenu = new QPopupMenu( this ); 1694 viewMenu = new QPopupMenu( this );
1693 settingsMenu = new QPopupMenu( this ); 1695 settingsMenu = new QPopupMenu( this );
1694 //filterMenu = new QPopupMenu( this ); 1696 //filterMenu = new QPopupMenu( this );
1695 ImportMenu = new QPopupMenu( this ); 1697 ImportMenu = new QPopupMenu( this );
1696 ExportMenu = new QPopupMenu( this ); 1698 ExportMenu = new QPopupMenu( this );
1697 syncMenu = new QPopupMenu( this ); 1699 syncMenu = new QPopupMenu( this );
1698 changeMenu= new QPopupMenu( this ); 1700 changeMenu= new QPopupMenu( this );
1701 beamMenu= new QPopupMenu( this );
1699 1702
1700//US since we have no splitter for the embedded system, setup 1703//US since we have no splitter for the embedded system, setup
1701// a layout with two frames. One left and one right. 1704// a layout with two frames. One left and one right.
1702 1705
1703 QBoxLayout *topLayout; 1706 QBoxLayout *topLayout;
1704 1707
1705 // = new QHBoxLayout( this ); 1708 // = new QHBoxLayout( this );
1706// QBoxLayout *topLayout = (QBoxLayout*)layout(); 1709// QBoxLayout *topLayout = (QBoxLayout*)layout();
1707 1710
1708// QWidget *mainBox = new QWidget( this ); 1711// QWidget *mainBox = new QWidget( this );
1709// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); 1712// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox);
1710 1713
1711#ifdef DESKTOP_VERSION 1714#ifdef DESKTOP_VERSION
1712 topLayout = new QHBoxLayout( this ); 1715 topLayout = new QHBoxLayout( this );
1713 1716
1714 1717
1715 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1718 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1716 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1719 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1717 1720
1718 topLayout->addWidget(mMiniSplitter ); 1721 topLayout->addWidget(mMiniSplitter );
1719 1722
1720 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); 1723 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter );
1721 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1724 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1722 mViewManager = new ViewManager( this, mExtensionBarSplitter ); 1725 mViewManager = new ViewManager( this, mExtensionBarSplitter );
1723 mDetails = new ViewContainer( mMiniSplitter ); 1726 mDetails = new ViewContainer( mMiniSplitter );
1724 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1727 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1725#else 1728#else
1726 if ( QApplication::desktop()->width() > 480 ) { 1729 if ( QApplication::desktop()->width() > 480 ) {
1727 topLayout = new QHBoxLayout( this ); 1730 topLayout = new QHBoxLayout( this );
1728 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1731 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1729 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1732 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1730 } else { 1733 } else {
1731 1734
1732 topLayout = new QHBoxLayout( this ); 1735 topLayout = new QHBoxLayout( this );
1733 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); 1736 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this);
1734 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1737 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1735 } 1738 }
1736 1739
1737 topLayout->addWidget(mMiniSplitter ); 1740 topLayout->addWidget(mMiniSplitter );
1738 mViewManager = new ViewManager( this, mMiniSplitter ); 1741 mViewManager = new ViewManager( this, mMiniSplitter );
1739 mDetails = new ViewContainer( mMiniSplitter ); 1742 mDetails = new ViewContainer( mMiniSplitter );
1740 1743
1741 1744
1742 mExtensionManager = new ExtensionManager( this, mMiniSplitter ); 1745 mExtensionManager = new ExtensionManager( this, mMiniSplitter );
1743#endif 1746#endif
1744 //eh->hide(); 1747 //eh->hide();
1745 // topLayout->addWidget(mExtensionManager ); 1748 // topLayout->addWidget(mExtensionManager );
1746 1749
1747 1750
1748/*US 1751/*US
1749#ifndef KAB_NOSPLITTER 1752#ifndef KAB_NOSPLITTER
1750 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1753 QHBoxLayout *topLayout = new QHBoxLayout( this );
1751//US topLayout->setSpacing( KDialogBase::spacingHint() ); 1754//US topLayout->setSpacing( KDialogBase::spacingHint() );
1752 topLayout->setSpacing( 10 ); 1755 topLayout->setSpacing( 10 );
1753 1756
1754 mDetailsSplitter = new QSplitter( this ); 1757 mDetailsSplitter = new QSplitter( this );
1755 1758
1756 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1759 QVBox *viewSpace = new QVBox( mDetailsSplitter );
1757 1760
1758 mViewManager = new ViewManager( this, viewSpace ); 1761 mViewManager = new ViewManager( this, viewSpace );
1759 viewSpace->setStretchFactor( mViewManager, 1 ); 1762 viewSpace->setStretchFactor( mViewManager, 1 );
1760 1763
1761 mDetails = new ViewContainer( mDetailsSplitter ); 1764 mDetails = new ViewContainer( mDetailsSplitter );
1762 1765
1763 topLayout->addWidget( mDetailsSplitter ); 1766 topLayout->addWidget( mDetailsSplitter );
1764 topLayout->setStretchFactor( mDetailsSplitter, 100 ); 1767 topLayout->setStretchFactor( mDetailsSplitter, 100 );
1765#else //KAB_NOSPLITTER 1768#else //KAB_NOSPLITTER
1766 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1769 QHBoxLayout *topLayout = new QHBoxLayout( this );
1767//US topLayout->setSpacing( KDialogBase::spacingHint() ); 1770//US topLayout->setSpacing( KDialogBase::spacingHint() );
1768 topLayout->setSpacing( 10 ); 1771 topLayout->setSpacing( 10 );
1769 1772
1770// mDetailsSplitter = new QSplitter( this ); 1773// mDetailsSplitter = new QSplitter( this );
1771 1774
1772 QVBox *viewSpace = new QVBox( this ); 1775 QVBox *viewSpace = new QVBox( this );
1773 1776
1774 mViewManager = new ViewManager( this, viewSpace ); 1777 mViewManager = new ViewManager( this, viewSpace );
1775 viewSpace->setStretchFactor( mViewManager, 1 ); 1778 viewSpace->setStretchFactor( mViewManager, 1 );
1776 1779
1777 mDetails = new ViewContainer( this ); 1780 mDetails = new ViewContainer( this );
1778 1781
1779 topLayout->addWidget( viewSpace ); 1782 topLayout->addWidget( viewSpace );
1780// topLayout->setStretchFactor( mDetailsSplitter, 100 ); 1783// topLayout->setStretchFactor( mDetailsSplitter, 100 );
1781 topLayout->addWidget( mDetails ); 1784 topLayout->addWidget( mDetails );
1782#endif //KAB_NOSPLITTER 1785#endif //KAB_NOSPLITTER
1783*/ 1786*/
1784 1787
1785 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 1788 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
1786 syncManager->setBlockSave(false); 1789 syncManager->setBlockSave(false);
1787 1790
1788 connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 1791 connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
1789 connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 1792 connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
1790 syncManager->setDefaultFileName( sentSyncFile()); 1793 syncManager->setDefaultFileName( sentSyncFile());
1791 //connect(syncManager , SIGNAL( ), this, SLOT( ) ); 1794 //connect(syncManager , SIGNAL( ), this, SLOT( ) );
1792 1795
1793#endif //KAB_EMBEDDED 1796#endif //KAB_EMBEDDED
1794 initActions(); 1797 initActions();
1795 1798
1796#ifdef KAB_EMBEDDED 1799#ifdef KAB_EMBEDDED
1797 addActionsManually(); 1800 addActionsManually();
1798 //US make sure the export and import menues are initialized before creating the xxPortManager. 1801 //US make sure the export and import menues are initialized before creating the xxPortManager.
1799 mXXPortManager = new XXPortManager( this, this ); 1802 mXXPortManager = new XXPortManager( this, this );
1800 1803
1801 // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() ); 1804 // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() );
1802 //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget); 1805 //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget);
1803 // mActionQuit->plug ( mMainWindow->toolBar()); 1806 // mActionQuit->plug ( mMainWindow->toolBar());
1804 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() ); 1807 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() );
1805 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget); 1808 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget);
1806 // mIncSearchWidget->hide(); 1809 // mIncSearchWidget->hide();
1807 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1810 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1808 SLOT( incrementalSearch( const QString& ) ) ); 1811 SLOT( incrementalSearch( const QString& ) ) );
1809 connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) ); 1812 connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) );
1810 connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) ); 1813 connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) );
1811 1814
1812 mJumpButtonBar = new JumpButtonBar( this, this ); 1815 mJumpButtonBar = new JumpButtonBar( this, this );
1813 1816
1814 topLayout->addWidget( mJumpButtonBar ); 1817 topLayout->addWidget( mJumpButtonBar );
1815//US topLayout->setStretchFactor( mJumpButtonBar, 10 ); 1818//US topLayout->setStretchFactor( mJumpButtonBar, 10 );
1816 1819
1817// mMainWindow->getIconToolBar()->raise(); 1820// mMainWindow->getIconToolBar()->raise();
1818 1821
1819#endif //KAB_EMBEDDED 1822#endif //KAB_EMBEDDED
1820 1823
1821} 1824}
1822void KABCore::initActions() 1825void KABCore::initActions()
1823{ 1826{
1824//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 1827//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
1825 1828
1826#ifndef KAB_EMBEDDED 1829#ifndef KAB_EMBEDDED
1827 connect( QApplication::clipboard(), SIGNAL( dataChanged() ), 1830 connect( QApplication::clipboard(), SIGNAL( dataChanged() ),
1828 SLOT( clipboardDataChanged() ) ); 1831 SLOT( clipboardDataChanged() ) );
1829#endif //KAB_EMBEDDED 1832#endif //KAB_EMBEDDED
1830 1833
1831 // file menu 1834 // file menu
1832 if ( mIsPart ) { 1835 if ( mIsPart ) {
1833 mActionMail = new KAction( i18n( "&Mail" ), "mail_generic", 0, this, 1836 mActionMail = new KAction( i18n( "&Mail" ), "mail_generic", 0, this,
1834 SLOT( sendMail() ), actionCollection(), 1837 SLOT( sendMail() ), actionCollection(),
1835 "kaddressbook_mail" ); 1838 "kaddressbook_mail" );
1836 mActionPrint = new KAction( i18n( "&Print" ), "fileprint", CTRL + Key_P, this, 1839 mActionPrint = new KAction( i18n( "&Print" ), "fileprint", CTRL + Key_P, this,
1837 SLOT( print() ), actionCollection(), "kaddressbook_print" ); 1840 SLOT( print() ), actionCollection(), "kaddressbook_print" );
1838 1841
1839 } else { 1842 } else {
1840 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); 1843 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() );
1841 mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); 1844 mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() );
1842 } 1845 }
1843 1846
1844 1847
1845 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, 1848 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this,
1846 SLOT( save() ), actionCollection(), "file_sync" ); 1849 SLOT( save() ), actionCollection(), "file_sync" );
1847 1850
1848 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, 1851 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this,
1849 SLOT( newContact() ), actionCollection(), "file_new_contact" ); 1852 SLOT( newContact() ), actionCollection(), "file_new_contact" );
1850 1853
1851 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, 1854 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0,
1852 this, SLOT( mailVCard() ), 1855 this, SLOT( mailVCard() ),
1853 actionCollection(), "file_mail_vcard"); 1856 actionCollection(), "file_mail_vcard");
1854 1857
1855 mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this, 1858 mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this,
1856 SLOT( export2phone() ), actionCollection(), 1859 SLOT( export2phone() ), actionCollection(),
1857 "kaddressbook_ex2phone" ); 1860 "kaddressbook_ex2phone" );
1858 1861
1859 mActionBeamVCard = 0; 1862 mActionBeamVCard = 0;
1860 mActionBeam = 0; 1863 mActionBeam = 0;
1861 1864
1862#ifndef DESKTOP_VERSION 1865#ifndef DESKTOP_VERSION
1863 if ( Ir::supported() ) { 1866 if ( Ir::supported() ) {
1864 mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, 1867 mActionBeamVCard = new KAction( i18n( "Beam v&Card(s)..." ), "beam", 0, this,
1865 SLOT( beamVCard() ), actionCollection(), 1868 SLOT( beamVCard() ), actionCollection(),
1866 "kaddressbook_beam_vcard" ); 1869 "kaddressbook_beam_vcard" );
1867 1870
1868 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, 1871 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this,
1869 SLOT( beamMySelf() ), actionCollection(), 1872 SLOT( beamMySelf() ), actionCollection(),
1870 "kaddressbook_beam_myself" ); 1873 "kaddressbook_beam_myself" );
1871 } 1874 }
1872#endif 1875#endif
1873 1876
1874 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, 1877 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0,
1875 this, SLOT( editContact2() ), 1878 this, SLOT( editContact2() ),
1876 actionCollection(), "file_properties" ); 1879 actionCollection(), "file_properties" );
1877 1880
1878#ifdef KAB_EMBEDDED 1881#ifdef KAB_EMBEDDED
1879 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); 1882 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() );
1880 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, 1883 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0,
1881 mMainWindow, SLOT( exit() ), 1884 mMainWindow, SLOT( exit() ),
1882 actionCollection(), "quit" ); 1885 actionCollection(), "quit" );
1883#endif //KAB_EMBEDDED 1886#endif //KAB_EMBEDDED
1884 1887
1885 // edit menu 1888 // edit menu
1886 if ( mIsPart ) { 1889 if ( mIsPart ) {
1887 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, 1890 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this,
1888 SLOT( copyContacts() ), actionCollection(), 1891 SLOT( copyContacts() ), actionCollection(),
1889 "kaddressbook_copy" ); 1892 "kaddressbook_copy" );
1890 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, 1893 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this,
1891 SLOT( cutContacts() ), actionCollection(), 1894 SLOT( cutContacts() ), actionCollection(),
1892 "kaddressbook_cut" ); 1895 "kaddressbook_cut" );
1893 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, 1896 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this,
1894 SLOT( pasteContacts() ), actionCollection(), 1897 SLOT( pasteContacts() ), actionCollection(),
1895 "kaddressbook_paste" ); 1898 "kaddressbook_paste" );
1896 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, 1899 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this,
1897 SLOT( selectAllContacts() ), actionCollection(), 1900 SLOT( selectAllContacts() ), actionCollection(),
1898 "kaddressbook_select_all" ); 1901 "kaddressbook_select_all" );
1899 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, 1902 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this,
1900 SLOT( undo() ), actionCollection(), 1903 SLOT( undo() ), actionCollection(),
1901 "kaddressbook_undo" ); 1904 "kaddressbook_undo" );
1902 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, 1905 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z,
1903 this, SLOT( redo() ), actionCollection(), 1906 this, SLOT( redo() ), actionCollection(),
1904 "kaddressbook_redo" ); 1907 "kaddressbook_redo" );
1905 } else { 1908 } else {
1906 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); 1909 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() );
1907 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); 1910 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() );
1908 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); 1911 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() );
1909 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); 1912 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() );
1910 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); 1913 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() );
1911 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); 1914 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() );
1912 } 1915 }
1913 1916
1914 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", 1917 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete",
1915 Key_Delete, this, SLOT( deleteContacts() ), 1918 Key_Delete, this, SLOT( deleteContacts() ),
1916 actionCollection(), "edit_delete" ); 1919 actionCollection(), "edit_delete" );
1917 1920
1918 mActionUndo->setEnabled( false ); 1921 mActionUndo->setEnabled( false );
1919 mActionRedo->setEnabled( false ); 1922 mActionRedo->setEnabled( false );
1920 1923
1921 // settings menu 1924 // settings menu
1922#ifdef KAB_EMBEDDED 1925#ifdef KAB_EMBEDDED
1923//US special menuentry to configure the addressbook resources. On KDE 1926//US special menuentry to configure the addressbook resources. On KDE
1924// you do that through the control center !!! 1927// you do that through the control center !!!
1925 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, 1928 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this,
1926 SLOT( configureResources() ), actionCollection(), 1929 SLOT( configureResources() ), actionCollection(),
1927 "kaddressbook_configure_resources" ); 1930 "kaddressbook_configure_resources" );
1928#endif //KAB_EMBEDDED 1931#endif //KAB_EMBEDDED
1929 1932
1930 if ( mIsPart ) { 1933 if ( mIsPart ) {
1931 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, 1934 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this,
1932 SLOT( openConfigDialog() ), actionCollection(), 1935 SLOT( openConfigDialog() ), actionCollection(),
1933 "kaddressbook_configure" ); 1936 "kaddressbook_configure" );
1934 1937
1935 //US not implemented yet 1938 //US not implemented yet
1936 //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, 1939 //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0,
1937 // this, SLOT( configureKeyBindings() ), actionCollection(), 1940 // this, SLOT( configureKeyBindings() ), actionCollection(),
1938 // "kaddressbook_configure_shortcuts" ); 1941 // "kaddressbook_configure_shortcuts" );
1939#ifdef KAB_EMBEDDED 1942#ifdef KAB_EMBEDDED
1940 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); 1943 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() );
1941 mActionConfigureToolbars->setEnabled( false ); 1944 mActionConfigureToolbars->setEnabled( false );
1942#endif //KAB_EMBEDDED 1945#endif //KAB_EMBEDDED
1943 1946
1944 } else { 1947 } else {
1945 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); 1948 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() );
1946 1949
1947 //US not implemented yet 1950 //US not implemented yet
1948 //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); 1951 //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() );
1949 } 1952 }
1950 1953
1951 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, 1954 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0,
1952 actionCollection(), "options_show_jump_bar" ); 1955 actionCollection(), "options_show_jump_bar" );
1953 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); 1956 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) );
1954 1957
1955 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, 1958 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0,
1956 actionCollection(), "options_show_details" ); 1959 actionCollection(), "options_show_details" );
1957 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); 1960 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) );
1958 1961
1959 1962
1960 mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, 1963 mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this,
@@ -2010,241 +2013,245 @@ void KABCore::initActions()
2010 this, SLOT( whatsnew() ), actionCollection(), 2013 this, SLOT( whatsnew() ), actionCollection(),
2011 "wn" ); 2014 "wn" );
2012 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, 2015 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0,
2013 this, SLOT( synchowto() ), actionCollection(), 2016 this, SLOT( synchowto() ), actionCollection(),
2014 "sync" ); 2017 "sync" );
2015 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, 2018 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0,
2016 this, SLOT( kdesynchowto() ), actionCollection(), 2019 this, SLOT( kdesynchowto() ), actionCollection(),
2017 "kdesync" ); 2020 "kdesync" );
2018 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, 2021 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0,
2019 this, SLOT( multisynchowto() ), actionCollection(), 2022 this, SLOT( multisynchowto() ), actionCollection(),
2020 "multisync" ); 2023 "multisync" );
2021 2024
2022 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, 2025 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0,
2023 this, SLOT( createAboutData() ), actionCollection(), 2026 this, SLOT( createAboutData() ), actionCollection(),
2024 "kaddressbook_about_data" ); 2027 "kaddressbook_about_data" );
2025#endif //KAB_EMBEDDED 2028#endif //KAB_EMBEDDED
2026 2029
2027 clipboardDataChanged(); 2030 clipboardDataChanged();
2028 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2031 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2029 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2032 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2030} 2033}
2031 2034
2032//US we need this function, to plug all actions into the correct menues. 2035//US we need this function, to plug all actions into the correct menues.
2033// KDE uses a XML format to plug the actions, but we work her without this overhead. 2036// KDE uses a XML format to plug the actions, but we work her without this overhead.
2034void KABCore::addActionsManually() 2037void KABCore::addActionsManually()
2035{ 2038{
2036//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 2039//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
2037 2040
2038#ifdef KAB_EMBEDDED 2041#ifdef KAB_EMBEDDED
2039 QPopupMenu *fileMenu = new QPopupMenu( this ); 2042 QPopupMenu *fileMenu = new QPopupMenu( this );
2040 QPopupMenu *editMenu = new QPopupMenu( this ); 2043 QPopupMenu *editMenu = new QPopupMenu( this );
2041 QPopupMenu *helpMenu = new QPopupMenu( this ); 2044 QPopupMenu *helpMenu = new QPopupMenu( this );
2042 2045
2043 KToolBar* tb = mMainWindow->toolBar(); 2046 KToolBar* tb = mMainWindow->toolBar();
2044 2047
2045#ifndef DESKTOP_VERSION 2048#ifndef DESKTOP_VERSION
2046 if ( KABPrefs::instance()->mFullMenuBarVisible ) { 2049 if ( KABPrefs::instance()->mFullMenuBarVisible ) {
2047#endif 2050#endif
2048 QMenuBar* mb = mMainWindow->menuBar(); 2051 QMenuBar* mb = mMainWindow->menuBar();
2049 2052
2050 //US setup menubar. 2053 //US setup menubar.
2051 //Disable the following block if you do not want to have a menubar. 2054 //Disable the following block if you do not want to have a menubar.
2052 mb->insertItem( i18n("&File"), fileMenu ); 2055 mb->insertItem( i18n("&File"), fileMenu );
2053 mb->insertItem( i18n("&Edit"), editMenu ); 2056 mb->insertItem( i18n("&Edit"), editMenu );
2054 mb->insertItem( i18n("&View"), viewMenu ); 2057 mb->insertItem( i18n("&View"), viewMenu );
2055 mb->insertItem( i18n("&Settings"), settingsMenu ); 2058 mb->insertItem( i18n("&Settings"), settingsMenu );
2056 mb->insertItem( i18n("Synchronize"), syncMenu ); 2059 mb->insertItem( i18n("Synchronize"), syncMenu );
2057 //mb->insertItem( i18n("&Change"), changeMenu ); 2060 //mb->insertItem( i18n("&Change"), changeMenu );
2058 mb->insertItem( i18n("&Help"), helpMenu ); 2061 mb->insertItem( i18n("&Help"), helpMenu );
2059 mIncSearchWidget = new IncSearchWidget( tb ); 2062 mIncSearchWidget = new IncSearchWidget( tb );
2060 // tb->insertWidget(-1, 0, mIncSearchWidget); 2063 // tb->insertWidget(-1, 0, mIncSearchWidget);
2061#ifndef DESKTOP_VERSION 2064#ifndef DESKTOP_VERSION
2062 } else { 2065 } else {
2063 //US setup toolbar 2066 //US setup toolbar
2064 QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); 2067 QPEMenuBar *menuBarTB = new QPEMenuBar( tb );
2065 QPopupMenu *popupBarTB = new QPopupMenu( this ); 2068 QPopupMenu *popupBarTB = new QPopupMenu( this );
2066 menuBarTB->insertItem( "ME", popupBarTB); 2069 menuBarTB->insertItem( "ME", popupBarTB);
2067 tb->insertWidget(-1, 0, menuBarTB); 2070 tb->insertWidget(-1, 0, menuBarTB);
2068 mIncSearchWidget = new IncSearchWidget( tb ); 2071 mIncSearchWidget = new IncSearchWidget( tb );
2069 2072
2070 tb->enableMoving(false); 2073 tb->enableMoving(false);
2071 popupBarTB->insertItem( i18n("&File"), fileMenu ); 2074 popupBarTB->insertItem( i18n("&File"), fileMenu );
2072 popupBarTB->insertItem( i18n("&Edit"), editMenu ); 2075 popupBarTB->insertItem( i18n("&Edit"), editMenu );
2073 popupBarTB->insertItem( i18n("&View"), viewMenu ); 2076 popupBarTB->insertItem( i18n("&View"), viewMenu );
2074 popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); 2077 popupBarTB->insertItem( i18n("&Settings"), settingsMenu );
2075 popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); 2078 popupBarTB->insertItem( i18n("Synchronize"), syncMenu );
2076 mViewManager->getFilterAction()->plug ( popupBarTB); 2079 mViewManager->getFilterAction()->plug ( popupBarTB);
2077 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu ); 2080 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu );
2078 popupBarTB->insertItem( i18n("&Help"), helpMenu ); 2081 popupBarTB->insertItem( i18n("&Help"), helpMenu );
2079 if (QApplication::desktop()->width() > 320 ) { 2082 if (QApplication::desktop()->width() > 320 ) {
2080 // mViewManager->getFilterAction()->plug ( tb); 2083 // mViewManager->getFilterAction()->plug ( tb);
2081 } 2084 }
2082 } 2085 }
2083#endif 2086#endif
2084 // mActionQuit->plug ( mMainWindow->toolBar()); 2087 // mActionQuit->plug ( mMainWindow->toolBar());
2085 2088
2086 2089
2087 2090
2088 //US Now connect the actions with the menue entries. 2091 //US Now connect the actions with the menue entries.
2089 mActionPrint->plug( fileMenu ); 2092 mActionPrint->plug( fileMenu );
2090 mActionMail->plug( fileMenu ); 2093 mActionMail->plug( fileMenu );
2091 fileMenu->insertSeparator(); 2094 fileMenu->insertSeparator();
2092 2095
2093 mActionNewContact->plug( fileMenu ); 2096 mActionNewContact->plug( fileMenu );
2094 mActionNewContact->plug( tb ); 2097 mActionNewContact->plug( tb );
2095 2098
2096 mActionEditAddressee->plug( fileMenu ); 2099 mActionEditAddressee->plug( fileMenu );
2097 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || 2100 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
2098 // (!KABPrefs::instance()->mMultipleViewsAtOnce )) 2101 // (!KABPrefs::instance()->mMultipleViewsAtOnce ))
2099 mActionEditAddressee->plug( tb ); 2102 mActionEditAddressee->plug( tb );
2100 2103
2101 fileMenu->insertSeparator(); 2104 fileMenu->insertSeparator();
2102 mActionSave->plug( fileMenu ); 2105 mActionSave->plug( fileMenu );
2103 fileMenu->insertItem( "&Import", ImportMenu ); 2106 fileMenu->insertItem( "&Import", ImportMenu );
2104 fileMenu->insertItem( "&Export", ExportMenu ); 2107 fileMenu->insertItem( "&Export", ExportMenu );
2105 fileMenu->insertItem( i18n("&Change"), changeMenu ); 2108 fileMenu->insertItem( i18n("&Change"), changeMenu );
2109 fileMenu->insertItem( i18n("&Beam"), beamMenu );
2106 fileMenu->insertSeparator(); 2110 fileMenu->insertSeparator();
2107 mActionMailVCard->plug( fileMenu ); 2111 mActionMailVCard->plug( fileMenu );
2108#ifndef DESKTOP_VERSION 2112#ifndef DESKTOP_VERSION
2109 if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); 2113 if ( Ir::supported() ) mActionBR->plug( beamMenu );
2110 if ( Ir::supported() ) mActionBeam->plug(fileMenu ); 2114 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu );
2115 if ( Ir::supported() ) mActionBeam->plug( beamMenu );
2111#endif 2116#endif
2112 fileMenu->insertSeparator(); 2117 fileMenu->insertSeparator();
2113 mActionQuit->plug( fileMenu ); 2118 mActionQuit->plug( fileMenu );
2114#ifdef _WIN32_ 2119#ifdef _WIN32_
2115 mActionImportOL->plug( ImportMenu ); 2120 mActionImportOL->plug( ImportMenu );
2116#endif 2121#endif
2117 // edit menu 2122 // edit menu
2118 mActionUndo->plug( editMenu ); 2123 mActionUndo->plug( editMenu );
2119 mActionRedo->plug( editMenu ); 2124 mActionRedo->plug( editMenu );
2120 editMenu->insertSeparator(); 2125 editMenu->insertSeparator();
2121 mActionCut->plug( editMenu ); 2126 mActionCut->plug( editMenu );
2122 mActionCopy->plug( editMenu ); 2127 mActionCopy->plug( editMenu );
2123 mActionPaste->plug( editMenu ); 2128 mActionPaste->plug( editMenu );
2124 mActionDelete->plug( editMenu ); 2129 mActionDelete->plug( editMenu );
2125 editMenu->insertSeparator(); 2130 editMenu->insertSeparator();
2126 mActionSelectAll->plug( editMenu ); 2131 mActionSelectAll->plug( editMenu );
2127 2132
2128 mActionRemoveVoice->plug( changeMenu ); 2133 mActionRemoveVoice->plug( changeMenu );
2129 // settings menu 2134 // settings menu
2130//US special menuentry to configure the addressbook resources. On KDE 2135//US special menuentry to configure the addressbook resources. On KDE
2131// you do that through the control center !!! 2136// you do that through the control center !!!
2132 mActionConfigResources->plug( settingsMenu ); 2137 mActionConfigResources->plug( settingsMenu );
2133 settingsMenu->insertSeparator(); 2138 settingsMenu->insertSeparator();
2134 2139
2135 mActionConfigKAddressbook->plug( settingsMenu ); 2140 mActionConfigKAddressbook->plug( settingsMenu );
2136 2141
2137 if ( mIsPart ) { 2142 if ( mIsPart ) {
2138 //US not implemented yet 2143 //US not implemented yet
2139 //mActionConfigShortcuts->plug( settingsMenu ); 2144 //mActionConfigShortcuts->plug( settingsMenu );
2140 //mActionConfigureToolbars->plug( settingsMenu ); 2145 //mActionConfigureToolbars->plug( settingsMenu );
2141 2146
2142 } else { 2147 } else {
2143 //US not implemented yet 2148 //US not implemented yet
2144 //mActionKeyBindings->plug( settingsMenu ); 2149 //mActionKeyBindings->plug( settingsMenu );
2145 } 2150 }
2146 2151
2147 settingsMenu->insertSeparator(); 2152 settingsMenu->insertSeparator();
2148 2153
2149 mActionJumpBar->plug( settingsMenu ); 2154 mActionJumpBar->plug( settingsMenu );
2150 mActionDetails->plug( settingsMenu ); 2155 mActionDetails->plug( settingsMenu );
2151 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) 2156 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop )
2152 mActionDetails->plug( tb ); 2157 mActionDetails->plug( tb );
2153 settingsMenu->insertSeparator(); 2158 settingsMenu->insertSeparator();
2154 mActionBR->plug(settingsMenu ); 2159#ifndef DESKTOP_VERSION
2160 if ( Ir::supported() ) mActionBR->plug(settingsMenu );
2161#endif
2155 settingsMenu->insertSeparator(); 2162 settingsMenu->insertSeparator();
2156 2163
2157 mActionWhoAmI->plug( settingsMenu ); 2164 mActionWhoAmI->plug( settingsMenu );
2158 mActionEditCategories->plug( settingsMenu ); 2165 mActionEditCategories->plug( settingsMenu );
2159 mActionEditCategories->plug( changeMenu ); 2166 mActionEditCategories->plug( changeMenu );
2160 mActionCategories->plug( changeMenu ); 2167 mActionCategories->plug( changeMenu );
2161 mActionManageCategories->plug( changeMenu ); 2168 mActionManageCategories->plug( changeMenu );
2162 2169
2163 mActionCategories->plug( settingsMenu ); 2170 mActionCategories->plug( settingsMenu );
2164 mActionManageCategories->plug( settingsMenu ); 2171 mActionManageCategories->plug( settingsMenu );
2165 2172
2166 2173
2167 mActionWN->plug( helpMenu ); 2174 mActionWN->plug( helpMenu );
2168 mActionSyncHowto->plug( helpMenu ); 2175 mActionSyncHowto->plug( helpMenu );
2169 mActionKdeSyncHowto->plug( helpMenu ); 2176 mActionKdeSyncHowto->plug( helpMenu );
2170 mActionMultiSyncHowto->plug( helpMenu ); 2177 mActionMultiSyncHowto->plug( helpMenu );
2171 mActionFaq->plug( helpMenu ); 2178 mActionFaq->plug( helpMenu );
2172 mActionLicence->plug( helpMenu ); 2179 mActionLicence->plug( helpMenu );
2173 mActionAboutKAddressbook->plug( helpMenu ); 2180 mActionAboutKAddressbook->plug( helpMenu );
2174 2181
2175 if (KGlobal::getDesktopSize() > KGlobal::Small ) { 2182 if (KGlobal::getDesktopSize() > KGlobal::Small ) {
2176 2183
2177 mActionSave->plug( tb ); 2184 mActionSave->plug( tb );
2178 mViewManager->getFilterAction()->plug ( tb); 2185 mViewManager->getFilterAction()->plug ( tb);
2179 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { 2186 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) {
2180 mActionUndo->plug( tb ); 2187 mActionUndo->plug( tb );
2181 mActionDelete->plug( tb ); 2188 mActionDelete->plug( tb );
2182 mActionRedo->plug( tb ); 2189 mActionRedo->plug( tb );
2183 } 2190 }
2184 } else { 2191 } else {
2185 mActionSave->plug( tb ); 2192 mActionSave->plug( tb );
2186 tb->enableMoving(false); 2193 tb->enableMoving(false);
2187 } 2194 }
2188 //mActionQuit->plug ( tb ); 2195 //mActionQuit->plug ( tb );
2189 // tb->insertWidget(-1, 0, mIncSearchWidget, 6); 2196 // tb->insertWidget(-1, 0, mIncSearchWidget, 6);
2190 2197
2191 //US link the searchwidget first to this. 2198 //US link the searchwidget first to this.
2192 // The real linkage to the toolbar happens later. 2199 // The real linkage to the toolbar happens later.
2193//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 2200//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
2194//US tb->insertItem( mIncSearchWidget ); 2201//US tb->insertItem( mIncSearchWidget );
2195/*US 2202/*US
2196 mIncSearchWidget = new IncSearchWidget( tb ); 2203 mIncSearchWidget = new IncSearchWidget( tb );
2197 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 2204 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
2198 SLOT( incrementalSearch( const QString& ) ) ); 2205 SLOT( incrementalSearch( const QString& ) ) );
2199 2206
2200 mJumpButtonBar = new JumpButtonBar( this, this ); 2207 mJumpButtonBar = new JumpButtonBar( this, this );
2201 2208
2202//US topLayout->addWidget( mJumpButtonBar ); 2209//US topLayout->addWidget( mJumpButtonBar );
2203 this->layout()->add( mJumpButtonBar ); 2210 this->layout()->add( mJumpButtonBar );
2204*/ 2211*/
2205 2212
2206#endif //KAB_EMBEDDED 2213#endif //KAB_EMBEDDED
2207 2214
2208 mActionExport2phone->plug( ExportMenu ); 2215 mActionExport2phone->plug( ExportMenu );
2209 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); 2216 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) );
2210 syncManager->fillSyncMenu(); 2217 syncManager->fillSyncMenu();
2211 2218
2212} 2219}
2213void KABCore::showLicence() 2220void KABCore::showLicence()
2214{ 2221{
2215 KApplication::showLicence(); 2222 KApplication::showLicence();
2216} 2223}
2217 2224
2218void KABCore::manageCategories( ) 2225void KABCore::manageCategories( )
2219{ 2226{
2220 KABCatPrefs* cp = new KABCatPrefs(); 2227 KABCatPrefs* cp = new KABCatPrefs();
2221 cp->show(); 2228 cp->show();
2222 int w =cp->sizeHint().width() ; 2229 int w =cp->sizeHint().width() ;
2223 int h = cp->sizeHint().height() ; 2230 int h = cp->sizeHint().height() ;
2224 int dw = QApplication::desktop()->width(); 2231 int dw = QApplication::desktop()->width();
2225 int dh = QApplication::desktop()->height(); 2232 int dh = QApplication::desktop()->height();
2226 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2233 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2227 if ( !cp->exec() ) { 2234 if ( !cp->exec() ) {
2228 delete cp; 2235 delete cp;
2229 return; 2236 return;
2230 } 2237 }
2231 int count = 0; 2238 int count = 0;
2232 message( i18n("Please wait, processing categories...")); 2239 message( i18n("Please wait, processing categories..."));
2233 if ( cp->addCat() ) { 2240 if ( cp->addCat() ) {
2234 KABC::AddressBook::Iterator it; 2241 KABC::AddressBook::Iterator it;
2235 QStringList catList = KABPrefs::instance()->mCustomCategories; 2242 QStringList catList = KABPrefs::instance()->mCustomCategories;
2236 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2243 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2237 QStringList catIncList = (*it).categories(); 2244 QStringList catIncList = (*it).categories();
2238 int i; 2245 int i;
2239 for( i = 0; i< catIncList.count(); ++i ) { 2246 for( i = 0; i< catIncList.count(); ++i ) {
2240 if ( !catList.contains (catIncList[i])) { 2247 if ( !catList.contains (catIncList[i])) {
2241 catList.append( catIncList[i] ); 2248 catList.append( catIncList[i] );
2242 //qDebug("add cat %s ", catIncList[i].latin1()); 2249 //qDebug("add cat %s ", catIncList[i].latin1());
2243 ++count; 2250 ++count;
2244 } 2251 }
2245 } 2252 }
2246 } 2253 }
2247 catList.sort(); 2254 catList.sort();
2248 KABPrefs::instance()->mCustomCategories = catList; 2255 KABPrefs::instance()->mCustomCategories = catList;
2249 KABPrefs::instance()->writeConfig(); 2256 KABPrefs::instance()->writeConfig();
2250 message(QString::number( count )+ i18n(" categories added to list! ")); 2257 message(QString::number( count )+ i18n(" categories added to list! "));
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index 88e83f0..c7c12ff 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -379,137 +379,138 @@ class KABCore : public QWidget, public KSyncInterface
379#endif //KAB_EMBEDDED 379#endif //KAB_EMBEDDED
380 380
381 void slotEditorDestroyed( const QString &uid ); 381 void slotEditorDestroyed( const QString &uid );
382 void configurationChanged(); 382 void configurationChanged();
383 void addressBookChanged(); 383 void addressBookChanged();
384 384
385 private: 385 private:
386 void resizeEvent(QResizeEvent* e ); 386 void resizeEvent(QResizeEvent* e );
387 bool mBRdisabled; 387 bool mBRdisabled;
388#ifndef DESKTOP_VERSION 388#ifndef DESKTOP_VERSION
389 QCopChannel* infrared; 389 QCopChannel* infrared;
390#endif 390#endif
391 QTimer *mMessageTimer; 391 QTimer *mMessageTimer;
392 void initGUI(); 392 void initGUI();
393 void initActions(); 393 void initActions();
394 QString getPhoneFile(); 394 QString getPhoneFile();
395 395
396 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, 396 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent,
397 const char *name = 0 ); 397 const char *name = 0 );
398 398
399 KXMLGUIClient *mGUIClient; 399 KXMLGUIClient *mGUIClient;
400 400
401 KABC::AddressBook *mAddressBook; 401 KABC::AddressBook *mAddressBook;
402 402
403 ViewManager *mViewManager; 403 ViewManager *mViewManager;
404 // QSplitter *mDetailsSplitter; 404 // QSplitter *mDetailsSplitter;
405 KDGanttMinimizeSplitter *mExtensionBarSplitter; 405 KDGanttMinimizeSplitter *mExtensionBarSplitter;
406 ViewContainer *mDetails; 406 ViewContainer *mDetails;
407 KDGanttMinimizeSplitter* mMiniSplitter; 407 KDGanttMinimizeSplitter* mMiniSplitter;
408 XXPortManager *mXXPortManager; 408 XXPortManager *mXXPortManager;
409 JumpButtonBar *mJumpButtonBar; 409 JumpButtonBar *mJumpButtonBar;
410 IncSearchWidget *mIncSearchWidget; 410 IncSearchWidget *mIncSearchWidget;
411 ExtensionManager *mExtensionManager; 411 ExtensionManager *mExtensionManager;
412 412
413 KCMultiDialog *mConfigureDialog; 413 KCMultiDialog *mConfigureDialog;
414 414
415#ifndef KAB_EMBEDDED 415#ifndef KAB_EMBEDDED
416 LDAPSearchDialog *mLdapSearchDialog; 416 LDAPSearchDialog *mLdapSearchDialog;
417#endif //KAB_EMBEDDED 417#endif //KAB_EMBEDDED
418 // QDict<AddresseeEditorDialog> mEditorDict; 418 // QDict<AddresseeEditorDialog> mEditorDict;
419 AddresseeEditorDialog *mEditorDialog; 419 AddresseeEditorDialog *mEditorDialog;
420 bool mReadWrite; 420 bool mReadWrite;
421 bool mModified; 421 bool mModified;
422 bool mIsPart; 422 bool mIsPart;
423 bool mMultipleViewsAtOnce; 423 bool mMultipleViewsAtOnce;
424 424
425 425
426 //US file menu 426 //US file menu
427 KAction *mActionMail; 427 KAction *mActionMail;
428 KAction *mActionBeam; 428 KAction *mActionBeam;
429 KToggleAction *mActionBR; 429 KToggleAction *mActionBR;
430 KAction *mActionExport2phone; 430 KAction *mActionExport2phone;
431 KAction* mActionPrint; 431 KAction* mActionPrint;
432 KAction* mActionNewContact; 432 KAction* mActionNewContact;
433 KAction *mActionSave; 433 KAction *mActionSave;
434 KAction *mActionEditAddressee; 434 KAction *mActionEditAddressee;
435 KAction *mActionMailVCard; 435 KAction *mActionMailVCard;
436 KAction *mActionBeamVCard; 436 KAction *mActionBeamVCard;
437 437
438 KAction *mActionQuit; 438 KAction *mActionQuit;
439 439
440 //US edit menu 440 //US edit menu
441 KAction *mActionCopy; 441 KAction *mActionCopy;
442 KAction *mActionCut; 442 KAction *mActionCut;
443 KAction *mActionPaste; 443 KAction *mActionPaste;
444 KAction *mActionSelectAll; 444 KAction *mActionSelectAll;
445 KAction *mActionUndo; 445 KAction *mActionUndo;
446 KAction *mActionRedo; 446 KAction *mActionRedo;
447 KAction *mActionDelete; 447 KAction *mActionDelete;
448 448
449 //US settings menu 449 //US settings menu
450 KAction *mActionConfigResources; 450 KAction *mActionConfigResources;
451 KAction *mActionConfigKAddressbook; 451 KAction *mActionConfigKAddressbook;
452 KAction *mActionConfigShortcuts; 452 KAction *mActionConfigShortcuts;
453 KAction *mActionConfigureToolbars; 453 KAction *mActionConfigureToolbars;
454 KAction *mActionKeyBindings; 454 KAction *mActionKeyBindings;
455 KToggleAction *mActionJumpBar; 455 KToggleAction *mActionJumpBar;
456 KToggleAction *mActionDetails; 456 KToggleAction *mActionDetails;
457 KAction *mActionWhoAmI; 457 KAction *mActionWhoAmI;
458 KAction *mActionCategories; 458 KAction *mActionCategories;
459 KAction *mActionEditCategories; 459 KAction *mActionEditCategories;
460 KAction *mActionManageCategories; 460 KAction *mActionManageCategories;
461 KAction *mActionAboutKAddressbook; 461 KAction *mActionAboutKAddressbook;
462 KAction *mActionLicence; 462 KAction *mActionLicence;
463 KAction *mActionFaq; 463 KAction *mActionFaq;
464 KAction *mActionWN; 464 KAction *mActionWN;
465 KAction *mActionSyncHowto; 465 KAction *mActionSyncHowto;
466 KAction *mActionKdeSyncHowto; 466 KAction *mActionKdeSyncHowto;
467 KAction *mActionMultiSyncHowto; 467 KAction *mActionMultiSyncHowto;
468 468
469 KAction *mActionDeleteView; 469 KAction *mActionDeleteView;
470 470
471 QPopupMenu *viewMenu; 471 QPopupMenu *viewMenu;
472 QPopupMenu *filterMenu; 472 QPopupMenu *filterMenu;
473 QPopupMenu *settingsMenu; 473 QPopupMenu *settingsMenu;
474 QPopupMenu *changeMenu; 474 QPopupMenu *changeMenu;
475 QPopupMenu *beamMenu;
475//US QAction *mActionSave; 476//US QAction *mActionSave;
476 QPopupMenu *ImportMenu; 477 QPopupMenu *ImportMenu;
477 QPopupMenu *ExportMenu; 478 QPopupMenu *ExportMenu;
478 //LR additional methods 479 //LR additional methods
479 KAction *mActionRemoveVoice; 480 KAction *mActionRemoveVoice;
480 KAction * mActionImportOL; 481 KAction * mActionImportOL;
481 482
482#ifndef KAB_EMBEDDED 483#ifndef KAB_EMBEDDED
483 KAddressBookService *mAddressBookService; 484 KAddressBookService *mAddressBookService;
484#endif //KAB_EMBEDDED 485#endif //KAB_EMBEDDED
485 486
486 class KABCorePrivate; 487 class KABCorePrivate;
487 KABCorePrivate *d; 488 KABCorePrivate *d;
488 //US bool mBlockSaveFlag; 489 //US bool mBlockSaveFlag;
489 490
490#ifdef KAB_EMBEDDED 491#ifdef KAB_EMBEDDED
491 KAddressBookMain *mMainWindow; // should be the same like mGUIClient 492 KAddressBookMain *mMainWindow; // should be the same like mGUIClient
492#endif //KAB_EMBEDDED 493#endif //KAB_EMBEDDED
493 494
494 //this are the overwritten callbackmethods from the syncinterface 495 //this are the overwritten callbackmethods from the syncinterface
495 virtual bool sync(KSyncManager* manager, QString filename, int mode); 496 virtual bool sync(KSyncManager* manager, QString filename, int mode);
496 virtual bool syncExternal(KSyncManager* manager, QString resource); 497 virtual bool syncExternal(KSyncManager* manager, QString resource);
497 virtual void removeSyncInfo( QString syncProfile); 498 virtual void removeSyncInfo( QString syncProfile);
498 bool syncPhone(); 499 bool syncPhone();
499 void message( QString m ); 500 void message( QString m );
500 501
501 // LR ******************************* 502 // LR *******************************
502 // sync stuff! 503 // sync stuff!
503 QString sentSyncFile(); 504 QString sentSyncFile();
504 QPopupMenu *syncMenu; 505 QPopupMenu *syncMenu;
505 KSyncManager* syncManager; 506 KSyncManager* syncManager;
506 int mGlobalSyncMode; 507 int mGlobalSyncMode;
507 bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); 508 bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode);
508 KABC::Addressee getLastSyncAddressee(); 509 KABC::Addressee getLastSyncAddressee();
509 QDateTime mLastAddressbookSync; 510 QDateTime mLastAddressbookSync;
510 int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); 511 int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full );
511 // ********************* 512 // *********************
512 513
513}; 514};
514 515
515#endif 516#endif