author | zautrix <zautrix> | 2005-07-06 14:53:38 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-06 14:53:38 (UTC) |
commit | 2038f7363c31e1a0ab139a1184cbed10086e1862 (patch) (unidiff) | |
tree | 532bc409b7046938614417a8043455de0e86c8fe /korganizer | |
parent | 2e8199c8aa82c018d24d67c299a09b2aa6a786f1 (diff) | |
download | kdepimpi-2038f7363c31e1a0ab139a1184cbed10086e1862.zip kdepimpi-2038f7363c31e1a0ab139a1184cbed10086e1862.tar.gz kdepimpi-2038f7363c31e1a0ab139a1184cbed10086e1862.tar.bz2 |
huhu
-rw-r--r-- | korganizer/calendarview.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 558fc55..98e0ac1 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2536,192 +2536,206 @@ void CalendarView::writeFilterSettings(KConfig *config) | |||
2536 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); | 2536 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); |
2537 | } | 2537 | } |
2538 | 2538 | ||
2539 | 2539 | ||
2540 | void CalendarView::goToday() | 2540 | void CalendarView::goToday() |
2541 | { | 2541 | { |
2542 | if ( mViewManager->currentView()->isMonthView() ) | 2542 | if ( mViewManager->currentView()->isMonthView() ) |
2543 | mNavigator->selectTodayMonth(); | 2543 | mNavigator->selectTodayMonth(); |
2544 | else | 2544 | else |
2545 | mNavigator->selectToday(); | 2545 | mNavigator->selectToday(); |
2546 | } | 2546 | } |
2547 | 2547 | ||
2548 | void CalendarView::goNext() | 2548 | void CalendarView::goNext() |
2549 | { | 2549 | { |
2550 | mNavigator->selectNext(); | 2550 | mNavigator->selectNext(); |
2551 | } | 2551 | } |
2552 | 2552 | ||
2553 | void CalendarView::goPrevious() | 2553 | void CalendarView::goPrevious() |
2554 | { | 2554 | { |
2555 | mNavigator->selectPrevious(); | 2555 | mNavigator->selectPrevious(); |
2556 | } | 2556 | } |
2557 | void CalendarView::goNextMonth() | 2557 | void CalendarView::goNextMonth() |
2558 | { | 2558 | { |
2559 | mNavigator->selectNextMonth(); | 2559 | mNavigator->selectNextMonth(); |
2560 | } | 2560 | } |
2561 | 2561 | ||
2562 | void CalendarView::goPreviousMonth() | 2562 | void CalendarView::goPreviousMonth() |
2563 | { | 2563 | { |
2564 | mNavigator->selectPreviousMonth(); | 2564 | mNavigator->selectPreviousMonth(); |
2565 | } | 2565 | } |
2566 | 2566 | ||
2567 | void CalendarView::updateConfig() | 2567 | void CalendarView::updateConfig() |
2568 | { | 2568 | { |
2569 | if ( KOPrefs::instance()->mUseAppColors ) | 2569 | if ( KOPrefs::instance()->mUseAppColors ) |
2570 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 2570 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
2571 | emit configChanged(); | 2571 | emit configChanged(); |
2572 | mTodoList->updateConfig(); | 2572 | mTodoList->updateConfig(); |
2573 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); | 2573 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); |
2574 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2574 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2575 | // To make the "fill window" configurations work | 2575 | // To make the "fill window" configurations work |
2576 | //mViewManager->raiseCurrentView(); | 2576 | //mViewManager->raiseCurrentView(); |
2577 | } | 2577 | } |
2578 | 2578 | ||
2579 | 2579 | ||
2580 | void CalendarView::eventChanged(Event *event) | 2580 | void CalendarView::eventChanged(Event *event) |
2581 | { | 2581 | { |
2582 | changeEventDisplay(event,KOGlobals::EVENTEDITED); | 2582 | changeEventDisplay(event,KOGlobals::EVENTEDITED); |
2583 | //updateUnmanagedViews(); | 2583 | //updateUnmanagedViews(); |
2584 | } | 2584 | } |
2585 | 2585 | ||
2586 | void CalendarView::eventAdded(Event *event) | 2586 | void CalendarView::eventAdded(Event *event) |
2587 | { | 2587 | { |
2588 | changeEventDisplay(event,KOGlobals::EVENTADDED); | 2588 | changeEventDisplay(event,KOGlobals::EVENTADDED); |
2589 | } | 2589 | } |
2590 | 2590 | ||
2591 | void CalendarView::eventToBeDeleted(Event *) | 2591 | void CalendarView::eventToBeDeleted(Event *) |
2592 | { | 2592 | { |
2593 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; | 2593 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; |
2594 | } | 2594 | } |
2595 | 2595 | ||
2596 | void CalendarView::eventDeleted() | 2596 | void CalendarView::eventDeleted() |
2597 | { | 2597 | { |
2598 | changeEventDisplay(0,KOGlobals::EVENTDELETED); | 2598 | changeEventDisplay(0,KOGlobals::EVENTDELETED); |
2599 | } | 2599 | } |
2600 | void CalendarView::changeTodoDisplay(Todo *which, int action) | 2600 | void CalendarView::changeTodoDisplay(Todo *which, int action) |
2601 | { | 2601 | { |
2602 | changeIncidenceDisplay((Incidence *)which, action); | 2602 | changeIncidenceDisplay((Incidence *)which, action); |
2603 | mDateNavigator->updateView(); //LR | 2603 | mDateNavigator->updateView(); //LR |
2604 | //mDialogManager->updateSearchDialog(); | 2604 | //mDialogManager->updateSearchDialog(); |
2605 | 2605 | ||
2606 | if (which) { | 2606 | if (which) { |
2607 | mViewManager->updateWNview(); | 2607 | mViewManager->updateWNview(); |
2608 | //mTodoList->updateView(); | 2608 | //mTodoList->updateView(); |
2609 | } | 2609 | } |
2610 | 2610 | ||
2611 | } | 2611 | } |
2612 | 2612 | ||
2613 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) | 2613 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) |
2614 | { | 2614 | { |
2615 | updateUnmanagedViews(); | 2615 | updateUnmanagedViews(); |
2616 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); | 2616 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); |
2617 | if ( action == KOGlobals::EVENTDELETED ) { //delete | 2617 | if ( action == KOGlobals::EVENTDELETED ) { //delete |
2618 | mCalendar->checkAlarmForIncidence( 0, true ); | 2618 | mCalendar->checkAlarmForIncidence( 0, true ); |
2619 | if ( mEventViewerDialog ) | 2619 | if ( mEventViewerDialog ) |
2620 | mEventViewerDialog->hide(); | 2620 | mEventViewerDialog->hide(); |
2621 | } | 2621 | } |
2622 | else | 2622 | else |
2623 | mCalendar->checkAlarmForIncidence( which , false ); | 2623 | mCalendar->checkAlarmForIncidence( which , false ); |
2624 | } | 2624 | } |
2625 | 2625 | ||
2626 | // most of the changeEventDisplays() right now just call the view's | 2626 | // most of the changeEventDisplays() right now just call the view's |
2627 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. | 2627 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. |
2628 | void CalendarView::changeEventDisplay(Event *which, int action) | 2628 | void CalendarView::changeEventDisplay(Event *which, int action) |
2629 | { | 2629 | { |
2630 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; | 2630 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; |
2631 | changeIncidenceDisplay((Incidence *)which, action); | 2631 | changeIncidenceDisplay((Incidence *)which, action); |
2632 | |||
2633 | |||
2634 | static bool clearallviews = false; | ||
2635 | if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { | ||
2636 | if ( clearallviews ) { | ||
2637 | clearAllViews(); | ||
2638 | clearallviews = false; | ||
2639 | } | ||
2640 | return; | ||
2641 | } | ||
2642 | clearallviews = true; | ||
2643 | |||
2644 | |||
2645 | |||
2632 | mDateNavigator->updateView(); | 2646 | mDateNavigator->updateView(); |
2633 | //mDialogManager->updateSearchDialog(); | 2647 | //mDialogManager->updateSearchDialog(); |
2634 | 2648 | ||
2635 | if (which) { | 2649 | if (which) { |
2636 | // If there is an event view visible update the display | 2650 | // If there is an event view visible update the display |
2637 | mViewManager->currentView()->changeEventDisplay(which,action); | 2651 | mViewManager->currentView()->changeEventDisplay(which,action); |
2638 | // TODO: check, if update needed | 2652 | // TODO: check, if update needed |
2639 | // if (which->getTodoStatus()) { | 2653 | // if (which->getTodoStatus()) { |
2640 | mTodoList->updateView(); | 2654 | mTodoList->updateView(); |
2641 | // } | 2655 | // } |
2642 | } else { | 2656 | } else { |
2643 | mViewManager->currentView()->updateView(); | 2657 | mViewManager->currentView()->updateView(); |
2644 | } | 2658 | } |
2645 | } | 2659 | } |
2646 | 2660 | ||
2647 | 2661 | ||
2648 | void CalendarView::updateTodoViews() | 2662 | void CalendarView::updateTodoViews() |
2649 | { | 2663 | { |
2650 | mTodoList->updateView(); | 2664 | mTodoList->updateView(); |
2651 | mViewManager->currentView()->updateView(); | 2665 | mViewManager->currentView()->updateView(); |
2652 | 2666 | ||
2653 | } | 2667 | } |
2654 | 2668 | ||
2655 | 2669 | ||
2656 | 2670 | ||
2657 | void CalendarView::clearAllViews() | 2671 | void CalendarView::clearAllViews() |
2658 | { | 2672 | { |
2659 | mTodoList->clearList(); | 2673 | mTodoList->clearList(); |
2660 | mViewManager->clearAllViews(); | 2674 | mViewManager->clearAllViews(); |
2661 | SearchDialog * sd = mDialogManager->getSearchDialog(); | 2675 | SearchDialog * sd = mDialogManager->getSearchDialog(); |
2662 | if ( sd ) { | 2676 | if ( sd ) { |
2663 | KOListView* kol = sd->listview(); | 2677 | KOListView* kol = sd->listview(); |
2664 | if ( kol ) | 2678 | if ( kol ) |
2665 | kol->clearList(); | 2679 | kol->clearList(); |
2666 | } | 2680 | } |
2667 | } | 2681 | } |
2668 | void CalendarView::updateView() | 2682 | void CalendarView::updateView() |
2669 | { | 2683 | { |
2670 | static bool clearallviews = false; | 2684 | static bool clearallviews = false; |
2671 | if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { | 2685 | if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { |
2672 | if ( clearallviews ) { | 2686 | if ( clearallviews ) { |
2673 | clearAllViews(); | 2687 | clearAllViews(); |
2674 | clearallviews = false; | 2688 | clearallviews = false; |
2675 | } | 2689 | } |
2676 | return; | 2690 | return; |
2677 | } | 2691 | } |
2678 | clearallviews = true; | 2692 | clearallviews = true; |
2679 | DateList tmpList = mNavigator->selectedDates(); | 2693 | DateList tmpList = mNavigator->selectedDates(); |
2680 | 2694 | ||
2681 | if ( KOPrefs::instance()->mHideNonStartedTodos ) | 2695 | if ( KOPrefs::instance()->mHideNonStartedTodos ) |
2682 | mTodoList->updateView(); | 2696 | mTodoList->updateView(); |
2683 | // We assume that the navigator only selects consecutive days. | 2697 | // We assume that the navigator only selects consecutive days. |
2684 | updateView( tmpList.first(), tmpList.last() ); | 2698 | updateView( tmpList.first(), tmpList.last() ); |
2685 | } | 2699 | } |
2686 | 2700 | ||
2687 | void CalendarView::updateUnmanagedViews() | 2701 | void CalendarView::updateUnmanagedViews() |
2688 | { | 2702 | { |
2689 | mDateNavigator->updateDayMatrix(); | 2703 | mDateNavigator->updateDayMatrix(); |
2690 | } | 2704 | } |
2691 | 2705 | ||
2692 | int CalendarView::msgItemDelete(const QString name) | 2706 | int CalendarView::msgItemDelete(const QString name) |
2693 | { | 2707 | { |
2694 | return KMessageBox::warningContinueCancel(this,name +"\n\n"+ | 2708 | return KMessageBox::warningContinueCancel(this,name +"\n\n"+ |
2695 | i18n("This item will be\npermanently deleted."), | 2709 | i18n("This item will be\npermanently deleted."), |
2696 | i18n("KO/Pi Confirmation"),i18n("Delete")); | 2710 | i18n("KO/Pi Confirmation"),i18n("Delete")); |
2697 | } | 2711 | } |
2698 | 2712 | ||
2699 | 2713 | ||
2700 | void CalendarView::edit_cut() | 2714 | void CalendarView::edit_cut() |
2701 | { | 2715 | { |
2702 | Event *anEvent=0; | 2716 | Event *anEvent=0; |
2703 | 2717 | ||
2704 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2718 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2705 | 2719 | ||
2706 | if (mViewManager->currentView()->isEventView()) { | 2720 | if (mViewManager->currentView()->isEventView()) { |
2707 | if ( incidence && incidence->typeID() == eventID ) { | 2721 | if ( incidence && incidence->typeID() == eventID ) { |
2708 | anEvent = static_cast<Event *>(incidence); | 2722 | anEvent = static_cast<Event *>(incidence); |
2709 | } | 2723 | } |
2710 | } | 2724 | } |
2711 | 2725 | ||
2712 | if (!anEvent) { | 2726 | if (!anEvent) { |
2713 | KNotifyClient::beep(); | 2727 | KNotifyClient::beep(); |
2714 | return; | 2728 | return; |
2715 | } | 2729 | } |
2716 | DndFactory factory( mCalendar ); | 2730 | DndFactory factory( mCalendar ); |
2717 | factory.cutIncidence(anEvent); | 2731 | factory.cutIncidence(anEvent); |
2718 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 2732 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
2719 | } | 2733 | } |
2720 | 2734 | ||
2721 | void CalendarView::edit_copy() | 2735 | void CalendarView::edit_copy() |
2722 | { | 2736 | { |
2723 | Event *anEvent=0; | 2737 | Event *anEvent=0; |
2724 | 2738 | ||
2725 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2739 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2726 | 2740 | ||
2727 | if (mViewManager->currentView()->isEventView()) { | 2741 | if (mViewManager->currentView()->isEventView()) { |