From c8b484570a9cf8aacc070f92141c8bcfebbf3a93 Mon Sep 17 00:00:00 2001 From: zautrix Date: Thu, 27 Jan 2005 12:14:32 +0000 Subject: birthday fixes --- (limited to 'korganizer') diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 1d5a57e..257a4dd 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1523,11 +1523,14 @@ bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a ev->addAttendee( a ); } QString kind; - if ( birthday ) + if ( birthday ) { kind = i18n( "Birthday" ); - else + ev->setSummary( name + " (" + QString::number(date.year()) +")"); + } + else { kind = i18n( "Anniversary" ); - ev->setSummary( name + " - " + kind ); + ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind ); + } ev->setOrganizer(a->email()); ev->setCategories( kind ); ev->setDtStart( QDateTime(date) ); @@ -2511,6 +2514,7 @@ void CalendarView::showEventEditor() if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); + qApp->processEvents(); delete mEventEditor; mEventEditor = mDialogManager->getEventEditor(); topLevelWidget()->setCaption( i18n("") ); @@ -2526,6 +2530,7 @@ void CalendarView::showTodoEditor() if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); + qApp->processEvents(); delete mTodoEditor; mTodoEditor = mDialogManager->getTodoEditor(); topLevelWidget()->setCaption( i18n("") ); diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 7166a01..4111c5d 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -600,6 +600,14 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a tempText += ev->summary(); else tempText += i18n("-no summary-"); + if ( ev->categories().contains( i18n("Birthday") ) || ev->categories().contains( i18n("Anniversary") ) ) { + noc = ev->getNextOccurence( cdt, &ok ); + if ( ok ) { + int years = noc.date().year() - ev->dtStart().date().year(); + tempText += i18n(" (%1 y.)"). arg( years ); + } + } + tempText += ""; if ( KOPrefs::instance()->mWNViewShowLocation ) if ( !ev->location().isEmpty() ) @@ -655,7 +663,10 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) if ( ev->cancelled() ) mText += ""; mText += "uid() + "\">"; - mText += ev->summary(); + if ( ev->summary().length() > 0 ) + mText += ev->summary(); + else + mText += i18n("-no summary-"); mText += ""; if ( ((Todo*)ev)->hasDueDate () ) { QString year = ""; -- cgit v0.9.0.2