-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 @@ -2625,102 +2625,109 @@ void CalendarView::newEvent() QDate date = mNavigator->selectedDates().first(); QDateTime current = QDateTime::currentDateTime(); if ( date <= current.date() ) { int hour = current.time().hour() +1; newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); } else newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), QDateTime( date, QTime( KOPrefs::instance()->mStartTime + KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); } void CalendarView::newEvent(QDateTime fh) { newEvent(fh, QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); } void CalendarView::newEvent(QDate dt) { newEvent(QDateTime(dt, QTime(0,0,0)), QDateTime(dt, QTime(0,0,0)), true); } - +void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) +{ + newEvent(fromHint, toHint, false); +} void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) { showEventEditor(); mEventEditor->newEvent(fromHint,toHint,allDay); if ( mFilterView->filtersEnabled() ) { CalFilter *filter = mFilterView->selectedFilter(); if (filter && filter->showCategories()) { mEventEditor->setCategories(filter->categoryList().join(",") ); } if ( filter ) mEventEditor->setSecrecy( filter->getSecrecy() ); } } void CalendarView::todoAdded(Todo * t) { changeTodoDisplay ( t ,KOGlobals::EVENTADDED); updateTodoViews(); } void CalendarView::todoChanged(Todo * t) { emit todoModified( t, 4 ); // updateTodoViews(); } void CalendarView::todoToBeDeleted(Todo *) { //qDebug("todoToBeDeleted(Todo *) "); updateTodoViews(); } void CalendarView::todoDeleted() { //qDebug(" todoDeleted()"); updateTodoViews(); } - -void CalendarView::newTodo() +void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) { - + qDebug("datetime "); showTodoEditor(); - mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true); + mTodoEditor->newTodo(dt,0,allday); if ( mFilterView->filtersEnabled() ) { CalFilter *filter = mFilterView->selectedFilter(); if (filter && filter->showCategories()) { mTodoEditor->setCategories(filter->categoryList().join(",") ); } if ( filter ) mTodoEditor->setSecrecy( filter->getSecrecy() ); } } +void CalendarView::newTodo() +{ + newTodoDateTime( QDateTime(),true ); +} + void CalendarView::newSubTodo() { Todo *todo = selectedTodo(); if ( todo ) newSubTodo( todo ); } void CalendarView::newSubTodo(Todo *parentEvent) { showTodoEditor(); mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); } void CalendarView::newFloatingEvent() { DateList tmpList = mNavigator->selectedDates(); QDate date = tmpList.first(); newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), QDateTime( date, QTime( 12, 0, 0 ) ), true ); } void CalendarView::editEvent( Event *event ) |