summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-04-08 13:58:07 (UTC)
committer zautrix <zautrix>2005-04-08 13:58:07 (UTC)
commitc0f1d38e29ee0d0a1d1dcb5bda08089923926b41 (patch) (unidiff)
treea235fdef5d4b8b519bfd8141247993ba778b39b2 /kaddressbook
parent19a95939a6469ab5469f6904f57263a792598f07 (diff)
downloadkdepimpi-c0f1d38e29ee0d0a1d1dcb5bda08089923926b41.zip
kdepimpi-c0f1d38e29ee0d0a1d1dcb5bda08089923926b41.tar.gz
kdepimpi-c0f1d38e29ee0d0a1d1dcb5bda08089923926b41.tar.bz2
fix
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp34
1 files changed, 7 insertions, 27 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index fa9f130..9c40142 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -570,173 +570,153 @@ void KABCore::saveSettings()
570 570
571 KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); 571 KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem();
572 KABPrefs::instance()->writeConfig(); 572 KABPrefs::instance()->writeConfig();
573 qDebug("KA: KABCore::saveSettings() "); 573 qDebug("KA: KABCore::saveSettings() ");
574} 574}
575 575
576KABC::AddressBook *KABCore::addressBook() const 576KABC::AddressBook *KABCore::addressBook() const
577{ 577{
578 return mAddressBook; 578 return mAddressBook;
579} 579}
580 580
581KConfig *KABCore::config() 581KConfig *KABCore::config()
582{ 582{
583#ifndef KAB_EMBEDDED 583#ifndef KAB_EMBEDDED
584 return KABPrefs::instance()->config(); 584 return KABPrefs::instance()->config();
585#else //KAB_EMBEDDED 585#else //KAB_EMBEDDED
586 return KABPrefs::instance()->getConfig(); 586 return KABPrefs::instance()->getConfig();
587#endif //KAB_EMBEDDED 587#endif //KAB_EMBEDDED
588} 588}
589 589
590KActionCollection *KABCore::actionCollection() const 590KActionCollection *KABCore::actionCollection() const
591{ 591{
592 return mGUIClient->actionCollection(); 592 return mGUIClient->actionCollection();
593} 593}
594 594
595KABC::Field *KABCore::currentSearchField() const 595KABC::Field *KABCore::currentSearchField() const
596{ 596{
597 if (mIncSearchWidget) 597 if (mIncSearchWidget)
598 return mIncSearchWidget->currentField(); 598 return mIncSearchWidget->currentField();
599 else 599 else
600 return 0; 600 return 0;
601} 601}
602 602
603QStringList KABCore::selectedUIDs() const 603QStringList KABCore::selectedUIDs() const
604{ 604{
605 return mViewManager->selectedUids(); 605 return mViewManager->selectedUids();
606} 606}
607 607
608KABC::Resource *KABCore::requestResource( QWidget *parent ) 608KABC::Resource *KABCore::requestResource( QWidget *parent )
609{ 609{
610 QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); 610 QPtrList<KABC::Resource> kabcResources = addressBook()->resources();
611 611
612 QPtrList<KRES::Resource> kresResources; 612 QPtrList<KRES::Resource> kresResources;
613 QPtrListIterator<KABC::Resource> resIt( kabcResources ); 613 QPtrListIterator<KABC::Resource> resIt( kabcResources );
614 KABC::Resource *resource; 614 KABC::Resource *resource;
615 while ( ( resource = resIt.current() ) != 0 ) { 615 while ( ( resource = resIt.current() ) != 0 ) {
616 ++resIt; 616 ++resIt;
617 if ( !resource->readOnly() ) { 617 if ( !resource->readOnly() ) {
618 KRES::Resource *res = static_cast<KRES::Resource*>( resource ); 618 KRES::Resource *res = static_cast<KRES::Resource*>( resource );
619 if ( res ) 619 if ( res )
620 kresResources.append( res ); 620 kresResources.append( res );
621 } 621 }
622 } 622 }
623 623
624 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); 624 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent );
625 return static_cast<KABC::Resource*>( res ); 625 return static_cast<KABC::Resource*>( res );
626} 626}
627 627
628#ifndef KAB_EMBEDDED 628#ifndef KAB_EMBEDDED
629KAboutData *KABCore::createAboutData() 629KAboutData *KABCore::createAboutData()
630#else //KAB_EMBEDDED 630#else //KAB_EMBEDDED
631void KABCore::createAboutData() 631void KABCore::createAboutData()
632#endif //KAB_EMBEDDED 632#endif //KAB_EMBEDDED
633{ 633{
634#ifndef KAB_EMBEDDED 634
635 KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ),
636 "3.1", I18N_NOOP( "The KDE Address Book" ),
637 KAboutData::License_GPL_V2,
638 I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) );
639 about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" );
640 about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) );
641 about->addAuthor( "Cornelius Schumacher",
642 I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ),
643 "schumacher@kde.org" );
644 about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ),
645 "mpilone@slac.com" );
646 about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) );
647 about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) );
648 about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ),
649 "michel@klaralvdalens-datakonsult.se" );
650 about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ),
651 "hansen@kde.org" );
652
653 return about;
654#endif //KAB_EMBEDDED
655 635
656 QString version; 636 QString version;
657#include <../version> 637#include <../version>
658 QMessageBox::about( this, "About KAddressbook/Pi", 638 QMessageBox::about( this, "About KAddressbook/Pi",
659 "KAddressbook/Platform-independent\n" 639 "KAddressbook/Platform-independent\n"
660 "(KA/Pi) " +version + " - " + 640 "(KA/Pi) " +version + " - " +
661#ifdef DESKTOP_VERSION 641#ifdef DESKTOP_VERSION
662 "Desktop Edition\n" 642 "Desktop Edition\n"
663#else 643#else
664 "PDA-Edition\n" 644 "PDA-Edition\n"
665 "for: Zaurus 5500 / 7x0 / 8x0\n" 645 "for: Zaurus 5500 / 7x0 / 8x0\n"
666#endif 646#endif
667 647
668 "(c) 2004 Ulf Schenk\n" 648 "(c) 2004 Ulf Schenk\n"
669 "(c) 2004 Lutz Rogowski\n" 649 "(c) 2004-2005 Lutz Rogowski\nrogowski@kde.org\n"
670 "(c) 1997-2003, The KDE PIM Team\n" 650 "(c) 1997-2003, The KDE PIM Team\n"
671 "Tobias Koenig Current maintainer\ntokoe@kde.org\n" 651 "Tobias Koenig Maintainer\n"
672 "Don Sanders Original author\n" 652 "Don Sanders Original author\n"
673 "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n" 653 "Cornelius Schumacher Co-maintainer\n"
674 "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n" 654 "Mike Pilone GUI and framework redesign\n"
675 "Greg Stern DCOP interface\n" 655 "Greg Stern DCOP interface\n"
676 "Mark Westcot Contact pinning\n" 656 "Mark Westcot Contact pinning\n"
677 "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n" 657 "Michel Boyer de la Giroday LDAP Lookup\n"
678 "Steffen Hansen LDAP Lookup\nhansen@kde.org\n" 658 "Steffen Hansen LDAP Lookup"
679#ifdef _WIN32_ 659#ifdef _WIN32_
680 "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" 660 "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n"
681#endif 661#endif
682 ); 662 );
683} 663}
684 664
685void KABCore::setContactSelected( const QString &uid ) 665void KABCore::setContactSelected( const QString &uid )
686{ 666{
687 KABC::Addressee addr = mAddressBook->findByUid( uid ); 667 KABC::Addressee addr = mAddressBook->findByUid( uid );
688 if ( !mDetails->isHidden() ) 668 if ( !mDetails->isHidden() )
689 mDetails->setAddressee( addr ); 669 mDetails->setAddressee( addr );
690 670
691 if ( !addr.isEmpty() ) { 671 if ( !addr.isEmpty() ) {
692 emit contactSelected( addr.formattedName() ); 672 emit contactSelected( addr.formattedName() );
693 KABC::Picture pic = addr.photo(); 673 KABC::Picture pic = addr.photo();
694 if ( pic.isIntern() ) { 674 if ( pic.isIntern() ) {
695//US emit contactSelected( pic.data() ); 675//US emit contactSelected( pic.data() );
696//US instead use: 676//US instead use:
697 QPixmap px; 677 QPixmap px;
698 if (pic.data().isNull() != true) 678 if (pic.data().isNull() != true)
699 { 679 {
700 px.convertFromImage(pic.data()); 680 px.convertFromImage(pic.data());
701 } 681 }
702 682
703 emit contactSelected( px ); 683 emit contactSelected( px );
704 } 684 }
705 } 685 }
706 686
707 687
708 mExtensionManager->setSelectionChanged(); 688 mExtensionManager->setSelectionChanged();
709 689
710 // update the actions 690 // update the actions
711 bool selected = !uid.isEmpty(); 691 bool selected = !uid.isEmpty();
712 692
713 if ( mReadWrite ) { 693 if ( mReadWrite ) {
714 mActionCut->setEnabled( selected ); 694 mActionCut->setEnabled( selected );
715 mActionPaste->setEnabled( selected ); 695 mActionPaste->setEnabled( selected );
716 } 696 }
717 697
718 mActionCopy->setEnabled( selected ); 698 mActionCopy->setEnabled( selected );
719 mActionDelete->setEnabled( selected ); 699 mActionDelete->setEnabled( selected );
720 mActionEditAddressee->setEnabled( selected ); 700 mActionEditAddressee->setEnabled( selected );
721 mActionMail->setEnabled( selected ); 701 mActionMail->setEnabled( selected );
722 mActionMailVCard->setEnabled( selected ); 702 mActionMailVCard->setEnabled( selected );
723 //if (mActionBeam) 703 //if (mActionBeam)
724 //mActionBeam->setEnabled( selected ); 704 //mActionBeam->setEnabled( selected );
725 mActionWhoAmI->setEnabled( selected ); 705 mActionWhoAmI->setEnabled( selected );
726} 706}
727 707
728void KABCore::sendMail() 708void KABCore::sendMail()
729{ 709{
730 sendMail( mViewManager->selectedEmails().join( ", " ) ); 710 sendMail( mViewManager->selectedEmails().join( ", " ) );
731} 711}
732 712
733void KABCore::sendMail( const QString& emaillist ) 713void KABCore::sendMail( const QString& emaillist )
734{ 714{
735 // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... " 715 // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... "
736 if (emaillist.contains(",") > 0) 716 if (emaillist.contains(",") > 0)
737 ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); 717 ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null );
738 else 718 else
739 ExternalAppHandler::instance()->mailToOneContact( emaillist ); 719 ExternalAppHandler::instance()->mailToOneContact( emaillist );
740} 720}
741 721
742 722