-rw-r--r-- | korganizer/koagendaview.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
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 | */ |
915 | void KOAgendaView::updateConfig() | 915 | void 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 | ||
953 | void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) | 953 | void 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 { |