author | zautrix <zautrix> | 2005-02-13 19:07:45 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-13 19:07:45 (UTC) |
commit | 7bd83e913399b8be68a7d37e8f02118ec9eab90e (patch) (unidiff) | |
tree | 284d1592687ea4d3e0c220fafd289a702718dee4 /korganizer | |
parent | 293271fe9e6a9061da329183f8f488d79580f7da (diff) | |
download | kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.zip kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.tar.gz kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.tar.bz2 |
todo fixi
-rw-r--r-- | korganizer/calendarview.cpp | 14 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 17 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 7 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 2 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 3 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 6 |
6 files changed, 45 insertions, 4 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 7c8316f..3dac20b 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2242,57 +2242,69 @@ void CalendarView::edit_options() | |||
2242 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto apply timezone changes?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), | 2242 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto apply timezone changes?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), |
2243 | i18n("Timezone settings"),i18n("Reload"))) { | 2243 | i18n("Timezone settings"),i18n("Reload"))) { |
2244 | qDebug("KO: TZ reload cancelled "); | 2244 | qDebug("KO: TZ reload cancelled "); |
2245 | return; | 2245 | return; |
2246 | } | 2246 | } |
2247 | qDebug("KO: Timezone change "); | 2247 | qDebug("KO: Timezone change "); |
2248 | openCalendar( MainWindow::defaultFileName() ); | 2248 | openCalendar( MainWindow::defaultFileName() ); |
2249 | setModified(true); | 2249 | setModified(true); |
2250 | } | 2250 | } |
2251 | else | 2251 | else |
2252 | qDebug("KO: No tz change "); | 2252 | qDebug("KO: No tz change "); |
2253 | 2253 | ||
2254 | } | 2254 | } |
2255 | 2255 | ||
2256 | 2256 | ||
2257 | void CalendarView::slotSelectPickerDate( QDate d) | 2257 | void CalendarView::slotSelectPickerDate( QDate d) |
2258 | { | 2258 | { |
2259 | mDateFrame->hide(); | 2259 | mDateFrame->hide(); |
2260 | if ( mDatePickerMode == 1 ) { | 2260 | if ( mDatePickerMode == 1 ) { |
2261 | mNavigator->slotDaySelect( d ); | 2261 | mNavigator->slotDaySelect( d ); |
2262 | } else if ( mDatePickerMode == 2 ) { | 2262 | } else if ( mDatePickerMode == 2 ) { |
2263 | if ( mMoveIncidence->type() == "Todo" ) { | 2263 | if ( mMoveIncidence->type() == "Todo" ) { |
2264 | Todo * to = (Todo *) mMoveIncidence; | 2264 | Todo * to = (Todo *) mMoveIncidence; |
2265 | QTime tim; | 2265 | QTime tim; |
2266 | int len = 0; | ||
2267 | if ( to->hasStartDate() && to->hasDueDate() ) | ||
2268 | len = to->dtStart().secsTo( to->dtDue()); | ||
2266 | if ( to->hasDueDate() ) | 2269 | if ( to->hasDueDate() ) |
2267 | tim = to->dtDue().time(); | 2270 | tim = to->dtDue().time(); |
2268 | else { | 2271 | else { |
2269 | tim = QTime ( 0,0,0 ); | 2272 | tim = QTime ( 0,0,0 ); |
2270 | to->setFloats( true ); | 2273 | to->setFloats( true ); |
2271 | to->setHasDueDate( true ); | 2274 | to->setHasDueDate( true ); |
2272 | } | 2275 | } |
2273 | QDateTime dt ( d,tim ); | 2276 | QDateTime dt ( d,tim ); |
2274 | to->setDtDue( dt ); | 2277 | to->setDtDue( dt ); |
2278 | |||
2279 | if ( to->hasStartDate() ) { | ||
2280 | if ( len>0 ) | ||
2281 | to->setDtStart(to->dtDue().addSecs( -len )); | ||
2282 | else | ||
2283 | if (to->dtStart() > to->dtDue() ) | ||
2284 | to->setDtStart(to->dtDue().addDays( -3 )); | ||
2285 | } | ||
2286 | |||
2275 | todoChanged( to ); | 2287 | todoChanged( to ); |
2276 | } else { | 2288 | } else { |
2277 | if ( mMoveIncidence->doesRecur() ) { | 2289 | if ( mMoveIncidence->doesRecur() ) { |
2278 | #if 0 | 2290 | #if 0 |
2279 | // PENDING implement this | 2291 | // PENDING implement this |
2280 | Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); | 2292 | Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); |
2281 | mCalendar()->addIncidence( newInc ); | 2293 | mCalendar()->addIncidence( newInc ); |
2282 | if ( mMoveIncidence->type() == "Todo" ) | 2294 | if ( mMoveIncidence->type() == "Todo" ) |
2283 | emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); | 2295 | emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); |
2284 | else | 2296 | else |
2285 | emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); | 2297 | emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); |
2286 | mMoveIncidence = newInc; | 2298 | mMoveIncidence = newInc; |
2287 | 2299 | ||
2288 | #endif | 2300 | #endif |
2289 | } | 2301 | } |
2290 | QTime tim = mMoveIncidence->dtStart().time(); | 2302 | QTime tim = mMoveIncidence->dtStart().time(); |
2291 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); | 2303 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); |
2292 | QDateTime dt ( d,tim ); | 2304 | QDateTime dt ( d,tim ); |
2293 | mMoveIncidence->setDtStart( dt ); | 2305 | mMoveIncidence->setDtStart( dt ); |
2294 | ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); | 2306 | ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); |
2295 | changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); | 2307 | changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); |
2296 | } | 2308 | } |
2297 | 2309 | ||
2298 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); | 2310 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); |
@@ -3789,49 +3801,49 @@ void CalendarView::deleteIncidence(Incidence *incidence) | |||
3789 | 3801 | ||
3790 | void CalendarView::lookForOutgoingMessages() | 3802 | void CalendarView::lookForOutgoingMessages() |
3791 | { | 3803 | { |
3792 | OutgoingDialog *ogd = mDialogManager->outgoingDialog(); | 3804 | OutgoingDialog *ogd = mDialogManager->outgoingDialog(); |
3793 | ogd->loadMessages(); | 3805 | ogd->loadMessages(); |
3794 | } | 3806 | } |
3795 | 3807 | ||
3796 | void CalendarView::lookForIncomingMessages() | 3808 | void CalendarView::lookForIncomingMessages() |
3797 | { | 3809 | { |
3798 | IncomingDialog *icd = mDialogManager->incomingDialog(); | 3810 | IncomingDialog *icd = mDialogManager->incomingDialog(); |
3799 | icd->retrieve(); | 3811 | icd->retrieve(); |
3800 | } | 3812 | } |
3801 | 3813 | ||
3802 | bool CalendarView::removeCompletedSubTodos( Todo* t ) | 3814 | bool CalendarView::removeCompletedSubTodos( Todo* t ) |
3803 | { | 3815 | { |
3804 | bool deleteTodo = true; | 3816 | bool deleteTodo = true; |
3805 | QPtrList<Incidence> subTodos; | 3817 | QPtrList<Incidence> subTodos; |
3806 | Incidence *aTodo; | 3818 | Incidence *aTodo; |
3807 | subTodos = t->relations(); | 3819 | subTodos = t->relations(); |
3808 | for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { | 3820 | for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { |
3809 | if (! removeCompletedSubTodos( (Todo*) aTodo )) | 3821 | if (! removeCompletedSubTodos( (Todo*) aTodo )) |
3810 | deleteTodo = false; | 3822 | deleteTodo = false; |
3811 | } | 3823 | } |
3812 | if ( deleteTodo ) { | 3824 | if ( deleteTodo ) { |
3813 | if ( t->isCompleted() ) { | 3825 | if ( t->isCompleted() && !t->doesRecur()) { |
3814 | checkExternalId( t ); | 3826 | checkExternalId( t ); |
3815 | mCalendar->deleteTodo( t ); | 3827 | mCalendar->deleteTodo( t ); |
3816 | changeTodoDisplay( t,KOGlobals::EVENTDELETED ); | 3828 | changeTodoDisplay( t,KOGlobals::EVENTDELETED ); |
3817 | } | 3829 | } |
3818 | else | 3830 | else |
3819 | deleteTodo = false; | 3831 | deleteTodo = false; |
3820 | } | 3832 | } |
3821 | return deleteTodo; | 3833 | return deleteTodo; |
3822 | 3834 | ||
3823 | } | 3835 | } |
3824 | void CalendarView::purgeCompleted() | 3836 | void CalendarView::purgeCompleted() |
3825 | { | 3837 | { |
3826 | int result = KMessageBox::warningContinueCancel(this, | 3838 | int result = KMessageBox::warningContinueCancel(this, |
3827 | i18n("Delete all\ncompleted To-Dos?"),i18n("Purge To-Dos"),i18n("Purge")); | 3839 | i18n("Delete all\ncompleted To-Dos?"),i18n("Purge To-Dos"),i18n("Purge")); |
3828 | 3840 | ||
3829 | if (result == KMessageBox::Continue) { | 3841 | if (result == KMessageBox::Continue) { |
3830 | 3842 | ||
3831 | QPtrList<Todo> todoCal; | 3843 | QPtrList<Todo> todoCal; |
3832 | QPtrList<Todo> rootTodos; | 3844 | QPtrList<Todo> rootTodos; |
3833 | //QPtrList<Incidence> rel; | 3845 | //QPtrList<Incidence> rel; |
3834 | Todo *aTodo;//, *rTodo; | 3846 | Todo *aTodo;//, *rTodo; |
3835 | Incidence *rIncidence; | 3847 | Incidence *rIncidence; |
3836 | bool childDelete = false; | 3848 | bool childDelete = false; |
3837 | bool deletedOne = true; | 3849 | bool deletedOne = true; |
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 13d8398..4ff6899 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -978,49 +978,62 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) | |||
978 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); | 978 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); |
979 | endDt.setDate(startDate); | 979 | endDt.setDate(startDate); |
980 | } | 980 | } |
981 | } | 981 | } |
982 | } else { | 982 | } else { |
983 | // todo | 983 | // todo |
984 | if (item->lastMultiItem()) { | 984 | if (item->lastMultiItem()) { |
985 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); | 985 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); |
986 | endDt.setDate(startDate. | 986 | endDt.setDate(startDate. |
987 | addDays(item->lastMultiItem()->cellX() - item->cellX())); | 987 | addDays(item->lastMultiItem()->cellX() - item->cellX())); |
988 | } else { | 988 | } else { |
989 | //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); | 989 | //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); |
990 | if ( item->cellYBottom() > 0 ) | 990 | if ( item->cellYBottom() > 0 ) |
991 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); | 991 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); |
992 | else | 992 | else |
993 | endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); | 993 | endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); |
994 | endDt.setDate(startDate); | 994 | endDt.setDate(startDate); |
995 | } | 995 | } |
996 | } | 996 | } |
997 | } | 997 | } |
998 | if ( item->incidence()->type() == "Event" ) { | 998 | if ( item->incidence()->type() == "Event" ) { |
999 | item->incidence()->setDtStart(startDt); | 999 | item->incidence()->setDtStart(startDt); |
1000 | (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); | 1000 | (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); |
1001 | } else if ( item->incidence()->type() == "Todo" ) { | 1001 | } else if ( item->incidence()->type() == "Todo" ) { |
1002 | (static_cast<Todo*>(item->incidence()))->setDtDue(endDt); | 1002 | Todo* to = static_cast<Todo*>(item->incidence()); |
1003 | |||
1004 | int len = 0; | ||
1005 | if ( to->hasStartDate() && to->hasDueDate() ) | ||
1006 | len = to->dtStart().secsTo( to->dtDue()); | ||
1007 | to->setDtDue(endDt); | ||
1008 | if ( to->hasStartDate() ) { | ||
1009 | if ( len>0 ) | ||
1010 | to->setDtStart(to->dtDue().addSecs( -len )); | ||
1011 | else | ||
1012 | if (to->dtStart() > to->dtDue() ) | ||
1013 | to->setDtStart(to->dtDue().addDays( -3 )); | ||
1014 | } | ||
1015 | |||
1003 | } | 1016 | } |
1004 | //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); | 1017 | //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); |
1005 | item->incidence()->setRevision(item->incidence()->revision()+1); | 1018 | item->incidence()->setRevision(item->incidence()->revision()+1); |
1006 | item->setItemDate(startDt.date()); | 1019 | item->setItemDate(startDt.date()); |
1007 | //item->updateItem(); | 1020 | //item->updateItem(); |
1008 | if ( item->incidence()->type() == "Todo" ) { | 1021 | if ( item->incidence()->type() == "Todo" ) { |
1009 | emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED ); | 1022 | emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED ); |
1010 | 1023 | ||
1011 | } | 1024 | } |
1012 | else | 1025 | else |
1013 | emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED); | 1026 | emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED); |
1014 | item->updateItem(); | 1027 | item->updateItem(); |
1015 | } | 1028 | } |
1016 | 1029 | ||
1017 | void KOAgendaView::showDates( const QDate &start, const QDate &end ) | 1030 | void KOAgendaView::showDates( const QDate &start, const QDate &end ) |
1018 | { | 1031 | { |
1019 | // kdDebug() << "KOAgendaView::selectDates" << endl; | 1032 | // kdDebug() << "KOAgendaView::selectDates" << endl; |
1020 | 1033 | ||
1021 | mSelectedDates.clear(); | 1034 | mSelectedDates.clear(); |
1022 | // qDebug("KOAgendaView::showDates "); | 1035 | // qDebug("KOAgendaView::showDates "); |
1023 | QDate d = start; | 1036 | QDate d = start; |
1024 | while (d <= end) { | 1037 | while (d <= end) { |
1025 | mSelectedDates.append(d); | 1038 | mSelectedDates.append(d); |
1026 | d = d.addDays( 1 ); | 1039 | d = d.addDays( 1 ); |
@@ -1159,49 +1172,49 @@ void KOAgendaView::fillAgenda() | |||
1159 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); | 1172 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); |
1160 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; | 1173 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; |
1161 | } else if (endX == curCol) { | 1174 | } else if (endX == curCol) { |
1162 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); | 1175 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); |
1163 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; | 1176 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; |
1164 | } else { | 1177 | } else { |
1165 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); | 1178 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); |
1166 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); | 1179 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); |
1167 | } | 1180 | } |
1168 | } else { | 1181 | } else { |
1169 | int startY = mAgenda->timeToY(event->dtStart().time()); | 1182 | int startY = mAgenda->timeToY(event->dtStart().time()); |
1170 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; | 1183 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; |
1171 | if (endY < startY) endY = startY; | 1184 | if (endY < startY) endY = startY; |
1172 | mAgenda->insertItem(event,currentDate,curCol,startY,endY); | 1185 | mAgenda->insertItem(event,currentDate,curCol,startY,endY); |
1173 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; | 1186 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; |
1174 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; | 1187 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; |
1175 | } | 1188 | } |
1176 | } | 1189 | } |
1177 | // ---------- [display Todos -------------- | 1190 | // ---------- [display Todos -------------- |
1178 | unsigned int numTodo; | 1191 | unsigned int numTodo; |
1179 | for (numTodo = 0; numTodo < todos.count(); ++numTodo) { | 1192 | for (numTodo = 0; numTodo < todos.count(); ++numTodo) { |
1180 | Todo *todo = todos.at(numTodo); | 1193 | Todo *todo = todos.at(numTodo); |
1181 | 1194 | ||
1182 | if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date | 1195 | if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date |
1183 | 1196 | ||
1184 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. | 1197 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. |
1185 | // Already completed items can be displayed on their original due date | 1198 | // Already completed items can be displayed on their original due date |
1186 | //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda | 1199 | //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda |
1187 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; | 1200 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; |
1188 | bool fillIn = false; | 1201 | bool fillIn = false; |
1189 | if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) | 1202 | if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) |
1190 | fillIn = true; | 1203 | fillIn = true; |
1191 | if ( ! fillIn && !todo->hasCompletedDate() ) | 1204 | if ( ! fillIn && !todo->hasCompletedDate() ) |
1192 | fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue); | 1205 | fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue); |
1193 | if ( fillIn ) { | 1206 | if ( fillIn ) { |
1194 | if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue | 1207 | if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue |
1195 | if ( KOPrefs::instance()->mShowTodoInAgenda ) | 1208 | if ( KOPrefs::instance()->mShowTodoInAgenda ) |
1196 | mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol); | 1209 | mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol); |
1197 | } | 1210 | } |
1198 | else { | 1211 | else { |
1199 | QDateTime dt; | 1212 | QDateTime dt; |
1200 | if ( todo->hasCompletedDate() ) | 1213 | if ( todo->hasCompletedDate() ) |
1201 | dt = todo->completed(); | 1214 | dt = todo->completed(); |
1202 | else | 1215 | else |
1203 | dt = todo->dtDue();; | 1216 | dt = todo->dtDue();; |
1204 | 1217 | ||
1205 | 1218 | ||
1206 | int endY = mAgenda->timeToY(dt.time()) - 1; | 1219 | int endY = mAgenda->timeToY(dt.time()) - 1; |
1207 | int hi = (18/KOPrefs::instance()->mHourSize); | 1220 | int hi = (18/KOPrefs::instance()->mHourSize); |
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 39921a0..f6c9624 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -381,48 +381,55 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) | |||
381 | mMailSubject += i18n( "Todo " )+ event->summary(); | 381 | mMailSubject += i18n( "Todo " )+ event->summary(); |
382 | 382 | ||
383 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { | 383 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { |
384 | mText +="<font color=\"#B00000\">"; | 384 | mText +="<font color=\"#B00000\">"; |
385 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); | 385 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); |
386 | mText += "</font>"; | 386 | mText += "</font>"; |
387 | } else { | 387 | } else { |
388 | mText.append(i18n("<p><i>%1 % completed</i></p>") | 388 | mText.append(i18n("<p><i>%1 % completed</i></p>") |
389 | .arg(event->percentComplete())); | 389 | .arg(event->percentComplete())); |
390 | } | 390 | } |
391 | 391 | ||
392 | if (event->cancelled ()) { | 392 | if (event->cancelled ()) { |
393 | mText +="<font color=\"#B00000\">"; | 393 | mText +="<font color=\"#B00000\">"; |
394 | addTag("i",i18n("This todo has been cancelled!")); | 394 | addTag("i",i18n("This todo has been cancelled!")); |
395 | mText.append("<br>"); | 395 | mText.append("<br>"); |
396 | mText += "</font>"; | 396 | mText += "</font>"; |
397 | mMailSubject += i18n("(cancelled)"); | 397 | mMailSubject += i18n("(cancelled)"); |
398 | } | 398 | } |
399 | 399 | ||
400 | if (!event->location().isEmpty()) { | 400 | if (!event->location().isEmpty()) { |
401 | addTag("b",i18n("Location: ")); | 401 | addTag("b",i18n("Location: ")); |
402 | mText.append(event->location()+"<br>"); | 402 | mText.append(event->location()+"<br>"); |
403 | mMailSubject += i18n(" at ") + event->location(); | 403 | mMailSubject += i18n(" at ") + event->location(); |
404 | } | 404 | } |
405 | |||
406 | if (event->recurrence()->doesRecur()) { | ||
407 | |||
408 | QString recurText = event->recurrence()->recurrenceText(); | ||
409 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); | ||
410 | |||
411 | } | ||
405 | if (event->hasStartDate()) { | 412 | if (event->hasStartDate()) { |
406 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); | 413 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); |
407 | } | 414 | } |
408 | if (event->hasDueDate()) { | 415 | if (event->hasDueDate()) { |
409 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); | 416 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); |
410 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); | 417 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); |
411 | } | 418 | } |
412 | addTag("b",i18n("Access: ")); | 419 | addTag("b",i18n("Access: ")); |
413 | mText.append(event->secrecyStr()+"<br>"); | 420 | mText.append(event->secrecyStr()+"<br>"); |
414 | if (!event->description().isEmpty()) { | 421 | if (!event->description().isEmpty()) { |
415 | addTag("p",i18n("<b>Details: </b>")); | 422 | addTag("p",i18n("<b>Details: </b>")); |
416 | addTag("p",event->description()); | 423 | addTag("p",event->description()); |
417 | } | 424 | } |
418 | 425 | ||
419 | formatCategories(event); | 426 | formatCategories(event); |
420 | 427 | ||
421 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | 428 | mText.append(i18n("<p><b>Priority:</b> %2</p>") |
422 | .arg(QString::number(event->priority()))); | 429 | .arg(QString::number(event->priority()))); |
423 | 430 | ||
424 | formatReadOnly(event); | 431 | formatReadOnly(event); |
425 | formatAttendees(event); | 432 | formatAttendees(event); |
426 | if ( event->relatedTo() ) { | 433 | if ( event->relatedTo() ) { |
427 | addTag("b",i18n("Parent todo:<br>")); | 434 | addTag("b",i18n("Parent todo:<br>")); |
428 | mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); | 435 | mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index acd9265..d8e940b 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -135,49 +135,49 @@ bool ListItemVisitor::visit(Event *e) | |||
135 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); | 135 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); |
136 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); | 136 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); |
137 | mItem->setSortKey(3,key); | 137 | mItem->setSortKey(3,key); |
138 | 138 | ||
139 | return true; | 139 | return true; |
140 | } | 140 | } |
141 | 141 | ||
142 | bool ListItemVisitor::visit(Todo *t) | 142 | bool ListItemVisitor::visit(Todo *t) |
143 | { | 143 | { |
144 | mItem->setText(0,i18n("To-Do: %1").arg(t->summary())); | 144 | mItem->setText(0,i18n("To-Do: %1").arg(t->summary())); |
145 | if (t->hasStartDate()) { | 145 | if (t->hasStartDate()) { |
146 | mItem->setText(1,t->dtStartDateStr()); | 146 | mItem->setText(1,t->dtStartDateStr()); |
147 | if (t->doesFloat()) { | 147 | if (t->doesFloat()) { |
148 | mItem->setText(2,"---"); | 148 | mItem->setText(2,"---"); |
149 | } else { | 149 | } else { |
150 | mItem->setText(2,t->dtStartTimeStr()); | 150 | mItem->setText(2,t->dtStartTimeStr()); |
151 | } | 151 | } |
152 | } else { | 152 | } else { |
153 | mItem->setText(1,"---"); | 153 | mItem->setText(1,"---"); |
154 | mItem->setText(2,"---"); | 154 | mItem->setText(2,"---"); |
155 | } | 155 | } |
156 | mItem->setText(3,"---"); | 156 | mItem->setText(3,"---"); |
157 | mItem->setText(4,"---"); | 157 | mItem->setText(4,"---"); |
158 | mItem->setText(5,t->isAlarmEnabled() ? i18n("Yes") : i18n("No")); | 158 | mItem->setText(5,t->isAlarmEnabled() ? i18n("Yes") : i18n("No")); |
159 | mItem->setText(6,"---"); | 159 | mItem->setText(6, t->recurrence()->recurrenceText()); |
160 | if (t->hasDueDate()) { | 160 | if (t->hasDueDate()) { |
161 | mItem->setText(7,t->dtDueDateStr()); | 161 | mItem->setText(7,t->dtDueDateStr()); |
162 | if (t->doesFloat()) { | 162 | if (t->doesFloat()) { |
163 | mItem->setText(8,"---"); | 163 | mItem->setText(8,"---"); |
164 | } else { | 164 | } else { |
165 | mItem->setText(8,t->dtDueTimeStr()); | 165 | mItem->setText(8,t->dtDueTimeStr()); |
166 | } | 166 | } |
167 | } else { | 167 | } else { |
168 | mItem->setText(7,"---"); | 168 | mItem->setText(7,"---"); |
169 | mItem->setText(8,"---"); | 169 | mItem->setText(8,"---"); |
170 | } | 170 | } |
171 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); | 171 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); |
172 | mItem->setText(10,t->categoriesStr()); | 172 | mItem->setText(10,t->categoriesStr()); |
173 | 173 | ||
174 | QString key; | 174 | QString key; |
175 | QDate d; | 175 | QDate d; |
176 | if (t->hasDueDate()) { | 176 | if (t->hasDueDate()) { |
177 | d = t->dtDue().date(); | 177 | d = t->dtDue().date(); |
178 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); | 178 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); |
179 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 179 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
180 | mItem->setSortKey(7,key); | 180 | mItem->setSortKey(7,key); |
181 | } | 181 | } |
182 | if ( t->hasStartDate() ) { | 182 | if ( t->hasStartDate() ) { |
183 | d = t->dtStart().date(); | 183 | d = t->dtStart().date(); |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index f595d35..d0380e3 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -560,48 +560,51 @@ void MonthViewCell::insertTodo(Todo *todo) | |||
560 | QPalette pal; | 560 | QPalette pal; |
561 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 561 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
562 | QStringList categories = todo->categories(); | 562 | QStringList categories = todo->categories(); |
563 | QString cat = categories.first(); | 563 | QString cat = categories.first(); |
564 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 564 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
565 | pal = getPalette(); | 565 | pal = getPalette(); |
566 | if (cat.isEmpty()) { | 566 | if (cat.isEmpty()) { |
567 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 567 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
568 | } else { | 568 | } else { |
569 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 569 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
570 | } | 570 | } |
571 | 571 | ||
572 | } else { | 572 | } else { |
573 | if (cat.isEmpty()) { | 573 | if (cat.isEmpty()) { |
574 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 574 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
575 | } else { | 575 | } else { |
576 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 576 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
577 | } | 577 | } |
578 | } | 578 | } |
579 | 579 | ||
580 | } else { | 580 | } else { |
581 | pal = mStandardPalette ; | 581 | pal = mStandardPalette ; |
582 | } | 582 | } |
583 | item->setPalette( pal ); | 583 | item->setPalette( pal ); |
584 | item->setRecur( todo->recurrence()->doesRecur() ); | ||
585 | item->setAlarm( todo->isAlarmEnabled() ); | ||
586 | item->setMoreInfo( todo->description().length() > 0 ); | ||
584 | mItemList->insertItem( item ); | 587 | mItemList->insertItem( item ); |
585 | mToolTip += text+"\n"; | 588 | mToolTip += text+"\n"; |
586 | } | 589 | } |
587 | void MonthViewCell::finishUpdateCell() | 590 | void MonthViewCell::finishUpdateCell() |
588 | { | 591 | { |
589 | #ifdef DESKTOP_VERSION | 592 | #ifdef DESKTOP_VERSION |
590 | if (mToolTip != "") | 593 | if (mToolTip != "") |
591 | QToolTip::add(this,mToolTip,toolTipGroup(),""); | 594 | QToolTip::add(this,mToolTip,toolTipGroup(),""); |
592 | #endif | 595 | #endif |
593 | mItemList->sort(); | 596 | mItemList->sort(); |
594 | //setMyPalette(); | 597 | //setMyPalette(); |
595 | setMyPalette(); | 598 | setMyPalette(); |
596 | QString text; | 599 | QString text; |
597 | bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; | 600 | bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; |
598 | if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { | 601 | if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { |
599 | text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; | 602 | text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; |
600 | mLabel->resize( mLabelBigSize ); | 603 | mLabel->resize( mLabelBigSize ); |
601 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); | 604 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); |
602 | } else { | 605 | } else { |
603 | mLabel->resize( mLabelSize ); | 606 | mLabel->resize( mLabelSize ); |
604 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); | 607 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); |
605 | } | 608 | } |
606 | 609 | ||
607 | mLabel->setText( text ); | 610 | mLabel->setText( text ); |
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 391b3bb..18dc656 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp | |||
@@ -646,48 +646,54 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) | |||
646 | mText += "<li>"; | 646 | mText += "<li>"; |
647 | mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] "; | 647 | mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] "; |
648 | 648 | ||
649 | 649 | ||
650 | mText += ind; | 650 | mText += ind; |
651 | bool needClose = false; | 651 | bool needClose = false; |
652 | if ( ev->cancelled() ) { | 652 | if ( ev->cancelled() ) { |
653 | mText += "<font color=\"#F00000\">[c"; | 653 | mText += "<font color=\"#F00000\">[c"; |
654 | needClose =true; | 654 | needClose =true; |
655 | 655 | ||
656 | } | 656 | } |
657 | if ( ev->isAlarmEnabled() ) { | 657 | if ( ev->isAlarmEnabled() ) { |
658 | if ( !needClose) | 658 | if ( !needClose) |
659 | mText +="["; | 659 | mText +="["; |
660 | mText += "a"; | 660 | mText += "a"; |
661 | needClose =true; | 661 | needClose =true; |
662 | 662 | ||
663 | } | 663 | } |
664 | 664 | ||
665 | if ( ev->description().length() > 0 ) { | 665 | if ( ev->description().length() > 0 ) { |
666 | if ( !needClose) | 666 | if ( !needClose) |
667 | mText +="["; | 667 | mText +="["; |
668 | mText += "i"; | 668 | mText += "i"; |
669 | needClose =true; | 669 | needClose =true; |
670 | } | ||
671 | if ( ev->doesRecur() ) { | ||
672 | if ( !needClose) | ||
673 | mText +="["; | ||
674 | mText += "r"; | ||
675 | needClose =true; | ||
670 | } | 676 | } |
671 | // if ( ev->recurrence()->doesRecur() ) { | 677 | // if ( ev->recurrence()->doesRecur() ) { |
672 | // if ( !needClose) | 678 | // if ( !needClose) |
673 | // mText +="("; | 679 | // mText +="("; |
674 | // mText += "r"; | 680 | // mText += "r"; |
675 | // needClose =true; | 681 | // needClose =true; |
676 | // } | 682 | // } |
677 | if ( needClose ) | 683 | if ( needClose ) |
678 | mText += "] "; | 684 | mText += "] "; |
679 | if ( ev->cancelled() ) | 685 | if ( ev->cancelled() ) |
680 | mText += "</font>"; | 686 | mText += "</font>"; |
681 | mText += "<a href=\"todo:" + ev->uid() + "\">"; | 687 | mText += "<a href=\"todo:" + ev->uid() + "\">"; |
682 | if ( ev->summary().length() > 0 ) | 688 | if ( ev->summary().length() > 0 ) |
683 | mText += ev->summary(); | 689 | mText += ev->summary(); |
684 | else | 690 | else |
685 | mText += i18n("-no summary-"); | 691 | mText += i18n("-no summary-"); |
686 | mText += "</a>"; | 692 | mText += "</a>"; |
687 | if ( ((Todo*)ev)->hasDueDate () ) { | 693 | if ( ((Todo*)ev)->hasDueDate () ) { |
688 | QString year = ""; | 694 | QString year = ""; |
689 | int ye = ((Todo*)ev)->dtDue().date().year(); | 695 | int ye = ((Todo*)ev)->dtDue().date().year(); |
690 | if ( QDateTime::currentDateTime().date().year() != ye ) | 696 | if ( QDateTime::currentDateTime().date().year() != ye ) |
691 | year = QString::number( ye ); | 697 | year = QString::number( ye ); |
692 | QString dfs = KGlobal::locale()->dateFormatShort(); | 698 | QString dfs = KGlobal::locale()->dateFormatShort(); |
693 | KGlobal::locale()->setDateFormatShort("%d.%b"); | 699 | KGlobal::locale()->setDateFormatShort("%d.%b"); |