-rw-r--r-- | korganizer/calendarview.cpp | 2 |
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 | |||
@@ -3349,97 +3349,97 @@ void CalendarView::cancelIncidence(Incidence * inc ) | |||
3349 | } | 3349 | } |
3350 | void CalendarView::cloneIncidence(Incidence * orgInc ) | 3350 | void 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 | ||
3404 | void CalendarView::newEvent() | 3404 | void 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 | ||
3433 | void CalendarView::newEvent(QDateTime fh) | 3433 | void 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 | ||
3439 | void CalendarView::newEvent(QDate dt) | 3439 | void 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 | } |
3444 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) | 3444 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) |
3445 | { | 3445 | { |