-rw-r--r-- | korganizer/calendarview.cpp | 2 | ||||
-rw-r--r-- | korganizer/koagenda.cpp | 4 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 2 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 2 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 2 | ||||
-rw-r--r-- | korganizer/koeditorrecurrence.cpp | 172 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 6 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 4 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 6 | ||||
-rw-r--r-- | korganizer/kotodoeditor.cpp | 3 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 4 |
11 files changed, 108 insertions, 99 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index a76f2ed..a9d42f0 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -3746,33 +3746,33 @@ void CalendarView::deleteJournal(Journal *jour) | |||
3746 | break; | 3746 | break; |
3747 | } // switch | 3747 | } // switch |
3748 | } else { | 3748 | } else { |
3749 | calendar()->deleteJournal(jour);; | 3749 | calendar()->deleteJournal(jour);; |
3750 | updateView(); | 3750 | updateView(); |
3751 | } | 3751 | } |
3752 | emit updateSearchDialog(); | 3752 | emit updateSearchDialog(); |
3753 | } | 3753 | } |
3754 | 3754 | ||
3755 | void CalendarView::deleteEvent(Event *anEvent) | 3755 | void CalendarView::deleteEvent(Event *anEvent) |
3756 | { | 3756 | { |
3757 | if (!anEvent) { | 3757 | if (!anEvent) { |
3758 | KNotifyClient::beep(); | 3758 | KNotifyClient::beep(); |
3759 | return; | 3759 | return; |
3760 | } | 3760 | } |
3761 | 3761 | ||
3762 | if (anEvent->recurrence()->doesRecur()) { | 3762 | if (anEvent->doesRecur()) { |
3763 | QDate itemDate = mViewManager->currentSelectionDate(); | 3763 | QDate itemDate = mViewManager->currentSelectionDate(); |
3764 | int km; | 3764 | int km; |
3765 | if (!itemDate.isValid()) { | 3765 | if (!itemDate.isValid()) { |
3766 | //kdDebug() << "Date Not Valid" << endl; | 3766 | //kdDebug() << "Date Not Valid" << endl; |
3767 | if (KOPrefs::instance()->mConfirm) { | 3767 | if (KOPrefs::instance()->mConfirm) { |
3768 | km = KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + | 3768 | km = KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + |
3769 | i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), | 3769 | i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), |
3770 | i18n("KO/Pi Confirmation"),i18n("Delete All")); | 3770 | i18n("KO/Pi Confirmation"),i18n("Delete All")); |
3771 | if ( km == KMessageBox::Continue ) | 3771 | if ( km == KMessageBox::Continue ) |
3772 | km = KMessageBox::No; // No = all below | 3772 | km = KMessageBox::No; // No = all below |
3773 | } else | 3773 | } else |
3774 | km = KMessageBox::No; | 3774 | km = KMessageBox::No; |
3775 | } else { | 3775 | } else { |
3776 | km = KMessageBox::warningYesNoCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + | 3776 | km = KMessageBox::warningYesNoCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + |
3777 | i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ | 3777 | i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ |
3778 | KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), | 3778 | KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), |
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 0dd5ef5..c738f7e 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -566,33 +566,33 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
566 | } | 566 | } |
567 | } | 567 | } |
568 | } | 568 | } |
569 | if ( objIsNotViewport ) { | 569 | if ( objIsNotViewport ) { |
570 | mPopupItem = (KOAgendaItem *)object; | 570 | mPopupItem = (KOAgendaItem *)object; |
571 | mPopupKind = 1; | 571 | mPopupKind = 1; |
572 | if (me->button() == RightButton) { | 572 | if (me->button() == RightButton) { |
573 | mPopupKind = 3; | 573 | mPopupKind = 3; |
574 | popupMenu(); | 574 | popupMenu(); |
575 | } else if (me->button() == LeftButton) { | 575 | } else if (me->button() == LeftButton) { |
576 | mActionItem = (KOAgendaItem *)object; | 576 | mActionItem = (KOAgendaItem *)object; |
577 | if (mActionItem) { | 577 | if (mActionItem) { |
578 | emit signalClearSelection(); | 578 | emit signalClearSelection(); |
579 | slotClearSelection(); | 579 | slotClearSelection(); |
580 | selectItem(mActionItem); | 580 | selectItem(mActionItem); |
581 | Incidence *incidence = mActionItem->incidence(); | 581 | Incidence *incidence = mActionItem->incidence(); |
582 | if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { | 582 | if ( incidence->isReadOnly() /*|| incidence->doesRecur() */) { |
583 | mActionItem = 0; | 583 | mActionItem = 0; |
584 | } else { | 584 | } else { |
585 | startItemAction(viewportPos); | 585 | startItemAction(viewportPos); |
586 | } | 586 | } |
587 | } | 587 | } |
588 | } | 588 | } |
589 | } else { // ---------- viewport() | 589 | } else { // ---------- viewport() |
590 | mPopupItem = 0; | 590 | mPopupItem = 0; |
591 | mPopupKind = 2; | 591 | mPopupKind = 2; |
592 | selectItem(0); | 592 | selectItem(0); |
593 | mActionItem = 0; | 593 | mActionItem = 0; |
594 | if (me->button() == RightButton) { | 594 | if (me->button() == RightButton) { |
595 | int x,y; | 595 | int x,y; |
596 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 596 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
597 | int gx,gy; | 597 | int gx,gy; |
598 | contentsToGrid(x,y,gx,gy); | 598 | contentsToGrid(x,y,gx,gy); |
@@ -986,33 +986,33 @@ void KOAgenda::performItemAction(QPoint viewportPos) | |||
986 | mActionItem->height()); | 986 | mActionItem->height()); |
987 | } | 987 | } |
988 | } | 988 | } |
989 | mCurrentCellX = gx; | 989 | mCurrentCellX = gx; |
990 | mCurrentCellY = gy; | 990 | mCurrentCellY = gy; |
991 | } | 991 | } |
992 | } | 992 | } |
993 | 993 | ||
994 | void KOAgenda::endItemAction() | 994 | void KOAgenda::endItemAction() |
995 | { | 995 | { |
996 | 996 | ||
997 | if ( mItemMoved ) { | 997 | if ( mItemMoved ) { |
998 | KOAgendaItem *placeItem = mActionItem->firstMultiItem(); | 998 | KOAgendaItem *placeItem = mActionItem->firstMultiItem(); |
999 | if ( !placeItem ) { | 999 | if ( !placeItem ) { |
1000 | placeItem = mActionItem; | 1000 | placeItem = mActionItem; |
1001 | } | 1001 | } |
1002 | if ( placeItem->incidence()->recurrence()->doesRecur() ) { | 1002 | if ( placeItem->incidence()->doesRecur() ) { |
1003 | Incidence* oldInc = placeItem->incidence(); | 1003 | Incidence* oldInc = placeItem->incidence(); |
1004 | placeItem->recreateIncidence(); | 1004 | placeItem->recreateIncidence(); |
1005 | emit addToCalSignal(placeItem->incidence(), oldInc ); | 1005 | emit addToCalSignal(placeItem->incidence(), oldInc ); |
1006 | } | 1006 | } |
1007 | int type = mActionType; | 1007 | int type = mActionType; |
1008 | if ( mAllDayMode ) | 1008 | if ( mAllDayMode ) |
1009 | type = -1; | 1009 | type = -1; |
1010 | KOAgendaItem *modifiedItem = placeItem; | 1010 | KOAgendaItem *modifiedItem = placeItem; |
1011 | //emit itemModified( placeItem, mActionType /*KOGlobals::EVENTEDITED */); | 1011 | //emit itemModified( placeItem, mActionType /*KOGlobals::EVENTEDITED */); |
1012 | QPtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems(); | 1012 | QPtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems(); |
1013 | KOAgendaItem *item; | 1013 | KOAgendaItem *item; |
1014 | 1014 | ||
1015 | if ( placeItem->incidence()->typeID() == todoID ) { | 1015 | if ( placeItem->incidence()->typeID() == todoID ) { |
1016 | mSelectedItem = 0; | 1016 | mSelectedItem = 0; |
1017 | //qDebug("todo %d %d %d ", mCurrentCellX, modifiedItem->cellX() ,modifiedItem->cellXWidth()); | 1017 | //qDebug("todo %d %d %d ", mCurrentCellX, modifiedItem->cellX() ,modifiedItem->cellXWidth()); |
1018 | modifiedItem->mLastMoveXPos = mCurrentCellX; | 1018 | modifiedItem->mLastMoveXPos = mCurrentCellX; |
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 303a92a..49ad9b8 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -221,33 +221,33 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) | |||
221 | int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; | 221 | int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; |
222 | int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; | 222 | int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; |
223 | p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); | 223 | p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); |
224 | p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); | 224 | p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); |
225 | if ( horLayout ) | 225 | if ( horLayout ) |
226 | ++xOff; | 226 | ++xOff; |
227 | else | 227 | else |
228 | ++yOff; | 228 | ++yOff; |
229 | } | 229 | } |
230 | if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) { | 230 | if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) { |
231 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); | 231 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); |
232 | if ( horLayout ) | 232 | if ( horLayout ) |
233 | ++xOff; | 233 | ++xOff; |
234 | else | 234 | else |
235 | ++yOff; | 235 | ++yOff; |
236 | } | 236 | } |
237 | if (mIncidence->recurrence()->doesRecur()) { | 237 | if (mIncidence->doesRecur()) { |
238 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); | 238 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); |
239 | if ( horLayout ) | 239 | if ( horLayout ) |
240 | ++xOff; | 240 | ++xOff; |
241 | else | 241 | else |
242 | ++yOff; | 242 | ++yOff; |
243 | } | 243 | } |
244 | if (mIncidence->description().length() > 0) { | 244 | if (mIncidence->description().length() > 0) { |
245 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen ); | 245 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen ); |
246 | if ( horLayout ) | 246 | if ( horLayout ) |
247 | ++xOff; | 247 | ++xOff; |
248 | else | 248 | else |
249 | ++yOff; | 249 | ++yOff; |
250 | } | 250 | } |
251 | if (mIncidence->isReadOnly()) { | 251 | if (mIncidence->isReadOnly()) { |
252 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white ); | 252 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white ); |
253 | if ( horLayout ) | 253 | if ( horLayout ) |
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index a01323a..04f30bb 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -1188,33 +1188,33 @@ void KOAgendaView::fillAgenda() | |||
1188 | 1188 | ||
1189 | unsigned int numEvent; | 1189 | unsigned int numEvent; |
1190 | //qDebug("+++++NUMEVENT %d", dayEvents.count()); | 1190 | //qDebug("+++++NUMEVENT %d", dayEvents.count()); |
1191 | for(numEvent=0;numEvent<dayEvents.count();++numEvent) { | 1191 | for(numEvent=0;numEvent<dayEvents.count();++numEvent) { |
1192 | Event *event = dayEvents.at(numEvent); | 1192 | Event *event = dayEvents.at(numEvent); |
1193 | if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") ) | 1193 | if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") ) |
1194 | if ( event->uid().left(15) == QString("last-syncEvent-") ) | 1194 | if ( event->uid().left(15) == QString("last-syncEvent-") ) |
1195 | continue; | 1195 | continue; |
1196 | // kdDebug() << " Event: " << event->summary() << endl; | 1196 | // kdDebug() << " Event: " << event->summary() << endl; |
1197 | 1197 | ||
1198 | int beginX = currentDate.daysTo(event->dtStart().date()) + curCol; | 1198 | int beginX = currentDate.daysTo(event->dtStart().date()) + curCol; |
1199 | int endX = currentDate.daysTo(event->dtEnd().date()) + curCol; | 1199 | int endX = currentDate.daysTo(event->dtEnd().date()) + curCol; |
1200 | 1200 | ||
1201 | // kdDebug() << " beginX: " << beginX << " endX: " << endX << endl; | 1201 | // kdDebug() << " beginX: " << beginX << " endX: " << endX << endl; |
1202 | 1202 | ||
1203 | if (event->doesFloat()) { | 1203 | if (event->doesFloat()) { |
1204 | if (event->recurrence()->doesRecur()) { | 1204 | if (event->doesRecur()) { |
1205 | if (event->isMultiDay() ) { | 1205 | if (event->isMultiDay() ) { |
1206 | endX = endX - beginX;// endX is now number of days | 1206 | endX = endX - beginX;// endX is now number of days |
1207 | if ( event->recursOn( currentDate ) ) { | 1207 | if ( event->recursOn( currentDate ) ) { |
1208 | endX += curCol; | 1208 | endX += curCol; |
1209 | beginX = curCol; | 1209 | beginX = curCol; |
1210 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); | 1210 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); |
1211 | } else { | 1211 | } else { |
1212 | //qDebug("days endX %d curCol %d max Col %d %s",endX ,curCol, maxCol, currentDate.toString().latin1()); | 1212 | //qDebug("days endX %d curCol %d max Col %d %s",endX ,curCol, maxCol, currentDate.toString().latin1()); |
1213 | if ( curCol == maxCol && maxCol+1 < endX ) { | 1213 | if ( curCol == maxCol && maxCol+1 < endX ) { |
1214 | int i; | 1214 | int i; |
1215 | for ( i = 1; i< endX; ++i ) { | 1215 | for ( i = 1; i< endX; ++i ) { |
1216 | if ( event->recursOn( currentDate.addDays( -i ) ) ) | 1216 | if ( event->recursOn( currentDate.addDays( -i ) ) ) |
1217 | break; | 1217 | break; |
1218 | } | 1218 | } |
1219 | if ( i > maxCol ) { | 1219 | if ( i > maxCol ) { |
1220 | mAllDayAgenda->insertAllDayItem(event,currentDate,0,curCol); | 1220 | mAllDayAgenda->insertAllDayItem(event,currentDate,0,curCol); |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index ec1154a..057df0d 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -440,33 +440,33 @@ void KODayMatrix::updateViewTimed() | |||
440 | 440 | ||
441 | 441 | ||
442 | int i; | 442 | int i; |
443 | int timeSpan = NUMDAYS-1; | 443 | int timeSpan = NUMDAYS-1; |
444 | QPtrList<Event> events = mCalendar->events(); | 444 | QPtrList<Event> events = mCalendar->events(); |
445 | Event *event; | 445 | Event *event; |
446 | QDateTime dt; | 446 | QDateTime dt; |
447 | bool ok; | 447 | bool ok; |
448 | bDays.fill( false); | 448 | bDays.fill( false); |
449 | pDays.fill( false); | 449 | pDays.fill( false); |
450 | hDays.fill( false); | 450 | hDays.fill( false); |
451 | eDays.fill( false); | 451 | eDays.fill( false); |
452 | mHolidays.clear(); | 452 | mHolidays.clear(); |
453 | QDate mStartDate = days[0]; | 453 | QDate mStartDate = days[0]; |
454 | QDate endDate = mStartDate.addDays( timeSpan ); | 454 | QDate endDate = mStartDate.addDays( timeSpan ); |
455 | for( event = events.first(); event; event = events.next() ) { // for event | 455 | for( event = events.first(); event; event = events.next() ) { // for event |
456 | ushort recurType = event->recurrence()->doesRecur(); | 456 | ushort recurType = event->doesRecur(); |
457 | if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || | 457 | if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || |
458 | (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { | 458 | (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { |
459 | continue; | 459 | continue; |
460 | } | 460 | } |
461 | if ( event->doesRecur() ) { | 461 | if ( event->doesRecur() ) { |
462 | bool last; | 462 | bool last; |
463 | QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last ); | 463 | QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last ); |
464 | QDateTime incidenceEnd; | 464 | QDateTime incidenceEnd; |
465 | int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() ); | 465 | int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() ); |
466 | bool invalid = false; | 466 | bool invalid = false; |
467 | while( true ) { | 467 | while( true ) { |
468 | if ( incidenceStart.isValid() ) { | 468 | if ( incidenceStart.isValid() ) { |
469 | incidenceEnd = incidenceStart.addDays( eventlen ); | 469 | incidenceEnd = incidenceStart.addDays( eventlen ); |
470 | int st = incidenceStart.date().daysTo( endDate ); | 470 | int st = incidenceStart.date().daysTo( endDate ); |
471 | if ( st >= 0 ) { // start before timeend | 471 | if ( st >= 0 ) { // start before timeend |
472 | int end = mStartDate.daysTo( incidenceEnd.date() ); | 472 | int end = mStartDate.daysTo( incidenceEnd.date() ); |
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp index de4e4f7..89504db 100644 --- a/korganizer/koeditorrecurrence.cpp +++ b/korganizer/koeditorrecurrence.cpp | |||
@@ -884,148 +884,154 @@ void KOEditorRecurrence::readEvent(Incidence *event) | |||
884 | 884 | ||
885 | QDateTime dtEnd; | 885 | QDateTime dtEnd; |
886 | if ( event->typeID() == eventID ) | 886 | if ( event->typeID() == eventID ) |
887 | dtEnd = ((Event*)event)->dtEnd(); | 887 | dtEnd = ((Event*)event)->dtEnd(); |
888 | else | 888 | else |
889 | dtEnd = ((Todo*)event)->dtDue(); | 889 | dtEnd = ((Todo*)event)->dtDue(); |
890 | 890 | ||
891 | setDefaults( event->dtStart(), dtEnd ); | 891 | setDefaults( event->dtStart(), dtEnd ); |
892 | QBitArray rDays( 7 ); | 892 | QBitArray rDays( 7 ); |
893 | QPtrList<Recurrence::rMonthPos> rmp; | 893 | QPtrList<Recurrence::rMonthPos> rmp; |
894 | QPtrList<int> rmd; | 894 | QPtrList<int> rmd; |
895 | int day = 0; | 895 | int day = 0; |
896 | int count = 0; | 896 | int count = 0; |
897 | int month = 0; | 897 | int month = 0; |
898 | setDateTimes( event->dtStart(), dtEnd ); | 898 | setDateTimes( event->dtStart(), dtEnd ); |
899 | 899 | ||
900 | Recurrence *r = event->recurrence(); | 900 | |
901 | int f = r->frequency(); | ||
902 | 901 | ||
903 | int recurs = r->doesRecur(); | 902 | int recurs = event->doesRecur(); |
904 | 903 | ||
905 | mEnabledCheck->setChecked( recurs ); | 904 | mEnabledCheck->setChecked( recurs ); |
906 | setEnabled( recurs ); | 905 | setEnabled( recurs ); |
907 | 906 | ||
908 | int recurrenceType = RecurrenceChooser::Weekly; | 907 | int recurrenceType = RecurrenceChooser::Weekly; |
909 | 908 | if ( recurs ) { | |
910 | switch ( recurs ) { | 909 | Recurrence *r = event->recurrence(); |
911 | case Recurrence::rNone: | 910 | int f = r->frequency(); |
912 | setDefaults( event->dtStart(), dtEnd ); | 911 | switch ( recurs ) { |
913 | break; | 912 | case Recurrence::rNone: |
914 | case Recurrence::rDaily: | 913 | setDefaults( event->dtStart(), dtEnd ); |
915 | recurrenceType = RecurrenceChooser::Daily; | 914 | break; |
916 | mDaily->setFrequency( f ); | 915 | case Recurrence::rDaily: |
917 | break; | 916 | recurrenceType = RecurrenceChooser::Daily; |
918 | case Recurrence::rWeekly: | 917 | mDaily->setFrequency( f ); |
919 | recurrenceType = RecurrenceChooser::Weekly; | 918 | break; |
920 | mWeekly->setFrequency( f ); | 919 | case Recurrence::rWeekly: |
921 | mWeekly->setDays( r->days() ); | 920 | recurrenceType = RecurrenceChooser::Weekly; |
922 | break; | 921 | mWeekly->setFrequency( f ); |
923 | case Recurrence::rMonthlyPos: | 922 | mWeekly->setDays( r->days() ); |
924 | // we only handle one possibility in the list right now, | 923 | break; |
925 | // so I have hardcoded calls with first(). If we make the GUI | 924 | case Recurrence::rMonthlyPos: |
926 | // more extended, this can be changed. | 925 | // we only handle one possibility in the list right now, |
927 | recurrenceType = RecurrenceChooser::Monthly; | 926 | // so I have hardcoded calls with first(). If we make the GUI |
928 | 927 | // more extended, this can be changed. | |
929 | rmp = r->monthPositions(); | 928 | recurrenceType = RecurrenceChooser::Monthly; |
930 | if ( rmp.first()->negative ) | 929 | |
931 | count = 5 - rmp.first()->rPos - 1; | 930 | rmp = r->monthPositions(); |
932 | else | 931 | if ( rmp.first()->negative ) |
933 | count = rmp.first()->rPos - 1; | 932 | count = 5 - rmp.first()->rPos - 1; |
934 | day = 0; | 933 | else |
935 | while ( !rmp.first()->rDays.testBit( day ) ) ++day; | 934 | count = rmp.first()->rPos - 1; |
936 | mMonthly->setByPos( count, day ); | 935 | day = 0; |
937 | 936 | while ( !rmp.first()->rDays.testBit( day ) ) ++day; | |
938 | mMonthly->setFrequency( f ); | 937 | mMonthly->setByPos( count, day ); |
939 | 938 | ||
940 | break; | 939 | mMonthly->setFrequency( f ); |
941 | case Recurrence::rMonthlyDay: | 940 | |
942 | recurrenceType = RecurrenceChooser::Monthly; | 941 | break; |
943 | 942 | case Recurrence::rMonthlyDay: | |
944 | rmd = r->monthDays(); | 943 | recurrenceType = RecurrenceChooser::Monthly; |
945 | day = *rmd.first() - 1; | 944 | |
946 | mMonthly->setByDay( day ); | 945 | rmd = r->monthDays(); |
947 | 946 | day = *rmd.first() - 1; | |
948 | mMonthly->setFrequency( f ); | 947 | mMonthly->setByDay( day ); |
949 | 948 | ||
950 | break; | 949 | mMonthly->setFrequency( f ); |
951 | case Recurrence::rYearlyMonth: | 950 | |
952 | { | 951 | break; |
953 | recurrenceType = RecurrenceChooser::Yearly; | 952 | case Recurrence::rYearlyMonth: |
954 | //qDebug("Recurrence::rYearlyMonth: "); | 953 | { |
955 | day = event->dtStart().date().day(); | 954 | recurrenceType = RecurrenceChooser::Yearly; |
956 | rmd = r->yearNums(); | 955 | //qDebug("Recurrence::rYearlyMonth: "); |
957 | if ( rmd.count() > 0 ) | 956 | day = event->dtStart().date().day(); |
958 | month = *rmd.first(); | 957 | rmd = r->yearNums(); |
959 | else | 958 | if ( rmd.count() > 0 ) |
960 | month = event->dtStart().date().month() ; | 959 | month = *rmd.first(); |
961 | mYearly->setByMonth( month, day ); | 960 | else |
961 | month = event->dtStart().date().month() ; | ||
962 | mYearly->setByMonth( month, day ); | ||
962 | #if 0 | 963 | #if 0 |
963 | //qDebug("2day = %d ",day ); | 964 | //qDebug("2day = %d ",day ); |
964 | QPtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions(); | 965 | QPtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions(); |
965 | int month; | 966 | int month; |
966 | if ( !monthlist.isEmpty() ) { | 967 | if ( !monthlist.isEmpty() ) { |
967 | month = monthlist.first()->rPos ; | 968 | month = monthlist.first()->rPos ; |
968 | } else { | 969 | } else { |
969 | month = event->dtStart().date().month() ; | 970 | month = event->dtStart().date().month() ; |
970 | } | 971 | } |
971 | mYearly->setByMonth( day, month ); | 972 | mYearly->setByMonth( day, month ); |
972 | #endif | 973 | #endif |
973 | mYearly->setFrequency( f ); | 974 | mYearly->setFrequency( f ); |
974 | } | 975 | } |
975 | 976 | ||
976 | break; | 977 | break; |
977 | case Recurrence::rYearlyDay: | 978 | case Recurrence::rYearlyDay: |
978 | //qDebug("Recurrence::rYearlyDay: "); | 979 | //qDebug("Recurrence::rYearlyDay: "); |
979 | recurrenceType = RecurrenceChooser::Yearly; | 980 | recurrenceType = RecurrenceChooser::Yearly; |
980 | mYearly->setByDay( event->dtStart().date().dayOfYear() ); | 981 | mYearly->setByDay( event->dtStart().date().dayOfYear() ); |
981 | mYearly->setFrequency( f ); | 982 | mYearly->setFrequency( f ); |
982 | break; | 983 | break; |
983 | default: | 984 | default: |
984 | setDefaults( event->dtStart(), dtEnd ); | 985 | setDefaults( event->dtStart(), dtEnd ); |
985 | break; | 986 | break; |
987 | } | ||
986 | } | 988 | } |
987 | |||
988 | mRecurrenceChooser->setType( recurrenceType ); | 989 | mRecurrenceChooser->setType( recurrenceType ); |
989 | showCurrentRule( recurrenceType ); | 990 | showCurrentRule( recurrenceType ); |
990 | 991 | ||
991 | mRecurrenceRange->setDateTimes( event->dtStart() ); | 992 | mRecurrenceRange->setDateTimes( event->dtStart() ); |
992 | 993 | ||
993 | if ( r->doesRecur() ) { | 994 | if ( event->doesRecur() ) { |
995 | Recurrence *r = event->recurrence(); | ||
994 | mRecurrenceRange->setDuration( r->duration() ); | 996 | mRecurrenceRange->setDuration( r->duration() ); |
995 | if ( r->duration() == 0 ) | 997 | if ( r->duration() == 0 ) |
996 | { | 998 | { |
997 | if ( r->endDate() < event->dtStart().date() ) | 999 | if ( r->endDate() < event->dtStart().date() ) |
998 | mRecurrenceRange->setEndDate( event->dtStart().date() ); | 1000 | mRecurrenceRange->setEndDate( event->dtStart().date() ); |
999 | else | 1001 | else |
1000 | mRecurrenceRange->setEndDate( r->endDate() ); | 1002 | mRecurrenceRange->setEndDate( r->endDate() ); |
1001 | } else | 1003 | } else |
1002 | mRecurrenceRange->setEndDate( event->dtStart().date() ); | 1004 | mRecurrenceRange->setEndDate( event->dtStart().date() ); |
1003 | } | 1005 | } |
1004 | 1006 | ||
1005 | mExceptions->setDates( event->exDates() ); | 1007 | mExceptions->setDates( event->exDates() ); |
1006 | } | 1008 | } |
1007 | 1009 | ||
1008 | void KOEditorRecurrence::writeEvent( Incidence *event ) | 1010 | void KOEditorRecurrence::writeEvent( Incidence *event ) |
1009 | { | 1011 | { |
1010 | Recurrence *r = event->recurrence(); | 1012 | |
1011 | 1013 | ||
1012 | // clear out any old settings; | 1014 | if ( !mEnabledCheck->isChecked() ) { |
1013 | r->unsetRecurs(); | 1015 | if ( event->doesRecur() ) |
1016 | event->recurrence()->unsetRecurs(); | ||
1017 | } else { | ||
1018 | Recurrence *r = event->recurrence(); | ||
1014 | 1019 | ||
1015 | if ( mEnabledCheck->isChecked() ) { | 1020 | // clear out any old settings; |
1021 | r->unsetRecurs(); | ||
1016 | int duration = mRecurrenceRange->duration(); | 1022 | int duration = mRecurrenceRange->duration(); |
1017 | QDate endDate; | 1023 | QDate endDate; |
1018 | if ( duration == 0 ) endDate = mRecurrenceRange->endDate(); | 1024 | if ( duration == 0 ) endDate = mRecurrenceRange->endDate(); |
1019 | 1025 | ||
1020 | int recurrenceType = mRecurrenceChooser->type(); | 1026 | int recurrenceType = mRecurrenceChooser->type(); |
1021 | 1027 | ||
1022 | if ( recurrenceType == RecurrenceChooser::Daily ) { | 1028 | if ( recurrenceType == RecurrenceChooser::Daily ) { |
1023 | int freq = mDaily->frequency(); | 1029 | int freq = mDaily->frequency(); |
1024 | if ( duration != 0 ) r->setDaily( freq, duration ); | 1030 | if ( duration != 0 ) r->setDaily( freq, duration ); |
1025 | else r->setDaily( freq, endDate ); | 1031 | else r->setDaily( freq, endDate ); |
1026 | } else if ( recurrenceType == RecurrenceChooser::Weekly ) { | 1032 | } else if ( recurrenceType == RecurrenceChooser::Weekly ) { |
1027 | int freq = mWeekly->frequency(); | 1033 | int freq = mWeekly->frequency(); |
1028 | QBitArray days = mWeekly->days(); | 1034 | QBitArray days = mWeekly->days(); |
1029 | int j; | 1035 | int j; |
1030 | bool found = false; | 1036 | bool found = false; |
1031 | for (j = 0; j < 7 ; ++j ) { | 1037 | for (j = 0; j < 7 ; ++j ) { |
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index a690ab1..db695f5 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -334,35 +334,35 @@ void KOEventViewer::appendEvent(Event *event, int mode ) | |||
334 | mText.append(i18n("<p><b>From:</b> %1</p> ") | 334 | mText.append(i18n("<p><b>From:</b> %1</p> ") |
335 | .arg(event->dtStartStr( shortDate))); | 335 | .arg(event->dtStartStr( shortDate))); |
336 | mText.append(i18n("<p><b>To:</b> %1</p>") | 336 | mText.append(i18n("<p><b>To:</b> %1</p>") |
337 | .arg(event->dtEndStr(shortDate))); | 337 | .arg(event->dtEndStr(shortDate))); |
338 | } else { | 338 | } else { |
339 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") | 339 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") |
340 | .arg(event->dtStartTimeStr()) | 340 | .arg(event->dtStartTimeStr()) |
341 | .arg(event->dtEndTimeStr())); | 341 | .arg(event->dtEndTimeStr())); |
342 | mText.append(i18n("<p><b>On:</b> %1</p> ") | 342 | mText.append(i18n("<p><b>On:</b> %1</p> ") |
343 | .arg(event->dtStartDateStr( shortDate ))); | 343 | .arg(event->dtStartDateStr( shortDate ))); |
344 | } | 344 | } |
345 | } | 345 | } |
346 | if (!event->location().isEmpty()) { | 346 | if (!event->location().isEmpty()) { |
347 | addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); | 347 | addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); |
348 | mMailSubject += i18n(" at ") + event->location(); | 348 | mMailSubject += i18n(" at ") + event->location(); |
349 | } | 349 | } |
350 | if (event->recurrence()->doesRecur()) { | 350 | if (event->doesRecur()) { |
351 | 351 | ||
352 | QString recurText = event->recurrence()->recurrenceText(); | 352 | QString recurText = event->recurrenceText(); |
353 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); | 353 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); |
354 | bool ok; | 354 | bool ok; |
355 | QDate start = QDate::currentDate(); | 355 | QDate start = QDate::currentDate(); |
356 | QDateTime next; | 356 | QDateTime next; |
357 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); | 357 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); |
358 | if ( ok ) { | 358 | if ( ok ) { |
359 | if ( wideScreen ){ | 359 | if ( wideScreen ){ |
360 | addTag("p",i18n("<b>Next recurrence is on:</b>") +" " + KGlobal::locale()->formatDate( next.date(), shortDate ) ); | 360 | addTag("p",i18n("<b>Next recurrence is on:</b>") +" " + KGlobal::locale()->formatDate( next.date(), shortDate ) ); |
361 | } else { | 361 | } else { |
362 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); | 362 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); |
363 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); | 363 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); |
364 | } | 364 | } |
365 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); | 365 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); |
366 | 366 | ||
367 | } else { | 367 | } else { |
368 | bool last; | 368 | bool last; |
@@ -468,33 +468,33 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) | |||
468 | mText += "</font>"; | 468 | mText += "</font>"; |
469 | } else { | 469 | } else { |
470 | mText.append(i18n("<p><i>%1 % completed</i></p>") | 470 | mText.append(i18n("<p><i>%1 % completed</i></p>") |
471 | .arg(event->percentComplete())); | 471 | .arg(event->percentComplete())); |
472 | } | 472 | } |
473 | 473 | ||
474 | if (event->cancelled ()) { | 474 | if (event->cancelled ()) { |
475 | mText +="<font color=\"#B00000\">"; | 475 | mText +="<font color=\"#B00000\">"; |
476 | addTag("i",i18n("This todo has been cancelled!")); | 476 | addTag("i",i18n("This todo has been cancelled!")); |
477 | mText.append("<br>"); | 477 | mText.append("<br>"); |
478 | mText += "</font>"; | 478 | mText += "</font>"; |
479 | mMailSubject += i18n("(cancelled)"); | 479 | mMailSubject += i18n("(cancelled)"); |
480 | } | 480 | } |
481 | 481 | ||
482 | 482 | ||
483 | 483 | ||
484 | if (event->recurrence()->doesRecur()) { | 484 | if (event->doesRecur()) { |
485 | 485 | ||
486 | QString recurText = event->recurrence()->recurrenceText(); | 486 | QString recurText = event->recurrence()->recurrenceText(); |
487 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); | 487 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); |
488 | 488 | ||
489 | } | 489 | } |
490 | if (event->hasStartDate()) { | 490 | if (event->hasStartDate()) { |
491 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); | 491 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); |
492 | } | 492 | } |
493 | if (event->hasDueDate()) { | 493 | if (event->hasDueDate()) { |
494 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); | 494 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); |
495 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); | 495 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); |
496 | } | 496 | } |
497 | if (!event->location().isEmpty()) { | 497 | if (!event->location().isEmpty()) { |
498 | addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); | 498 | addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); |
499 | mMailSubject += i18n(" at ") + event->location(); | 499 | mMailSubject += i18n(" at ") + event->location(); |
500 | } | 500 | } |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index d25f671..e7a5e0e 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -120,33 +120,33 @@ bool ListItemVisitor::visit(Event *e) | |||
120 | mItem->setText(0,e->summary()); | 120 | mItem->setText(0,e->summary()); |
121 | mItem->setText(1,start); | 121 | mItem->setText(1,start); |
122 | if ( e->doesFloat() ) | 122 | if ( e->doesFloat() ) |
123 | mItem->setText(2,"---"); | 123 | mItem->setText(2,"---"); |
124 | else | 124 | else |
125 | mItem->setText(2,e->dtStartTimeStr()); | 125 | mItem->setText(2,e->dtStartTimeStr()); |
126 | mItem->setText(3,end); | 126 | mItem->setText(3,end); |
127 | if ( e->doesFloat() ) | 127 | if ( e->doesFloat() ) |
128 | mItem->setText(4,"---"); | 128 | mItem->setText(4,"---"); |
129 | else | 129 | else |
130 | mItem->setText(4,e->dtEndTimeStr()); | 130 | mItem->setText(4,e->dtEndTimeStr()); |
131 | if ( e->isAlarmEnabled() ) { | 131 | if ( e->isAlarmEnabled() ) { |
132 | mItem->setText(5,e->alarms().first()->offsetText() ); | 132 | mItem->setText(5,e->alarms().first()->offsetText() ); |
133 | } else { | 133 | } else { |
134 | mItem->setText(5, i18n("No")); | 134 | mItem->setText(5, i18n("No")); |
135 | } | 135 | } |
136 | mItem->setText(6, e->recurrence()->recurrenceText()); | 136 | mItem->setText(6, e->recurrenceText()); |
137 | if( ! e->doesRecur() ) | 137 | if( ! e->doesRecur() ) |
138 | mItem->setSortKey( 6, "-" ); | 138 | mItem->setSortKey( 6, "-" ); |
139 | mItem->setText(7,"---"); | 139 | mItem->setText(7,"---"); |
140 | mItem->setText(8,"---"); | 140 | mItem->setText(8,"---"); |
141 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); | 141 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); |
142 | mItem->setText(10,e->categoriesStr()); | 142 | mItem->setText(10,e->categoriesStr()); |
143 | mItem->setText(11, KOPrefs::instance()->calName( e->calID() )); | 143 | mItem->setText(11, KOPrefs::instance()->calName( e->calID() )); |
144 | mItem->setText(12, KGlobal::locale()->formatDateTime( e->lastModified(), true, true )); | 144 | mItem->setText(12, KGlobal::locale()->formatDateTime( e->lastModified(), true, true )); |
145 | 145 | ||
146 | QString key; | 146 | QString key; |
147 | QDate d = e->lastModified().date(); | 147 | QDate d = e->lastModified().date(); |
148 | QTime t = e->lastModified().time(); | 148 | QTime t = e->lastModified().time(); |
149 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | 149 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); |
150 | mItem->setSortKey(12,key); | 150 | mItem->setSortKey(12,key); |
151 | t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); | 151 | t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); |
152 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); | 152 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); |
@@ -171,33 +171,33 @@ bool ListItemVisitor::visit(Todo *t) | |||
171 | if (t->doesFloat()) { | 171 | if (t->doesFloat()) { |
172 | mItem->setText(2,"---"); | 172 | mItem->setText(2,"---"); |
173 | } else { | 173 | } else { |
174 | mItem->setText(2,t->dtStartTimeStr()); | 174 | mItem->setText(2,t->dtStartTimeStr()); |
175 | } | 175 | } |
176 | } else { | 176 | } else { |
177 | mItem->setText(1,"---"); | 177 | mItem->setText(1,"---"); |
178 | mItem->setText(2,"---"); | 178 | mItem->setText(2,"---"); |
179 | } | 179 | } |
180 | mItem->setText(3,"---"); | 180 | mItem->setText(3,"---"); |
181 | mItem->setText(4,"---"); | 181 | mItem->setText(4,"---"); |
182 | if ( t->isAlarmEnabled() ) { | 182 | if ( t->isAlarmEnabled() ) { |
183 | mItem->setText(5,t->alarms().first()->offsetText() ); | 183 | mItem->setText(5,t->alarms().first()->offsetText() ); |
184 | } else { | 184 | } else { |
185 | mItem->setText(5, i18n("No")); | 185 | mItem->setText(5, i18n("No")); |
186 | } | 186 | } |
187 | mItem->setText(6, t->recurrence()->recurrenceText()); | 187 | mItem->setText(6, t->recurrenceText()); |
188 | if( ! t->doesRecur() ) | 188 | if( ! t->doesRecur() ) |
189 | mItem->setSortKey( 6, "-" ); | 189 | mItem->setSortKey( 6, "-" ); |
190 | if (t->hasDueDate()) { | 190 | if (t->hasDueDate()) { |
191 | mItem->setText(7,t->dtDueDateStr()); | 191 | mItem->setText(7,t->dtDueDateStr()); |
192 | if (t->doesFloat()) { | 192 | if (t->doesFloat()) { |
193 | mItem->setText(8,"---"); | 193 | mItem->setText(8,"---"); |
194 | } else { | 194 | } else { |
195 | mItem->setText(8,t->dtDueTimeStr()); | 195 | mItem->setText(8,t->dtDueTimeStr()); |
196 | } | 196 | } |
197 | } else { | 197 | } else { |
198 | mItem->setText(7,"---"); | 198 | mItem->setText(7,"---"); |
199 | mItem->setText(8,"---"); | 199 | mItem->setText(8,"---"); |
200 | } | 200 | } |
201 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); | 201 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); |
202 | mItem->setText(10,t->categoriesStr()); | 202 | mItem->setText(10,t->categoriesStr()); |
203 | mItem->setText(11, KOPrefs::instance()->calName( t->calID() )); | 203 | mItem->setText(11, KOPrefs::instance()->calName( t->calID() )); |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 498d9b0..eea9a4d 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -774,33 +774,33 @@ int MonthViewCell::insertEvent(Event *event) | |||
774 | } | 774 | } |
775 | 775 | ||
776 | } else { | 776 | } else { |
777 | if (cat.isEmpty()) { | 777 | if (cat.isEmpty()) { |
778 | //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 778 | //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
779 | pal = QPalette( KOPrefs::instance()->defaultColor( event->calID() ), KOPrefs::instance()->defaultColor( event->calID() )); | 779 | pal = QPalette( KOPrefs::instance()->defaultColor( event->calID() ), KOPrefs::instance()->defaultColor( event->calID() )); |
780 | } else { | 780 | } else { |
781 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 781 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
782 | } | 782 | } |
783 | } | 783 | } |
784 | 784 | ||
785 | } else { | 785 | } else { |
786 | pal = mStandardPalette ; | 786 | pal = mStandardPalette ; |
787 | } | 787 | } |
788 | pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor); | 788 | pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor); |
789 | item->setPalette( pal ); | 789 | item->setPalette( pal ); |
790 | item->setRecur( event->recurrence()->doesRecur() ); | 790 | item->setRecur( event->doesRecur() ); |
791 | item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() ); | 791 | item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() ); |
792 | item->setMoreInfo( event->description().length() > 0 ); | 792 | item->setMoreInfo( event->description().length() > 0 ); |
793 | #ifdef DESKTOP_VERSION | 793 | #ifdef DESKTOP_VERSION |
794 | Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, | 794 | Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, |
795 | KOPrefs::instance()->email()); | 795 | KOPrefs::instance()->email()); |
796 | if ( me != 0 ) { | 796 | if ( me != 0 ) { |
797 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) | 797 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) |
798 | item->setReply(true && multiday < 2); | 798 | item->setReply(true && multiday < 2); |
799 | else | 799 | else |
800 | item->setReply(false); | 800 | item->setReply(false); |
801 | } else | 801 | } else |
802 | item->setReply(false); | 802 | item->setReply(false); |
803 | #endif | 803 | #endif |
804 | 804 | ||
805 | item->setMultiDay( multiday ); | 805 | item->setMultiDay( multiday ); |
806 | if ( multiday ) { | 806 | if ( multiday ) { |
@@ -865,33 +865,33 @@ void MonthViewCell::insertTodo(Todo *todo) | |||
865 | } | 865 | } |
866 | 866 | ||
867 | } else { | 867 | } else { |
868 | if (cat.isEmpty()) { | 868 | if (cat.isEmpty()) { |
869 | //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 869 | //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
870 | pal = QPalette(KOPrefs::instance()->defaultColor( todo->calID() ), KOPrefs::instance()->defaultColor( todo->calID() )); | 870 | pal = QPalette(KOPrefs::instance()->defaultColor( todo->calID() ), KOPrefs::instance()->defaultColor( todo->calID() )); |
871 | } else { | 871 | } else { |
872 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 872 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
873 | } | 873 | } |
874 | } | 874 | } |
875 | 875 | ||
876 | } else { | 876 | } else { |
877 | pal = mStandardPalette ; | 877 | pal = mStandardPalette ; |
878 | } | 878 | } |
879 | pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor); | 879 | pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor); |
880 | item->setPalette( pal ); | 880 | item->setPalette( pal ); |
881 | item->setRecur( todo->recurrence()->doesRecur() ); | 881 | item->setRecur( todo->doesRecur() ); |
882 | item->setAlarm( todo->isAlarmEnabled() && todo->alarmEnabled() ); | 882 | item->setAlarm( todo->isAlarmEnabled() && todo->alarmEnabled() ); |
883 | item->setMoreInfo( todo->description().length() > 0 ); | 883 | item->setMoreInfo( todo->description().length() > 0 ); |
884 | insertItem( item , count()); | 884 | insertItem( item , count()); |
885 | #ifdef DESKTOP_VERSION | 885 | #ifdef DESKTOP_VERSION |
886 | mToolTip.append( text ); | 886 | mToolTip.append( text ); |
887 | #endif | 887 | #endif |
888 | } | 888 | } |
889 | void MonthViewCell::repaintfinishUpdateCell() | 889 | void MonthViewCell::repaintfinishUpdateCell() |
890 | { | 890 | { |
891 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); | 891 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); |
892 | while ( mitem ) { | 892 | while ( mitem ) { |
893 | mitem->setBlockRepaint( false ); | 893 | mitem->setBlockRepaint( false ); |
894 | updateItem ( mitem ); | 894 | updateItem ( mitem ); |
895 | mitem = (MonthViewItem *)mitem->next(); | 895 | mitem = (MonthViewItem *)mitem->next(); |
896 | } | 896 | } |
897 | blockSignals( false ); | 897 | blockSignals( false ); |
@@ -1092,32 +1092,34 @@ void MonthViewCell::cellClicked( QListBoxItem *item ) | |||
1092 | mMonthView->setSelectedCell( this ); | 1092 | mMonthView->setSelectedCell( this ); |
1093 | if ( item == 0 ) { | 1093 | if ( item == 0 ) { |
1094 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 1094 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
1095 | emit newEventSignal( dt ); | 1095 | emit newEventSignal( dt ); |
1096 | return; | 1096 | return; |
1097 | } | 1097 | } |
1098 | 1098 | ||
1099 | } | 1099 | } |
1100 | 1100 | ||
1101 | void MonthViewCell::contextMenu( QListBoxItem *item ) | 1101 | void MonthViewCell::contextMenu( QListBoxItem *item ) |
1102 | { | 1102 | { |
1103 | mMonthView->setPopupCell( this ); | 1103 | mMonthView->setPopupCell( this ); |
1104 | if ( !item ) { | 1104 | if ( !item ) { |
1105 | mMonthView->showContextMenu( 0 ); | 1105 | mMonthView->showContextMenu( 0 ); |
1106 | return; | 1106 | return; |
1107 | } | 1107 | } |
1108 | //selection( item ); | ||
1109 | //qApp->processEvents(); | ||
1108 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); | 1110 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); |
1109 | Incidence *incidence = eventItem->incidence(); | 1111 | Incidence *incidence = eventItem->incidence(); |
1110 | if ( incidence ) mMonthView->showContextMenu( incidence ); | 1112 | if ( incidence ) mMonthView->showContextMenu( incidence ); |
1111 | } | 1113 | } |
1112 | 1114 | ||
1113 | void MonthViewCell::selection( QListBoxItem *item ) | 1115 | void MonthViewCell::selection( QListBoxItem *item ) |
1114 | { | 1116 | { |
1115 | if ( !item ) { | 1117 | if ( !item ) { |
1116 | emit highlightIncidence( 0 , this, 0 ); | 1118 | emit highlightIncidence( 0 , this, 0 ); |
1117 | return; | 1119 | return; |
1118 | } | 1120 | } |
1119 | MonthViewItem * it = (static_cast<MonthViewItem *>( item )); | 1121 | MonthViewItem * it = (static_cast<MonthViewItem *>( item )); |
1120 | emit highlightIncidence( it->incidence(), this, it->multiDay() ); | 1122 | emit highlightIncidence( it->incidence(), this, it->multiDay() ); |
1121 | mMonthView->setSelectedCell( this ); | 1123 | mMonthView->setSelectedCell( this ); |
1122 | } | 1124 | } |
1123 | 1125 | ||
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp index 100a81b..682f83b 100644 --- a/korganizer/kotodoeditor.cpp +++ b/korganizer/kotodoeditor.cpp | |||
@@ -364,33 +364,34 @@ void KOTodoEditor::writeTodo(Todo *event) | |||
364 | if (mRelatedTodo) { | 364 | if (mRelatedTodo) { |
365 | event->setRelatedTo(mRelatedTodo); | 365 | event->setRelatedTo(mRelatedTodo); |
366 | } | 366 | } |
367 | if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { | 367 | if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { |
368 | mRecurrence->writeEvent(event); | 368 | mRecurrence->writeEvent(event); |
369 | if ( event->doesRecur() ) { | 369 | if ( event->doesRecur() ) { |
370 | int addSec = -1 ; | 370 | int addSec = -1 ; |
371 | if ( maybeComputeRecurrenceTime && event->percentComplete() == 100 ) | 371 | if ( maybeComputeRecurrenceTime && event->percentComplete() == 100 ) |
372 | addSec = 1; | 372 | addSec = 1; |
373 | event->setRecurrenceID( event->dtStart().addSecs( addSec ) ); | 373 | event->setRecurrenceID( event->dtStart().addSecs( addSec ) ); |
374 | event->setRecurDates(); | 374 | event->setRecurDates(); |
375 | } else { | 375 | } else { |
376 | event->setHasRecurrenceID( false ); | 376 | event->setHasRecurrenceID( false ); |
377 | } | 377 | } |
378 | } else { | 378 | } else { |
379 | event->setHasRecurrenceID( false ); | 379 | event->setHasRecurrenceID( false ); |
380 | event->recurrence()->unsetRecurs(); | 380 | if ( event->doesRecur() ) |
381 | event->recurrence()->unsetRecurs(); | ||
381 | } | 382 | } |
382 | } | 383 | } |
383 | 384 | ||
384 | bool KOTodoEditor::validateInput() | 385 | bool KOTodoEditor::validateInput() |
385 | { | 386 | { |
386 | if (!mGeneral->validateInput()) return false; | 387 | if (!mGeneral->validateInput()) return false; |
387 | if (!mDetails->validateInput()) return false; | 388 | if (!mDetails->validateInput()) return false; |
388 | return true; | 389 | return true; |
389 | } | 390 | } |
390 | 391 | ||
391 | int KOTodoEditor::msgItemDelete() | 392 | int KOTodoEditor::msgItemDelete() |
392 | { | 393 | { |
393 | return KMessageBox::warningContinueCancel(this, | 394 | return KMessageBox::warningContinueCancel(this, |
394 | i18n("This item will be permanently deleted."), | 395 | i18n("This item will be permanently deleted."), |
395 | i18n("KOrganizer Confirmation"),i18n("Delete")); | 396 | i18n("KOrganizer Confirmation"),i18n("Delete")); |
396 | } | 397 | } |
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index fafcb58..f88403c 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp | |||
@@ -494,33 +494,33 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a | |||
494 | } | 494 | } |
495 | bool bDay = false; | 495 | bool bDay = false; |
496 | if ( ev->isBirthday() || ev->isAnniversary() ) | 496 | if ( ev->isBirthday() || ev->isAnniversary() ) |
497 | bDay = true; | 497 | bDay = true; |
498 | tempText += "<tr><td><b>"; | 498 | tempText += "<tr><td><b>"; |
499 | if (ev->typeID() == eventID ) { | 499 | if (ev->typeID() == eventID ) { |
500 | if (reply) { | 500 | if (reply) { |
501 | if (!ev->doesFloat()) | 501 | if (!ev->doesFloat()) |
502 | tempText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": "; | 502 | tempText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": "; |
503 | else | 503 | else |
504 | tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; | 504 | tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; |
505 | 505 | ||
506 | } else { | 506 | } else { |
507 | if (!ev->doesFloat()) { | 507 | if (!ev->doesFloat()) { |
508 | Event *event = static_cast<Event *>(ev); | 508 | Event *event = static_cast<Event *>(ev); |
509 | QDateTime st,end; | 509 | QDateTime st,end; |
510 | if ( event->recurrence()->doesRecur() ) { | 510 | if ( event->doesRecur() ) { |
511 | QDate recDate= mEventDate; | 511 | QDate recDate= mEventDate; |
512 | int days = event->dtStart().date().daysTo (event->dtEnd().date() ); | 512 | int days = event->dtStart().date().daysTo (event->dtEnd().date() ); |
513 | while ( ! event->recursOn( recDate ) ) { | 513 | while ( ! event->recursOn( recDate ) ) { |
514 | recDate = recDate.addDays( -1 ); | 514 | recDate = recDate.addDays( -1 ); |
515 | 515 | ||
516 | } | 516 | } |
517 | st = QDateTime ( recDate, event->dtStart().time() ); | 517 | st = QDateTime ( recDate, event->dtStart().time() ); |
518 | end = QDateTime ( recDate.addDays( days ), event->dtEnd().time() ); | 518 | end = QDateTime ( recDate.addDays( days ), event->dtEnd().time() ); |
519 | } | 519 | } |
520 | else { | 520 | else { |
521 | st = event->dtStart(); | 521 | st = event->dtStart(); |
522 | end = event->dtEnd(); | 522 | end = event->dtEnd(); |
523 | } | 523 | } |
524 | 524 | ||
525 | 525 | ||
526 | QString dateText; | 526 | QString dateText; |
@@ -609,33 +609,33 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a | |||
609 | needClose =true; | 609 | needClose =true; |
610 | 610 | ||
611 | } | 611 | } |
612 | if ( ev->isAlarmEnabled() && ev->alarmEnabled()) { | 612 | if ( ev->isAlarmEnabled() && ev->alarmEnabled()) { |
613 | if ( !needClose) | 613 | if ( !needClose) |
614 | tempText +="["; | 614 | tempText +="["; |
615 | tempText += "a"; | 615 | tempText += "a"; |
616 | needClose =true; | 616 | needClose =true; |
617 | 617 | ||
618 | } | 618 | } |
619 | if ( ev->description().length() > 0 ) { | 619 | if ( ev->description().length() > 0 ) { |
620 | if ( !needClose) | 620 | if ( !needClose) |
621 | tempText +="["; | 621 | tempText +="["; |
622 | tempText += "i"; | 622 | tempText += "i"; |
623 | needClose =true; | 623 | needClose =true; |
624 | } | 624 | } |
625 | if ( ev->recurrence()->doesRecur() ) { | 625 | if ( ev->doesRecur() ) { |
626 | if ( !needClose) | 626 | if ( !needClose) |
627 | tempText +="["; | 627 | tempText +="["; |
628 | tempText += "r"; | 628 | tempText += "r"; |
629 | needClose =true; | 629 | needClose =true; |
630 | } | 630 | } |
631 | if ( needClose ) { | 631 | if ( needClose ) { |
632 | tempText += "] "; | 632 | tempText += "] "; |
633 | } | 633 | } |
634 | if ( ev->cancelled() ) | 634 | if ( ev->cancelled() ) |
635 | tempText += "</font>"; | 635 | tempText += "</font>"; |
636 | tempText += "<a "; | 636 | tempText += "<a "; |
637 | if (ev->typeID() == eventID ) tempText += "href=\"event:"; | 637 | if (ev->typeID() == eventID ) tempText += "href=\"event:"; |
638 | if (ev->typeID() == todoID ) tempText += "href=\"todo:"; | 638 | if (ev->typeID() == todoID ) tempText += "href=\"todo:"; |
639 | tempText += ev->uid() + "\">"; | 639 | tempText += ev->uid() + "\">"; |
640 | if ( ev->summary().length() > 0 ) | 640 | if ( ev->summary().length() > 0 ) |
641 | tempText += ev->summary(); | 641 | tempText += ev->summary(); |