summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--korganizer/koviewmanager.cpp6
-rw-r--r--korganizer/koviewmanager.h2
-rw-r--r--korganizer/kowhatsnextview.cpp45
-rw-r--r--libkcal/incidence.cpp4
-rw-r--r--libkcal/incidencebase.cpp4
6 files changed, 45 insertions, 18 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index ba0e6c6..bbed05b 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1933,13 +1933,13 @@ void CalendarView::changeTodoDisplay(Todo *which, int action)
1933{ 1933{
1934 changeIncidenceDisplay((Incidence *)which, action); 1934 changeIncidenceDisplay((Incidence *)which, action);
1935 mDateNavigator->updateView(); //LR 1935 mDateNavigator->updateView(); //LR
1936 //mDialogManager->updateSearchDialog(); 1936 //mDialogManager->updateSearchDialog();
1937 1937
1938 if (which) { 1938 if (which) {
1939 //mViewManager->currentView()->updateView();//LR 1939 mViewManager->updateWNview();
1940 //mTodoList->updateView(); 1940 //mTodoList->updateView();
1941 } 1941 }
1942 1942
1943} 1943}
1944 1944
1945void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 1945void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index fc2bc77..ba77b45 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -220,12 +220,18 @@ void KOViewManager::updateView(const QDate &start, const QDate &end)
220 if (mCurrentView) mCurrentView->showDates(start, end); 220 if (mCurrentView) mCurrentView->showDates(start, end);
221 221
222 if (mTodoView) mTodoView->updateView(); 222 if (mTodoView) mTodoView->updateView();
223} 223}
224 224
225 225
226void KOViewManager::updateWNview()
227{
228 if ( mCurrentView == mWhatsNextView && mWhatsNextView )
229 mWhatsNextView->updateView();
230
231}
226void KOViewManager::showWhatsNextView() 232void KOViewManager::showWhatsNextView()
227{ 233{
228 if (!mWhatsNextView) { 234 if (!mWhatsNextView) {
229 mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), 235 mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(),
230 "KOViewManager::WhatsNextView"); 236 "KOViewManager::WhatsNextView");
231 mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); 237 mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog());
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index f814c36..26b22be 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -50,13 +50,13 @@ class KOViewManager : public QObject
50 public: 50 public:
51 KOViewManager( CalendarView * ); 51 KOViewManager( CalendarView * );
52 virtual ~KOViewManager(); 52 virtual ~KOViewManager();
53 53
54 /** changes the view to be the currently selected view */ 54 /** changes the view to be the currently selected view */
55 void showView(KOrg::BaseView *, bool fullScreen = false ); 55 void showView(KOrg::BaseView *, bool fullScreen = false );
56 56 void updateWNview();
57 void readSettings(KConfig *config); 57 void readSettings(KConfig *config);
58 void writeSettings(KConfig *config); 58 void writeSettings(KConfig *config);
59 bool showsNextDays(); 59 bool showsNextDays();
60 /** Read which view was shown last from config file */ 60 /** Read which view was shown last from config file */
61 void readCurrentView(KConfig *); 61 void readCurrentView(KConfig *);
62 /** Write which view is currently shown to config file */ 62 /** Write which view is currently shown to config file */
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index b2001ec..2a8a7c1 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -260,17 +260,18 @@ void KOWhatsNextView::updateView()
260 Attendee *me = ev->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 260 Attendee *me = ev->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
261 if (me!=0) { 261 if (me!=0) {
262 if (me->status()==Attendee::NeedsAction && me->RSVP()) { 262 if (me->status()==Attendee::NeedsAction && me->RSVP()) {
263 if (replys == 0) { 263 if (replys == 0) {
264 mText += "<p></p>"; 264 mText += "<p></p>";
265 // kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); 265 // kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
266 mText += "<h2>"; 266 //mText += "<h2>";
267 //<img src=\""; 267 //<img src=\"";
268 // mText += ipath; 268 // mText += ipath;
269 // mText += "\">"; 269 // mText += "\">";
270 mText += i18n("Events and To-Dos that need a reply:") + "</h2>\n"; 270 //mText += i18n("Events and To-Dos that need a reply:") + "</h2>\n";
271 mText +="<big><big><strong><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></strong></big></big>\n";
271 mText += "<table>\n"; 272 mText += "<table>\n";
272 } 273 }
273 replys++; 274 replys++;
274 appendEvent(ev,true); 275 appendEvent(ev,true);
275 } 276 }
276 } 277 }
@@ -278,39 +279,33 @@ void KOWhatsNextView::updateView()
278 } 279 }
279 } 280 }
280 todos = calendar()->todos(); 281 todos = calendar()->todos();
281 if (todos.count() > 0) { 282 if (todos.count() > 0) {
282 Todo *to = todos.first(); 283 Todo *to = todos.first();
283 while(to) { 284 while(to) {
285 if ( !to->isCompleted() ){
284 Attendee *me = to->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 286 Attendee *me = to->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
285 if (me!=0) { 287 if (me!=0) {
286 if (me->status()==Attendee::NeedsAction && me->RSVP()) { 288 if (me->status()==Attendee::NeedsAction && me->RSVP()) {
287 if (replys == 0) { 289 if (replys == 0) {
288 mText += "<p></p>"; 290 mText +="<big><big><strong><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></strong></big></big>\n";
289 // kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
290 mText += "<h2>";
291 //<img src=\"";
292 // mText += ipath;
293 // mText += "\">";
294 mText += i18n("Events and To-Dos that need a reply:") + "</h2>\n";
295 mText += "<table>\n"; 291 mText += "<table>\n";
296 } 292 }
297 replys++; 293 replys++;
298 appendEvent(to); 294 appendEvent(to, true);
295 }
299 } 296 }
300 } 297 }
301 kdDebug () << "check for todo-replys..." << endl;
302 to = todos.next(); 298 to = todos.next();
303 } 299 }
304 } 300 }
305 if (replys > 0 ) mText += "</table>\n"; 301 if (replys > 0 ) mText += "</table>\n";
306 302
307 303
308 mText += "</td></tr>\n</table>\n"; 304 mText += "</td></tr>\n</table>\n";
309 305
310 kdDebug() << "KOWhatsNextView::updateView: text: " << mText << endl;
311 mView->setText(mText); 306 mView->setText(mText);
312 mView->setFocus(); 307 mView->setFocus();
313 308
314 // QPixmap bPix = SmallIcon( "back" ); 309 // QPixmap bPix = SmallIcon( "back" );
315 // qDebug("xxxxxxxxxxxxxxxxxxxxx "); 310 // qDebug("xxxxxxxxxxxxxxxxxxxxx ");
316 // QWidget* test = new QWidget(); 311 // QWidget* test = new QWidget();
@@ -391,18 +386,31 @@ void KOWhatsNextView::changeEventDisplay(Event *, int action)
391 kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl; 386 kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl;
392 } 387 }
393} 388}
394 389
395void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) 390void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
396{ 391{
397 if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(21) == QString("last-syncEvent-device") ) 392 if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") )
398 return; 393 return;
399 QDateTime cdt = QDateTime::currentDateTime(); 394 QDateTime cdt = QDateTime::currentDateTime();
395 QDateTime noc;
396 bool ok = true;
397 if ( reply ) {
398 noc = ev->getNextOccurence( cdt, &ok );
399 if (! ok && ev->type() == "Event")
400 return;
401 }
400 mText += "<tr><td><b>"; 402 mText += "<tr><td><b>";
401 if (ev->type()=="Event") { 403 if (ev->type()=="Event") {
404 if (reply) {
405 if (!ev->doesFloat())
406 mText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": ";
407 else
408 mText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
402 409
410 } else {
403 if (!ev->doesFloat()) { 411 if (!ev->doesFloat()) {
404 Event *event = static_cast<Event *>(ev); 412 Event *event = static_cast<Event *>(ev);
405 QDateTime st,end; 413 QDateTime st,end;
406 if ( event->recurrence()->doesRecur() ) { 414 if ( event->recurrence()->doesRecur() ) {
407 QDate recDate= mEventDate; 415 QDate recDate= mEventDate;
408 int days = event->dtStart().date().daysTo (event->dtEnd().date() ); 416 int days = event->dtStart().date().daysTo (event->dtEnd().date() );
@@ -415,13 +423,13 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
415 } 423 }
416 else { 424 else {
417 st = event->dtStart(); 425 st = event->dtStart();
418 end = event->dtEnd(); 426 end = event->dtEnd();
419 } 427 }
420 428
421 if (reply) mText += "on " + event->dtStartDateStr() + ": "; 429
422 QString dateText; 430 QString dateText;
423 // qDebug("%s %s %s %s ", mEventDate.toString().latin1(),event->summary().latin1(), st .toString().latin1(),end.toString().latin1() ); 431 // qDebug("%s %s %s %s ", mEventDate.toString().latin1(),event->summary().latin1(), st .toString().latin1(),end.toString().latin1() );
424 if ( st.date() < mEventDate ) 432 if ( st.date() < mEventDate )
425 dateText = "++:++-"; 433 dateText = "++:++-";
426 else 434 else
427 dateText = event->dtStartTimeStr() + "-"; 435 dateText = event->dtStartTimeStr() + "-";
@@ -435,21 +443,29 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
435 if ( end < cdt ) 443 if ( end < cdt )
436 mText += "<font color=\"#F00000\">" + dateText + "</font>"; 444 mText += "<font color=\"#F00000\">" + dateText + "</font>";
437 else if ( st < cdt ) 445 else if ( st < cdt )
438 mText += "<font color=\"#008000\">" + dateText + "</font>"; 446 mText += "<font color=\"#008000\">" + dateText + "</font>";
439 else 447 else
440 mText += dateText; 448 mText += dateText;
449
441 } 450 }
442 451
443 } else { 452 } else {
444 mText += i18n("Allday:"); 453 mText += i18n("Allday:");
445 454
446 } 455 }
456 }
447 } else { 457 } else {
448 mTodos.append( ev ); 458 mTodos.append( ev );
449 mText += i18n("ToDo:"); 459 mText += i18n("ToDo:");
460 if (reply) {
461 mText += " ";
462 if ( noc != cdt ) {
463 mText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
464 }
465 } else {
450 if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) { 466 if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) {
451 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; 467 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
452 QString dfs = KGlobal::locale()->dateFormatShort(); 468 QString dfs = KGlobal::locale()->dateFormatShort();
453 KGlobal::locale()->setDateFormatShort("%d.%b"); 469 KGlobal::locale()->setDateFormatShort("%d.%b");
454 mText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>"; 470 mText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>";
455 KGlobal::locale()->setDateFormatShort(dfs); 471 KGlobal::locale()->setDateFormatShort(dfs);
@@ -461,12 +477,13 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
461 477
462 } else 478 } else
463 mText +=((Todo*)ev)->dtDueTimeStr(); 479 mText +=((Todo*)ev)->dtDueTimeStr();
464 mTodos.append( ev ); 480 mTodos.append( ev );
465 } 481 }
466 } 482 }
483 }
467 mText += "</b></td><td>"; 484 mText += "</b></td><td>";
468 bool needClose = false; 485 bool needClose = false;
469 if ( ev->cancelled() ) { 486 if ( ev->cancelled() ) {
470 mText += "<font color=\"#F00000\">[c"; 487 mText += "<font color=\"#F00000\">[c";
471 needClose =true; 488 needClose =true;
472 489
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 56c9801..55ac6d4 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -587,12 +587,16 @@ QDateTime Incidence::getNextOccurence( const QDateTime& dt, bool* ok ) const
587 } else { 587 } else {
588 return QDateTime (); 588 return QDateTime ();
589 } 589 }
590 } else { 590 } else {
591 if ( hasStartDate () ) { 591 if ( hasStartDate () ) {
592 incidenceStart = dtStart(); 592 incidenceStart = dtStart();
593 }
594 if ( type() =="Todo" ) {
595 if ( ((Todo*)this)->hasDueDate() )
596 incidenceStart = ((Todo*)this)->dtDue();
593 597
594 } 598 }
595 } 599 }
596 if ( incidenceStart > dt ) 600 if ( incidenceStart > dt )
597 *ok = true; 601 *ok = true;
598 return incidenceStart; 602 return incidenceStart;
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp
index 64a343c..b36dc1a 100644
--- a/libkcal/incidencebase.cpp
+++ b/libkcal/incidencebase.cpp
@@ -268,13 +268,13 @@ Attendee *IncidenceBase::getAttendee(const char *n) const
268Attendee *IncidenceBase::attendeeByMail(const QString &email) 268Attendee *IncidenceBase::attendeeByMail(const QString &email)
269{ 269{
270 QPtrListIterator<Attendee> qli(mAttendees); 270 QPtrListIterator<Attendee> qli(mAttendees);
271 271
272 qli.toFirst(); 272 qli.toFirst();
273 while (qli) { 273 while (qli) {
274 if (qli.current()->email() == email) 274 if (qli.current()->email().lower() == email.lower())
275 return qli.current(); 275 return qli.current();
276 ++qli; 276 ++qli;
277 } 277 }
278 return 0L; 278 return 0L;
279} 279}
280 280
@@ -286,13 +286,13 @@ Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QStrin
286 if (!email.isEmpty()) { 286 if (!email.isEmpty()) {
287 mails.append(email); 287 mails.append(email);
288 } 288 }
289 qli.toFirst(); 289 qli.toFirst();
290 while (qli) { 290 while (qli) {
291 for ( QStringList::Iterator it = mails.begin(); it != mails.end(); ++it ) { 291 for ( QStringList::Iterator it = mails.begin(); it != mails.end(); ++it ) {
292 if (qli.current()->email() == *it) 292 if (qli.current()->email().lower() == (*it).lower())
293 return qli.current(); 293 return qli.current();
294 } 294 }
295 295
296 ++qli; 296 ++qli;
297 } 297 }
298 return 0L; 298 return 0L;