author | zautrix <zautrix> | 2005-03-27 09:46:04 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-27 09:46:04 (UTC) |
commit | b170a7414ff72016285ea207caa7ccf786530e77 (patch) (side-by-side diff) | |
tree | cb635d155fed20ecb33f877659a00d88bedb309e /korganizer | |
parent | ee6f7d5329658c567882e8e496c65eef8874496e (diff) | |
download | kdepimpi-b170a7414ff72016285ea207caa7ccf786530e77.zip kdepimpi-b170a7414ff72016285ea207caa7ccf786530e77.tar.gz kdepimpi-b170a7414ff72016285ea207caa7ccf786530e77.tar.bz2 |
many fixes
-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 @@ -236,5 +236,5 @@ CalendarView::CalendarView( Calendar *calendar, void CalendarView::init() { - + mNextAlarmDateTime = QDateTime::currentDateTime(); setFocusPolicy ( WheelFocus ); mViewerCallerIsSearchDialog = false; @@ -643,4 +643,5 @@ void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) { + mNextAlarmDateTime = qdt; //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { @@ -4065,2 +4066,17 @@ void CalendarView::resetFocus() mViewerCallerIsSearchDialog = false; } + +void CalendarView::showNextAlarms() +{ + QString message; + if ( mNextAlarmDateTime > QDateTime::currentDateTime() ) { + QString sum = mCalendar->nextSummary(); + QDateTime nextA = mNextAlarmDateTime; + QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); + 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)) ; + } else { + message = i18n("There is no next alarm."); + + } + KMessageBox::information( this, message); +} diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 16e671f..9782ffe 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -177,4 +177,5 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser public slots: + void showNextAlarms(); void showOpenError(); void watchSavedFile(); @@ -500,4 +501,5 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser private: + QDateTime mNextAlarmDateTime; bool mViewerCallerIsSearchDialog; bool mBlockShowDates; diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 95b836c..7a4275b 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -591,5 +591,5 @@ void MainWindow::initActions() QFontMetrics f( mWeekFont ); fontWid = f.width( "30" ); - qDebug("dec-- "); + //qDebug("dec-- "); } @@ -1749,5 +1749,8 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) break; case Qt::Key_A: - mView->toggleAllDaySize(); + if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) + mView->showNextAlarms(); + else + mView->toggleAllDaySize(); break; case Qt::Key_T: @@ -2134,2 +2137,14 @@ void MainWindow::weekAction() delete popup; } + +void MainWindow::hideEvent ( QHideEvent * ) +{ + QString message; + QDateTime nextA = mCalendar->nextAlarmEventDateTime(); + if ( nextA.isValid() ) { + QString sum = mCalendar->nextSummary(); + + 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)); + setCaption( message ); + } +} diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 7604529..b3041dc 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h @@ -105,4 +105,5 @@ class MainWindow : public QMainWindow protected: + void hideEvent ( QHideEvent * ); QString sentSyncFile(); void displayText( QString, QString); |