summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp17
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
@@ -2637,25 +2637,28 @@ void CalendarView::newEvent()
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() );
@@ -2675,40 +2678,44 @@ void CalendarView::todoChanged(Todo * t)
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);
}