-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 4 | ||||
-rw-r--r-- | korganizer/koeditorgeneraltodo.cpp | 52 | ||||
-rw-r--r-- | korganizer/koeditorgeneraltodo.h | 2 |
3 files changed, 46 insertions, 12 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 8f63d1c..b8080b5 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1218,4 +1218,4 @@ | |||
1218 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, | 1218 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, |
1219 | { "","" }, | 1219 | { " on"," am" }, |
1220 | { "","" }, | 1220 | { " completed on "," erledigt am " }, |
1221 | { "","" }, | 1221 | { "","" }, |
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index b9a028b..ce0d7a9 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp | |||
@@ -150,3 +150,17 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) | |||
150 | mCompletedLabel = new QLabel(i18n("completed"),parent); | 150 | mCompletedLabel = new QLabel(i18n("completed"),parent); |
151 | topLayout->addWidget(mCompletedLabel); | 151 | topLayout->addWidget(mCompletedLabel); |
152 | |||
153 | mCompleteDateEdit = new KDateEdit(parent); | ||
154 | topLayout->addWidget(mCompleteDateEdit ); | ||
155 | |||
156 | mCompleteTimeEdit = new KOTimeEdit(parent); | ||
157 | topLayout->addWidget( mCompleteTimeEdit); | ||
158 | |||
159 | mCompletedCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred,QSizePolicy::Preferred) ); | ||
160 | mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) ); | ||
161 | |||
162 | if ( QApplication::desktop()->width() < 320 ) { | ||
163 | mCompleteDateEdit->setMaximumWidth( 85 ); | ||
164 | topLayout->setSpacing( 0 ); | ||
165 | } | ||
152 | } | 166 | } |
@@ -160,3 +174,2 @@ void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) | |||
160 | // topLayout->addWidget(priorityLabel); | 174 | // topLayout->addWidget(priorityLabel); |
161 | |||
162 | mPriorityCombo = new QComboBox( h ); | 175 | mPriorityCombo = new QComboBox( h ); |
@@ -314,3 +327,2 @@ void KOEditorGeneralTodo::writeTodo(Todo *todo) | |||
314 | } | 327 | } |
315 | |||
316 | todo->setPriority(mPriorityCombo->currentItem()+1); | 328 | todo->setPriority(mPriorityCombo->currentItem()+1); |
@@ -318,7 +330,17 @@ void KOEditorGeneralTodo::writeTodo(Todo *todo) | |||
318 | // set completion state | 330 | // set completion state |
319 | todo->setPercentComplete(mCompletedCombo->currentItem() * 20); | 331 | if ( mCompletedCombo->currentItem() == 5 ) { |
320 | 332 | QDateTime comp ( mCompleteDateEdit->date(), mCompleteTimeEdit->getTime() ); | |
321 | if (mCompletedCombo->currentItem() == 5 && mCompleted.isValid()) { | 333 | if ( comp.isValid () ) { |
322 | todo->setCompleted(mCompleted); | 334 | todo->setPercentComplete(0); |
335 | todo->setPercentComplete(100); | ||
336 | todo->setCompleted(comp); | ||
337 | } else { | ||
338 | todo->setPercentComplete( 100 ); | ||
339 | if ( mCompleted.isValid() ) | ||
340 | todo->setCompleted(mCompleted); | ||
341 | } | ||
342 | } else { | ||
343 | todo->setPercentComplete(mCompletedCombo->currentItem() * 20); | ||
323 | } | 344 | } |
345 | |||
324 | mSummaryEdit->save(KOLocationBox::SUMMARYTODO); | 346 | mSummaryEdit->save(KOLocationBox::SUMMARYTODO); |
@@ -422,3 +444,4 @@ void KOEditorGeneralTodo::completedChanged(int index) | |||
422 | if (index == 5) { | 444 | if (index == 5) { |
423 | mCompleted = QDateTime::currentDateTime(); | 445 | //get rid of milli sec |
446 | mCompleted = QDateTime::currentDateTime(); | ||
424 | } | 447 | } |
@@ -430,6 +453,15 @@ void KOEditorGeneralTodo::setCompletedDate() | |||
430 | if (mCompletedCombo->currentItem() == 5 && mCompleted.isValid()) { | 453 | if (mCompletedCombo->currentItem() == 5 && mCompleted.isValid()) { |
431 | mCompletedLabel->setText(i18n("completed on %1") | 454 | if ( QApplication::desktop()->width() < 480 ) { |
432 | .arg(KGlobal::locale()->formatDateTime(mCompleted))); | 455 | mCompletedLabel->setText(i18n(" on")); |
456 | } | ||
457 | else | ||
458 | mCompletedLabel->setText(i18n(" completed on ")); | ||
459 | mCompleteDateEdit->show(); | ||
460 | mCompleteTimeEdit->show(); | ||
461 | mCompleteTimeEdit->setTime( mCompleted.time() ); | ||
462 | mCompleteDateEdit->setDate( mCompleted.date() ); | ||
433 | } else { | 463 | } else { |
434 | mCompletedLabel->setText(i18n("completed")); | 464 | mCompletedLabel->setText(i18n("completed")); |
465 | mCompleteDateEdit->hide(); | ||
466 | mCompleteTimeEdit->hide(); | ||
435 | } | 467 | } |
diff --git a/korganizer/koeditorgeneraltodo.h b/korganizer/koeditorgeneraltodo.h index 5f1c3cc..98f43dd 100644 --- a/korganizer/koeditorgeneraltodo.h +++ b/korganizer/koeditorgeneraltodo.h | |||
@@ -90,2 +90,4 @@ class KOEditorGeneralTodo : public KOEditorGeneral | |||
90 | KOTimeEdit *mStartTimeEdit; | 90 | KOTimeEdit *mStartTimeEdit; |
91 | KDateEdit *mCompleteDateEdit; | ||
92 | KOTimeEdit *mCompleteTimeEdit; | ||
91 | QCheckBox *mTimeButton; | 93 | QCheckBox *mTimeButton; |