Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koviewmanager.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index c442d0b..406e741 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -218,33 +218,25 @@ void KOViewManager::showNextView() | |||
218 | if (mCurrentView == mJournalView ) goto DAY_1; | 218 | if (mCurrentView == mJournalView ) goto DAY_1; |
219 | if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5; | 219 | if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5; |
220 | if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7; | 220 | if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7; |
221 | if (mCurrentView == mAgendaView ) goto DAY_6; | 221 | if (mCurrentView == mAgendaView ) goto DAY_6; |
222 | if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH; | 222 | if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH; |
223 | if (mCurrentView == mMonthView ) goto LIST; | 223 | if (mCurrentView == mMonthView ) goto LIST; |
224 | if (mCurrentView == mListView ) goto TODO; | 224 | if (mCurrentView == mListView ) goto TODO; |
225 | // if (mCurrentView == mTodoView ) goto NEXT; | 225 | // if (mCurrentView == mTodoView ) goto NEXT; |
226 | NEXT: | 226 | NEXT: |
227 | if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();goto ENTE ;} | 227 | if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();goto ENTE ;} |
228 | NEXT_X: | 228 | NEXT_X: |
229 | if ( KOPrefs::instance()->mShowIconNextDays ) { | 229 | if ( KOPrefs::instance()->mShowIconNextDays ) { |
230 | globalFlagBlockAgenda = 1; | 230 | showNextXView(); |
231 | if ( mCurrentAgendaView != 3 ) | ||
232 | mCurrentAgendaView = -1; | ||
233 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | ||
234 | globalFlagBlockAgenda = 2; | ||
235 | mMainView->dateNavigator()->selectDates( baseCycleDate , | ||
236 | KOPrefs::instance()->mNextXDays ); | ||
237 | mFlagShowNextxDays = true; | ||
238 | mCurrentAgendaView = 3 ; | ||
239 | goto ENTE ; | 231 | goto ENTE ; |
240 | } | 232 | } |
241 | JOURNAL: | 233 | JOURNAL: |
242 | if ( KOPrefs::instance()->mShowIconJournal ) { | 234 | if ( KOPrefs::instance()->mShowIconJournal ) { |
243 | resetDateSilent( baseCycleDate , 1 ); | 235 | resetDateSilent( baseCycleDate , 1 ); |
244 | showJournalView() ;goto ENTE ;} | 236 | showJournalView() ;goto ENTE ;} |
245 | DAY_1: | 237 | DAY_1: |
246 | if ( KOPrefs::instance()->mShowIconDay1 ) { | 238 | if ( KOPrefs::instance()->mShowIconDay1 ) { |
247 | resetDateSilent( baseCycleDate , 2 ); | 239 | resetDateSilent( baseCycleDate , 2 ); |
248 | showDayView() ;goto ENTE ;} | 240 | showDayView() ;goto ENTE ;} |
249 | DAY_5: | 241 | DAY_5: |
250 | if ( KOPrefs::instance()->mShowIconDay5 ) { | 242 | if ( KOPrefs::instance()->mShowIconDay5 ) { |
@@ -398,25 +390,25 @@ void KOViewManager::showWhatsNextView() | |||
398 | if (!mWhatsNextView) { | 390 | if (!mWhatsNextView) { |
399 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), | 391 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), |
400 | "KOViewManager::WhatsNextView"); | 392 | "KOViewManager::WhatsNextView"); |
401 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); | 393 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); |
402 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); | 394 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); |
403 | addView(mWhatsNextView); | 395 | addView(mWhatsNextView); |
404 | connect(this, SIGNAL( printWNV() ), | 396 | connect(this, SIGNAL( printWNV() ), |
405 | mWhatsNextView, SLOT( printMe() ) ); | 397 | mWhatsNextView, SLOT( printMe() ) ); |
406 | } | 398 | } |
407 | globalFlagBlockAgenda = 1; | 399 | globalFlagBlockAgenda = 1; |
408 | showView(mWhatsNextView, true ); | 400 | showView(mWhatsNextView, true ); |
409 | //mWhatsNextView->updateView(); | 401 | //mWhatsNextView->updateView(); |
410 | 402 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW; | |
411 | } | 403 | } |
412 | 404 | ||
413 | void KOViewManager::slotprintWNV() | 405 | void KOViewManager::slotprintWNV() |
414 | { | 406 | { |
415 | if (!mWhatsNextView) | 407 | if (!mWhatsNextView) |
416 | showWhatsNextView(); | 408 | showWhatsNextView(); |
417 | emit printWNV(); | 409 | emit printWNV(); |
418 | 410 | ||
419 | } | 411 | } |
420 | void KOViewManager::showListView() | 412 | void KOViewManager::showListView() |
421 | { | 413 | { |
422 | if (!mListView) { | 414 | if (!mListView) { |
@@ -444,24 +436,25 @@ void KOViewManager::showListView() | |||
444 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 436 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
445 | } | 437 | } |
446 | // bool temp = mFlagShowNextxDays; | 438 | // bool temp = mFlagShowNextxDays; |
447 | //globalFlagBlockPainting = true; | 439 | //globalFlagBlockPainting = true; |
448 | globalFlagBlockAgenda = 1; | 440 | globalFlagBlockAgenda = 1; |
449 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { | 441 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { |
450 | mMainView->setBlockShowDates( true ); | 442 | mMainView->setBlockShowDates( true ); |
451 | mMainView->dateNavigator()->selectMonth(); | 443 | mMainView->dateNavigator()->selectMonth(); |
452 | mMainView->setBlockShowDates( false ); | 444 | mMainView->setBlockShowDates( false ); |
453 | } | 445 | } |
454 | showView(mListView, KOPrefs::instance()->mFullViewTodo); | 446 | showView(mListView, KOPrefs::instance()->mFullViewTodo); |
455 | //mFlagShowNextxDays = temp; | 447 | //mFlagShowNextxDays = temp; |
448 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; | ||
456 | } | 449 | } |
457 | 450 | ||
458 | void KOViewManager::showAgendaView( bool fullScreen ) | 451 | void KOViewManager::showAgendaView( bool fullScreen ) |
459 | { | 452 | { |
460 | 453 | ||
461 | mMainView->dialogManager()->hideSearchDialog(); | 454 | mMainView->dialogManager()->hideSearchDialog(); |
462 | // qDebug("KOViewManager::showAgendaView "); | 455 | // qDebug("KOViewManager::showAgendaView "); |
463 | bool full; | 456 | bool full; |
464 | full = fullScreen; | 457 | full = fullScreen; |
465 | if (!mAgendaView) { | 458 | if (!mAgendaView) { |
466 | full = false; | 459 | full = false; |
467 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); | 460 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); |
@@ -509,25 +502,25 @@ void KOViewManager::showAgendaView( bool fullScreen ) | |||
509 | mMainView, SIGNAL( todoModified( Todo *, int ))); | 502 | mMainView, SIGNAL( todoModified( Todo *, int ))); |
510 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 503 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
511 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 504 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
512 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 505 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
513 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 506 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
514 | connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), | 507 | connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), |
515 | mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); | 508 | mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); |
516 | mAgendaView->readSettings(); | 509 | mAgendaView->readSettings(); |
517 | mAgendaView->updateConfig(); | 510 | mAgendaView->updateConfig(); |
518 | } | 511 | } |
519 | 512 | ||
520 | showView( mAgendaView, full); | 513 | showView( mAgendaView, full); |
521 | 514 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW; | |
522 | } | 515 | } |
523 | 516 | ||
524 | void KOViewManager::showDayView() | 517 | void KOViewManager::showDayView() |
525 | { | 518 | { |
526 | mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); | 519 | mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); |
527 | mFlagShowNextxDays = false; | 520 | mFlagShowNextxDays = false; |
528 | globalFlagBlockLabel = 1; | 521 | globalFlagBlockLabel = 1; |
529 | globalFlagBlockAgenda = 1; | 522 | globalFlagBlockAgenda = 1; |
530 | if ( mCurrentAgendaView != 1 ) | 523 | if ( mCurrentAgendaView != 1 ) |
531 | mCurrentAgendaView = -1; | 524 | mCurrentAgendaView = -1; |
532 | showAgendaView(); | 525 | showAgendaView(); |
533 | qApp->processEvents(); | 526 | qApp->processEvents(); |
@@ -583,24 +576,25 @@ void KOViewManager::showWeekView() | |||
583 | void KOViewManager::showNextXView() | 576 | void KOViewManager::showNextXView() |
584 | { | 577 | { |
585 | 578 | ||
586 | globalFlagBlockAgenda = 1; | 579 | globalFlagBlockAgenda = 1; |
587 | if ( mCurrentAgendaView != 3 ) | 580 | if ( mCurrentAgendaView != 3 ) |
588 | mCurrentAgendaView = -1; | 581 | mCurrentAgendaView = -1; |
589 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | 582 | showAgendaView(KOPrefs::instance()->mFullViewMonth); |
590 | globalFlagBlockAgenda = 2; | 583 | globalFlagBlockAgenda = 2; |
591 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), | 584 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), |
592 | KOPrefs::instance()->mNextXDays ); | 585 | KOPrefs::instance()->mNextXDays ); |
593 | mFlagShowNextxDays = true; | 586 | mFlagShowNextxDays = true; |
594 | mCurrentAgendaView = 3 ; | 587 | mCurrentAgendaView = 3 ; |
588 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW; | ||
595 | } | 589 | } |
596 | bool KOViewManager::showsNextDays() | 590 | bool KOViewManager::showsNextDays() |
597 | { | 591 | { |
598 | return mFlagShowNextxDays; | 592 | return mFlagShowNextxDays; |
599 | } | 593 | } |
600 | void KOViewManager::createMonthView() | 594 | void KOViewManager::createMonthView() |
601 | { | 595 | { |
602 | if (!mMonthView) { | 596 | if (!mMonthView) { |
603 | mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); | 597 | mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); |
604 | 598 | ||
605 | addView(mMonthView); | 599 | addView(mMonthView); |
606 | // mMonthView->show(); | 600 | // mMonthView->show(); |
@@ -667,24 +661,25 @@ void KOViewManager::showMonthViewWeek() | |||
667 | if ( mCurrentView == mMonthView) | 661 | if ( mCurrentView == mMonthView) |
668 | full = mMainView->leftFrame()->isVisible(); | 662 | full = mMainView->leftFrame()->isVisible(); |
669 | if ( !KOPrefs::instance()->mMonthViewWeek ) { | 663 | if ( !KOPrefs::instance()->mMonthViewWeek ) { |
670 | mMonthView->switchView(); | 664 | mMonthView->switchView(); |
671 | if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) | 665 | if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) |
672 | full = false; | 666 | full = false; |
673 | else | 667 | else |
674 | full = true; | 668 | full = true; |
675 | } | 669 | } |
676 | mMainView->dateNavigator()->selectWeek(); | 670 | mMainView->dateNavigator()->selectWeek(); |
677 | showView(mMonthView, full ); | 671 | showView(mMonthView, full ); |
678 | mMonthView->setKeyBFocus(); | 672 | mMonthView->setKeyBFocus(); |
673 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_ML_VIEW ; | ||
679 | } | 674 | } |
680 | 675 | ||
681 | void KOViewManager::showMonth( const QDate & date ) | 676 | void KOViewManager::showMonth( const QDate & date ) |
682 | { | 677 | { |
683 | mMainView->dateNavigator()->blockSignals( true ); | 678 | mMainView->dateNavigator()->blockSignals( true ); |
684 | mMainView->dateNavigator()->selectDate( date ); | 679 | mMainView->dateNavigator()->selectDate( date ); |
685 | mMainView->dateNavigator()->blockSignals( false ); | 680 | mMainView->dateNavigator()->blockSignals( false ); |
686 | showMonthView(); | 681 | showMonthView(); |
687 | } | 682 | } |
688 | void KOViewManager::showMonthView() | 683 | void KOViewManager::showMonthView() |
689 | { | 684 | { |
690 | 685 | ||
@@ -697,24 +692,25 @@ void KOViewManager::showMonthView() | |||
697 | // if(mMonthView == mCurrentView) return; | 692 | // if(mMonthView == mCurrentView) return; |
698 | if ( KOPrefs::instance()->mMonthViewWeek ) { | 693 | if ( KOPrefs::instance()->mMonthViewWeek ) { |
699 | mMonthView->switchView(); | 694 | mMonthView->switchView(); |
700 | if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) | 695 | if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) |
701 | full = false; | 696 | full = false; |
702 | else | 697 | else |
703 | full = true; | 698 | full = true; |
704 | } | 699 | } |
705 | mMainView->dateNavigator()->selectMonth(); | 700 | mMainView->dateNavigator()->selectMonth(); |
706 | 701 | ||
707 | showView(mMonthView, full ); | 702 | showView(mMonthView, full ); |
708 | mMonthView->setKeyBFocus(); | 703 | mMonthView->setKeyBFocus(); |
704 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_M_VIEW ; | ||
709 | 705 | ||
710 | } | 706 | } |
711 | 707 | ||
712 | void KOViewManager::showTodoView() | 708 | void KOViewManager::showTodoView() |
713 | { | 709 | { |
714 | //mFlagShowNextxDays = false; | 710 | //mFlagShowNextxDays = false; |
715 | if ( !mTodoView ) { | 711 | if ( !mTodoView ) { |
716 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), | 712 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), |
717 | "KOViewManager::TodoView" ); | 713 | "KOViewManager::TodoView" ); |
718 | 714 | ||
719 | addView( mTodoView ); | 715 | addView( mTodoView ); |
720 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); | 716 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); |
@@ -752,41 +748,43 @@ void KOViewManager::showTodoView() | |||
752 | mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); | 748 | mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); |
753 | connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), | 749 | connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), |
754 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 750 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
755 | connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), | 751 | connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), |
756 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 752 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
757 | KConfig *config = KOGlobals::config(); | 753 | KConfig *config = KOGlobals::config(); |
758 | mTodoView->restoreLayout(config,"Todo View"); | 754 | mTodoView->restoreLayout(config,"Todo View"); |
759 | mTodoView->setNavigator( mMainView->dateNavigator() ); | 755 | mTodoView->setNavigator( mMainView->dateNavigator() ); |
760 | } | 756 | } |
761 | 757 | ||
762 | globalFlagBlockAgenda = 1; | 758 | globalFlagBlockAgenda = 1; |
763 | showView( mTodoView, true ); | 759 | showView( mTodoView, true ); |
760 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ; | ||
764 | 761 | ||
765 | } | 762 | } |
766 | 763 | ||
767 | void KOViewManager::showJournalView() | 764 | void KOViewManager::showJournalView() |
768 | { | 765 | { |
769 | //mFlagShowNextxDays = false; | 766 | //mFlagShowNextxDays = false; |
770 | if (!mJournalView) { | 767 | if (!mJournalView) { |
771 | mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), | 768 | mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), |
772 | "KOViewManager::JournalView"); | 769 | "KOViewManager::JournalView"); |
773 | connect( mMainView, SIGNAL( configChanged() ), mJournalView, | 770 | connect( mMainView, SIGNAL( configChanged() ), mJournalView, |
774 | SLOT( updateConfig() ) ); | 771 | SLOT( updateConfig() ) ); |
775 | connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); | 772 | connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); |
776 | addView(mJournalView); | 773 | addView(mJournalView); |
777 | } | 774 | } |
778 | 775 | ||
779 | showView(mJournalView); | 776 | showView(mJournalView); |
780 | mMainView->dateNavigator()->selectDates( 1 ); | 777 | mMainView->dateNavigator()->selectDates( 1 ); |
778 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ; | ||
781 | } | 779 | } |
782 | 780 | ||
783 | void KOViewManager::showTimeSpanView() | 781 | void KOViewManager::showTimeSpanView() |
784 | { | 782 | { |
785 | //mFlagShowNextxDays = false; | 783 | //mFlagShowNextxDays = false; |
786 | if (!mTimeSpanView) { | 784 | if (!mTimeSpanView) { |
787 | mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), | 785 | mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), |
788 | "KOViewManager::TimeSpanView"); | 786 | "KOViewManager::TimeSpanView"); |
789 | addView(mTimeSpanView); | 787 | addView(mTimeSpanView); |
790 | 788 | ||
791 | mTimeSpanView->readSettings(); | 789 | mTimeSpanView->readSettings(); |
792 | } | 790 | } |