-rw-r--r-- | korganizer/calendarview.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 257a4dd..035d630 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2633,33 +2633,36 @@ void CalendarView::newEvent() | |||
2633 | newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), | 2633 | newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), |
2634 | QDateTime( date, QTime( KOPrefs::instance()->mStartTime + | 2634 | QDateTime( date, QTime( KOPrefs::instance()->mStartTime + |
2635 | KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); | 2635 | KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); |
2636 | } | 2636 | } |
2637 | 2637 | ||
2638 | void CalendarView::newEvent(QDateTime fh) | 2638 | void CalendarView::newEvent(QDateTime fh) |
2639 | { | 2639 | { |
2640 | newEvent(fh, | 2640 | newEvent(fh, |
2641 | QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); | 2641 | QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); |
2642 | } | 2642 | } |
2643 | 2643 | ||
2644 | void CalendarView::newEvent(QDate dt) | 2644 | void CalendarView::newEvent(QDate dt) |
2645 | { | 2645 | { |
2646 | newEvent(QDateTime(dt, QTime(0,0,0)), | 2646 | newEvent(QDateTime(dt, QTime(0,0,0)), |
2647 | QDateTime(dt, QTime(0,0,0)), true); | 2647 | QDateTime(dt, QTime(0,0,0)), true); |
2648 | } | 2648 | } |
2649 | 2649 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) | |
2650 | { | ||
2651 | newEvent(fromHint, toHint, false); | ||
2652 | } | ||
2650 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) | 2653 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) |
2651 | { | 2654 | { |
2652 | 2655 | ||
2653 | showEventEditor(); | 2656 | showEventEditor(); |
2654 | mEventEditor->newEvent(fromHint,toHint,allDay); | 2657 | mEventEditor->newEvent(fromHint,toHint,allDay); |
2655 | if ( mFilterView->filtersEnabled() ) { | 2658 | if ( mFilterView->filtersEnabled() ) { |
2656 | CalFilter *filter = mFilterView->selectedFilter(); | 2659 | CalFilter *filter = mFilterView->selectedFilter(); |
2657 | if (filter && filter->showCategories()) { | 2660 | if (filter && filter->showCategories()) { |
2658 | mEventEditor->setCategories(filter->categoryList().join(",") ); | 2661 | mEventEditor->setCategories(filter->categoryList().join(",") ); |
2659 | } | 2662 | } |
2660 | if ( filter ) | 2663 | if ( filter ) |
2661 | mEventEditor->setSecrecy( filter->getSecrecy() ); | 2664 | mEventEditor->setSecrecy( filter->getSecrecy() ); |
2662 | } | 2665 | } |
2663 | } | 2666 | } |
2664 | void CalendarView::todoAdded(Todo * t) | 2667 | void CalendarView::todoAdded(Todo * t) |
2665 | { | 2668 | { |
@@ -2671,48 +2674,52 @@ void CalendarView::todoChanged(Todo * t) | |||
2671 | { | 2674 | { |
2672 | emit todoModified( t, 4 ); | 2675 | emit todoModified( t, 4 ); |
2673 | // updateTodoViews(); | 2676 | // updateTodoViews(); |
2674 | } | 2677 | } |
2675 | void CalendarView::todoToBeDeleted(Todo *) | 2678 | void CalendarView::todoToBeDeleted(Todo *) |
2676 | { | 2679 | { |
2677 | //qDebug("todoToBeDeleted(Todo *) "); | 2680 | //qDebug("todoToBeDeleted(Todo *) "); |
2678 | updateTodoViews(); | 2681 | updateTodoViews(); |
2679 | } | 2682 | } |
2680 | void CalendarView::todoDeleted() | 2683 | void CalendarView::todoDeleted() |
2681 | { | 2684 | { |
2682 | //qDebug(" todoDeleted()"); | 2685 | //qDebug(" todoDeleted()"); |
2683 | updateTodoViews(); | 2686 | updateTodoViews(); |
2684 | } | 2687 | } |
2685 | 2688 | ||
2686 | 2689 | ||
2687 | 2690 | void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) | |
2688 | void CalendarView::newTodo() | ||
2689 | { | 2691 | { |
2690 | 2692 | qDebug("datetime "); | |
2691 | showTodoEditor(); | 2693 | showTodoEditor(); |
2692 | mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true); | 2694 | mTodoEditor->newTodo(dt,0,allday); |
2693 | if ( mFilterView->filtersEnabled() ) { | 2695 | if ( mFilterView->filtersEnabled() ) { |
2694 | CalFilter *filter = mFilterView->selectedFilter(); | 2696 | CalFilter *filter = mFilterView->selectedFilter(); |
2695 | if (filter && filter->showCategories()) { | 2697 | if (filter && filter->showCategories()) { |
2696 | mTodoEditor->setCategories(filter->categoryList().join(",") ); | 2698 | mTodoEditor->setCategories(filter->categoryList().join(",") ); |
2697 | } | 2699 | } |
2698 | if ( filter ) | 2700 | if ( filter ) |
2699 | mTodoEditor->setSecrecy( filter->getSecrecy() ); | 2701 | mTodoEditor->setSecrecy( filter->getSecrecy() ); |
2700 | } | 2702 | } |
2701 | } | 2703 | } |
2702 | 2704 | ||
2705 | void CalendarView::newTodo() | ||
2706 | { | ||
2707 | newTodoDateTime( QDateTime(),true ); | ||
2708 | } | ||
2709 | |||
2703 | void CalendarView::newSubTodo() | 2710 | void CalendarView::newSubTodo() |
2704 | { | 2711 | { |
2705 | Todo *todo = selectedTodo(); | 2712 | Todo *todo = selectedTodo(); |
2706 | if ( todo ) newSubTodo( todo ); | 2713 | if ( todo ) newSubTodo( todo ); |
2707 | } | 2714 | } |
2708 | 2715 | ||
2709 | void CalendarView::newSubTodo(Todo *parentEvent) | 2716 | void CalendarView::newSubTodo(Todo *parentEvent) |
2710 | { | 2717 | { |
2711 | 2718 | ||
2712 | showTodoEditor(); | 2719 | showTodoEditor(); |
2713 | mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); | 2720 | mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); |
2714 | } | 2721 | } |
2715 | 2722 | ||
2716 | void CalendarView::newFloatingEvent() | 2723 | void CalendarView::newFloatingEvent() |
2717 | { | 2724 | { |
2718 | DateList tmpList = mNavigator->selectedDates(); | 2725 | DateList tmpList = mNavigator->selectedDates(); |