-rw-r--r-- | korganizer/calendarview.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 2582931..68d1bc6 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2726,93 +2726,92 @@ void CalendarView::changeEventDisplay(Event *which, int action) | |||
2726 | clearallviews = true; | 2726 | clearallviews = true; |
2727 | mDateNavigator->updateView(); | 2727 | mDateNavigator->updateView(); |
2728 | //mDialogManager->updateSearchDialog(); | 2728 | //mDialogManager->updateSearchDialog(); |
2729 | if (which) { | 2729 | if (which) { |
2730 | // If there is an event view visible update the display | 2730 | // If there is an event view visible update the display |
2731 | mViewManager->currentView()->changeEventDisplay(which,action); | 2731 | mViewManager->currentView()->changeEventDisplay(which,action); |
2732 | // TODO: check, if update needed | 2732 | // TODO: check, if update needed |
2733 | // if (which->getTodoStatus()) { | 2733 | // if (which->getTodoStatus()) { |
2734 | mTodoList->updateView(); | 2734 | mTodoList->updateView(); |
2735 | if ( action != KOGlobals::EVENTDELETED ) { | 2735 | if ( action != KOGlobals::EVENTDELETED ) { |
2736 | mConflictingEvent = which ; | 2736 | mConflictingEvent = which ; |
2737 | QTimer::singleShot( 1000, this, SLOT ( checkConflictForEvent() ) ); | 2737 | QTimer::singleShot( 1000, this, SLOT ( checkConflictForEvent() ) ); |
2738 | } | 2738 | } |
2739 | // } | 2739 | // } |
2740 | } else { | 2740 | } else { |
2741 | mViewManager->currentView()->updateView(); | 2741 | mViewManager->currentView()->updateView(); |
2742 | } | 2742 | } |
2743 | } | 2743 | } |
2744 | void CalendarView::checkConflictForEvent() | 2744 | void CalendarView::checkConflictForEvent() |
2745 | { | 2745 | { |
2746 | 2746 | ||
2747 | if (!KOPrefs::instance()->mConfirm) | 2747 | if (!KOPrefs::instance()->mConfirm) |
2748 | return; | 2748 | return; |
2749 | if ( ! mConflictingEvent ) return; | 2749 | if ( ! mConflictingEvent ) return; |
2750 | if ( mConflictingEvent->doesFloat() ) { | 2750 | if ( mConflictingEvent->isHoliday() || mConflictingEvent->isBirthday() || mConflictingEvent->isAnniversary() ) { |
2751 | mConflictingEvent = 0; | 2751 | mConflictingEvent = 0; |
2752 | return; | 2752 | return; |
2753 | } | 2753 | } |
2754 | QPtrList<Event> testlist = mCalendar->events(); | 2754 | QPtrList<Event> testlist = mCalendar->events(); |
2755 | Event * test = testlist.first(); | 2755 | Event * test = testlist.first(); |
2756 | QDateTime conflict; | 2756 | QDateTime conflict; |
2757 | QDateTime retVal; | 2757 | QDateTime retVal; |
2758 | bool found = false; | 2758 | bool found = false; |
2759 | Event * cE = 0; | 2759 | Event * cE = 0; |
2760 | QDateTime current = QDateTime::currentDateTime(); | 2760 | QDateTime current = QDateTime::currentDateTime(); |
2761 | while ( test ) { | 2761 | while ( test ) { |
2762 | if ( !test->doesFloat() ) { | 2762 | if ( !test->doesFloat() ) { |
2763 | if ( mConflictingEvent->isOverlapping ( test, &retVal, ¤t ) ) { | 2763 | if ( mConflictingEvent->isOverlapping ( test, &retVal, ¤t ) ) { |
2764 | if ( ! found ) { | 2764 | if ( ! found ) { |
2765 | conflict = retVal; | 2765 | conflict = retVal; |
2766 | cE = test; | 2766 | cE = test; |
2767 | } else { | 2767 | } else { |
2768 | if ( retVal < conflict ) { | 2768 | if ( retVal < conflict ) { |
2769 | conflict = retVal; | 2769 | conflict = retVal; |
2770 | cE = test; | 2770 | cE = test; |
2771 | } | 2771 | } |
2772 | } | 2772 | } |
2773 | found = true; | 2773 | found = true; |
2774 | } | 2774 | } |
2775 | } | 2775 | } |
2776 | test = testlist.next(); | 2776 | test = testlist.next(); |
2777 | } | 2777 | } |
2778 | if ( found ) { | 2778 | if ( found ) { |
2779 | QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( mConflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; | 2779 | QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( mConflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; |
2780 | qApp->processEvents(); | 2780 | qApp->processEvents(); |
2781 | int km = KMessageBox::warningContinueCancel(this,mess, | 2781 | int km = KMessageBox::warningContinueCancel(this,mess, |
2782 | i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!")); | 2782 | i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!")); |
2783 | if ( km != KMessageBox::Continue ) | 2783 | if ( km != KMessageBox::Continue ) |
2784 | return; | 2784 | return; |
2785 | 2785 | ||
2786 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) | 2786 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) |
2787 | mViewManager->showDayView(); | 2787 | mViewManager->showDayView(); |
2788 | mNavigator->slotDaySelect( conflict.date() ); | 2788 | mNavigator->slotDaySelect( conflict.date() ); |
2789 | int hour = conflict.time().hour(); | 2789 | int hour = conflict.time().hour(); |
2790 | mViewManager->agendaView()->setStartHour( hour ); | 2790 | mViewManager->agendaView()->setStartHour( hour ); |
2791 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); | 2791 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); |
2792 | return; | ||
2793 | } | 2792 | } |
2794 | 2793 | mConflictingEvent = 0; | |
2795 | return; | 2794 | return; |
2796 | 2795 | ||
2797 | } | 2796 | } |
2798 | 2797 | ||
2799 | void CalendarView::updateTodoViews() | 2798 | void CalendarView::updateTodoViews() |
2800 | { | 2799 | { |
2801 | mTodoList->updateView(); | 2800 | mTodoList->updateView(); |
2802 | mViewManager->currentView()->updateView(); | 2801 | mViewManager->currentView()->updateView(); |
2803 | 2802 | ||
2804 | } | 2803 | } |
2805 | 2804 | ||
2806 | 2805 | ||
2807 | 2806 | ||
2808 | void CalendarView::clearAllViews() | 2807 | void CalendarView::clearAllViews() |
2809 | { | 2808 | { |
2810 | mTodoList->clearList(); | 2809 | mTodoList->clearList(); |
2811 | mViewManager->clearAllViews(); | 2810 | mViewManager->clearAllViews(); |
2812 | SearchDialog * sd = mDialogManager->getSearchDialog(); | 2811 | SearchDialog * sd = mDialogManager->getSearchDialog(); |
2813 | if ( sd ) { | 2812 | if ( sd ) { |
2814 | KOListView* kol = sd->listview(); | 2813 | KOListView* kol = sd->listview(); |
2815 | if ( kol ) | 2814 | if ( kol ) |
2816 | kol->clearList(); | 2815 | kol->clearList(); |
2817 | } | 2816 | } |
2818 | } | 2817 | } |