-rw-r--r-- | bin/kdepim/WhatsNew.txt | 14 | ||||
-rw-r--r-- | korganizer/kdatenavigator.cpp | 4 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 13 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 148 | ||||
-rw-r--r-- | korganizer/kodaymatrix.h | 5 |
5 files changed, 119 insertions, 65 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 6c9daad..05aa8fe 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -12,3 +12,3 @@ introduced in the latest versions, where the text was not fitting on the Added a popup menu ( press pen and hold to get popup ) to the agenda view -with may useful items. +with many useful items (add event/todo, show next week, two weeks, month, journal). @@ -17,2 +17,14 @@ Display all opened, all closed or all todos flat. The "flat" view makes is possible to sort all todos after ,e.g., prio or date. +Made the reparenting of todos on the desktop possible via Drag&Drop. +Fixed several bugs in setting the completed datetime for todos. +Added info about completed datetime of todos to the todo viewer. +Now displaying a completed todo (with completed datetime set) in the agenda view +at the time of the completion. Such that now it is possible to see in the agenda view +when what todo was completed. +Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. +Now the behaviour is: +Setting a parent to complete sets all (sub)childs to complete. +Setting a parent to uncomplete does not change the childs. +Setting a child to uncomplete sets all parent to uncomplete. +Setting a child to complete does not change the parents. diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index b420351..f31e50a 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp @@ -227,3 +227,3 @@ void KDateNavigator::updateDayMatrix() daymatrix->updateView(); - daymatrix->repaint(); + //daymatrix->repaint(); } @@ -264,3 +264,3 @@ void KDateNavigator::updateView() repaint(); - daymatrix->repaint(); + // daymatrix->repaint(); } diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 39355b4..ee9f39a 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -471,9 +471,8 @@ void KOAgendaItem::computeText() if ( (mIncidence->type() == "Todo") ) { - if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) - mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; - else if ( !(mIncidence->doesFloat())) - mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; - - - + if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { + if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) + mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; + else if ( !(mIncidence->doesFloat())) + mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; + } } else { diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index fc00828..060b4c4 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -110,3 +110,9 @@ KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const //setFont( QFont("Arial", 10) ); - updateView(date); + + mUpdateTimer = new QTimer( this ); + connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( updateViewTimed() )); + mRepaintTimer = new QTimer( this ); + connect (mRepaintTimer ,SIGNAL(timeout()), this, SLOT ( repaintViewTimed() )); + mDayChanged = false; + updateView(); } @@ -204,36 +210,21 @@ void KODayMatrix::updateView() } - -void KODayMatrix::updateView(QDate actdate) +void KODayMatrix::repaintViewTimed() +{ + qDebug("KODayMatrix::repaintViewTimed "); + mRepaintTimer->stop(); + repaint(false); +} +void KODayMatrix::updateViewTimed() { - -// kdDebug() << "KODayMatrix::updateView() " << actdate.toString() << endl; - - //flag to indicate if the starting day of the matrix has changed by this call - bool daychanged = false; - // if a new startdate is to be set then apply Cornelius's calculation - // of the first day to be shown - if (actdate != startdate) { - // reset index of selection according to shift of starting date from startdate to actdate - if (mSelStart != NOSELECTION) { - int tmp = actdate.daysTo(startdate); - //kdDebug() << "Shift of Selection1: " << mSelStart << " - " << mSelEnd << " -> " << tmp << "(" << offset << ")" << endl; - // shift selection if new one would be visible at least partly ! - - if (mSelStart+tmp < NUMDAYS && mSelEnd+tmp >= 0) { - // nested if is required for next X display pushed from a different month - correction required - // otherwise, for month forward and backward, it must be avoided - if( mSelStart > NUMDAYS || mSelStart < 0 ) - mSelStart = mSelStart + tmp; - if( mSelEnd > NUMDAYS || mSelEnd < 0 ) - mSelEnd = mSelEnd + tmp; - } - } - startdate = actdate; - daychanged = true; - } + mUpdateTimer->stop(); + //QDate actdate = mPendingNewDate; - if (daychanged) { - recalculateToday(); - } + static int iii = 0; + qDebug("KODayMatrix::updateView(QDate actdate) %d", ++iii ); + + if (mDayChanged) { + recalculateToday(); + mDayChanged = false; + } @@ -241,32 +232,79 @@ void KODayMatrix::updateView(QDate actdate) - // if events are set for the day then remember to draw it bold - QPtrList<Event> eventlist = mCalendar->events(days[i]); - Event *event; - int numEvents = eventlist.count(); + // if events are set for the day then remember to draw it bold + QPtrList<Event> eventlist = mCalendar->events(days[i]); + Event *event; + int numEvents = eventlist.count(); - for(event=eventlist.first();event != 0;event=eventlist.next()) { - ushort recurType = event->recurrence()->doesRecur(); + for(event=eventlist.first();event != 0;event=eventlist.next()) { + ushort recurType = event->recurrence()->doesRecur(); - if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || - (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { - numEvents--; - } - } - events[i] = numEvents; + if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || + (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { + numEvents--; + } + } + events[i] = numEvents; - //if it is a holy day then draw it red. Sundays are consider holidays, too + //if it is a holy day then draw it red. Sundays are consider holidays, too #ifndef KORG_NOPLUGINS - QString holiStr = KOCore::self()->holiday(days[i]); + QString holiStr = KOCore::self()->holiday(days[i]); #else - QString holiStr = QString::null; + QString holiStr = QString::null; #endif - if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || - !holiStr.isEmpty()) { - if (holiStr.isNull()) holiStr = ""; - mHolidays[i] = holiStr; + if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || + !holiStr.isEmpty()) { + if (holiStr.isNull()) holiStr = ""; + mHolidays[i] = holiStr; + } else { + mHolidays[i] = QString::null; + } + } + repaint(false); + } +void KODayMatrix::updateView(QDate actdate) +{ + + //flag to indicate if the starting day of the matrix has changed by this call + //mDayChanged = false; + // if a new startdate is to be set then apply Cornelius's calculation + // of the first day to be shown + if (actdate != startdate) { + // reset index of selection according to shift of starting date from startdate to actdate + if (mSelStart != NOSELECTION) { + int tmp = actdate.daysTo(startdate); + //kdDebug() << "Shift of Selection1: " << mSelStart << " - " << mSelEnd << " -> " << tmp << "(" << offset << ")" << endl; + // shift selection if new one would be visible at least partly ! + + if (mSelStart+tmp < NUMDAYS && mSelEnd+tmp >= 0) { + // nested if is required for next X display pushed from a different month - correction required + // otherwise, for month forward and backward, it must be avoided + if( mSelStart > NUMDAYS || mSelStart < 0 ) + mSelStart = mSelStart + tmp; + if( mSelEnd > NUMDAYS || mSelEnd < 0 ) + mSelEnd = mSelEnd + tmp; + } + } + + startdate = actdate; + mDayChanged = true; + } + qDebug("restart Timer %d", mDayChanged ); + static int iii = 0; + if ( iii < 5 ) { + ++iii; + updateViewTimed(); } else { - mHolidays[i] = QString::null; + if ( !isVisible() ) { + mUpdateTimer->start( 2000 ); + } else { + if ( mDayChanged ) { + mUpdateTimer->start( 250 ); + } else { + mRepaintTimer->start( 250 ); + mUpdateTimer->start( 2000 ); + } + } } - } + } @@ -276,3 +314,3 @@ const QDate& KODayMatrix::getDate(int offset) if (offset < 0 || offset > NUMDAYS-1) { - kdDebug() << "Wrong offset (" << offset << ") in KODayMatrix::getDate(int)" << endl; + qDebug("Wrong offset2 "); return days[0]; @@ -285,3 +323,3 @@ QString KODayMatrix::getHolidayLabel(int offset) if (offset < 0 || offset > NUMDAYS-1) { - kdDebug() << "Wrong offset (" << offset << ") in KODayMatrix::getHolidayLabel(int)" << endl; + qDebug("Wrong offset1 "); return 0; diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h index b4eb2a8..0e9640a 100644 --- a/korganizer/kodaymatrix.h +++ b/korganizer/kodaymatrix.h @@ -174,2 +174,4 @@ public slots: void updateView(); + void updateViewTimed(); + void repaintViewTimed(); @@ -221,2 +223,5 @@ protected: private: + QTimer* mUpdateTimer; + QTimer* mRepaintTimer; + bool mDayChanged; |