summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-08-17 22:49:32 (UTC)
committer zautrix <zautrix>2005-08-17 22:49:32 (UTC)
commita685e90ea183cba87e852d6f6272e54704034347 (patch) (unidiff)
treef773086786d564866c4d5b7ca08fb510ebf0eb0b /korganizer
parentede1d2a3a3d772cabc54ec117006ec6f445485cc (diff)
downloadkdepimpi-a685e90ea183cba87e852d6f6272e54704034347.zip
kdepimpi-a685e90ea183cba87e852d6f6272e54704034347.tar.gz
kdepimpi-a685e90ea183cba87e852d6f6272e54704034347.tar.bz2
oops
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 898da6c..e3b62de 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2937,193 +2937,193 @@ void CalendarView::goNext()
2937void CalendarView::goPrevious() 2937void CalendarView::goPrevious()
2938{ 2938{
2939 mNavigator->selectPrevious(); 2939 mNavigator->selectPrevious();
2940} 2940}
2941void CalendarView::goNextMonth() 2941void CalendarView::goNextMonth()
2942{ 2942{
2943 mNavigator->selectNextMonth(); 2943 mNavigator->selectNextMonth();
2944} 2944}
2945 2945
2946void CalendarView::goPreviousMonth() 2946void CalendarView::goPreviousMonth()
2947{ 2947{
2948 mNavigator->selectPreviousMonth(); 2948 mNavigator->selectPreviousMonth();
2949} 2949}
2950 2950
2951void CalendarView::updateConfig() 2951void CalendarView::updateConfig()
2952{ 2952{
2953 if ( KOPrefs::instance()->mUseAppColors ) 2953 if ( KOPrefs::instance()->mUseAppColors )
2954 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 2954 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
2955 emit configChanged(); 2955 emit configChanged();
2956 mTodoList->updateConfig(); 2956 mTodoList->updateConfig();
2957 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); 2957 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
2958 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2958 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2959 // To make the "fill window" configurations work 2959 // To make the "fill window" configurations work
2960 //mViewManager->raiseCurrentView(); 2960 //mViewManager->raiseCurrentView();
2961} 2961}
2962 2962
2963 2963
2964void CalendarView::eventChanged(Event *event) 2964void CalendarView::eventChanged(Event *event)
2965{ 2965{
2966 changeEventDisplay(event,KOGlobals::EVENTEDITED); 2966 changeEventDisplay(event,KOGlobals::EVENTEDITED);
2967 //updateUnmanagedViews(); 2967 //updateUnmanagedViews();
2968} 2968}
2969 2969
2970void CalendarView::eventAdded(Event *event) 2970void CalendarView::eventAdded(Event *event)
2971{ 2971{
2972 changeEventDisplay(event,KOGlobals::EVENTADDED); 2972 changeEventDisplay(event,KOGlobals::EVENTADDED);
2973} 2973}
2974 2974
2975void CalendarView::eventToBeDeleted(Event *) 2975void CalendarView::eventToBeDeleted(Event *)
2976{ 2976{
2977 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 2977 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
2978} 2978}
2979 2979
2980void CalendarView::eventDeleted() 2980void CalendarView::eventDeleted()
2981{ 2981{
2982 changeEventDisplay(0,KOGlobals::EVENTDELETED); 2982 changeEventDisplay(0,KOGlobals::EVENTDELETED);
2983} 2983}
2984void CalendarView::changeTodoDisplay(Todo *which, int action) 2984void CalendarView::changeTodoDisplay(Todo *which, int action)
2985{ 2985{
2986 changeIncidenceDisplay((Incidence *)which, action); 2986 changeIncidenceDisplay((Incidence *)which, action);
2987 mDateNavigator->updateView(); //LR 2987 mDateNavigator->updateView(); //LR
2988 //mDialogManager->updateSearchDialog(); 2988 //mDialogManager->updateSearchDialog();
2989 2989
2990 if (which) { 2990 if (which) {
2991 mViewManager->updateWNview(); 2991 mViewManager->updateWNview();
2992 //mTodoList->updateView(); 2992 //mTodoList->updateView();
2993 } 2993 }
2994 2994
2995} 2995}
2996 2996
2997void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2997void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2998{ 2998{
2999 updateUnmanagedViews(); 2999 updateUnmanagedViews();
3000 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 3000 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
3001 if ( action == KOGlobals::EVENTDELETED ) { //delete 3001 if ( action == KOGlobals::EVENTDELETED ) { //delete
3002 mCalendar->checkAlarmForIncidence( 0, true ); 3002 mCalendar->checkAlarmForIncidence( 0, true );
3003 if ( mEventViewerDialog ) 3003 if ( mEventViewerDialog )
3004 mEventViewerDialog->hide(); 3004 mEventViewerDialog->hide();
3005 } 3005 }
3006 else 3006 else
3007 mCalendar->checkAlarmForIncidence( which , false ); 3007 mCalendar->checkAlarmForIncidence( which , false );
3008} 3008}
3009 3009
3010// most of the changeEventDisplays() right now just call the view's 3010// most of the changeEventDisplays() right now just call the view's
3011// total update mode, but they SHOULD be recoded to be more refresh-efficient. 3011// total update mode, but they SHOULD be recoded to be more refresh-efficient.
3012void CalendarView::changeEventDisplay(Event *which, int action) 3012void CalendarView::changeEventDisplay(Event *which, int action)
3013{ 3013{
3014 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 3014 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
3015 changeIncidenceDisplay((Incidence *)which, action); 3015 changeIncidenceDisplay((Incidence *)which, action);
3016 static bool clearallviews = false; 3016 static bool clearallviews = false;
3017 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 3017 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
3018 if ( clearallviews ) { 3018 if ( clearallviews ) {
3019 clearAllViews(); 3019 clearAllViews();
3020 clearallviews = false; 3020 clearallviews = false;
3021 } 3021 }
3022 return; 3022 return;
3023 } 3023 }
3024 clearallviews = true; 3024 clearallviews = true;
3025 mDateNavigator->updateView(); 3025 mDateNavigator->updateView();
3026 //mDialogManager->updateSearchDialog(); 3026 //mDialogManager->updateSearchDialog();
3027 if (which) { 3027 if (which) {
3028 // If there is an event view visible update the display 3028 // If there is an event view visible update the display
3029 mViewManager->currentView()->changeEventDisplay(which,action); 3029 mViewManager->currentView()->changeEventDisplay(which,action);
3030 // TODO: check, if update needed 3030 // TODO: check, if update needed
3031 // if (which->getTodoStatus()) { 3031 // if (which->getTodoStatus()) {
3032 mTodoList->updateView(); 3032 mTodoList->updateView();
3033 if ( action != KOGlobals::EVENTDELETED ) { 3033 if ( action != KOGlobals::EVENTDELETED && KOPrefs::instance()->mDetectConflicts ) {
3034 mConflictingEvent = which ; 3034 mConflictingEvent = which ;
3035 int time = 1000; 3035 int time = 1000;
3036#ifdef DESKTOP_VERSION 3036#ifdef DESKTOP_VERSION
3037 time = 500; 3037 time = 500;
3038#endif 3038#endif
3039 bool checkC = false; 3039 bool checkC = false;
3040 if ( mConflictingEvent->doesFloat() ) { 3040 if ( mConflictingEvent->doesFloat() ) {
3041 checkC = KOPrefs::instance()->mCheckConflictsAllDayAllDay 3041 checkC = KOPrefs::instance()->mCheckConflictsAllDayAllDay
3042 || KOPrefs::instance()->mCheckConflictsAllDayNonAD; 3042 || KOPrefs::instance()->mCheckConflictsAllDayNonAD;
3043 } else { 3043 } else {
3044 checkC = KOPrefs::instance()->mCheckConflictsNonADAllDay 3044 checkC = KOPrefs::instance()->mCheckConflictsNonADAllDay
3045 || KOPrefs::instance()->mCheckConflictsNonADNonAD; 3045 || KOPrefs::instance()->mCheckConflictsNonADNonAD;
3046 } 3046 }
3047 if ( checkC ) 3047 if ( checkC )
3048 QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) ); 3048 QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) );
3049 } 3049 }
3050 // } 3050 // }
3051 } else { 3051 } else {
3052 mViewManager->currentView()->updateView(); 3052 mViewManager->currentView()->updateView();
3053 } 3053 }
3054} 3054}
3055void CalendarView::checkConflictForEvent() 3055void CalendarView::checkConflictForEvent()
3056{ 3056{
3057 3057
3058 if (!KOPrefs::instance()->mConfirm) 3058 if (!KOPrefs::instance()->mConfirm)
3059 return; 3059 return;
3060 if ( ! mConflictingEvent ) return; 3060 if ( ! mConflictingEvent ) return;
3061 Event * conflictingEvent = mConflictingEvent; 3061 Event * conflictingEvent = mConflictingEvent;
3062 mConflictingEvent = 0; 3062 mConflictingEvent = 0;
3063 QDateTime current = QDateTime::currentDateTime(); 3063 QDateTime current = QDateTime::currentDateTime();
3064 if ( ! conflictingEvent->matchTime( &current, 0 ) ) { 3064 if ( ! conflictingEvent->matchTime( &current, 0 ) ) {
3065 return; 3065 return;
3066 } 3066 }
3067 CalFilter *filterIN = 0; 3067 CalFilter *filterIN = 0;
3068 CalFilter *filterALL = 0; 3068 CalFilter *filterALL = 0;
3069 CalFilter *filter = mFilters.first(); 3069 CalFilter *filter = mFilters.first();
3070 while(filter) { 3070 while(filter) {
3071 if ( filter->name() == KOPrefs::instance()->mFilterConflictEditItem) 3071 if ( filter->name() == KOPrefs::instance()->mFilterConflictEditItem)
3072 filterIN = filter; 3072 filterIN = filter;
3073 if ( filter->name() == KOPrefs::instance()->mFilterConflictAllItem ) 3073 if ( filter->name() == KOPrefs::instance()->mFilterConflictAllItem )
3074 filterALL = filter; 3074 filterALL = filter;
3075 filter = mFilters.next(); 3075 filter = mFilters.next();
3076 } 3076 }
3077 if ( filterIN ) { 3077 if ( filterIN ) {
3078 if ( !filterIN->filterCalendarItem( conflictingEvent ) ) { 3078 if ( !filterIN->filterCalendarItem( conflictingEvent ) ) {
3079 return; 3079 return;
3080 } 3080 }
3081 } 3081 }
3082 QPtrList<Event> testlist = mCalendar->events(); 3082 QPtrList<Event> testlist = mCalendar->events();
3083 Event * test = testlist.first(); 3083 Event * test = testlist.first();
3084 QDateTime conflict; 3084 QDateTime conflict;
3085 QDateTime retVal; 3085 QDateTime retVal;
3086 bool found = false; 3086 bool found = false;
3087 Event * cE = 0; 3087 Event * cE = 0;
3088 bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay; 3088 bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay;
3089 bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD; 3089 bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD;
3090 if ( !conflictingEvent->doesFloat() ) { 3090 if ( !conflictingEvent->doesFloat() ) {
3091 chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay; 3091 chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay;
3092 chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD; 3092 chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD;
3093 } 3093 }
3094 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); 3094 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") );
3095 while ( test ) { 3095 while ( test ) {
3096 qApp->processEvents(); 3096 qApp->processEvents();
3097 bool skip = ( test->doesFloat() && !chAD ) || ( !test->doesFloat() && !chNad ); 3097 bool skip = ( test->doesFloat() && !chAD ) || ( !test->doesFloat() && !chNad );
3098 if ( !skip ) { 3098 if ( !skip ) {
3099 if ( filterALL ) { 3099 if ( filterALL ) {
3100 if ( !filterALL->filterCalendarItem( test ) ) { 3100 if ( !filterALL->filterCalendarItem( test ) ) {
3101 skip = true; 3101 skip = true;
3102 } 3102 }
3103 } 3103 }
3104 if ( !skip ) { 3104 if ( !skip ) {
3105 if ( found ) 3105 if ( found )
3106 skip = !test->matchTime( &current, &conflict ); 3106 skip = !test->matchTime( &current, &conflict );
3107 else 3107 else
3108 skip = !test->matchTime( &current, 0 ); 3108 skip = !test->matchTime( &current, 0 );
3109 if ( !skip ) { 3109 if ( !skip ) {
3110 if ( conflictingEvent->isOverlapping ( test, &retVal, &current ) ) { 3110 if ( conflictingEvent->isOverlapping ( test, &retVal, &current ) ) {
3111 if ( ! found ) { 3111 if ( ! found ) {
3112 conflict = retVal; 3112 conflict = retVal;
3113 cE = test; 3113 cE = test;
3114 } else { 3114 } else {
3115 if ( retVal < conflict ) { 3115 if ( retVal < conflict ) {
3116 conflict = retVal; 3116 conflict = retVal;
3117 cE = test; 3117 cE = test;
3118 } 3118 }
3119 } 3119 }
3120 found = true; 3120 found = true;
3121 } 3121 }
3122 } 3122 }
3123 } 3123 }
3124 } 3124 }
3125 test = testlist.next(); 3125 test = testlist.next();
3126 } 3126 }
3127 topLevelWidget()->setCaption( i18n("KO/Pi") ); 3127 topLevelWidget()->setCaption( i18n("KO/Pi") );
3128 if ( found ) { 3128 if ( found ) {
3129 QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( conflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; 3129 QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( conflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ;