-rw-r--r-- | korganizer/calendarview.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 3a16fe6..73aa733 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -235,7 +235,7 @@ CalendarView::CalendarView( Calendar *calendar, | |||
235 | 235 | ||
236 | void CalendarView::init() | 236 | void CalendarView::init() |
237 | { | 237 | { |
238 | 238 | mNextAlarmDateTime = QDateTime::currentDateTime(); | |
239 | setFocusPolicy ( WheelFocus ); | 239 | setFocusPolicy ( WheelFocus ); |
240 | mViewerCallerIsSearchDialog = false; | 240 | mViewerCallerIsSearchDialog = false; |
241 | mBlockShowDates = false; | 241 | mBlockShowDates = false; |
@@ -642,6 +642,7 @@ void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) | |||
642 | 642 | ||
643 | void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) | 643 | void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) |
644 | { | 644 | { |
645 | mNextAlarmDateTime = qdt; | ||
645 | //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); | 646 | //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); |
646 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { | 647 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { |
647 | #ifndef DESKTOP_VERSION | 648 | #ifndef DESKTOP_VERSION |
@@ -4064,3 +4065,18 @@ void CalendarView::resetFocus() | |||
4064 | } | 4065 | } |
4065 | mViewerCallerIsSearchDialog = false; | 4066 | mViewerCallerIsSearchDialog = false; |
4066 | } | 4067 | } |
4068 | |||
4069 | void CalendarView::showNextAlarms() | ||
4070 | { | ||
4071 | QString message; | ||
4072 | if ( mNextAlarmDateTime > QDateTime::currentDateTime() ) { | ||
4073 | QString sum = mCalendar->nextSummary(); | ||
4074 | QDateTime nextA = mNextAlarmDateTime; | ||
4075 | QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); | ||
4076 | message = i18n("The next alarm is on:\n%1\nat: %2\n\n%3\n(%4)").arg( KGlobal::locale()->formatDate(nextA.date() , false)).arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; | ||
4077 | } else { | ||
4078 | message = i18n("There is no next alarm."); | ||
4079 | |||
4080 | } | ||
4081 | KMessageBox::information( this, message); | ||
4082 | } | ||