-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 4 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 2 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 65 | ||||
-rw-r--r-- | korganizer/koviewmanager.h | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 5 |
5 files changed, 75 insertions, 2 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index ec7f730..e8ec033 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp | |||
@@ -649,25 +649,27 @@ void SimpleAlarmDaemonImpl::newCountdown() | |||
649 | { | 649 | { |
650 | //recieve("cal_alarm", 10 ); | 650 | //recieve("cal_alarm", 10 ); |
651 | } | 651 | } |
652 | void SimpleAlarmDaemonImpl::simulate() | 652 | void SimpleAlarmDaemonImpl::simulate() |
653 | { | 653 | { |
654 | writeFile(); | 654 | writeFile(); |
655 | QString filename = getenv("QPEDIR") ; | 655 | QString filename = getenv("QPEDIR") ; |
656 | filename += "/pics/kdepim/korganizer/koalarm.wav"; | 656 | filename += "/pics/kdepim/korganizer/koalarm.wav"; |
657 | startAlarm("Alarm simulation", filename ); | 657 | startAlarm("Alarm simulation", filename ); |
658 | } | 658 | } |
659 | void SimpleAlarmDaemonImpl::showKO() | 659 | void SimpleAlarmDaemonImpl::showKO() |
660 | { | 660 | { |
661 | QCopEnvelope e("QPE/Application/kopi", "-showKO"); | 661 | QCopEnvelope e("QPE/Application/kopi", "-showKO"); |
662 | // testing only | ||
663 | //QCopEnvelope e("QPE/Application/kopi", "nextView()"); | ||
662 | 664 | ||
663 | } | 665 | } |
664 | void SimpleAlarmDaemonImpl::showTodo() | 666 | void SimpleAlarmDaemonImpl::showTodo() |
665 | { | 667 | { |
666 | QCopEnvelope e("QPE/Application/kopi", "-showTodo"); | 668 | QCopEnvelope e("QPE/Application/kopi", "-showTodo"); |
667 | 669 | ||
668 | } | 670 | } |
669 | void SimpleAlarmDaemonImpl::writeJournal() | 671 | void SimpleAlarmDaemonImpl::writeJournal() |
670 | { | 672 | { |
671 | QCopEnvelope e("QPE/Application/kopi", "-showJournal"); | 673 | QCopEnvelope e("QPE/Application/kopi", "-showJournal"); |
672 | 674 | ||
673 | } | 675 | } |
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index a32333c..fa6b951 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -753,24 +753,26 @@ void KOAgendaView::createDayLabels() | |||
753 | if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) | 753 | if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) |
754 | addString = i18n("Today"); | 754 | addString = i18n("Today"); |
755 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) | 755 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) |
756 | addString = i18n("Tomorrow"); | 756 | addString = i18n("Tomorrow"); |
757 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) | 757 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) |
758 | addString = i18n("Yesterday"); | 758 | addString = i18n("Yesterday"); |
759 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) | 759 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) |
760 | addString = i18n("Day before yesterday"); | 760 | addString = i18n("Day before yesterday"); |
761 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) | 761 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) |
762 | addString = i18n("Day after tomorrow"); | 762 | addString = i18n("Day after tomorrow"); |
763 | if ( !addString.isEmpty() ) { | 763 | if ( !addString.isEmpty() ) { |
764 | str = addString+", " + str; | 764 | str = addString+", " + str; |
765 | } else { | ||
766 | str = KGlobal::locale()->formatDate( date, KOPrefs::instance()->mShortDateInViewer); | ||
765 | } | 767 | } |
766 | } | 768 | } |
767 | dayLabel->setText(str); | 769 | dayLabel->setText(str); |
768 | //dayLabel->setAlignment(QLabel::AlignHCenter); | 770 | //dayLabel->setAlignment(QLabel::AlignHCenter); |
769 | if (date == QDate::currentDate()) { | 771 | if (date == QDate::currentDate()) { |
770 | QFont bFont = dlf; | 772 | QFont bFont = dlf; |
771 | bFont.setBold( true ); | 773 | bFont.setBold( true ); |
772 | dayLabel->setFont(bFont); | 774 | dayLabel->setFont(bFont); |
773 | } | 775 | } |
774 | //dayLayout->addWidget(dayLabel); | 776 | //dayLayout->addWidget(dayLabel); |
775 | 777 | ||
776 | #ifndef KORG_NOPLUGINS | 778 | #ifndef KORG_NOPLUGINS |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 31ee5e2..b5de4a1 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -189,25 +189,90 @@ void KOViewManager::writeSettings(KConfig *config) | |||
189 | mAgendaView->writeSettings(config); | 189 | mAgendaView->writeSettings(config); |
190 | } | 190 | } |
191 | if (mTimeSpanView) { | 191 | if (mTimeSpanView) { |
192 | mTimeSpanView->writeSettings(config); | 192 | mTimeSpanView->writeSettings(config); |
193 | } | 193 | } |
194 | if (mListView) { | 194 | if (mListView) { |
195 | mListView->writeSettings(config); | 195 | mListView->writeSettings(config); |
196 | } | 196 | } |
197 | if (mTodoView) { | 197 | if (mTodoView) { |
198 | mTodoView->saveLayout(config,"Todo View"); | 198 | mTodoView->saveLayout(config,"Todo View"); |
199 | } | 199 | } |
200 | } | 200 | } |
201 | void KOViewManager::showNextView() | ||
202 | { | ||
203 | if (mCurrentView == mWhatsNextView) goto NEXT_X; | ||
204 | |||
205 | if (mCurrentView == mAgendaView && mFlagShowNextxDays) goto LIST; | ||
206 | |||
207 | if (mCurrentView == mListView ) goto DAY_1; | ||
208 | |||
209 | if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5; | ||
210 | |||
211 | if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7; | ||
212 | |||
213 | if (mCurrentView == mAgendaView ) goto DAY_6; | ||
214 | |||
215 | if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH; | ||
216 | |||
217 | if (mCurrentView == mMonthView ) goto TODO; | ||
218 | |||
219 | if (mCurrentView == mTodoView ) goto JOURNAL; | ||
220 | |||
221 | NEXT: | ||
222 | if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;} | ||
223 | NEXT_X: | ||
224 | if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;} | ||
225 | LIST: | ||
226 | if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;} | ||
227 | DAY_1: | ||
228 | if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;} | ||
229 | DAY_5: | ||
230 | if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;} | ||
231 | DAY_7: | ||
232 | if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;} | ||
233 | DAY_6: | ||
234 | if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;} | ||
235 | MONTH: | ||
236 | if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;} | ||
237 | TODO: | ||
238 | if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;} | ||
239 | JOURNAL: | ||
240 | if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;} | ||
241 | |||
242 | |||
243 | |||
244 | if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;} | ||
245 | |||
246 | if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;} | ||
247 | |||
248 | if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;} | ||
249 | |||
250 | if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;} | ||
201 | 251 | ||
252 | if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;} | ||
253 | |||
254 | if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;} | ||
255 | |||
256 | if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;} | ||
257 | |||
258 | if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;} | ||
259 | |||
260 | if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;} | ||
261 | |||
262 | if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;} | ||
263 | |||
264 | |||
265 | |||
266 | } | ||
202 | void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) | 267 | void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) |
203 | { | 268 | { |
204 | 269 | ||
205 | //mFlagShowNextxDays = false; | 270 | //mFlagShowNextxDays = false; |
206 | //if(view == mCurrentView) return; | 271 | //if(view == mCurrentView) return; |
207 | if ( view == 0 ) { | 272 | if ( view == 0 ) { |
208 | view = mCurrentView; | 273 | view = mCurrentView; |
209 | if ( view == 0 ) | 274 | if ( view == 0 ) |
210 | return; | 275 | return; |
211 | } | 276 | } |
212 | bool callupdate = !(view == mCurrentView); | 277 | bool callupdate = !(view == mCurrentView); |
213 | bool full = fullScreen; | 278 | bool full = fullScreen; |
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h index 6290227..d829f14 100644 --- a/korganizer/koviewmanager.h +++ b/korganizer/koviewmanager.h | |||
@@ -73,24 +73,25 @@ class KOViewManager : public QObject | |||
73 | void addView(KOrg::BaseView *); | 73 | void addView(KOrg::BaseView *); |
74 | 74 | ||
75 | Incidence *currentSelection(); | 75 | Incidence *currentSelection(); |
76 | QDate currentSelectionDate(); | 76 | QDate currentSelectionDate(); |
77 | 77 | ||
78 | KOAgendaView *agendaView() const { return mAgendaView; } | 78 | KOAgendaView *agendaView() const { return mAgendaView; } |
79 | 79 | ||
80 | signals: | 80 | signals: |
81 | void printWNV(); | 81 | void printWNV(); |
82 | void signalFullScreen( bool ); | 82 | void signalFullScreen( bool ); |
83 | void signalAgendaView( bool ); | 83 | void signalAgendaView( bool ); |
84 | public slots: | 84 | public slots: |
85 | void showNextView(); | ||
85 | void showMonth( const QDate & ); | 86 | void showMonth( const QDate & ); |
86 | void showDateView( int, QDate ); | 87 | void showDateView( int, QDate ); |
87 | void updateView(); | 88 | void updateView(); |
88 | void showWhatsNextView(); | 89 | void showWhatsNextView(); |
89 | void showListView(); | 90 | void showListView(); |
90 | void showAgendaView( bool fullScreen = false ); | 91 | void showAgendaView( bool fullScreen = false ); |
91 | void showDayView(); | 92 | void showDayView(); |
92 | void showWorkWeekView(); | 93 | void showWorkWeekView(); |
93 | void showWeekView(); | 94 | void showWeekView(); |
94 | void showNextXView(); | 95 | void showNextXView(); |
95 | void showMonthView(); | 96 | void showMonthView(); |
96 | void showMonthViewWeek(); | 97 | void showMonthViewWeek(); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 7d5cf72..b947cac 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -475,27 +475,30 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
475 | } | 475 | } |
476 | else if ( msg == "-showTodo" ) { | 476 | else if ( msg == "-showTodo" ) { |
477 | mView->viewManager()->showTodoView(); | 477 | mView->viewManager()->showTodoView(); |
478 | } | 478 | } |
479 | else if ( msg == "-showJournal" ) { | 479 | else if ( msg == "-showJournal" ) { |
480 | mView->dateNavigator()->selectDates( 1 ); | 480 | mView->dateNavigator()->selectDates( 1 ); |
481 | mView->dateNavigator()->selectToday(); | 481 | mView->dateNavigator()->selectToday(); |
482 | mView->viewManager()->showJournalView(); | 482 | mView->viewManager()->showJournalView(); |
483 | } | 483 | } |
484 | else if ( msg == "-showKO" ) { | 484 | else if ( msg == "-showKO" ) { |
485 | mView->viewManager()->showNextXView(); | 485 | mView->viewManager()->showNextXView(); |
486 | } | 486 | } |
487 | else if ( msg == "-showWNext" || msg == "nextView()" ) { | 487 | else if ( msg == "-showWNext" ) { |
488 | mView->viewManager()->showWhatsNextView(); | 488 | mView->viewManager()->showWhatsNextView(); |
489 | } | 489 | } |
490 | else if ( msg == "nextView()" ) { | ||
491 | mView->viewManager()->showNextView(); | ||
492 | } | ||
490 | else if ( msg == "-showNextXView" ) { | 493 | else if ( msg == "-showNextXView" ) { |
491 | mView->viewManager()->showNextXView(); | 494 | mView->viewManager()->showNextXView(); |
492 | } | 495 | } |
493 | 496 | ||
494 | 497 | ||
495 | } | 498 | } |
496 | 499 | ||
497 | showMaximized(); | 500 | showMaximized(); |
498 | raise(); | 501 | raise(); |
499 | } | 502 | } |
500 | 503 | ||
501 | QPixmap MainWindow::loadPixmap( QString name ) | 504 | QPixmap MainWindow::loadPixmap( QString name ) |