-rw-r--r-- | korganizer/calendarview.cpp | 11 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 13 |
2 files changed, 20 insertions, 4 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 1d5a57e..257a4dd 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1518,21 +1518,24 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) { //qDebug("addAnni "); Event * ev = new Event(); if ( 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) ); ev->setDtEnd( QDateTime(date) ); ev->setFloats( true ); Recurrence * rec = ev->recurrence(); rec->setYearly(Recurrence::rYearlyMonth,1,-1); rec->addYearlyNum( date.month() ); @@ -2506,31 +2509,33 @@ void CalendarView::showDatePicker( ) void CalendarView::showEventEditor() { #ifdef DESKTOP_VERSION mEventEditor->show(); #else 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("") ); } mEventEditor->showMaximized(); #endif } void CalendarView::showTodoEditor() { #ifdef DESKTOP_VERSION mTodoEditor->show(); #else 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("") ); } mTodoEditor->showMaximized(); #endif } diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 7166a01..4111c5d 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -595,16 +595,24 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a tempText += "<a "; if (ev->type()=="Event") tempText += "href=\"event:"; if (ev->type()=="Todo") tempText += "href=\"todo:"; tempText += ev->uid() + "\">"; if ( ev->summary().length() > 0 ) 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 += "</a>"; if ( KOPrefs::instance()->mWNViewShowLocation ) if ( !ev->location().isEmpty() ) tempText += " ("+ev->location() +")"; if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents) tempText += " ["+ev->relatedTo()->summary() +"]"; tempText += "</td></tr>\n"; mText += tempText; @@ -650,17 +658,20 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) // mText += "r"; // needClose =true; // } if ( needClose ) mText += "] "; if ( ev->cancelled() ) mText += "</font>"; mText += "<a href=\"todo:" + ev->uid() + "\">"; - mText += ev->summary(); + if ( ev->summary().length() > 0 ) + mText += ev->summary(); + else + mText += i18n("-no summary-"); mText += "</a>"; if ( ((Todo*)ev)->hasDueDate () ) { QString year = ""; int ye = ((Todo*)ev)->dtDue().date().year(); if ( QDateTime::currentDateTime().date().year() != ye ) year = QString::number( ye ); QString dfs = KGlobal::locale()->dateFormatShort(); KGlobal::locale()->setDateFormatShort("%d.%b"); |