author | zautrix <zautrix> | 2005-01-23 15:44:48 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-23 15:44:48 (UTC) |
commit | abe5f73892c123110faec5648b484628b3265fd6 (patch) (unidiff) | |
tree | 8619e09ffbeb3b5ef9302a8bcb39092b426d3e43 /korganizer | |
parent | 6946f6ab0ee6eeafee0c8ff5d33fffc0826c7452 (diff) | |
download | kdepimpi-abe5f73892c123110faec5648b484628b3265fd6.zip kdepimpi-abe5f73892c123110faec5648b484628b3265fd6.tar.gz kdepimpi-abe5f73892c123110faec5648b484628b3265fd6.tar.bz2 |
bter today
-rw-r--r-- | korganizer/koagendaview.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index c5acafd..6428757 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -638,6 +638,7 @@ void KOAgendaView::createDayLabels() | |||
638 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); | 638 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); |
639 | dayLabel->show(); | 639 | dayLabel->show(); |
640 | DateList::ConstIterator dit; | 640 | DateList::ConstIterator dit; |
641 | bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); | ||
641 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { | 642 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { |
642 | QDate date = *dit; | 643 | QDate date = *dit; |
643 | // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); | 644 | // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); |
@@ -682,7 +683,22 @@ void KOAgendaView::createDayLabels() | |||
682 | default: | 683 | default: |
683 | break; | 684 | break; |
684 | } | 685 | } |
685 | 686 | if ( oneday ) { | |
687 | QString addString; | ||
688 | if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) | ||
689 | addString = i18n("Today"); | ||
690 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) | ||
691 | addString = i18n("Tomorrow"); | ||
692 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) | ||
693 | addString = i18n("Yesterday"); | ||
694 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) | ||
695 | addString = i18n("Day before yesterday"); | ||
696 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) | ||
697 | addString = i18n("Day after tomorrow"); | ||
698 | if ( !addString.isEmpty() ) { | ||
699 | str = addString+", " + str; | ||
700 | } | ||
701 | } | ||
686 | dayLabel->setText(str); | 702 | dayLabel->setText(str); |
687 | dayLabel->setAlignment(QLabel::AlignHCenter); | 703 | dayLabel->setAlignment(QLabel::AlignHCenter); |
688 | if (date == QDate::currentDate()) { | 704 | if (date == QDate::currentDate()) { |