summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt14
-rw-r--r--korganizer/kdatenavigator.cpp4
-rw-r--r--korganizer/koagendaitem.cpp13
-rw-r--r--korganizer/kodaymatrix.cpp148
-rw-r--r--korganizer/kodaymatrix.h5
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
@@ -10,11 +10,23 @@ introduced in the latest versions, where the text was not fitting on the
10240x320 display of the Zaurus 5500. 10240x320 display of the Zaurus 5500.
11 11
12Added a popup menu ( press pen and hold to get popup ) to the agenda view 12Added a popup menu ( press pen and hold to get popup ) to the agenda view
13with may useful items. 13with many useful items (add event/todo, show next week, two weeks, month, journal).
14 14
15Added items to the todolist popup menu for: 15Added items to the todolist popup menu for:
16Display all opened, all closed or all todos flat. 16Display all opened, all closed or all todos flat.
17The "flat" view makes is possible to sort all todos after ,e.g., prio or date. 17The "flat" view makes is possible to sort all todos after ,e.g., prio or date.
18Made the reparenting of todos on the desktop possible via Drag&Drop.
19Fixed several bugs in setting the completed datetime for todos.
20Added info about completed datetime of todos to the todo viewer.
21Now displaying a completed todo (with completed datetime set) in the agenda view
22at the time of the completion. Such that now it is possible to see in the agenda view
23when what todo was completed.
24Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos.
25Now the behaviour is:
26Setting a parent to complete sets all (sub)childs to complete.
27Setting a parent to uncomplete does not change the childs.
28Setting a child to uncomplete sets all parent to uncomplete.
29Setting a child to complete does not change the parents.
18 30
19 31
20********** VERSION 2.0.0 ************ 32********** VERSION 2.0.0 ************
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index b420351..f31e50a 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -225,7 +225,7 @@ void KDateNavigator::updateDates()
225void KDateNavigator::updateDayMatrix() 225void KDateNavigator::updateDayMatrix()
226{ 226{
227 daymatrix->updateView(); 227 daymatrix->updateView();
228 daymatrix->repaint(); 228 //daymatrix->repaint();
229} 229}
230 230
231 231
@@ -262,7 +262,7 @@ void KDateNavigator::updateView()
262 setUpdatesEnabled( true ); 262 setUpdatesEnabled( true );
263// kdDebug() << "updateView() -> repaint()" << endl; 263// kdDebug() << "updateView() -> repaint()" << endl;
264 repaint(); 264 repaint();
265 daymatrix->repaint(); 265 // daymatrix->repaint();
266} 266}
267 267
268void KDateNavigator::updateConfig() 268void KDateNavigator::updateConfig()
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 39355b4..ee9f39a 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -469,13 +469,12 @@ void KOAgendaItem::computeText()
469 469
470 mDisplayedText = mIncidence->summary(); 470 mDisplayedText = mIncidence->summary();
471 if ( (mIncidence->type() == "Todo") ) { 471 if ( (mIncidence->type() == "Todo") ) {
472 if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) 472 if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) {
473 mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; 473 if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() )
474 else if ( !(mIncidence->doesFloat())) 474 mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")";
475 mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; 475 else if ( !(mIncidence->doesFloat()))
476 476 mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")";
477 477 }
478
479 } else { 478 } else {
480 if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) 479 if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda)
481 mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; 480 mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ;
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index fc00828..060b4c4 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -108,7 +108,13 @@ KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const
108 108
109 setAcceptDrops(true); 109 setAcceptDrops(true);
110 //setFont( QFont("Arial", 10) ); 110 //setFont( QFont("Arial", 10) );
111 updateView(date); 111
112 mUpdateTimer = new QTimer( this );
113 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( updateViewTimed() ));
114 mRepaintTimer = new QTimer( this );
115 connect (mRepaintTimer ,SIGNAL(timeout()), this, SLOT ( repaintViewTimed() ));
116 mDayChanged = false;
117 updateView();
112} 118}
113 119
114QColor KODayMatrix::getShadedColor(QColor color) 120QColor KODayMatrix::getShadedColor(QColor color)
@@ -202,79 +208,111 @@ void KODayMatrix::updateView()
202{ 208{
203 updateView(startdate); 209 updateView(startdate);
204} 210}
205 211void KODayMatrix::repaintViewTimed()
206void KODayMatrix::updateView(QDate actdate) 212{
213 qDebug("KODayMatrix::repaintViewTimed ");
214 mRepaintTimer->stop();
215 repaint(false);
216}
217void KODayMatrix::updateViewTimed()
207{ 218{
208
209// kdDebug() << "KODayMatrix::updateView() " << actdate.toString() << endl;
210
211 //flag to indicate if the starting day of the matrix has changed by this call
212 bool daychanged = false;
213 // if a new startdate is to be set then apply Cornelius's calculation
214 // of the first day to be shown
215 if (actdate != startdate) {
216 // reset index of selection according to shift of starting date from startdate to actdate
217 if (mSelStart != NOSELECTION) {
218 int tmp = actdate.daysTo(startdate);
219 //kdDebug() << "Shift of Selection1: " << mSelStart << " - " << mSelEnd << " -> " << tmp << "(" << offset << ")" << endl;
220 // shift selection if new one would be visible at least partly !
221
222 if (mSelStart+tmp < NUMDAYS && mSelEnd+tmp >= 0) {
223 // nested if is required for next X display pushed from a different month - correction required
224 // otherwise, for month forward and backward, it must be avoided
225 if( mSelStart > NUMDAYS || mSelStart < 0 )
226 mSelStart = mSelStart + tmp;
227 if( mSelEnd > NUMDAYS || mSelEnd < 0 )
228 mSelEnd = mSelEnd + tmp;
229 }
230 }
231 219
232 startdate = actdate; 220 mUpdateTimer->stop();
233 daychanged = true; 221 //QDate actdate = mPendingNewDate;
234 }
235 222
236 if (daychanged) { 223 static int iii = 0;
237 recalculateToday(); 224 qDebug("KODayMatrix::updateView(QDate actdate) %d", ++iii );
238 } 225
226 if (mDayChanged) {
227 recalculateToday();
228 mDayChanged = false;
229 }
239 230
240 for(int i = 0; i < NUMDAYS; i++) { 231 for(int i = 0; i < NUMDAYS; i++) {
241 232
242 // if events are set for the day then remember to draw it bold 233 // if events are set for the day then remember to draw it bold
243 QPtrList<Event> eventlist = mCalendar->events(days[i]); 234 QPtrList<Event> eventlist = mCalendar->events(days[i]);
244 Event *event; 235 Event *event;
245 int numEvents = eventlist.count(); 236 int numEvents = eventlist.count();
246 237
247 for(event=eventlist.first();event != 0;event=eventlist.next()) { 238 for(event=eventlist.first();event != 0;event=eventlist.next()) {
248 ushort recurType = event->recurrence()->doesRecur(); 239 ushort recurType = event->recurrence()->doesRecur();
249 240
250 if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || 241 if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) ||
251 (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { 242 (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) {
252 numEvents--; 243 numEvents--;
253 } 244 }
254 } 245 }
255 events[i] = numEvents; 246 events[i] = numEvents;
256 247
257 //if it is a holy day then draw it red. Sundays are consider holidays, too 248 //if it is a holy day then draw it red. Sundays are consider holidays, too
258#ifndef KORG_NOPLUGINS 249#ifndef KORG_NOPLUGINS
259 QString holiStr = KOCore::self()->holiday(days[i]); 250 QString holiStr = KOCore::self()->holiday(days[i]);
260#else 251#else
261 QString holiStr = QString::null; 252 QString holiStr = QString::null;
262#endif 253#endif
263 if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || 254 if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) ||
264 !holiStr.isEmpty()) { 255 !holiStr.isEmpty()) {
265 if (holiStr.isNull()) holiStr = ""; 256 if (holiStr.isNull()) holiStr = "";
266 mHolidays[i] = holiStr; 257 mHolidays[i] = holiStr;
267 258
259 } else {
260 mHolidays[i] = QString::null;
261 }
262 }
263 repaint(false);
264 }
265void KODayMatrix::updateView(QDate actdate)
266{
267
268 //flag to indicate if the starting day of the matrix has changed by this call
269 //mDayChanged = false;
270 // if a new startdate is to be set then apply Cornelius's calculation
271 // of the first day to be shown
272 if (actdate != startdate) {
273 // reset index of selection according to shift of starting date from startdate to actdate
274 if (mSelStart != NOSELECTION) {
275 int tmp = actdate.daysTo(startdate);
276 //kdDebug() << "Shift of Selection1: " << mSelStart << " - " << mSelEnd << " -> " << tmp << "(" << offset << ")" << endl;
277 // shift selection if new one would be visible at least partly !
278
279 if (mSelStart+tmp < NUMDAYS && mSelEnd+tmp >= 0) {
280 // nested if is required for next X display pushed from a different month - correction required
281 // otherwise, for month forward and backward, it must be avoided
282 if( mSelStart > NUMDAYS || mSelStart < 0 )
283 mSelStart = mSelStart + tmp;
284 if( mSelEnd > NUMDAYS || mSelEnd < 0 )
285 mSelEnd = mSelEnd + tmp;
286 }
287 }
288
289 startdate = actdate;
290 mDayChanged = true;
291 }
292 qDebug("restart Timer %d", mDayChanged );
293 static int iii = 0;
294 if ( iii < 5 ) {
295 ++iii;
296 updateViewTimed();
268 } else { 297 } else {
269 mHolidays[i] = QString::null; 298 if ( !isVisible() ) {
299 mUpdateTimer->start( 2000 );
300 } else {
301 if ( mDayChanged ) {
302 mUpdateTimer->start( 250 );
303 } else {
304 mRepaintTimer->start( 250 );
305 mUpdateTimer->start( 2000 );
306 }
307 }
270 } 308 }
271 } 309
272} 310}
273 311
274const QDate& KODayMatrix::getDate(int offset) 312const QDate& KODayMatrix::getDate(int offset)
275{ 313{
276 if (offset < 0 || offset > NUMDAYS-1) { 314 if (offset < 0 || offset > NUMDAYS-1) {
277 kdDebug() << "Wrong offset (" << offset << ") in KODayMatrix::getDate(int)" << endl; 315 qDebug("Wrong offset2 ");
278 return days[0]; 316 return days[0];
279 } 317 }
280 return days[offset]; 318 return days[offset];
@@ -283,7 +321,7 @@ const QDate& KODayMatrix::getDate(int offset)
283QString KODayMatrix::getHolidayLabel(int offset) 321QString KODayMatrix::getHolidayLabel(int offset)
284{ 322{
285 if (offset < 0 || offset > NUMDAYS-1) { 323 if (offset < 0 || offset > NUMDAYS-1) {
286 kdDebug() << "Wrong offset (" << offset << ") in KODayMatrix::getHolidayLabel(int)" << endl; 324 qDebug("Wrong offset1 ");
287 return 0; 325 return 0;
288 } 326 }
289 return mHolidays[offset]; 327 return mHolidays[offset];
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h
index b4eb2a8..0e9640a 100644
--- a/korganizer/kodaymatrix.h
+++ b/korganizer/kodaymatrix.h
@@ -172,6 +172,8 @@ public slots:
172 * on a day (Actually calls above method with the actual startdate). 172 * on a day (Actually calls above method with the actual startdate).
173 */ 173 */
174 void updateView(); 174 void updateView();
175 void updateViewTimed();
176 void repaintViewTimed();
175 177
176 /** 178 /**
177 * Calculate which square in the matrix should be 179 * Calculate which square in the matrix should be
@@ -219,6 +221,9 @@ protected:
219 void resizeEvent(QResizeEvent *); 221 void resizeEvent(QResizeEvent *);
220 222
221private: 223private:
224 QTimer* mUpdateTimer;
225 QTimer* mRepaintTimer;
226 bool mDayChanged;
222 227
223 /** returns the index of the day located at the matrix's widget (x,y) position. 228 /** returns the index of the day located at the matrix's widget (x,y) position.
224 * 229 *