summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index f179c58..13cf69b 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2612,136 +2612,136 @@ int CalendarView::msgItemDelete(const QString name)
2612 return KMessageBox::warningContinueCancel(this,name +"\n\n"+ 2612 return KMessageBox::warningContinueCancel(this,name +"\n\n"+
2613 i18n("This item will be\npermanently deleted."), 2613 i18n("This item will be\npermanently deleted."),
2614 i18n("KO/Pi Confirmation"),i18n("Delete")); 2614 i18n("KO/Pi Confirmation"),i18n("Delete"));
2615} 2615}
2616 2616
2617 2617
2618void CalendarView::edit_cut() 2618void CalendarView::edit_cut()
2619{ 2619{
2620 Event *anEvent=0; 2620 Event *anEvent=0;
2621 2621
2622 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2622 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2623 2623
2624 if (mViewManager->currentView()->isEventView()) { 2624 if (mViewManager->currentView()->isEventView()) {
2625 if ( incidence && incidence->typeID() == eventID ) { 2625 if ( incidence && incidence->typeID() == eventID ) {
2626 anEvent = static_cast<Event *>(incidence); 2626 anEvent = static_cast<Event *>(incidence);
2627 } 2627 }
2628 } 2628 }
2629 2629
2630 if (!anEvent) { 2630 if (!anEvent) {
2631 KNotifyClient::beep(); 2631 KNotifyClient::beep();
2632 return; 2632 return;
2633 } 2633 }
2634 DndFactory factory( mCalendar ); 2634 DndFactory factory( mCalendar );
2635 factory.cutIncidence(anEvent); 2635 factory.cutIncidence(anEvent);
2636 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2636 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2637} 2637}
2638 2638
2639void CalendarView::edit_copy() 2639void CalendarView::edit_copy()
2640{ 2640{
2641 Event *anEvent=0; 2641 Event *anEvent=0;
2642 2642
2643 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2643 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2644 2644
2645 if (mViewManager->currentView()->isEventView()) { 2645 if (mViewManager->currentView()->isEventView()) {
2646 if ( incidence && incidence->typeID() == eventID ) { 2646 if ( incidence && incidence->typeID() == eventID ) {
2647 anEvent = static_cast<Event *>(incidence); 2647 anEvent = static_cast<Event *>(incidence);
2648 } 2648 }
2649 } 2649 }
2650 2650
2651 if (!anEvent) { 2651 if (!anEvent) {
2652 KNotifyClient::beep(); 2652 KNotifyClient::beep();
2653 return; 2653 return;
2654 } 2654 }
2655 DndFactory factory( mCalendar ); 2655 DndFactory factory( mCalendar );
2656 factory.copyIncidence(anEvent); 2656 factory.copyIncidence(anEvent);
2657} 2657}
2658 2658
2659void CalendarView::edit_paste() 2659void CalendarView::edit_paste()
2660{ 2660{
2661 QDate date = mNavigator->selectedDates().first(); 2661 QDate date = mNavigator->selectedDates().first();
2662 2662
2663 DndFactory factory( mCalendar ); 2663 DndFactory factory( mCalendar );
2664 Event *pastedEvent = (Event *)factory.pasteIncidence( date ); 2664 Event *pastedEvent = (Event *)factory.pasteIncidence( date );
2665 2665
2666 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2666 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2667} 2667}
2668void CalendarView::edit_global_options() 2668void CalendarView::edit_global_options()
2669{ 2669{
2670 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; 2670 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId;
2671 emit save(); 2671 emit save();
2672 emit saveStopTimer(); 2672 emit saveStopTimer();
2673 mDialogManager->showGlobalOptionsDialog(); 2673 mDialogManager->showGlobalOptionsDialog();
2674 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { 2674 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) {
2675 emit saveStopTimer(); 2675 emit saveStopTimer();
2676 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto apply timezone changes?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), 2676 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"),
2677 i18n("Timezone settings"),i18n("Reload"))) { 2677 i18n("Timezone settings"),i18n("Reload"))) {
2678 qDebug("KO: TZ reload cancelled "); 2678 qDebug("KO: TZ reload cancelled ");
2679 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2679 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2680 return; 2680 return;
2681 } 2681 }
2682 qDebug("KO: Timezone change "); 2682 qDebug("KO: Timezone change ");
2683 openCalendar( MainWindow::defaultFileName() ); 2683 loadCalendars();
2684 setModified(true); 2684 setModified(true);
2685 } 2685 }
2686 else 2686 else
2687 qDebug("KO: No tz change "); 2687 qDebug("KO: No tz change ");
2688} 2688}
2689void CalendarView::edit_options() 2689void CalendarView::edit_options()
2690{ 2690{
2691 mDialogManager->showOptionsDialog(); 2691 mDialogManager->showOptionsDialog();
2692} 2692}
2693 2693
2694 2694
2695void CalendarView::slotSelectPickerDate( QDate d) 2695void CalendarView::slotSelectPickerDate( QDate d)
2696{ 2696{
2697 mDateFrame->hide(); 2697 mDateFrame->hide();
2698 if ( mDatePickerMode == 1 ) { 2698 if ( mDatePickerMode == 1 ) {
2699 mNavigator->slotDaySelect( d ); 2699 mNavigator->slotDaySelect( d );
2700 } else if ( mDatePickerMode == 2 ) { 2700 } else if ( mDatePickerMode == 2 ) {
2701 if ( mMoveIncidence->typeID() == todoID ) { 2701 if ( mMoveIncidence->typeID() == todoID ) {
2702 Todo * to = (Todo *) mMoveIncidence; 2702 Todo * to = (Todo *) mMoveIncidence;
2703 QTime tim; 2703 QTime tim;
2704 int len = 0; 2704 int len = 0;
2705 if ( to->hasStartDate() && to->hasDueDate() ) 2705 if ( to->hasStartDate() && to->hasDueDate() )
2706 len = to->dtStart().secsTo( to->dtDue()); 2706 len = to->dtStart().secsTo( to->dtDue());
2707 if ( to->hasDueDate() ) 2707 if ( to->hasDueDate() )
2708 tim = to->dtDue().time(); 2708 tim = to->dtDue().time();
2709 else { 2709 else {
2710 tim = QTime ( 0,0,0 ); 2710 tim = QTime ( 0,0,0 );
2711 to->setFloats( true ); 2711 to->setFloats( true );
2712 to->setHasDueDate( true ); 2712 to->setHasDueDate( true );
2713 } 2713 }
2714 QDateTime dt ( d,tim ); 2714 QDateTime dt ( d,tim );
2715 to->setDtDue( dt ); 2715 to->setDtDue( dt );
2716 2716
2717 if ( to->hasStartDate() ) { 2717 if ( to->hasStartDate() ) {
2718 if ( len>0 ) 2718 if ( len>0 )
2719 to->setDtStart(to->dtDue().addSecs( -len )); 2719 to->setDtStart(to->dtDue().addSecs( -len ));
2720 else 2720 else
2721 if (to->dtStart() > to->dtDue() ) 2721 if (to->dtStart() > to->dtDue() )
2722 to->setDtStart(to->dtDue().addDays( -3 )); 2722 to->setDtStart(to->dtDue().addDays( -3 ));
2723 } 2723 }
2724 2724
2725 todoChanged( to ); 2725 todoChanged( to );
2726 } else { 2726 } else {
2727 if ( mMoveIncidence->doesRecur() ) { 2727 if ( mMoveIncidence->doesRecur() ) {
2728#if 0 2728#if 0
2729 // PENDING implement this 2729 // PENDING implement this
2730 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2730 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2731 mCalendar()->addIncidence( newInc ); 2731 mCalendar()->addIncidence( newInc );
2732 if ( mMoveIncidence->typeID() == todoID ) 2732 if ( mMoveIncidence->typeID() == todoID )
2733 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 2733 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2734 else 2734 else
2735 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 2735 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2736 mMoveIncidence = newInc; 2736 mMoveIncidence = newInc;
2737 2737
2738#endif 2738#endif
2739 } 2739 }
2740 QTime tim = mMoveIncidence->dtStart().time(); 2740 QTime tim = mMoveIncidence->dtStart().time();
2741 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 2741 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
2742 QDateTime dt ( d,tim ); 2742 QDateTime dt ( d,tim );
2743 mMoveIncidence->setDtStart( dt ); 2743 mMoveIncidence->setDtStart( dt );
2744 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 2744 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
2745 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 2745 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
2746 } 2746 }
2747 2747