author | zautrix <zautrix> | 2005-02-07 06:16:24 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-07 06:16:24 (UTC) |
commit | 363a0e27d630452762e76131b4606e14a3231f01 (patch) (unidiff) | |
tree | 11f423fbb1b29ad8315f2178d0a6ce20d7a36e7f /korganizer | |
parent | 301a4a207171549bd87815705d8dcf32ad15559d (diff) | |
download | kdepimpi-363a0e27d630452762e76131b4606e14a3231f01.zip kdepimpi-363a0e27d630452762e76131b4606e14a3231f01.tar.gz kdepimpi-363a0e27d630452762e76131b4606e14a3231f01.tar.bz2 |
another fix
-rw-r--r-- | korganizer/koeditorgeneraltodo.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index da5ef07..6370b54 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp | |||
@@ -212,50 +212,52 @@ void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay) | |||
212 | } | 212 | } |
213 | 213 | ||
214 | enableTimeEdits( !allDay ); | 214 | enableTimeEdits( !allDay ); |
215 | if ( due.isValid() ) { | 215 | if ( due.isValid() ) { |
216 | mDueCheck->setChecked(true); | 216 | mDueCheck->setChecked(true); |
217 | enableDueEdit(true); | 217 | enableDueEdit(true); |
218 | } else { | 218 | } else { |
219 | mDueCheck->setChecked(false); | 219 | mDueCheck->setChecked(false); |
220 | enableDueEdit(false); | 220 | enableDueEdit(false); |
221 | due = QDateTime::currentDateTime().addDays(7); | 221 | due = QDateTime::currentDateTime().addDays(7); |
222 | } | 222 | } |
223 | 223 | ||
224 | alarmDisable(true); | 224 | alarmDisable(true); |
225 | 225 | ||
226 | mStartCheck->setChecked(false); | 226 | mStartCheck->setChecked(false); |
227 | enableStartEdit(false); | 227 | enableStartEdit(false); |
228 | 228 | ||
229 | mDueDateEdit->setDate(due.date()); | 229 | mDueDateEdit->setDate(due.date()); |
230 | mDueTimeEdit->setTime(due.time()); | 230 | mDueTimeEdit->setTime(due.time()); |
231 | due = due.addDays(-7); | 231 | due = due.addDays(-7); |
232 | mStartDateEdit->setDate(due.date()); | 232 | mStartDateEdit->setDate(due.date()); |
233 | mStartTimeEdit->setTime(due.time()); | 233 | mStartTimeEdit->setTime(due.time()); |
234 | 234 | ||
235 | mPriorityCombo->setCurrentItem(2); | 235 | mPriorityCombo->setCurrentItem(2); |
236 | mCompletedLabel->setText(i18n("completed"));; | 236 | mCompletedLabel->setText(i18n(" completed"));; |
237 | mCompletedCombo->setCurrentItem(0); | 237 | mCompletedCombo->setCurrentItem(0); |
238 | mCompleteDateEdit->hide(); | ||
239 | mCompleteTimeEdit->hide(); | ||
238 | } | 240 | } |
239 | 241 | ||
240 | void KOEditorGeneralTodo::readTodo(Todo *todo) | 242 | void KOEditorGeneralTodo::readTodo(Todo *todo) |
241 | { | 243 | { |
242 | 244 | ||
243 | mSummaryEdit->load(KOLocationBox::SUMMARYTODO); | 245 | mSummaryEdit->load(KOLocationBox::SUMMARYTODO); |
244 | mLocationEdit->load(KOLocationBox::LOCATION); | 246 | mLocationEdit->load(KOLocationBox::LOCATION); |
245 | KOEditorGeneral::readIncidence(todo); | 247 | KOEditorGeneral::readIncidence(todo); |
246 | 248 | ||
247 | QDateTime dueDT; | 249 | QDateTime dueDT; |
248 | 250 | ||
249 | if (todo->hasDueDate()) { | 251 | if (todo->hasDueDate()) { |
250 | enableAlarmEdit(true); | 252 | enableAlarmEdit(true); |
251 | dueDT = todo->dtDue(); | 253 | dueDT = todo->dtDue(); |
252 | mDueDateEdit->setDate(todo->dtDue().date()); | 254 | mDueDateEdit->setDate(todo->dtDue().date()); |
253 | mDueTimeEdit->setTime(todo->dtDue().time()); | 255 | mDueTimeEdit->setTime(todo->dtDue().time()); |
254 | mDueCheck->setChecked(true); | 256 | mDueCheck->setChecked(true); |
255 | } else { | 257 | } else { |
256 | alarmDisable(true); | 258 | alarmDisable(true); |
257 | mDueDateEdit->setEnabled(false); | 259 | mDueDateEdit->setEnabled(false); |
258 | mDueTimeEdit->setEnabled(false); | 260 | mDueTimeEdit->setEnabled(false); |
259 | mDueDateEdit->setDate(QDate::currentDate()); | 261 | mDueDateEdit->setDate(QDate::currentDate()); |
260 | mDueTimeEdit->setTime(QTime::currentTime()); | 262 | mDueTimeEdit->setTime(QTime::currentTime()); |
261 | mDueCheck->setChecked(false); | 263 | mDueCheck->setChecked(false); |
@@ -444,49 +446,49 @@ bool KOEditorGeneralTodo::validateInput() | |||
444 | } | 446 | } |
445 | 447 | ||
446 | void KOEditorGeneralTodo::completedChanged(int index) | 448 | void KOEditorGeneralTodo::completedChanged(int index) |
447 | { | 449 | { |
448 | if (index == 5) { | 450 | if (index == 5) { |
449 | //get rid of milli sec | 451 | //get rid of milli sec |
450 | mCompleted = QDateTime::currentDateTime(); | 452 | mCompleted = QDateTime::currentDateTime(); |
451 | } | 453 | } |
452 | setCompletedDate(); | 454 | setCompletedDate(); |
453 | } | 455 | } |
454 | 456 | ||
455 | void KOEditorGeneralTodo::setCompletedDate() | 457 | void KOEditorGeneralTodo::setCompletedDate() |
456 | { | 458 | { |
457 | if (mCompletedCombo->currentItem() == 5 && mCompleted.isValid()) { | 459 | if (mCompletedCombo->currentItem() == 5 && mCompleted.isValid()) { |
458 | if ( QApplication::desktop()->width() < 480 ) { | 460 | if ( QApplication::desktop()->width() < 480 ) { |
459 | mCompletedLabel->setText(i18n(" on")); | 461 | mCompletedLabel->setText(i18n(" on")); |
460 | } | 462 | } |
461 | else | 463 | else |
462 | mCompletedLabel->setText(i18n(" completed on ")); | 464 | mCompletedLabel->setText(i18n(" completed on ")); |
463 | mCompleteDateEdit->show(); | 465 | mCompleteDateEdit->show(); |
464 | mCompleteTimeEdit->show(); | 466 | mCompleteTimeEdit->show(); |
465 | mCompleteTimeEdit->setTime( mCompleted.time() ); | 467 | mCompleteTimeEdit->setTime( mCompleted.time() ); |
466 | mCompleteDateEdit->setDate( mCompleted.date() ); | 468 | mCompleteDateEdit->setDate( mCompleted.date() ); |
467 | } else { | 469 | } else { |
468 | mCompletedLabel->setText(i18n("completed")); | 470 | mCompletedLabel->setText(i18n(" completed")); |
469 | mCompleteDateEdit->hide(); | 471 | mCompleteDateEdit->hide(); |
470 | mCompleteTimeEdit->hide(); | 472 | mCompleteTimeEdit->hide(); |
471 | } | 473 | } |
472 | } | 474 | } |
473 | 475 | ||
474 | void KOEditorGeneralTodo::modified (Todo* todo, int modification) | 476 | void KOEditorGeneralTodo::modified (Todo* todo, int modification) |
475 | { | 477 | { |
476 | switch (modification) { | 478 | switch (modification) { |
477 | case KOGlobals::PRIORITY_MODIFIED: | 479 | case KOGlobals::PRIORITY_MODIFIED: |
478 | mPriorityCombo->setCurrentItem(todo->priority()-1); | 480 | mPriorityCombo->setCurrentItem(todo->priority()-1); |
479 | break; | 481 | break; |
480 | case KOGlobals::COMPLETION_MODIFIED: | 482 | case KOGlobals::COMPLETION_MODIFIED: |
481 | mCompletedCombo->setCurrentItem(todo->percentComplete() / 20); | 483 | mCompletedCombo->setCurrentItem(todo->percentComplete() / 20); |
482 | if (todo->isCompleted() && todo->hasCompletedDate()) { | 484 | if (todo->isCompleted() && todo->hasCompletedDate()) { |
483 | mCompleted = todo->completed(); | 485 | mCompleted = todo->completed(); |
484 | } | 486 | } |
485 | setCompletedDate(); | 487 | setCompletedDate(); |
486 | break; | 488 | break; |
487 | case KOGlobals::CATEGORY_MODIFIED: | 489 | case KOGlobals::CATEGORY_MODIFIED: |
488 | setCategories (todo->categoriesStr ()); | 490 | setCategories (todo->categoriesStr ()); |
489 | break; | 491 | break; |
490 | case KOGlobals::UNKNOWN_MODIFIED: // fall through | 492 | case KOGlobals::UNKNOWN_MODIFIED: // fall through |
491 | default: | 493 | default: |
492 | readTodo( todo ); | 494 | readTodo( todo ); |