From c6548bb194a5e73b9b72505c2e952ef6346dec46 Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 29 Jan 2005 15:23:10 +0000 Subject: todo --- (limited to 'korganizer/koeditorgeneraltodo.cpp') diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index 158a7d3..b9a028b 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp @@ -195,9 +195,14 @@ void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay) } enableTimeEdits( !allDay ); - - mDueCheck->setChecked(false); - enableDueEdit(false); + if ( due.isValid() ) { + mDueCheck->setChecked(true); + enableDueEdit(true); + } else { + mDueCheck->setChecked(false); + enableDueEdit(false); + due = QDateTime::currentDateTime().addDays(7); + } alarmDisable(true); @@ -206,9 +211,9 @@ void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay) mDueDateEdit->setDate(due.date()); mDueTimeEdit->setTime(due.time()); - - mStartDateEdit->setDate(QDate::currentDate()); - mStartTimeEdit->setTime(QTime::currentTime()); + due = due.addDays(-7); + mStartDateEdit->setDate(due.date()); + mStartTimeEdit->setTime(due.time()); mPriorityCombo->setCurrentItem(2); mCompletedLabel->setText(i18n("completed"));; -- cgit v0.9.0.2