-rw-r--r-- | korganizer/calendarview.cpp | 18 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 19 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 |
4 files changed, 37 insertions, 3 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 | } | ||
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 16e671f..9782ffe 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -176,6 +176,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
176 | 176 | ||
177 | 177 | ||
178 | public slots: | 178 | public slots: |
179 | void showNextAlarms(); | ||
179 | void showOpenError(); | 180 | void showOpenError(); |
180 | void watchSavedFile(); | 181 | void watchSavedFile(); |
181 | void recheckTimerAlarm(); | 182 | void recheckTimerAlarm(); |
@@ -499,6 +500,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
499 | Todo *selectedTodo(); | 500 | Todo *selectedTodo(); |
500 | 501 | ||
501 | private: | 502 | private: |
503 | QDateTime mNextAlarmDateTime; | ||
502 | bool mViewerCallerIsSearchDialog; | 504 | bool mViewerCallerIsSearchDialog; |
503 | bool mBlockShowDates; | 505 | bool mBlockShowDates; |
504 | KSyncManager* mSyncManager; | 506 | KSyncManager* mSyncManager; |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 95b836c..7a4275b 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -590,7 +590,7 @@ void MainWindow::initActions() | |||
590 | mWeekFont.setPointSize( fontPoint ); | 590 | mWeekFont.setPointSize( fontPoint ); |
591 | QFontMetrics f( mWeekFont ); | 591 | QFontMetrics f( mWeekFont ); |
592 | fontWid = f.width( "30" ); | 592 | fontWid = f.width( "30" ); |
593 | qDebug("dec-- "); | 593 | //qDebug("dec-- "); |
594 | } | 594 | } |
595 | 595 | ||
596 | connect( mWeekAction, SIGNAL( activated() ), | 596 | connect( mWeekAction, SIGNAL( activated() ), |
@@ -1748,7 +1748,10 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) | |||
1748 | mView->toggleExpand(); | 1748 | mView->toggleExpand(); |
1749 | break; | 1749 | break; |
1750 | case Qt::Key_A: | 1750 | case Qt::Key_A: |
1751 | mView->toggleAllDaySize(); | 1751 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) |
1752 | mView->showNextAlarms(); | ||
1753 | else | ||
1754 | mView->toggleAllDaySize(); | ||
1752 | break; | 1755 | break; |
1753 | case Qt::Key_T: | 1756 | case Qt::Key_T: |
1754 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1757 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
@@ -2133,3 +2136,15 @@ void MainWindow::weekAction() | |||
2133 | } | 2136 | } |
2134 | delete popup; | 2137 | delete popup; |
2135 | } | 2138 | } |
2139 | |||
2140 | void MainWindow::hideEvent ( QHideEvent * ) | ||
2141 | { | ||
2142 | QString message; | ||
2143 | QDateTime nextA = mCalendar->nextAlarmEventDateTime(); | ||
2144 | if ( nextA.isValid() ) { | ||
2145 | QString sum = mCalendar->nextSummary(); | ||
2146 | |||
2147 | message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); | ||
2148 | setCaption( message ); | ||
2149 | } | ||
2150 | } | ||
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 7604529..b3041dc 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -104,6 +104,7 @@ class MainWindow : public QMainWindow | |||
104 | void syncFileRequest(); | 104 | void syncFileRequest(); |
105 | 105 | ||
106 | protected: | 106 | protected: |
107 | void hideEvent ( QHideEvent * ); | ||
107 | QString sentSyncFile(); | 108 | QString sentSyncFile(); |
108 | void displayText( QString, QString); | 109 | void displayText( QString, QString); |
109 | void enableIncidenceActions( bool ); | 110 | void enableIncidenceActions( bool ); |