-rw-r--r-- | korganizer/koagendaview.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 131a345..a01323a 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -793,807 +793,822 @@ void KOAgendaView::createDayLabels() | |||
793 | dayLabel->setMinimumWidth( 1 ); | 793 | dayLabel->setMinimumWidth( 1 ); |
794 | dayLabel->setMaximumWidth( 10240 ); | 794 | dayLabel->setMaximumWidth( 10240 ); |
795 | dayLabel->setFont( dlf ); | 795 | dayLabel->setFont( dlf ); |
796 | dayLabel->show(); | 796 | dayLabel->show(); |
797 | dayLabel->setAutoRepeat( false ); | 797 | dayLabel->setAutoRepeat( false ); |
798 | dayLabel->setNum( counter ); | 798 | dayLabel->setNum( counter ); |
799 | QString str; | 799 | QString str; |
800 | int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date); | 800 | int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date); |
801 | QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true ); | 801 | QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true ); |
802 | switch ( maxLen ) { | 802 | switch ( maxLen ) { |
803 | case 2: | 803 | case 2: |
804 | str = QString::number( date.day() ); | 804 | str = QString::number( date.day() ); |
805 | break; | 805 | break; |
806 | 806 | ||
807 | case 3: | 807 | case 3: |
808 | str = dayName.left( 1 ) +QString::number( date.day()); | 808 | str = dayName.left( 1 ) +QString::number( date.day()); |
809 | 809 | ||
810 | break; | 810 | break; |
811 | case 4: | 811 | case 4: |
812 | str = dayName.left( 1 ) + " " +QString::number( date.day()); | 812 | str = dayName.left( 1 ) + " " +QString::number( date.day()); |
813 | 813 | ||
814 | break; | 814 | break; |
815 | case 5: | 815 | case 5: |
816 | str = dayName.left( 2 ) + " " +QString::number( date.day()); | 816 | str = dayName.left( 2 ) + " " +QString::number( date.day()); |
817 | 817 | ||
818 | break; | 818 | break; |
819 | case 6: | 819 | case 6: |
820 | str = dayName.left( 3 ) + " " +QString::number( date.day()); | 820 | str = dayName.left( 3 ) + " " +QString::number( date.day()); |
821 | break; | 821 | break; |
822 | 822 | ||
823 | default: | 823 | default: |
824 | break; | 824 | break; |
825 | } | 825 | } |
826 | if ( oneday ) { | 826 | if ( oneday ) { |
827 | QString addString; | 827 | QString addString; |
828 | if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) | 828 | if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) |
829 | addString = i18n("Today"); | 829 | addString = i18n("Today"); |
830 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) | 830 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) |
831 | addString = i18n("Tomorrow"); | 831 | addString = i18n("Tomorrow"); |
832 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) | 832 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) |
833 | addString = i18n("Yesterday"); | 833 | addString = i18n("Yesterday"); |
834 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) | 834 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) |
835 | addString = i18n("Day before yesterday"); | 835 | addString = i18n("Day before yesterday"); |
836 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) | 836 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) |
837 | addString = i18n("Day after tomorrow"); | 837 | addString = i18n("Day after tomorrow"); |
838 | if ( !addString.isEmpty() ) { | 838 | if ( !addString.isEmpty() ) { |
839 | if ( QApplication::desktop()->width() < 640 ) | 839 | if ( QApplication::desktop()->width() < 640 ) |
840 | str = addString+", " + str; | 840 | str = addString+", " + str; |
841 | else | 841 | else |
842 | str = addString+", "+ KGlobal::locale()->formatDate( date, false); | 842 | str = addString+", "+ KGlobal::locale()->formatDate( date, false); |
843 | } else { | 843 | } else { |
844 | str = KGlobal::locale()->formatDate( date, KOPrefs::instance()->mShortDateInViewer); | 844 | str = KGlobal::locale()->formatDate( date, KOPrefs::instance()->mShortDateInViewer); |
845 | } | 845 | } |
846 | } | 846 | } |
847 | dayLabel->setText(str); | 847 | dayLabel->setText(str); |
848 | //dayLabel->setAlignment(QLabel::AlignHCenter); | 848 | //dayLabel->setAlignment(QLabel::AlignHCenter); |
849 | if (date == QDate::currentDate()) { | 849 | if (date == QDate::currentDate()) { |
850 | QFont bFont = dlf; | 850 | QFont bFont = dlf; |
851 | bFont.setBold( true ); | 851 | bFont.setBold( true ); |
852 | dayLabel->setFont(bFont); | 852 | dayLabel->setFont(bFont); |
853 | } | 853 | } |
854 | //dayLayout->addWidget(dayLabel); | 854 | //dayLayout->addWidget(dayLabel); |
855 | 855 | ||
856 | #ifndef KORG_NOPLUGINS | 856 | #ifndef KORG_NOPLUGINS |
857 | CalendarDecoration::List cds = KOCore::self()->calendarDecorations(); | 857 | CalendarDecoration::List cds = KOCore::self()->calendarDecorations(); |
858 | CalendarDecoration *it; | 858 | CalendarDecoration *it; |
859 | for(it = cds.first(); it; it = cds.next()) { | 859 | for(it = cds.first(); it; it = cds.next()) { |
860 | QString text = it->shortText( date ); | 860 | QString text = it->shortText( date ); |
861 | if ( !text.isEmpty() ) { | 861 | if ( !text.isEmpty() ) { |
862 | QLabel *label = new QLabel(text,mDayLabels); | 862 | QLabel *label = new QLabel(text,mDayLabels); |
863 | label->setAlignment(AlignCenter); | 863 | label->setAlignment(AlignCenter); |
864 | dayLayout->addWidget(label); | 864 | dayLayout->addWidget(label); |
865 | } | 865 | } |
866 | } | 866 | } |
867 | 867 | ||
868 | for(it = cds.first(); it; it = cds.next()) { | 868 | for(it = cds.first(); it; it = cds.next()) { |
869 | QWidget *wid = it->smallWidget(mDayLabels,date); | 869 | QWidget *wid = it->smallWidget(mDayLabels,date); |
870 | if ( wid ) { | 870 | if ( wid ) { |
871 | // wid->setHeight(20); | 871 | // wid->setHeight(20); |
872 | dayLayout->addWidget(wid); | 872 | dayLayout->addWidget(wid); |
873 | } | 873 | } |
874 | } | 874 | } |
875 | #endif | 875 | #endif |
876 | } | 876 | } |
877 | if ( ! appendLabels ) { | 877 | if ( ! appendLabels ) { |
878 | dayLabel = mDayLabelsList.next(); | 878 | dayLabel = mDayLabelsList.next(); |
879 | if ( !dayLabel ) | 879 | if ( !dayLabel ) |
880 | appendLabels = true; | 880 | appendLabels = true; |
881 | } | 881 | } |
882 | if ( appendLabels ) { | 882 | if ( appendLabels ) { |
883 | dayLabel = getNewDaylabel(); | 883 | dayLabel = getNewDaylabel(); |
884 | } | 884 | } |
885 | //dayLabel->hide();//test only | 885 | //dayLabel->hide();//test only |
886 | 886 | ||
887 | dayLabel->setText(">"); | 887 | dayLabel->setText(">"); |
888 | dayLabel->setFont( dlf ); | 888 | dayLabel->setFont( dlf ); |
889 | dayLabel->setAutoRepeat( true ); | 889 | dayLabel->setAutoRepeat( true ); |
890 | dayLabel->show(); | 890 | dayLabel->show(); |
891 | dayLabel->setNum( -2 ); | 891 | dayLabel->setNum( -2 ); |
892 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ widModulo ); | 892 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ widModulo ); |
893 | 893 | ||
894 | //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); | 894 | //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); |
895 | if ( !appendLabels ) { | 895 | if ( !appendLabels ) { |
896 | dayLabel = mDayLabelsList.next(); | 896 | dayLabel = mDayLabelsList.next(); |
897 | while ( dayLabel ) { | 897 | while ( dayLabel ) { |
898 | //qDebug("!dayLabel %d",dayLabel ); | 898 | //qDebug("!dayLabel %d",dayLabel ); |
899 | dayLabel->hide(); | 899 | dayLabel->hide(); |
900 | dayLabel = mDayLabelsList.next(); | 900 | dayLabel = mDayLabelsList.next(); |
901 | } | 901 | } |
902 | } | 902 | } |
903 | 903 | ||
904 | mDayLabelsFrame->setFixedHeight( newHight + 4 ); | 904 | mDayLabelsFrame->setFixedHeight( newHight + 4 ); |
905 | } | 905 | } |
906 | 906 | ||
907 | int KOAgendaView::maxDatesHint() | 907 | int KOAgendaView::maxDatesHint() |
908 | { | 908 | { |
909 | // Not sure about the max number of events, so return 0 for now. | 909 | // Not sure about the max number of events, so return 0 for now. |
910 | return 0; | 910 | return 0; |
911 | } | 911 | } |
912 | 912 | ||
913 | int KOAgendaView::currentDateCount() | 913 | int KOAgendaView::currentDateCount() |
914 | { | 914 | { |
915 | return mSelectedDates.count(); | 915 | return mSelectedDates.count(); |
916 | } | 916 | } |
917 | 917 | ||
918 | QPtrList<Incidence> KOAgendaView::selectedIncidences() | 918 | QPtrList<Incidence> KOAgendaView::selectedIncidences() |
919 | { | 919 | { |
920 | QPtrList<Incidence> selected; | 920 | QPtrList<Incidence> selected; |
921 | Incidence *incidence; | 921 | Incidence *incidence; |
922 | 922 | ||
923 | incidence = mAgenda->selectedIncidence(); | 923 | incidence = mAgenda->selectedIncidence(); |
924 | if (incidence) selected.append(incidence); | 924 | if (incidence) selected.append(incidence); |
925 | 925 | ||
926 | incidence = mAllDayAgenda->selectedIncidence(); | 926 | incidence = mAllDayAgenda->selectedIncidence(); |
927 | if (incidence) selected.append(incidence); | 927 | if (incidence) selected.append(incidence); |
928 | 928 | ||
929 | return selected; | 929 | return selected; |
930 | } | 930 | } |
931 | 931 | ||
932 | DateList KOAgendaView::selectedDates() | 932 | DateList KOAgendaView::selectedDates() |
933 | { | 933 | { |
934 | DateList selected; | 934 | DateList selected; |
935 | QDate qd; | 935 | QDate qd; |
936 | 936 | ||
937 | qd = mAgenda->selectedIncidenceDate(); | 937 | qd = mAgenda->selectedIncidenceDate(); |
938 | if (qd.isValid()) selected.append(qd); | 938 | if (qd.isValid()) selected.append(qd); |
939 | 939 | ||
940 | qd = mAllDayAgenda->selectedIncidenceDate(); | 940 | qd = mAllDayAgenda->selectedIncidenceDate(); |
941 | if (qd.isValid()) selected.append(qd); | 941 | if (qd.isValid()) selected.append(qd); |
942 | 942 | ||
943 | return selected; | 943 | return selected; |
944 | } | 944 | } |
945 | 945 | ||
946 | 946 | ||
947 | void KOAgendaView::updateView() | 947 | void KOAgendaView::updateView() |
948 | { | 948 | { |
949 | if ( mBlockUpdating ) | 949 | if ( mBlockUpdating ) |
950 | return; | 950 | return; |
951 | // kdDebug() << "KOAgendaView::updateView()" << endl; | 951 | // kdDebug() << "KOAgendaView::updateView()" << endl; |
952 | fillAgenda(); | 952 | fillAgenda(); |
953 | 953 | ||
954 | } | 954 | } |
955 | 955 | ||
956 | 956 | ||
957 | /* | 957 | /* |
958 | Update configuration settings for the agenda view. This method is not | 958 | Update configuration settings for the agenda view. This method is not |
959 | complete. | 959 | complete. |
960 | */ | 960 | */ |
961 | void KOAgendaView::updateConfig() | 961 | void KOAgendaView::updateConfig() |
962 | { | 962 | { |
963 | if ( mBlockUpdating ) | 963 | if ( mBlockUpdating ) |
964 | return; | 964 | return; |
965 | if ( mAgenda->height() > 96 * KOPrefs::instance()->mHourSize ) { | 965 | if ( mAgenda->height() > 96 * KOPrefs::instance()->mHourSize ) { |
966 | int old = KOPrefs::instance()->mHourSize; | 966 | int old = KOPrefs::instance()->mHourSize; |
967 | KOPrefs::instance()->mHourSize = mAgenda->height()/96 +1; | 967 | KOPrefs::instance()->mHourSize = mAgenda->height()/96 +1; |
968 | //qDebug("KOPrefs::instance()->mHourSize adjusted %d to %d ", old,KOPrefs::instance()->mHourSize ); | 968 | //qDebug("KOPrefs::instance()->mHourSize adjusted %d to %d ", old,KOPrefs::instance()->mHourSize ); |
969 | } | 969 | } |
970 | 970 | ||
971 | 971 | ||
972 | // update config for children | 972 | // update config for children |
973 | mTimeLabels->updateConfig(); | 973 | mTimeLabels->updateConfig(); |
974 | mAgenda->storePosition(); | 974 | mAgenda->storePosition(); |
975 | mAgenda->updateConfig(); | 975 | mAgenda->updateConfig(); |
976 | mAllDayAgenda->updateConfig(); | 976 | mAllDayAgenda->updateConfig(); |
977 | // widget synchronization | 977 | // widget synchronization |
978 | //TODO: find a better way, maybe signal/slot | 978 | //TODO: find a better way, maybe signal/slot |
979 | mTimeLabels->positionChanged(); | 979 | mTimeLabels->positionChanged(); |
980 | 980 | ||
981 | // for some reason, this needs to be called explicitly | 981 | // for some reason, this needs to be called explicitly |
982 | mTimeLabels->repaint(); | 982 | mTimeLabels->repaint(); |
983 | 983 | ||
984 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); | 984 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); |
985 | 985 | ||
986 | // ToolTips displaying summary of events | 986 | // ToolTips displaying summary of events |
987 | KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() | 987 | KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() |
988 | ->mEnableToolTips); | 988 | ->mEnableToolTips); |
989 | 989 | ||
990 | //setHolidayMasks(); | 990 | //setHolidayMasks(); |
991 | 991 | ||
992 | //createDayLabels(); called by via updateView(); | 992 | //createDayLabels(); called by via updateView(); |
993 | mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth()); | 993 | mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth()); |
994 | updateView(); | 994 | updateView(); |
995 | mAgenda->restorePosition(); | 995 | mAgenda->restorePosition(); |
996 | } | 996 | } |
997 | 997 | ||
998 | 998 | ||
999 | void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) | 999 | void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) |
1000 | { | 1000 | { |
1001 | 1001 | ||
1002 | 1002 | ||
1003 | int xxx = item->cellX(); | 1003 | int xxx = item->cellX(); |
1004 | //qDebug("KOAgendaView::updateEventDates %d %d %d %d %d", xxx, mMinY.at(xxx),mMaxY.at(xxx),item->cellYTop(),item->cellYBottom() ); | 1004 | //qDebug("KOAgendaView::updateEventDates %d %d %d %d %d", xxx, mMinY.at(xxx),mMaxY.at(xxx),item->cellYTop(),item->cellYBottom() ); |
1005 | if ( mMinY.at(xxx) > item->cellYTop() ) | 1005 | if ( mMinY.at(xxx) > item->cellYTop() ) |
1006 | mMinY.at(xxx) = item->cellYTop(); | 1006 | mMinY.at(xxx) = item->cellYTop(); |
1007 | if ( mMaxY.at(xxx) < item->cellYBottom() ) | 1007 | if ( mMaxY.at(xxx) < item->cellYBottom() ) |
1008 | mMaxY.at(xxx) = item->cellYBottom(); | 1008 | mMaxY.at(xxx) = item->cellYBottom(); |
1009 | 1009 | ||
1010 | QDateTime startDt,endDt; | 1010 | QDateTime startDt,endDt; |
1011 | QDate startDate; | 1011 | QDate startDate; |
1012 | int lenInSecs; | 1012 | int lenInSecs; |
1013 | // if ( type == KOAgenda::RESIZETOP ) | 1013 | // if ( type == KOAgenda::RESIZETOP ) |
1014 | // qDebug("RESIZETOP "); | 1014 | // qDebug("RESIZETOP "); |
1015 | // if ( type == KOAgenda::RESIZEBOTTOM ) | 1015 | // if ( type == KOAgenda::RESIZEBOTTOM ) |
1016 | // qDebug("RESIZEBOTTOM "); | 1016 | // qDebug("RESIZEBOTTOM "); |
1017 | // if ( type == KOAgenda::MOVE ) | 1017 | // if ( type == KOAgenda::MOVE ) |
1018 | // qDebug("MOVE "); | 1018 | // qDebug("MOVE "); |
1019 | if ( item->incidence()->typeID() == eventID ) { | 1019 | if ( item->incidence()->typeID() == eventID ) { |
1020 | startDt =item->incidence()->dtStart(); | 1020 | startDt =item->incidence()->dtStart(); |
1021 | endDt = item->incidence()->dtEnd(); | 1021 | endDt = item->incidence()->dtEnd(); |
1022 | lenInSecs = startDt.secsTo( endDt ); | 1022 | lenInSecs = startDt.secsTo( endDt ); |
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | // emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED ); | 1025 | // emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED ); |
1026 | 1026 | ||
1027 | if ( item->incidence()->typeID()== todoID && item->mLastMoveXPos > 0 ) { | 1027 | if ( item->incidence()->typeID()== todoID && item->mLastMoveXPos > 0 ) { |
1028 | startDate = mSelectedDates[item->mLastMoveXPos]; | 1028 | startDate = mSelectedDates[item->mLastMoveXPos]; |
1029 | } else { | 1029 | } else { |
1030 | if (item->cellX() < 0) { | 1030 | if (item->cellX() < 0) { |
1031 | startDate = (mSelectedDates.first()).addDays(item->cellX()); | 1031 | startDate = (mSelectedDates.first()).addDays(item->cellX()); |
1032 | } else { | 1032 | } else { |
1033 | startDate = mSelectedDates[item->cellX()]; | 1033 | startDate = mSelectedDates[item->cellX()]; |
1034 | } | 1034 | } |
1035 | } | 1035 | } |
1036 | startDt.setDate(startDate); | 1036 | startDt.setDate(startDate); |
1037 | 1037 | ||
1038 | if (item->incidence()->doesFloat()) { | 1038 | if (item->incidence()->doesFloat()) { |
1039 | endDt.setDate(startDate.addDays(item->cellWidth() - 1)); | 1039 | endDt.setDate(startDate.addDays(item->cellWidth() - 1)); |
1040 | } else { | 1040 | } else { |
1041 | if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE ) | 1041 | if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE ) |
1042 | startDt.setTime(mAgenda->gyToTime(item->cellYTop())); | 1042 | startDt.setTime(mAgenda->gyToTime(item->cellYTop())); |
1043 | if ( item->incidence()->typeID() == eventID ) { | 1043 | if ( item->incidence()->typeID() == eventID ) { |
1044 | if ( type == KOAgenda::MOVE ) { | 1044 | if ( type == KOAgenda::MOVE ) { |
1045 | endDt = startDt.addSecs(lenInSecs); | 1045 | endDt = startDt.addSecs(lenInSecs); |
1046 | 1046 | ||
1047 | } else if ( type == KOAgenda::RESIZEBOTTOM ) { | 1047 | } else if ( type == KOAgenda::RESIZEBOTTOM ) { |
1048 | if (item->lastMultiItem()) { | 1048 | if (item->lastMultiItem()) { |
1049 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); | 1049 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); |
1050 | endDt.setDate(startDate. | 1050 | endDt.setDate(startDate. |
1051 | addDays(item->lastMultiItem()->cellX() - item->cellX())); | 1051 | addDays(item->lastMultiItem()->cellX() - item->cellX())); |
1052 | } else { | 1052 | } else { |
1053 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); | 1053 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); |
1054 | endDt.setDate(startDate); | 1054 | endDt.setDate(startDate); |
1055 | } | 1055 | } |
1056 | } | 1056 | } |
1057 | } else { | 1057 | } else { |
1058 | // todo | 1058 | // todo |
1059 | if (item->lastMultiItem()) { | 1059 | if (item->lastMultiItem()) { |
1060 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); | 1060 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); |
1061 | endDt.setDate(startDate. | 1061 | endDt.setDate(startDate. |
1062 | addDays(item->lastMultiItem()->cellX() - item->cellX())); | 1062 | addDays(item->lastMultiItem()->cellX() - item->cellX())); |
1063 | } else { | 1063 | } else { |
1064 | //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); | 1064 | //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); |
1065 | if ( item->cellYBottom() > 0 ) | 1065 | if ( item->cellYBottom() > 0 ) |
1066 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); | 1066 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); |
1067 | else | 1067 | else |
1068 | endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); | 1068 | endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); |
1069 | endDt.setDate(startDate); | 1069 | endDt.setDate(startDate); |
1070 | } | 1070 | } |
1071 | } | 1071 | } |
1072 | } | 1072 | } |
1073 | if ( item->incidence()->typeID() == eventID ) { | 1073 | if ( item->incidence()->typeID() == eventID ) { |
1074 | item->incidence()->setDtStart(startDt); | 1074 | item->incidence()->setDtStart(startDt); |
1075 | (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); | 1075 | (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); |
1076 | } else if ( item->incidence()->typeID() == todoID ) { | 1076 | } else if ( item->incidence()->typeID() == todoID ) { |
1077 | Todo* to = static_cast<Todo*>(item->incidence()); | 1077 | Todo* to = static_cast<Todo*>(item->incidence()); |
1078 | 1078 | ||
1079 | to->setDtDue(endDt); | 1079 | to->setDtDue(endDt); |
1080 | if ( to->hasStartDate() ) { | 1080 | if ( to->hasStartDate() ) { |
1081 | if (to->dtStart() >= to->dtDue() ) | 1081 | if (to->dtStart() >= to->dtDue() ) |
1082 | to->setDtStart(to->dtDue().addDays( -2 )); | 1082 | to->setDtStart(to->dtDue().addDays( -2 )); |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | } | 1085 | } |
1086 | //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); | 1086 | //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); |
1087 | item->incidence()->setRevision(item->incidence()->revision()+1); | 1087 | item->incidence()->setRevision(item->incidence()->revision()+1); |
1088 | item->setItemDate(startDt.date()); | 1088 | item->setItemDate(startDt.date()); |
1089 | //item->updateItem(); | 1089 | //item->updateItem(); |
1090 | if ( item->incidence()->typeID() == todoID ) { | 1090 | if ( item->incidence()->typeID() == todoID ) { |
1091 | emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED ); | 1091 | emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED ); |
1092 | 1092 | ||
1093 | } | 1093 | } |
1094 | else | 1094 | else |
1095 | emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED); | 1095 | emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED); |
1096 | item->updateItem(); | 1096 | item->updateItem(); |
1097 | } | 1097 | } |
1098 | 1098 | ||
1099 | void KOAgendaView::showDates( const QDate &start, const QDate &end ) | 1099 | void KOAgendaView::showDates( const QDate &start, const QDate &end ) |
1100 | { | 1100 | { |
1101 | // kdDebug() << "KOAgendaView::selectDates" << endl; | 1101 | // kdDebug() << "KOAgendaView::selectDates" << endl; |
1102 | 1102 | ||
1103 | mSelectedDates.clear(); | 1103 | mSelectedDates.clear(); |
1104 | // qDebug("KOAgendaView::showDates "); | 1104 | // qDebug("KOAgendaView::showDates "); |
1105 | QDate d = start; | 1105 | QDate d = start; |
1106 | while (d <= end) { | 1106 | while (d <= end) { |
1107 | mSelectedDates.append(d); | 1107 | mSelectedDates.append(d); |
1108 | d = d.addDays( 1 ); | 1108 | d = d.addDays( 1 ); |
1109 | } | 1109 | } |
1110 | 1110 | ||
1111 | // and update the view | 1111 | // and update the view |
1112 | fillAgenda(); | 1112 | fillAgenda(); |
1113 | } | 1113 | } |
1114 | 1114 | ||
1115 | 1115 | ||
1116 | void KOAgendaView::showEvents(QPtrList<Event>) | 1116 | void KOAgendaView::showEvents(QPtrList<Event>) |
1117 | { | 1117 | { |
1118 | kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl; | 1118 | kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl; |
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | void KOAgendaView::changeEventDisplay(Event *, int) | 1121 | void KOAgendaView::changeEventDisplay(Event *, int) |
1122 | { | 1122 | { |
1123 | // qDebug("KOAgendaView::changeEventDisplay "); | 1123 | // qDebug("KOAgendaView::changeEventDisplay "); |
1124 | // kdDebug() << "KOAgendaView::changeEventDisplay" << endl; | 1124 | // kdDebug() << "KOAgendaView::changeEventDisplay" << endl; |
1125 | // this should be re-written to be MUCH smarter. Right now we | 1125 | // this should be re-written to be MUCH smarter. Right now we |
1126 | // are just playing dumb. | 1126 | // are just playing dumb. |
1127 | fillAgenda(); | 1127 | fillAgenda(); |
1128 | } | 1128 | } |
1129 | 1129 | ||
1130 | void KOAgendaView::fillAgenda(const QDate &) | 1130 | void KOAgendaView::fillAgenda(const QDate &) |
1131 | { | 1131 | { |
1132 | // qDebug("KOAgendaView::fillAgenda "); | 1132 | // qDebug("KOAgendaView::fillAgenda "); |
1133 | fillAgenda(); | 1133 | fillAgenda(); |
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | void KOAgendaView::fillAgenda() | 1136 | void KOAgendaView::fillAgenda() |
1137 | { | 1137 | { |
1138 | if ( globalFlagBlockStartup ) | 1138 | if ( globalFlagBlockStartup ) |
1139 | return; | 1139 | return; |
1140 | if ( globalFlagBlockAgenda == 1 ) | 1140 | if ( globalFlagBlockAgenda == 1 ) |
1141 | return; | 1141 | return; |
1142 | static bool onlyOne = false; | 1142 | static bool onlyOne = false; |
1143 | if ( onlyOne ) | 1143 | if ( onlyOne ) |
1144 | return; | 1144 | return; |
1145 | onlyOne = true; | 1145 | onlyOne = true; |
1146 | //if ( globalFlagBlockAgenda == 2 ) | 1146 | //if ( globalFlagBlockAgenda == 2 ) |
1147 | //globalFlagBlockAgenda = 0; | 1147 | //globalFlagBlockAgenda = 0; |
1148 | // globalFlagBlockPainting = false; | 1148 | // globalFlagBlockPainting = false; |
1149 | if ( globalFlagBlockAgenda == 0 ) | 1149 | if ( globalFlagBlockAgenda == 0 ) |
1150 | globalFlagBlockAgenda = 1; | 1150 | globalFlagBlockAgenda = 1; |
1151 | // clearView(); | 1151 | // clearView(); |
1152 | //qDebug("fillAgenda()++++ "); | 1152 | //qDebug("fillAgenda()++++ "); |
1153 | globalFlagBlockAgendaItemPaint = 1; | 1153 | globalFlagBlockAgendaItemPaint = 1; |
1154 | 1154 | ||
1155 | mAllDayAgenda->changeColumns(mSelectedDates.count()); | 1155 | mAllDayAgenda->changeColumns(mSelectedDates.count()); |
1156 | mAgenda->changeColumns(mSelectedDates.count()); | 1156 | mAgenda->changeColumns(mSelectedDates.count()); |
1157 | qApp->processEvents(); | 1157 | qApp->processEvents(); |
1158 | mEventIndicatorTop->changeColumns(mSelectedDates.count()); | 1158 | mEventIndicatorTop->changeColumns(mSelectedDates.count()); |
1159 | mEventIndicatorBottom->changeColumns(mSelectedDates.count()); | 1159 | mEventIndicatorBottom->changeColumns(mSelectedDates.count()); |
1160 | setHolidayMasks(); | 1160 | setHolidayMasks(); |
1161 | 1161 | ||
1162 | mMinY.resize(mSelectedDates.count()); | 1162 | mMinY.resize(mSelectedDates.count()); |
1163 | mMaxY.resize(mSelectedDates.count()); | 1163 | mMaxY.resize(mSelectedDates.count()); |
1164 | 1164 | ||
1165 | QPtrList<Event> dayEvents; | 1165 | QPtrList<Event> dayEvents; |
1166 | 1166 | ||
1167 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. | 1167 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. |
1168 | // Therefore, gtodoset all of them. | 1168 | // Therefore, gtodoset all of them. |
1169 | QPtrList<Todo> todos = calendar()->todos(); | 1169 | QPtrList<Todo> todos = calendar()->todos(); |
1170 | 1170 | ||
1171 | mAgenda->setDateList(mSelectedDates); | 1171 | mAgenda->setDateList(mSelectedDates); |
1172 | 1172 | ||
1173 | QDate today = QDate::currentDate(); | 1173 | QDate today = QDate::currentDate(); |
1174 | 1174 | ||
1175 | DateList::ConstIterator dit; | 1175 | DateList::ConstIterator dit; |
1176 | int curCol = 0; | 1176 | int curCol = 0; |
1177 | int maxCol = mSelectedDates.count()-1; | ||
1177 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { | 1178 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { |
1178 | QDate currentDate = *dit; | 1179 | QDate currentDate = *dit; |
1179 | // kdDebug() << "KOAgendaView::fillAgenda(): " << currentDate.toString() | 1180 | // kdDebug() << "KOAgendaView::fillAgenda(): " << currentDate.toString() |
1180 | // << endl; | 1181 | // << endl; |
1181 | 1182 | ||
1182 | dayEvents = calendar()->events(currentDate,false); | 1183 | dayEvents = calendar()->events(currentDate,false); |
1183 | 1184 | ||
1184 | // Default values, which can never be reached | 1185 | // Default values, which can never be reached |
1185 | mMinY[curCol] = mAgenda->timeToY(QTime(23,59)) + 1; | 1186 | mMinY[curCol] = mAgenda->timeToY(QTime(23,59)) + 1; |
1186 | mMaxY[curCol] = mAgenda->timeToY(QTime(0,0)) - 1; | 1187 | mMaxY[curCol] = mAgenda->timeToY(QTime(0,0)) - 1; |
1187 | 1188 | ||
1188 | unsigned int numEvent; | 1189 | unsigned int numEvent; |
1190 | //qDebug("+++++NUMEVENT %d", dayEvents.count()); | ||
1189 | for(numEvent=0;numEvent<dayEvents.count();++numEvent) { | 1191 | for(numEvent=0;numEvent<dayEvents.count();++numEvent) { |
1190 | Event *event = dayEvents.at(numEvent); | 1192 | Event *event = dayEvents.at(numEvent); |
1191 | if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") ) | 1193 | if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") ) |
1192 | if ( event->uid().left(15) == QString("last-syncEvent-") ) | 1194 | if ( event->uid().left(15) == QString("last-syncEvent-") ) |
1193 | continue; | 1195 | continue; |
1194 | // kdDebug() << " Event: " << event->summary() << endl; | 1196 | // kdDebug() << " Event: " << event->summary() << endl; |
1195 | 1197 | ||
1196 | int beginX = currentDate.daysTo(event->dtStart().date()) + curCol; | 1198 | int beginX = currentDate.daysTo(event->dtStart().date()) + curCol; |
1197 | int endX = currentDate.daysTo(event->dtEnd().date()) + curCol; | 1199 | int endX = currentDate.daysTo(event->dtEnd().date()) + curCol; |
1198 | 1200 | ||
1199 | // kdDebug() << " beginX: " << beginX << " endX: " << endX << endl; | 1201 | // kdDebug() << " beginX: " << beginX << " endX: " << endX << endl; |
1200 | 1202 | ||
1201 | if (event->doesFloat()) { | 1203 | if (event->doesFloat()) { |
1202 | if (event->recurrence()->doesRecur()) { | 1204 | if (event->recurrence()->doesRecur()) { |
1203 | if (event->isMultiDay() ) { | 1205 | if (event->isMultiDay() ) { |
1204 | endX = endX - beginX;// endX is now number of days | 1206 | endX = endX - beginX;// endX is now number of days |
1205 | if ( event->recursOn( currentDate ) ) { | 1207 | if ( event->recursOn( currentDate ) ) { |
1206 | endX += curCol; | 1208 | endX += curCol; |
1207 | beginX = curCol; | 1209 | beginX = curCol; |
1208 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); | 1210 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); |
1209 | } else { | 1211 | } else { |
1210 | //qDebug("days %d %s",endX , currentDate.toString().latin1()); | 1212 | //qDebug("days endX %d curCol %d max Col %d %s",endX ,curCol, maxCol, currentDate.toString().latin1()); |
1211 | QDate dateit = currentDate.addDays( -endX ); | 1213 | if ( curCol == maxCol && maxCol+1 < endX ) { |
1212 | if ( event->recursOn( dateit ) ) { | 1214 | int i; |
1213 | //qDebug("found %d %d %d %s", endX,curCol, curCol-endX ,dateit.toString().latin1() ); | 1215 | for ( i = 1; i< endX; ++i ) { |
1214 | if ( curCol-endX < 0 ) { | 1216 | if ( event->recursOn( currentDate.addDays( -i ) ) ) |
1217 | break; | ||
1218 | } | ||
1219 | if ( i > maxCol ) { | ||
1215 | mAllDayAgenda->insertAllDayItem(event,currentDate,0,curCol); | 1220 | mAllDayAgenda->insertAllDayItem(event,currentDate,0,curCol); |
1221 | //qDebug("BINGO "); | ||
1222 | } | ||
1223 | |||
1224 | } else { | ||
1225 | QDate dateit = currentDate.addDays( -endX ); | ||
1226 | if ( event->recursOn( dateit ) ) { | ||
1227 | //qDebug("found %d %d %d %s", endX,curCol, curCol-endX ,dateit.toString().latin1() ); | ||
1228 | if ( curCol-endX < 0 ) { | ||
1229 | mAllDayAgenda->insertAllDayItem(event,currentDate,0,curCol); | ||
1230 | } | ||
1216 | } | 1231 | } |
1217 | } | 1232 | } |
1218 | } | 1233 | } |
1219 | } else { | 1234 | } else { |
1220 | mAllDayAgenda->insertAllDayItem(event,currentDate,curCol,curCol); | 1235 | mAllDayAgenda->insertAllDayItem(event,currentDate,curCol,curCol); |
1221 | } | 1236 | } |
1222 | 1237 | ||
1223 | } else { | 1238 | } else { |
1224 | if (beginX <= 0 && curCol == 0) { | 1239 | if (beginX <= 0 && curCol == 0) { |
1225 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); | 1240 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); |
1226 | } else if (beginX == curCol) { | 1241 | } else if (beginX == curCol) { |
1227 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); | 1242 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); |
1228 | } | 1243 | } |
1229 | } | 1244 | } |
1230 | } else if (event->isMultiDay()) { | 1245 | } else if (event->isMultiDay()) { |
1231 | if ( event->doesRecur () ) { | 1246 | if ( event->doesRecur () ) { |
1232 | QDate dateit = currentDate; | 1247 | QDate dateit = currentDate; |
1233 | int count = 0; | 1248 | int count = 0; |
1234 | int max = event->dtStart().daysTo( event->dtEnd() ) +2; | 1249 | int max = event->dtStart().daysTo( event->dtEnd() ) +2; |
1235 | while (! event->recursOn( dateit ) && count <= max ) { | 1250 | while (! event->recursOn( dateit ) && count <= max ) { |
1236 | ++count; | 1251 | ++count; |
1237 | dateit = dateit.addDays( -1 ); | 1252 | dateit = dateit.addDays( -1 ); |
1238 | } | 1253 | } |
1239 | bool ok; | 1254 | bool ok; |
1240 | QDateTime nextOcstart = event->getNextOccurence( QDateTime(dateit) ,&ok ); | 1255 | QDateTime nextOcstart = event->getNextOccurence( QDateTime(dateit) ,&ok ); |
1241 | if ( ok ) | 1256 | if ( ok ) |
1242 | { | 1257 | { |
1243 | int secs = event->dtStart().secsTo( event->dtEnd() ); | 1258 | int secs = event->dtStart().secsTo( event->dtEnd() ); |
1244 | QDateTime nextOcend =nextOcstart.addSecs( secs ); ; | 1259 | QDateTime nextOcend =nextOcstart.addSecs( secs ); ; |
1245 | beginX = currentDate.daysTo(nextOcstart.date()) + curCol; | 1260 | beginX = currentDate.daysTo(nextOcstart.date()) + curCol; |
1246 | endX = currentDate.daysTo(nextOcend.date()) + curCol; | 1261 | endX = currentDate.daysTo(nextOcend.date()) + curCol; |
1247 | 1262 | ||
1248 | } | 1263 | } |
1249 | } | 1264 | } |
1250 | int startY = mAgenda->timeToY(event->dtStart().time()); | 1265 | int startY = mAgenda->timeToY(event->dtStart().time()); |
1251 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; | 1266 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; |
1252 | //qDebug("insert %d %d %d %d %d ",beginX,endX,startY,endY , curCol ); | 1267 | //qDebug("insert %d %d %d %d %d ",beginX,endX,startY,endY , curCol ); |
1253 | if ((beginX <= 0 && curCol == 0) || beginX == curCol) { | 1268 | if ((beginX <= 0 && curCol == 0) || beginX == curCol) { |
1254 | //qDebug("insert!!! "); | 1269 | //qDebug("insert!!! "); |
1255 | mAgenda->insertMultiItem(event,currentDate,beginX,endX,startY,endY); | 1270 | mAgenda->insertMultiItem(event,currentDate,beginX,endX,startY,endY); |
1256 | } | 1271 | } |
1257 | if (beginX == curCol) { | 1272 | if (beginX == curCol) { |
1258 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); | 1273 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); |
1259 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; | 1274 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; |
1260 | } else if (endX == curCol) { | 1275 | } else if (endX == curCol) { |
1261 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); | 1276 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); |
1262 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; | 1277 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; |
1263 | } else { | 1278 | } else { |
1264 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); | 1279 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); |
1265 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); | 1280 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); |
1266 | } | 1281 | } |
1267 | } else { | 1282 | } else { |
1268 | int startY = mAgenda->timeToY(event->dtStart().time()); | 1283 | int startY = mAgenda->timeToY(event->dtStart().time()); |
1269 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; | 1284 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; |
1270 | if (endY < startY) endY = startY; | 1285 | if (endY < startY) endY = startY; |
1271 | mAgenda->insertItem(event,currentDate,curCol,startY,endY); | 1286 | mAgenda->insertItem(event,currentDate,curCol,startY,endY); |
1272 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; | 1287 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; |
1273 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; | 1288 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; |
1274 | } | 1289 | } |
1275 | } | 1290 | } |
1276 | // ---------- [display Todos -------------- | 1291 | // ---------- [display Todos -------------- |
1277 | unsigned int numTodo; | 1292 | unsigned int numTodo; |
1278 | for (numTodo = 0; numTodo < todos.count(); ++numTodo) { | 1293 | for (numTodo = 0; numTodo < todos.count(); ++numTodo) { |
1279 | Todo *todo = todos.at(numTodo); | 1294 | Todo *todo = todos.at(numTodo); |
1280 | 1295 | ||
1281 | if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date | 1296 | if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date |
1282 | if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) continue; | 1297 | if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) continue; |
1283 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. | 1298 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. |
1284 | // Already completed items can be displayed on their original due date | 1299 | // Already completed items can be displayed on their original due date |
1285 | //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda | 1300 | //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda |
1286 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; | 1301 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; |
1287 | bool fillIn = false; | 1302 | bool fillIn = false; |
1288 | if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) | 1303 | if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) |
1289 | fillIn = true; | 1304 | fillIn = true; |
1290 | if ( ! fillIn && !todo->hasCompletedDate() ) | 1305 | if ( ! fillIn && !todo->hasCompletedDate() ) |
1291 | fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue); | 1306 | fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue); |
1292 | if ( fillIn ) { | 1307 | if ( fillIn ) { |
1293 | if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue | 1308 | if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue |
1294 | if ( KOPrefs::instance()->mShowTodoInAgenda ) | 1309 | if ( KOPrefs::instance()->mShowTodoInAgenda ) |
1295 | mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol); | 1310 | mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol); |
1296 | } | 1311 | } |
1297 | else { | 1312 | else { |
1298 | QDateTime dt; | 1313 | QDateTime dt; |
1299 | if ( todo->hasCompletedDate() ) | 1314 | if ( todo->hasCompletedDate() ) |
1300 | dt = todo->completed(); | 1315 | dt = todo->completed(); |
1301 | else | 1316 | else |
1302 | dt = todo->dtDue();; | 1317 | dt = todo->dtDue();; |
1303 | 1318 | ||
1304 | 1319 | ||
1305 | int endY = mAgenda->timeToY(dt.time()) - 1; | 1320 | int endY = mAgenda->timeToY(dt.time()) - 1; |
1306 | int hi = (18/KOPrefs::instance()->mHourSize); | 1321 | int hi = (18/KOPrefs::instance()->mHourSize); |
1307 | //qDebug("hei %d ",KOPrefs::instance()->mHourSize); | 1322 | //qDebug("hei %d ",KOPrefs::instance()->mHourSize); |
1308 | int startY = endY -hi; | 1323 | int startY = endY -hi; |
1309 | 1324 | ||
1310 | mAgenda->insertItem(todo,currentDate,curCol,startY,endY); | 1325 | mAgenda->insertItem(todo,currentDate,curCol,startY,endY); |
1311 | 1326 | ||
1312 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; | 1327 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; |
1313 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; | 1328 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; |
1314 | } | 1329 | } |
1315 | } | 1330 | } |
1316 | } | 1331 | } |
1317 | // ---------- display Todos] -------------- | 1332 | // ---------- display Todos] -------------- |
1318 | 1333 | ||
1319 | ++curCol; | 1334 | ++curCol; |
1320 | } | 1335 | } |
1321 | mAgenda->hideUnused(); | 1336 | mAgenda->hideUnused(); |
1322 | mAllDayAgenda->hideUnused(); | 1337 | mAllDayAgenda->hideUnused(); |
1323 | mAgenda->checkScrollBoundaries(); | 1338 | mAgenda->checkScrollBoundaries(); |
1324 | deleteSelectedDateTime(); | 1339 | deleteSelectedDateTime(); |
1325 | createDayLabels(); | 1340 | createDayLabels(); |
1326 | emit incidenceSelected( 0 ); | 1341 | emit incidenceSelected( 0 ); |
1327 | 1342 | ||
1328 | if ( globalFlagBlockAgenda == 2 ) { | 1343 | if ( globalFlagBlockAgenda == 2 ) { |
1329 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) | 1344 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) |
1330 | setStartHour( KOPrefs::instance()->mDayBegins ); | 1345 | setStartHour( KOPrefs::instance()->mDayBegins ); |
1331 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 1346 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
1332 | setStartHour( QTime::currentTime ().hour() ); | 1347 | setStartHour( QTime::currentTime ().hour() ); |
1333 | } | 1348 | } |
1334 | qApp->processEvents(); | 1349 | qApp->processEvents(); |
1335 | globalFlagBlockAgenda = 0; | 1350 | globalFlagBlockAgenda = 0; |
1336 | mAllDayAgenda->drawContentsToPainter(); | 1351 | mAllDayAgenda->drawContentsToPainter(); |
1337 | mAgenda->drawContentsToPainter(); | 1352 | mAgenda->drawContentsToPainter(); |
1338 | repaintAgenda(); | 1353 | repaintAgenda(); |
1339 | startIdleTimeout(); | 1354 | startIdleTimeout(); |
1340 | onlyOne = false; | 1355 | onlyOne = false; |
1341 | } | 1356 | } |
1342 | void KOAgendaView::repaintAgenda() | 1357 | void KOAgendaView::repaintAgenda() |
1343 | { | 1358 | { |
1344 | mAgenda->viewport()->repaint( false ); | 1359 | mAgenda->viewport()->repaint( false ); |
1345 | mAllDayAgenda->viewport()->repaint( false ); | 1360 | mAllDayAgenda->viewport()->repaint( false ); |
1346 | mAgenda->finishUpdate(); | 1361 | mAgenda->finishUpdate(); |
1347 | mAllDayAgenda->finishUpdate(); | 1362 | mAllDayAgenda->finishUpdate(); |
1348 | } | 1363 | } |
1349 | 1364 | ||
1350 | 1365 | ||
1351 | void KOAgendaView::clearView() | 1366 | void KOAgendaView::clearView() |
1352 | { | 1367 | { |
1353 | mAllDayAgenda->clear(); | 1368 | mAllDayAgenda->clear(); |
1354 | mAgenda->clear(); | 1369 | mAgenda->clear(); |
1355 | } | 1370 | } |
1356 | void KOAgendaView::clearList() | 1371 | void KOAgendaView::clearList() |
1357 | { | 1372 | { |
1358 | clearView(); | 1373 | clearView(); |
1359 | mAllDayAgenda->hideUnused(); | 1374 | mAllDayAgenda->hideUnused(); |
1360 | mAgenda->hideUnused(); | 1375 | mAgenda->hideUnused(); |
1361 | } | 1376 | } |
1362 | 1377 | ||
1363 | void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd, | 1378 | void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd, |
1364 | const QDate &td) | 1379 | const QDate &td) |
1365 | { | 1380 | { |
1366 | #ifndef KORG_NOPRINTER | 1381 | #ifndef KORG_NOPRINTER |
1367 | if (fd == td) | 1382 | if (fd == td) |
1368 | calPrinter->preview(CalPrinter::Day, fd, td); | 1383 | calPrinter->preview(CalPrinter::Day, fd, td); |
1369 | else | 1384 | else |
1370 | calPrinter->preview(CalPrinter::Week, fd, td); | 1385 | calPrinter->preview(CalPrinter::Week, fd, td); |
1371 | #endif | 1386 | #endif |
1372 | } | 1387 | } |
1373 | 1388 | ||
1374 | // void KOAgendaView::updateMovedTodo() | 1389 | // void KOAgendaView::updateMovedTodo() |
1375 | // { | 1390 | // { |
1376 | // // updateConfig(); | 1391 | // // updateConfig(); |
1377 | // // emit updateTodoViews(); | 1392 | // // emit updateTodoViews(); |
1378 | // } | 1393 | // } |
1379 | 1394 | ||
1380 | void KOAgendaView::slotShowDateView( int mode , int d ) | 1395 | void KOAgendaView::slotShowDateView( int mode , int d ) |
1381 | { | 1396 | { |
1382 | if ( d >= mSelectedDates.count() ) { | 1397 | if ( d >= mSelectedDates.count() ) { |
1383 | qDebug("KOAgendaView::slotShowDateView datecounterror %d %d ", d, mSelectedDates.count() ); | 1398 | qDebug("KOAgendaView::slotShowDateView datecounterror %d %d ", d, mSelectedDates.count() ); |
1384 | 1399 | ||
1385 | } else { | 1400 | } else { |
1386 | QDate day = mSelectedDates[d]; | 1401 | QDate day = mSelectedDates[d]; |
1387 | emit showDateView(mode , day ); | 1402 | emit showDateView(mode , day ); |
1388 | } | 1403 | } |
1389 | 1404 | ||
1390 | } | 1405 | } |
1391 | void KOAgendaView::newEvent(int gx, int gy) | 1406 | void KOAgendaView::newEvent(int gx, int gy) |
1392 | { | 1407 | { |
1393 | if (!mSelectedDates.count()) return; | 1408 | if (!mSelectedDates.count()) return; |
1394 | 1409 | ||
1395 | QDate day = mSelectedDates[gx]; | 1410 | QDate day = mSelectedDates[gx]; |
1396 | 1411 | ||
1397 | QTime time = mAgenda->gyToTime(gy); | 1412 | QTime time = mAgenda->gyToTime(gy); |
1398 | QDateTime dt(day,time); | 1413 | QDateTime dt(day,time); |
1399 | // if ( dt < QDateTime::currentDateTime () ) | 1414 | // if ( dt < QDateTime::currentDateTime () ) |
1400 | // dt = QDateTime::currentDateTime ().addSecs( 3600 ); | 1415 | // dt = QDateTime::currentDateTime ().addSecs( 3600 ); |
1401 | emit newEventSignal(dt); | 1416 | emit newEventSignal(dt); |
1402 | } | 1417 | } |
1403 | 1418 | ||
1404 | void KOAgendaView::newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd) | 1419 | void KOAgendaView::newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd) |
1405 | { | 1420 | { |
1406 | if (!mSelectedDates.count()) return; | 1421 | if (!mSelectedDates.count()) return; |
1407 | 1422 | ||
1408 | QDate dayStart = mSelectedDates[gxStart]; | 1423 | QDate dayStart = mSelectedDates[gxStart]; |
1409 | QDate dayEnd = mSelectedDates[gxEnd]; | 1424 | QDate dayEnd = mSelectedDates[gxEnd]; |
1410 | 1425 | ||
1411 | QTime timeStart = mAgenda->gyToTime(gyStart); | 1426 | QTime timeStart = mAgenda->gyToTime(gyStart); |
1412 | QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); | 1427 | QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); |
1413 | 1428 | ||
1414 | QDateTime dtStart(dayStart,timeStart); | 1429 | QDateTime dtStart(dayStart,timeStart); |
1415 | QDateTime dtEnd(dayEnd,timeEnd); | 1430 | QDateTime dtEnd(dayEnd,timeEnd); |
1416 | 1431 | ||
1417 | emit newEventSignal(dtStart,dtEnd); | 1432 | emit newEventSignal(dtStart,dtEnd); |
1418 | } | 1433 | } |
1419 | 1434 | ||
1420 | void KOAgendaView::newEventAllDay(int gx, int ) | 1435 | void KOAgendaView::newEventAllDay(int gx, int ) |
1421 | { | 1436 | { |
1422 | if (!mSelectedDates.count()) return; | 1437 | if (!mSelectedDates.count()) return; |
1423 | 1438 | ||
1424 | QDate day = mSelectedDates[gx]; | 1439 | QDate day = mSelectedDates[gx]; |
1425 | 1440 | ||
1426 | emit newEventSignal(day); | 1441 | emit newEventSignal(day); |
1427 | } | 1442 | } |
1428 | void KOAgendaView::newTodoAllDay(int gx, int ) | 1443 | void KOAgendaView::newTodoAllDay(int gx, int ) |
1429 | { | 1444 | { |
1430 | if (!mSelectedDates.count()) return; | 1445 | if (!mSelectedDates.count()) return; |
1431 | 1446 | ||
1432 | QDateTime day (mSelectedDates[gx] ); | 1447 | QDateTime day (mSelectedDates[gx] ); |
1433 | emit newTodoSignal(day, true); | 1448 | emit newTodoSignal(day, true); |
1434 | } | 1449 | } |
1435 | void KOAgendaView::newTodo(int gx, int gy ) | 1450 | void KOAgendaView::newTodo(int gx, int gy ) |
1436 | { | 1451 | { |
1437 | if (!mSelectedDates.count()) return; | 1452 | if (!mSelectedDates.count()) return; |
1438 | QDate dayStart = mSelectedDates[gx]; | 1453 | QDate dayStart = mSelectedDates[gx]; |
1439 | QTime timeStart = mAgenda->gyToTime(gy); | 1454 | QTime timeStart = mAgenda->gyToTime(gy); |
1440 | QDateTime dt (dayStart,timeStart); | 1455 | QDateTime dt (dayStart,timeStart); |
1441 | emit newTodoSignal( dt, false ); | 1456 | emit newTodoSignal( dt, false ); |
1442 | } | 1457 | } |
1443 | 1458 | ||
1444 | void KOAgendaView::updateEventIndicatorTop(int newY) | 1459 | void KOAgendaView::updateEventIndicatorTop(int newY) |
1445 | { | 1460 | { |
1446 | uint i; | 1461 | uint i; |
1447 | for(i=0;i<mMinY.size();++i) { | 1462 | for(i=0;i<mMinY.size();++i) { |
1448 | if (newY >= mMinY.at(i)) mEventIndicatorTop->enableColumn(i,true); | 1463 | if (newY >= mMinY.at(i)) mEventIndicatorTop->enableColumn(i,true); |
1449 | else mEventIndicatorTop->enableColumn(i,false); | 1464 | else mEventIndicatorTop->enableColumn(i,false); |
1450 | } | 1465 | } |
1451 | 1466 | ||
1452 | mEventIndicatorTop->update(); | 1467 | mEventIndicatorTop->update(); |
1453 | } | 1468 | } |
1454 | 1469 | ||
1455 | void KOAgendaView::updateEventIndicatorBottom(int newY) | 1470 | void KOAgendaView::updateEventIndicatorBottom(int newY) |
1456 | { | 1471 | { |
1457 | uint i; | 1472 | uint i; |
1458 | for(i=0;i<mMaxY.size();++i) { | 1473 | for(i=0;i<mMaxY.size();++i) { |
1459 | if (newY <= mMaxY.at(i)) mEventIndicatorBottom->enableColumn(i,true); | 1474 | if (newY <= mMaxY.at(i)) mEventIndicatorBottom->enableColumn(i,true); |
1460 | else mEventIndicatorBottom->enableColumn(i,false); | 1475 | else mEventIndicatorBottom->enableColumn(i,false); |
1461 | } | 1476 | } |
1462 | 1477 | ||
1463 | mEventIndicatorBottom->update(); | 1478 | mEventIndicatorBottom->update(); |
1464 | } | 1479 | } |
1465 | 1480 | ||
1466 | void KOAgendaView::startDrag(Event *event) | 1481 | void KOAgendaView::startDrag(Event *event) |
1467 | { | 1482 | { |
1468 | #ifndef KORG_NODND | 1483 | #ifndef KORG_NODND |
1469 | DndFactory factory( calendar() ); | 1484 | DndFactory factory( calendar() ); |
1470 | ICalDrag *vd = factory.createDrag(event,this); | 1485 | ICalDrag *vd = factory.createDrag(event,this); |
1471 | if (vd->drag()) { | 1486 | if (vd->drag()) { |
1472 | kdDebug() << "KOAgendaView::startDrag(): Delete drag source" << endl; | 1487 | kdDebug() << "KOAgendaView::startDrag(): Delete drag source" << endl; |
1473 | } | 1488 | } |
1474 | #endif | 1489 | #endif |
1475 | } | 1490 | } |
1476 | 1491 | ||
1477 | void KOAgendaView::readSettings() | 1492 | void KOAgendaView::readSettings() |
1478 | { | 1493 | { |
1479 | readSettings(KOGlobals::config()); | 1494 | readSettings(KOGlobals::config()); |
1480 | } | 1495 | } |
1481 | 1496 | ||
1482 | void KOAgendaView::readSettings(KConfig *config) | 1497 | void KOAgendaView::readSettings(KConfig *config) |
1483 | { | 1498 | { |
1484 | // kdDebug() << "KOAgendaView::readSettings()" << endl; | 1499 | // kdDebug() << "KOAgendaView::readSettings()" << endl; |
1485 | 1500 | ||
1486 | config->setGroup("Views"); | 1501 | config->setGroup("Views"); |
1487 | 1502 | ||
1488 | //#ifndef KORG_NOSPLITTER | 1503 | //#ifndef KORG_NOSPLITTER |
1489 | QValueList<int> sizes = config->readIntListEntry("Separator AgendaView"); | 1504 | QValueList<int> sizes = config->readIntListEntry("Separator AgendaView"); |
1490 | if (sizes.count() == 2) { | 1505 | if (sizes.count() == 2) { |
1491 | if ( sizes[0] < 20 ) { | 1506 | if ( sizes[0] < 20 ) { |
1492 | sizes[1] = sizes[1] +20 - sizes[0]; | 1507 | sizes[1] = sizes[1] +20 - sizes[0]; |
1493 | sizes[0] = 20; | 1508 | sizes[0] = 20; |
1494 | } | 1509 | } |
1495 | mSplitterAgenda->setSizes(sizes); | 1510 | mSplitterAgenda->setSizes(sizes); |
1496 | // qDebug("read %d %d ",sizes[0],sizes[1] ); | 1511 | // qDebug("read %d %d ",sizes[0],sizes[1] ); |
1497 | } | 1512 | } |
1498 | //#endif | 1513 | //#endif |
1499 | 1514 | ||
1500 | // updateConfig(); | 1515 | // updateConfig(); |
1501 | } | 1516 | } |
1502 | 1517 | ||
1503 | void KOAgendaView::writeSettings(KConfig *config) | 1518 | void KOAgendaView::writeSettings(KConfig *config) |
1504 | { | 1519 | { |
1505 | // kdDebug() << "KOAgendaView::writeSettings()" << endl; | 1520 | // kdDebug() << "KOAgendaView::writeSettings()" << endl; |
1506 | 1521 | ||
1507 | config->setGroup("Views"); | 1522 | config->setGroup("Views"); |
1508 | 1523 | ||
1509 | //#ifndef KORG_NOSPLITTER | 1524 | //#ifndef KORG_NOSPLITTER |
1510 | QValueList<int> list = mSplitterAgenda->sizes(); | 1525 | QValueList<int> list = mSplitterAgenda->sizes(); |
1511 | config->writeEntry("Separator AgendaView",list); | 1526 | config->writeEntry("Separator AgendaView",list); |
1512 | //qDebug("write %d %d ", list[0],list[1] ); | 1527 | //qDebug("write %d %d ", list[0],list[1] ); |
1513 | //#endif | 1528 | //#endif |
1514 | } | 1529 | } |
1515 | 1530 | ||
1516 | void KOAgendaView::setHolidayMasks() | 1531 | void KOAgendaView::setHolidayMasks() |
1517 | { | 1532 | { |
1518 | mHolidayMask.resize(mSelectedDates.count()); | 1533 | mHolidayMask.resize(mSelectedDates.count()); |
1519 | 1534 | ||
1520 | uint i; | 1535 | uint i; |
1521 | for(i=0;i<mSelectedDates.count();++i) { | 1536 | for(i=0;i<mSelectedDates.count();++i) { |
1522 | QDate date = mSelectedDates[i]; | 1537 | QDate date = mSelectedDates[i]; |
1523 | bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6); | 1538 | bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6); |
1524 | bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); | 1539 | bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); |
1525 | bool showHoliday = false; | 1540 | bool showHoliday = false; |
1526 | if ( KOPrefs::instance()->mExcludeHolidays ) { | 1541 | if ( KOPrefs::instance()->mExcludeHolidays ) { |
1527 | QPtrList<Event> events = calendar()->events( date, true ); | 1542 | QPtrList<Event> events = calendar()->events( date, true ); |
1528 | Event *event; | 1543 | Event *event; |
1529 | for( event = events.first(); event; event = events.next() ) { | 1544 | for( event = events.first(); event; event = events.next() ) { |
1530 | if ( event->isHoliday()) { | 1545 | if ( event->isHoliday()) { |
1531 | showHoliday = true; | 1546 | showHoliday = true; |
1532 | break; | 1547 | break; |
1533 | } | 1548 | } |
1534 | } | 1549 | } |
1535 | 1550 | ||
1536 | } | 1551 | } |
1537 | 1552 | ||
1538 | #ifndef KORG_NOPLUGINS | 1553 | #ifndef KORG_NOPLUGINS |
1539 | bool showHoliday = KOPrefs::instance()->mExcludeHolidays && | 1554 | bool showHoliday = KOPrefs::instance()->mExcludeHolidays && |
1540 | !KOCore::self()->holiday(date).isEmpty(); | 1555 | !KOCore::self()->holiday(date).isEmpty(); |
1541 | #endif | 1556 | #endif |
1542 | bool showDay = showSaturday || showSunday || showHoliday; | 1557 | bool showDay = showSaturday || showSunday || showHoliday; |
1543 | 1558 | ||
1544 | if (showDay) { | 1559 | if (showDay) { |
1545 | mHolidayMask.at(i) = true; | 1560 | mHolidayMask.at(i) = true; |
1546 | } else { | 1561 | } else { |
1547 | mHolidayMask.at(i) = false; | 1562 | mHolidayMask.at(i) = false; |
1548 | } | 1563 | } |
1549 | } | 1564 | } |
1550 | 1565 | ||
1551 | mAgenda->setHolidayMask(&mHolidayMask); | 1566 | mAgenda->setHolidayMask(&mHolidayMask); |
1552 | mAllDayAgenda->setHolidayMask(&mHolidayMask); | 1567 | mAllDayAgenda->setHolidayMask(&mHolidayMask); |
1553 | } | 1568 | } |
1554 | 1569 | ||
1555 | void KOAgendaView::setContentsPos(int y) | 1570 | void KOAgendaView::setContentsPos(int y) |
1556 | { | 1571 | { |
1557 | mAgenda->setContentsPos(0,y); | 1572 | mAgenda->setContentsPos(0,y); |
1558 | } | 1573 | } |
1559 | 1574 | ||
1560 | void KOAgendaView::clearSelection() | 1575 | void KOAgendaView::clearSelection() |
1561 | { | 1576 | { |
1562 | mAgenda->deselectItem(); | 1577 | mAgenda->deselectItem(); |
1563 | mAllDayAgenda->deselectItem(); | 1578 | mAllDayAgenda->deselectItem(); |
1564 | } | 1579 | } |
1565 | 1580 | ||
1566 | void KOAgendaView::newTimeSpanSelectedAllDay(int gxStart, int gyStart, | 1581 | void KOAgendaView::newTimeSpanSelectedAllDay(int gxStart, int gyStart, |
1567 | int gxEnd, int gyEnd) | 1582 | int gxEnd, int gyEnd) |
1568 | { | 1583 | { |
1569 | mTimeSpanInAllDay = true; | 1584 | mTimeSpanInAllDay = true; |
1570 | newTimeSpanSelected(gxStart,gyStart,gxEnd,gyEnd); | 1585 | newTimeSpanSelected(gxStart,gyStart,gxEnd,gyEnd); |
1571 | } | 1586 | } |
1572 | 1587 | ||
1573 | 1588 | ||
1574 | 1589 | ||
1575 | 1590 | ||
1576 | void KOAgendaView::newTimeSpanSelected(int gxStart, int gyStart, | 1591 | void KOAgendaView::newTimeSpanSelected(int gxStart, int gyStart, |
1577 | int gxEnd, int gyEnd) | 1592 | int gxEnd, int gyEnd) |
1578 | { | 1593 | { |
1579 | if (!mSelectedDates.count()) return; | 1594 | if (!mSelectedDates.count()) return; |
1580 | 1595 | ||
1581 | QDate dayStart = mSelectedDates[gxStart]; | 1596 | QDate dayStart = mSelectedDates[gxStart]; |
1582 | QDate dayEnd = mSelectedDates[gxEnd]; | 1597 | QDate dayEnd = mSelectedDates[gxEnd]; |
1583 | 1598 | ||
1584 | QTime timeStart = mAgenda->gyToTime(gyStart); | 1599 | QTime timeStart = mAgenda->gyToTime(gyStart); |
1585 | QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); | 1600 | QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); |
1586 | 1601 | ||
1587 | QDateTime dtStart(dayStart,timeStart); | 1602 | QDateTime dtStart(dayStart,timeStart); |
1588 | QDateTime dtEnd(dayEnd,timeEnd); | 1603 | QDateTime dtEnd(dayEnd,timeEnd); |
1589 | 1604 | ||
1590 | mTimeSpanBegin = dtStart; | 1605 | mTimeSpanBegin = dtStart; |
1591 | mTimeSpanEnd = dtEnd; | 1606 | mTimeSpanEnd = dtEnd; |
1592 | 1607 | ||
1593 | } | 1608 | } |
1594 | 1609 | ||
1595 | void KOAgendaView::deleteSelectedDateTime() | 1610 | void KOAgendaView::deleteSelectedDateTime() |
1596 | { | 1611 | { |
1597 | mTimeSpanBegin.setDate(QDate()); | 1612 | mTimeSpanBegin.setDate(QDate()); |
1598 | mTimeSpanEnd.setDate(QDate()); | 1613 | mTimeSpanEnd.setDate(QDate()); |
1599 | mTimeSpanInAllDay = false; | 1614 | mTimeSpanInAllDay = false; |