summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-07-30 16:36:00 (UTC)
committer zautrix <zautrix>2005-07-30 16:36:00 (UTC)
commitbd2ab556e1a5066524d797856e6a13358155e24b (patch) (unidiff)
tree334d20a72ff2912d1a49d04671aa73bb424ca539
parent6a32c95e5f0a36cd9a681a3f3302bec6e83acce5 (diff)
downloadkdepimpi-bd2ab556e1a5066524d797856e6a13358155e24b.zip
kdepimpi-bd2ab556e1a5066524d797856e6a13358155e24b.tar.gz
kdepimpi-bd2ab556e1a5066524d797856e6a13358155e24b.tar.bz2
bugfix
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
@@ -3333,129 +3333,129 @@ void CalendarView::beamIncidence()
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();