summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-08 13:58:07 (UTC)
committer zautrix <zautrix>2005-04-08 13:58:07 (UTC)
commitc0f1d38e29ee0d0a1d1dcb5bda08089923926b41 (patch) (unidiff)
treea235fdef5d4b8b519bfd8141247993ba778b39b2
parent19a95939a6469ab5469f6904f57263a792598f07 (diff)
downloadkdepimpi-c0f1d38e29ee0d0a1d1dcb5bda08089923926b41.zip
kdepimpi-c0f1d38e29ee0d0a1d1dcb5bda08089923926b41.tar.gz
kdepimpi-c0f1d38e29ee0d0a1d1dcb5bda08089923926b41.tar.bz2
fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp34
-rw-r--r--korganizer/koagendaview.cpp11
2 files changed, 16 insertions, 29 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index fa9f130..9c40142 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -586,141 +586,121 @@ KConfig *KABCore::config()
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}
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 20a5b74..76d5c4b 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -907,98 +907,105 @@ void KOAgendaView::updateView()
907 907
908} 908}
909 909
910 910
911/* 911/*
912 Update configuration settings for the agenda view. This method is not 912 Update configuration settings for the agenda view. This method is not
913 complete. 913 complete.
914*/ 914*/
915void KOAgendaView::updateConfig() 915void KOAgendaView::updateConfig()
916{ 916{
917 if ( mBlockUpdating ) 917 if ( mBlockUpdating )
918 return; 918 return;
919 if ( mAgenda->height() > 96 * KOPrefs::instance()->mHourSize ) { 919 if ( mAgenda->height() > 96 * KOPrefs::instance()->mHourSize ) {
920 int old = KOPrefs::instance()->mHourSize; 920 int old = KOPrefs::instance()->mHourSize;
921 KOPrefs::instance()->mHourSize = mAgenda->height()/96 +1; 921 KOPrefs::instance()->mHourSize = mAgenda->height()/96 +1;
922 qDebug("KOPrefs::instance()->mHourSize adjusted %d to %d ", old,KOPrefs::instance()->mHourSize ); 922 qDebug("KOPrefs::instance()->mHourSize adjusted %d to %d ", old,KOPrefs::instance()->mHourSize );
923 } 923 }
924 924
925 925
926 // update config for children 926 // update config for children
927 mTimeLabels->updateConfig(); 927 mTimeLabels->updateConfig();
928 mAgenda->storePosition(); 928 mAgenda->storePosition();
929 mAgenda->updateConfig(); 929 mAgenda->updateConfig();
930 mAllDayAgenda->updateConfig(); 930 mAllDayAgenda->updateConfig();
931 // widget synchronization 931 // widget synchronization
932 //TODO: find a better way, maybe signal/slot 932 //TODO: find a better way, maybe signal/slot
933 mTimeLabels->positionChanged(); 933 mTimeLabels->positionChanged();
934 934
935 // for some reason, this needs to be called explicitly 935 // for some reason, this needs to be called explicitly
936 mTimeLabels->repaint(); 936 mTimeLabels->repaint();
937 937
938 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); 938 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width());
939 939
940 // ToolTips displaying summary of events 940 // ToolTips displaying summary of events
941 KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() 941 KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance()
942 ->mEnableToolTips); 942 ->mEnableToolTips);
943 943
944 //setHolidayMasks(); 944 //setHolidayMasks();
945 945
946 //createDayLabels(); called by via updateView(); 946 //createDayLabels(); called by via updateView();
947 mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth()); 947 mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth());
948 updateView(); 948 updateView();
949 mAgenda->restorePosition(); 949 mAgenda->restorePosition();
950} 950}
951 951
952 952
953void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) 953void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
954{ 954{
955 // kdDebug() << "KOAgendaView::updateEventDates(): " << item->text() << endl; 955
956 //qDebug("KOAgendaView::updateEventDates "); 956
957 int xxx = item->cellX();
958 //qDebug("KOAgendaView::updateEventDates %d %d %d %d %d", xxx, mMinY.at(xxx),mMaxY.at(xxx),item->cellYTop(),item->cellYBottom() );
959 if ( mMinY.at(xxx) > item->cellYTop() )
960 mMinY.at(xxx) = item->cellYTop();
961 if ( mMaxY.at(xxx) < item->cellYBottom() )
962 mMaxY.at(xxx) = item->cellYBottom();
963
957 QDateTime startDt,endDt; 964 QDateTime startDt,endDt;
958 QDate startDate; 965 QDate startDate;
959 int lenInSecs; 966 int lenInSecs;
960 // if ( type == KOAgenda::RESIZETOP ) 967 // if ( type == KOAgenda::RESIZETOP )
961 // qDebug("RESIZETOP "); 968 // qDebug("RESIZETOP ");
962 // if ( type == KOAgenda::RESIZEBOTTOM ) 969 // if ( type == KOAgenda::RESIZEBOTTOM )
963 // qDebug("RESIZEBOTTOM "); 970 // qDebug("RESIZEBOTTOM ");
964 // if ( type == KOAgenda::MOVE ) 971 // if ( type == KOAgenda::MOVE )
965 // qDebug("MOVE "); 972 // qDebug("MOVE ");
966 if ( item->incidence()->type() == "Event" ) { 973 if ( item->incidence()->type() == "Event" ) {
967 startDt =item->incidence()->dtStart(); 974 startDt =item->incidence()->dtStart();
968 endDt = item->incidence()->dtEnd(); 975 endDt = item->incidence()->dtEnd();
969 lenInSecs = startDt.secsTo( endDt ); 976 lenInSecs = startDt.secsTo( endDt );
970 } 977 }
971 978
972 // emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED ); 979 // emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED );
973 980
974 if ( item->incidence()->type()=="Todo" && item->mLastMoveXPos > 0 ) { 981 if ( item->incidence()->type()=="Todo" && item->mLastMoveXPos > 0 ) {
975 startDate = mSelectedDates[item->mLastMoveXPos]; 982 startDate = mSelectedDates[item->mLastMoveXPos];
976 } else { 983 } else {
977 if (item->cellX() < 0) { 984 if (item->cellX() < 0) {
978 startDate = (mSelectedDates.first()).addDays(item->cellX()); 985 startDate = (mSelectedDates.first()).addDays(item->cellX());
979 } else { 986 } else {
980 startDate = mSelectedDates[item->cellX()]; 987 startDate = mSelectedDates[item->cellX()];
981 } 988 }
982 } 989 }
983 startDt.setDate(startDate); 990 startDt.setDate(startDate);
984 991
985 if (item->incidence()->doesFloat()) { 992 if (item->incidence()->doesFloat()) {
986 endDt.setDate(startDate.addDays(item->cellWidth() - 1)); 993 endDt.setDate(startDate.addDays(item->cellWidth() - 1));
987 } else { 994 } else {
988 if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE ) 995 if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE )
989 startDt.setTime(mAgenda->gyToTime(item->cellYTop())); 996 startDt.setTime(mAgenda->gyToTime(item->cellYTop()));
990 if ( item->incidence()->type() == "Event" ) { 997 if ( item->incidence()->type() == "Event" ) {
991 if ( type == KOAgenda::MOVE ) { 998 if ( type == KOAgenda::MOVE ) {
992 endDt = startDt.addSecs(lenInSecs); 999 endDt = startDt.addSecs(lenInSecs);
993 1000
994 } else if ( type == KOAgenda::RESIZEBOTTOM ) { 1001 } else if ( type == KOAgenda::RESIZEBOTTOM ) {
995 if (item->lastMultiItem()) { 1002 if (item->lastMultiItem()) {
996 endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); 1003 endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1));
997 endDt.setDate(startDate. 1004 endDt.setDate(startDate.
998 addDays(item->lastMultiItem()->cellX() - item->cellX())); 1005 addDays(item->lastMultiItem()->cellX() - item->cellX()));
999 } else { 1006 } else {
1000 endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); 1007 endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1));
1001 endDt.setDate(startDate); 1008 endDt.setDate(startDate);
1002 } 1009 }
1003 } 1010 }
1004 } else { 1011 } else {