summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (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 28649d9..a1b1d71 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -3205,385 +3205,385 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
3205#ifndef DESKTOP_VERSION 3205#ifndef DESKTOP_VERSION
3206void CalendarView::beamDone( Ir *ir ) 3206void CalendarView::beamDone( Ir *ir )
3207{ 3207{
3208 delete ir; 3208 delete ir;
3209 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); 3209 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
3210 topLevelWidget()->raise(); 3210 topLevelWidget()->raise();
3211} 3211}
3212#else 3212#else
3213void CalendarView::beamDone( Ir *){;} 3213void CalendarView::beamDone( Ir *){;}
3214#endif 3214#endif
3215void CalendarView::moveIncidence(Incidence * inc ) 3215void CalendarView::moveIncidence(Incidence * inc )
3216{ 3216{
3217 if ( !inc ) return; 3217 if ( !inc ) return;
3218 showDatePickerPopup(); 3218 showDatePickerPopup();
3219 mDatePickerMode = 2; 3219 mDatePickerMode = 2;
3220 mMoveIncidence = inc ; 3220 mMoveIncidence = inc ;
3221 QDate da; 3221 QDate da;
3222 if ( mMoveIncidence->typeID() == todoID ) { 3222 if ( mMoveIncidence->typeID() == todoID ) {
3223 Todo * to = (Todo *) mMoveIncidence; 3223 Todo * to = (Todo *) mMoveIncidence;
3224 if ( to->hasDueDate() ) 3224 if ( to->hasDueDate() )
3225 da = to->dtDue().date(); 3225 da = to->dtDue().date();
3226 else 3226 else
3227 da = QDate::currentDate(); 3227 da = QDate::currentDate();
3228 } else { 3228 } else {
3229 da = mMoveIncidence->dtStart().date(); 3229 da = mMoveIncidence->dtStart().date();
3230 } 3230 }
3231 //PENDING set date for recurring incidence to date of recurrence 3231 //PENDING set date for recurring incidence to date of recurrence
3232 //mMoveIncidenceOldDate; 3232 //mMoveIncidenceOldDate;
3233 mDatePicker->setDate( da ); 3233 mDatePicker->setDate( da );
3234} 3234}
3235void CalendarView::showDatePickerPopup() 3235void CalendarView::showDatePickerPopup()
3236{ 3236{
3237 if ( mDateFrame->isVisible() ) 3237 if ( mDateFrame->isVisible() )
3238 mDateFrame->hide(); 3238 mDateFrame->hide();
3239 else { 3239 else {
3240 int offX = 0, offY = 0; 3240 int offX = 0, offY = 0;
3241#ifdef DESKTOP_VERSION 3241#ifdef DESKTOP_VERSION
3242 int w =mDatePicker->sizeHint().width() ; 3242 int w =mDatePicker->sizeHint().width() ;
3243 int h = mDatePicker->sizeHint().height() ; 3243 int h = mDatePicker->sizeHint().height() ;
3244 int dw = topLevelWidget()->width(); 3244 int dw = topLevelWidget()->width();
3245 int dh = topLevelWidget()->height(); 3245 int dh = topLevelWidget()->height();
3246 offX = topLevelWidget()->x(); 3246 offX = topLevelWidget()->x();
3247 offY = topLevelWidget()->y(); 3247 offY = topLevelWidget()->y();
3248#else 3248#else
3249 int w =mDatePicker->sizeHint().width() ; 3249 int w =mDatePicker->sizeHint().width() ;
3250 int h = mDatePicker->sizeHint().height() ; 3250 int h = mDatePicker->sizeHint().height() ;
3251 int dw = QApplication::desktop()->width(); 3251 int dw = QApplication::desktop()->width();
3252 int dh = QApplication::desktop()->height(); 3252 int dh = QApplication::desktop()->height();
3253#endif 3253#endif
3254 mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h ); 3254 mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h );
3255 mDateFrame->show(); 3255 mDateFrame->show();
3256 } 3256 }
3257} 3257}
3258void CalendarView::showDatePicker( ) 3258void CalendarView::showDatePicker( )
3259{ 3259{
3260 showDatePickerPopup(); 3260 showDatePickerPopup();
3261 mDatePickerMode = 1; 3261 mDatePickerMode = 1;
3262 mDatePicker->setDate( mNavigator->selectedDates().first() ); 3262 mDatePicker->setDate( mNavigator->selectedDates().first() );
3263} 3263}
3264 3264
3265void CalendarView::showEventEditor() 3265void CalendarView::showEventEditor()
3266{ 3266{
3267#ifdef DESKTOP_VERSION 3267#ifdef DESKTOP_VERSION
3268 int x,y,w,h; 3268 int x,y,w,h;
3269 x = mEventEditor->geometry().x(); 3269 x = mEventEditor->geometry().x();
3270 y = mEventEditor->geometry().y(); 3270 y = mEventEditor->geometry().y();
3271 w = mEventEditor->width(); 3271 w = mEventEditor->width();
3272 h = mEventEditor->height(); 3272 h = mEventEditor->height();
3273 mEventEditor->show(); 3273 mEventEditor->show();
3274 mEventEditor->setGeometry(x,y,w,h); 3274 mEventEditor->setGeometry(x,y,w,h);
3275#else 3275#else
3276 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { 3276 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) {
3277 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 3277 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
3278 qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); 3278 qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() );
3279 qApp->processEvents(); 3279 qApp->processEvents();
3280 delete mEventEditor; 3280 delete mEventEditor;
3281 mEventEditor = mDialogManager->getEventEditor(); 3281 mEventEditor = mDialogManager->getEventEditor();
3282 topLevelWidget()->setCaption( i18n("") ); 3282 topLevelWidget()->setCaption( i18n("") );
3283 } 3283 }
3284 mEventEditor->showMaximized(); 3284 mEventEditor->showMaximized();
3285#endif 3285#endif
3286} 3286}
3287void CalendarView::showTodoEditor() 3287void CalendarView::showTodoEditor()
3288{ 3288{
3289#ifdef DESKTOP_VERSION 3289#ifdef DESKTOP_VERSION
3290 int x,y,w,h; 3290 int x,y,w,h;
3291 x = mTodoEditor->geometry().x(); 3291 x = mTodoEditor->geometry().x();
3292 y = mTodoEditor->geometry().y(); 3292 y = mTodoEditor->geometry().y();
3293 w = mTodoEditor->width(); 3293 w = mTodoEditor->width();
3294 h = mTodoEditor->height(); 3294 h = mTodoEditor->height();
3295 mTodoEditor->show(); 3295 mTodoEditor->show();
3296 mTodoEditor->setGeometry(x,y,w,h); 3296 mTodoEditor->setGeometry(x,y,w,h);
3297#else 3297#else
3298 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { 3298 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) {
3299 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 3299 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
3300 qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); 3300 qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() );
3301 qApp->processEvents(); 3301 qApp->processEvents();
3302 delete mTodoEditor; 3302 delete mTodoEditor;
3303 mTodoEditor = mDialogManager->getTodoEditor(); 3303 mTodoEditor = mDialogManager->getTodoEditor();
3304 topLevelWidget()->setCaption( i18n("") ); 3304 topLevelWidget()->setCaption( i18n("") );
3305 } 3305 }
3306 mTodoEditor->showMaximized(); 3306 mTodoEditor->showMaximized();
3307#endif 3307#endif
3308} 3308}
3309 3309
3310void CalendarView::cloneIncidence() 3310void CalendarView::cloneIncidence()
3311{ 3311{
3312 Incidence *incidence = currentSelection(); 3312 Incidence *incidence = currentSelection();
3313 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3313 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3314 if ( incidence ) { 3314 if ( incidence ) {
3315 cloneIncidence(incidence); 3315 cloneIncidence(incidence);
3316 } 3316 }
3317} 3317}
3318void CalendarView::moveIncidence() 3318void CalendarView::moveIncidence()
3319{ 3319{
3320 Incidence *incidence = currentSelection(); 3320 Incidence *incidence = currentSelection();
3321 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3321 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3322 if ( incidence ) { 3322 if ( incidence ) {
3323 moveIncidence(incidence); 3323 moveIncidence(incidence);
3324 } 3324 }
3325} 3325}
3326void CalendarView::beamIncidence() 3326void CalendarView::beamIncidence()
3327{ 3327{
3328 Incidence *incidence = currentSelection(); 3328 Incidence *incidence = currentSelection();
3329 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3329 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3330 if ( incidence ) { 3330 if ( incidence ) {
3331 beamIncidence(incidence); 3331 beamIncidence(incidence);
3332 } 3332 }
3333} 3333}
3334void CalendarView::toggleCancelIncidence() 3334void CalendarView::toggleCancelIncidence()
3335{ 3335{
3336 Incidence *incidence = currentSelection(); 3336 Incidence *incidence = currentSelection();
3337 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3337 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3338 if ( incidence ) { 3338 if ( incidence ) {
3339 cancelIncidence(incidence); 3339 cancelIncidence(incidence);
3340 } 3340 }
3341} 3341}
3342 3342
3343 3343
3344void CalendarView::cancelIncidence(Incidence * inc ) 3344void CalendarView::cancelIncidence(Incidence * inc )
3345{ 3345{
3346 inc->setCancelled( ! inc->cancelled() ); 3346 inc->setCancelled( ! inc->cancelled() );
3347 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); 3347 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED );
3348 updateView(); 3348 updateView();
3349} 3349}
3350void CalendarView::cloneIncidence(Incidence * orgInc ) 3350void CalendarView::cloneIncidence(Incidence * orgInc )
3351{ 3351{
3352 Incidence * newInc = orgInc->clone(); 3352 Incidence * newInc = orgInc->clone();
3353 newInc->recreate(); 3353 newInc->recreate();
3354 3354
3355 if ( newInc->typeID() == todoID ) { 3355 if ( newInc->typeID() == todoID ) {
3356 Todo* t = (Todo*) newInc; 3356 Todo* t = (Todo*) newInc;
3357 bool cloneSub = false; 3357 bool cloneSub = false;
3358 if ( orgInc->relations().count() ) { 3358 if ( orgInc->relations().count() ) {
3359 int result = KMessageBox::warningYesNoCancel(this, 3359 int result = KMessageBox::warningYesNoCancel(this,
3360 i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( KGlobal::formatMessage ( newInc->summary(),0 ) ), 3360 i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( KGlobal::formatMessage ( newInc->summary(),0 ) ),
3361 i18n("Todo has subtodos"), 3361 i18n("Todo has subtodos"),
3362 i18n("Yes"), 3362 i18n("Yes"),
3363 i18n("No")); 3363 i18n("No"));
3364 3364
3365 if ( result == KMessageBox::Cancel ) { 3365 if ( result == KMessageBox::Cancel ) {
3366 delete t; 3366 delete t;
3367 return; 3367 return;
3368 } 3368 }
3369 if (result == KMessageBox::Yes) cloneSub = true; 3369 if (result == KMessageBox::Yes) cloneSub = true;
3370 } 3370 }
3371 showTodoEditor(); 3371 showTodoEditor();
3372 mTodoEditor->editTodo( t ); 3372 mTodoEditor->editTodo( t );
3373 if ( mTodoEditor->exec() ) { 3373 if ( mTodoEditor->exec() ) {
3374 if ( cloneSub ) { 3374 if ( cloneSub ) {
3375 orgInc->cloneRelations( t ); 3375 orgInc->cloneRelations( t );
3376 mCalendar->addIncidenceBranch( t ); 3376 mCalendar->addIncidenceBranch( t );
3377 updateView(); 3377 updateView();
3378 3378
3379 } else { 3379 } else {
3380 mCalendar->addTodo( t ); 3380 mCalendar->addTodo( t );
3381 updateView(); 3381 updateView();
3382 } 3382 }
3383 } else { 3383 } else {
3384 delete t; 3384 delete t;
3385 } 3385 }
3386 } 3386 }
3387 else if ( newInc->typeID() == eventID ) { 3387 else if ( newInc->typeID() == eventID ) {
3388 Event* e = (Event*) newInc; 3388 Event* e = (Event*) newInc;
3389 showEventEditor(); 3389 showEventEditor();
3390 mEventEditor->editEvent( e ); 3390 mEventEditor->editEvent( e );
3391 if ( mEventEditor->exec() ) { 3391 if ( mEventEditor->exec() ) {
3392 mCalendar->addEvent( e ); 3392 mCalendar->addEvent( e );
3393 updateView(); 3393 updateView();
3394 } else { 3394 } else {
3395 delete e; 3395 delete e;
3396 } 3396 }
3397 } if ( newInc->typeID() == journalID ) { 3397 } else if ( newInc->typeID() == journalID ) {
3398 mCalendar->addJournal( (Journal*) newInc ); 3398 mCalendar->addJournal( (Journal*) newInc );
3399 editJournal( (Journal*) newInc ); 3399 editJournal( (Journal*) newInc );
3400 } 3400 }
3401 setActiveWindow(); 3401 setActiveWindow();
3402} 3402}
3403 3403
3404void CalendarView::newEvent() 3404void CalendarView::newEvent()
3405{ 3405{
3406 // TODO: Replace this code by a common eventDurationHint of KOBaseView. 3406 // TODO: Replace this code by a common eventDurationHint of KOBaseView.
3407 KOAgendaView *aView = mViewManager->agendaView(); 3407 KOAgendaView *aView = mViewManager->agendaView();
3408 if (aView) { 3408 if (aView) {
3409 if (aView->selectionStart().isValid()) { 3409 if (aView->selectionStart().isValid()) {
3410 if (aView->selectedIsAllDay()) { 3410 if (aView->selectedIsAllDay()) {
3411 newEvent(aView->selectionStart(),aView->selectionEnd(),true); 3411 newEvent(aView->selectionStart(),aView->selectionEnd(),true);
3412 } else { 3412 } else {
3413 newEvent(aView->selectionStart(),aView->selectionEnd()); 3413 newEvent(aView->selectionStart(),aView->selectionEnd());
3414 } 3414 }
3415 return; 3415 return;
3416 } 3416 }
3417 } 3417 }
3418 3418
3419 QDate date = mNavigator->selectedDates().first(); 3419 QDate date = mNavigator->selectedDates().first();
3420#if 0 3420#if 0
3421 QDateTime current = QDateTime::currentDateTime(); 3421 QDateTime current = QDateTime::currentDateTime();
3422 if ( date <= current.date() ) { 3422 if ( date <= current.date() ) {
3423 int hour = current.time().hour() +1; 3423 int hour = current.time().hour() +1;
3424 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), 3424 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ),
3425 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 3425 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
3426 } else 3426 } else
3427#endif 3427#endif
3428 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), 3428 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ),
3429 QDateTime( date, QTime( KOPrefs::instance()->mStartTime + 3429 QDateTime( date, QTime( KOPrefs::instance()->mStartTime +
3430 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 3430 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
3431} 3431}
3432 3432
3433void CalendarView::newEvent(QDateTime fh) 3433void CalendarView::newEvent(QDateTime fh)
3434{ 3434{
3435 newEvent(fh, 3435 newEvent(fh,
3436 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); 3436 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration)));
3437} 3437}
3438 3438
3439void CalendarView::newEvent(QDate dt) 3439void CalendarView::newEvent(QDate dt)
3440{ 3440{
3441 newEvent(QDateTime(dt, QTime(0,0,0)), 3441 newEvent(QDateTime(dt, QTime(0,0,0)),
3442 QDateTime(dt, QTime(0,0,0)), true); 3442 QDateTime(dt, QTime(0,0,0)), true);
3443} 3443}
3444void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) 3444void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint)
3445{ 3445{
3446 newEvent(fromHint, toHint, false); 3446 newEvent(fromHint, toHint, false);
3447} 3447}
3448void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) 3448void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay)
3449{ 3449{
3450 3450
3451 showEventEditor(); 3451 showEventEditor();
3452 mEventEditor->newEvent(fromHint,toHint,allDay); 3452 mEventEditor->newEvent(fromHint,toHint,allDay);
3453 if ( mFilterView->filtersEnabled() ) { 3453 if ( mFilterView->filtersEnabled() ) {
3454 CalFilter *filter = mFilterView->selectedFilter(); 3454 CalFilter *filter = mFilterView->selectedFilter();
3455 if (filter && filter->showCategories()) { 3455 if (filter && filter->showCategories()) {
3456 mEventEditor->setCategories(filter->categoryList().join(",") ); 3456 mEventEditor->setCategories(filter->categoryList().join(",") );
3457 } 3457 }
3458 if ( filter ) 3458 if ( filter )
3459 mEventEditor->setSecrecy( filter->getSecrecy() ); 3459 mEventEditor->setSecrecy( filter->getSecrecy() );
3460 } 3460 }
3461 mEventEditor->exec(); 3461 mEventEditor->exec();
3462 setActiveWindow(); 3462 setActiveWindow();
3463} 3463}
3464void CalendarView::todoAdded(Todo * t) 3464void CalendarView::todoAdded(Todo * t)
3465{ 3465{
3466 3466
3467 changeTodoDisplay ( t ,KOGlobals::EVENTADDED); 3467 changeTodoDisplay ( t ,KOGlobals::EVENTADDED);
3468 updateTodoViews(); 3468 updateTodoViews();
3469} 3469}
3470void CalendarView::todoChanged(Todo * t) 3470void CalendarView::todoChanged(Todo * t)
3471{ 3471{
3472 emit todoModified( t, 4 ); 3472 emit todoModified( t, 4 );
3473 // updateTodoViews(); 3473 // updateTodoViews();
3474} 3474}
3475void CalendarView::todoToBeDeleted(Todo *) 3475void CalendarView::todoToBeDeleted(Todo *)
3476{ 3476{
3477 //qDebug("todoToBeDeleted(Todo *) "); 3477 //qDebug("todoToBeDeleted(Todo *) ");
3478 updateTodoViews(); 3478 updateTodoViews();
3479} 3479}
3480void CalendarView::todoDeleted() 3480void CalendarView::todoDeleted()
3481{ 3481{
3482 //qDebug(" todoDeleted()"); 3482 //qDebug(" todoDeleted()");
3483 updateTodoViews(); 3483 updateTodoViews();
3484} 3484}
3485 3485
3486 3486
3487void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) 3487void CalendarView::newTodoDateTime( QDateTime dt, bool allday )
3488{ 3488{
3489 showTodoEditor(); 3489 showTodoEditor();
3490 mTodoEditor->newTodo(dt,0,allday); 3490 mTodoEditor->newTodo(dt,0,allday);
3491 if ( mFilterView->filtersEnabled() ) { 3491 if ( mFilterView->filtersEnabled() ) {
3492 CalFilter *filter = mFilterView->selectedFilter(); 3492 CalFilter *filter = mFilterView->selectedFilter();
3493 if (filter && filter->showCategories()) { 3493 if (filter && filter->showCategories()) {
3494 mTodoEditor->setCategories(filter->categoryList().join(",") ); 3494 mTodoEditor->setCategories(filter->categoryList().join(",") );
3495 } 3495 }
3496 if ( filter ) 3496 if ( filter )
3497 mTodoEditor->setSecrecy( filter->getSecrecy() ); 3497 mTodoEditor->setSecrecy( filter->getSecrecy() );
3498 } 3498 }
3499 mTodoEditor->exec(); 3499 mTodoEditor->exec();
3500 setActiveWindow(); 3500 setActiveWindow();
3501} 3501}
3502 3502
3503void CalendarView::newTodo() 3503void CalendarView::newTodo()
3504{ 3504{
3505 newTodoDateTime( QDateTime(),true ); 3505 newTodoDateTime( QDateTime(),true );
3506} 3506}
3507 3507
3508void CalendarView::newSubTodo() 3508void CalendarView::newSubTodo()
3509{ 3509{
3510 Todo *todo = selectedTodo(); 3510 Todo *todo = selectedTodo();
3511 if ( todo ) newSubTodo( todo ); 3511 if ( todo ) newSubTodo( todo );
3512} 3512}
3513 3513
3514void CalendarView::newSubTodo(Todo *parentEvent) 3514void CalendarView::newSubTodo(Todo *parentEvent)
3515{ 3515{
3516 3516
3517 showTodoEditor(); 3517 showTodoEditor();
3518 mTodoEditor->newTodo(QDateTime(),parentEvent,true); 3518 mTodoEditor->newTodo(QDateTime(),parentEvent,true);
3519 mTodoEditor->exec(); 3519 mTodoEditor->exec();
3520 setActiveWindow(); 3520 setActiveWindow();
3521} 3521}
3522 3522
3523void CalendarView::newFloatingEvent() 3523void CalendarView::newFloatingEvent()
3524{ 3524{
3525 DateList tmpList = mNavigator->selectedDates(); 3525 DateList tmpList = mNavigator->selectedDates();
3526 QDate date = tmpList.first(); 3526 QDate date = tmpList.first();
3527 3527
3528 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), 3528 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ),
3529 QDateTime( date, QTime( 12, 0, 0 ) ), true ); 3529 QDateTime( date, QTime( 12, 0, 0 ) ), true );
3530} 3530}
3531 3531
3532 3532
3533void CalendarView::editEvent( Event *event ) 3533void CalendarView::editEvent( Event *event )
3534{ 3534{
3535 3535
3536 if ( !event ) return; 3536 if ( !event ) return;
3537 if ( event->isReadOnly() ) { 3537 if ( event->isReadOnly() ) {
3538 showEvent( event ); 3538 showEvent( event );
3539 return; 3539 return;
3540 } 3540 }
3541 showEventEditor(); 3541 showEventEditor();
3542 mEventEditor->editEvent( event , mFlagEditDescription); 3542 mEventEditor->editEvent( event , mFlagEditDescription);
3543 mEventEditor->exec(); 3543 mEventEditor->exec();
3544 setActiveWindow(); 3544 setActiveWindow();
3545 3545
3546} 3546}
3547void CalendarView::editJournal( Journal *jour ) 3547void CalendarView::editJournal( Journal *jour )
3548{ 3548{
3549 if ( !jour ) return; 3549 if ( !jour ) return;
3550 mDialogManager->hideSearchDialog(); 3550 mDialogManager->hideSearchDialog();
3551 mViewManager->showJournalView(); 3551 mViewManager->showJournalView();
3552 mNavigator->slotDaySelect( jour->dtStart().date() ); 3552 mNavigator->slotDaySelect( jour->dtStart().date() );
3553} 3553}
3554void CalendarView::editTodo( Todo *todo ) 3554void CalendarView::editTodo( Todo *todo )
3555{ 3555{
3556 if ( !todo ) return; 3556 if ( !todo ) return;
3557 3557
3558 if ( todo->isReadOnly() ) { 3558 if ( todo->isReadOnly() ) {
3559 showTodo( todo ); 3559 showTodo( todo );
3560 return; 3560 return;
3561 } 3561 }
3562 showTodoEditor(); 3562 showTodoEditor();
3563 mTodoEditor->editTodo( todo ,mFlagEditDescription); 3563 mTodoEditor->editTodo( todo ,mFlagEditDescription);
3564 mTodoEditor->exec(); 3564 mTodoEditor->exec();
3565 setActiveWindow(); 3565 setActiveWindow();
3566 3566
3567} 3567}
3568 3568
3569KOEventViewerDialog* CalendarView::getEventViewerDialog() 3569KOEventViewerDialog* CalendarView::getEventViewerDialog()
3570{ 3570{
3571 if ( !mEventViewerDialog ) { 3571 if ( !mEventViewerDialog ) {
3572 mEventViewerDialog = new KOEventViewerDialog(0); 3572 mEventViewerDialog = new KOEventViewerDialog(0);
3573 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); 3573 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) );
3574 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); 3574 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig()));
3575 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), 3575 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)),
3576 dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 3576 dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
3577 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), 3577 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ),
3578 viewManager(), SLOT( showAgendaView( bool ) ) ); 3578 viewManager(), SLOT( showAgendaView( bool ) ) );
3579 connect( mEventViewerDialog, SIGNAL(signalViewerClosed()), 3579 connect( mEventViewerDialog, SIGNAL(signalViewerClosed()),
3580 this, SLOT( slotViewerClosed() ) ); 3580 this, SLOT( slotViewerClosed() ) );
3581 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), 3581 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ),
3582 this, SLOT( todoChanged(Todo *) ) ); 3582 this, SLOT( todoChanged(Todo *) ) );
3583 connect( mEventViewerDialog, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); 3583 connect( mEventViewerDialog, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
3584 mEventViewerDialog->resize( 640, 480 ); 3584 mEventViewerDialog->resize( 640, 480 );
3585 3585
3586 } 3586 }
3587 return mEventViewerDialog; 3587 return mEventViewerDialog;
3588} 3588}
3589void CalendarView::showEvent(Event *event) 3589void CalendarView::showEvent(Event *event)