-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 4 | ||||
-rw-r--r-- | korganizer/koeditorgeneraltodo.cpp | 46 | ||||
-rw-r--r-- | korganizer/koeditorgeneraltodo.h | 2 |
3 files changed, 43 insertions, 9 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 @@ -1215,10 +1215,10 @@ { "Mail to selected","Mail an Ausgewählte" }, { "Mail to all","Mail an Alle" }, { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, -{ "","" }, -{ "","" }, +{ " on"," am" }, +{ " completed on "," erledigt am " }, { "","" }, { "","" }, { "","" }, { "","" }, diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index b9a028b..ce0d7a9 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp @@ -148,8 +148,22 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) topLayout->addWidget(mCompletedCombo); mCompletedLabel = new QLabel(i18n("completed"),parent); topLayout->addWidget(mCompletedLabel); + + mCompleteDateEdit = new KDateEdit(parent); + topLayout->addWidget(mCompleteDateEdit ); + + mCompleteTimeEdit = new KOTimeEdit(parent); + topLayout->addWidget( mCompleteTimeEdit); + + mCompletedCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred,QSizePolicy::Preferred) ); + mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) ); + + if ( QApplication::desktop()->width() < 320 ) { + mCompleteDateEdit->setMaximumWidth( 85 ); + topLayout->setSpacing( 0 ); + } } void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) { @@ -157,9 +171,8 @@ void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) QHBox* h = new QHBox ( parent ); topLayout->addWidget( h ); QLabel *priorityLabel = new QLabel(i18n("Priority:"), h); // topLayout->addWidget(priorityLabel); - mPriorityCombo = new QComboBox( h ); mPriorityCombo->insertItem(i18n("1 (high)")); mPriorityCombo->insertItem(i18n("2")); mPriorityCombo->insertItem(i18n("3")); @@ -311,17 +324,26 @@ void KOEditorGeneralTodo::writeTodo(Todo *todo) tmpDT.setDate(tmpDate); tmpDT.setTime(tmpTime); todo->setDtStart(tmpDT); } - todo->setPriority(mPriorityCombo->currentItem()+1); // set completion state - todo->setPercentComplete(mCompletedCombo->currentItem() * 20); - - if (mCompletedCombo->currentItem() == 5 && mCompleted.isValid()) { + if ( mCompletedCombo->currentItem() == 5 ) { + QDateTime comp ( mCompleteDateEdit->date(), mCompleteTimeEdit->getTime() ); + if ( comp.isValid () ) { + todo->setPercentComplete(0); + todo->setPercentComplete(100); + todo->setCompleted(comp); + } else { + todo->setPercentComplete( 100 ); + if ( mCompleted.isValid() ) todo->setCompleted(mCompleted); } + } else { + todo->setPercentComplete(mCompletedCombo->currentItem() * 20); + } + mSummaryEdit->save(KOLocationBox::SUMMARYTODO); } void KOEditorGeneralTodo::enableDueEdit(bool enable) @@ -419,20 +441,30 @@ bool KOEditorGeneralTodo::validateInput() void KOEditorGeneralTodo::completedChanged(int index) { if (index == 5) { + //get rid of milli sec mCompleted = QDateTime::currentDateTime(); } setCompletedDate(); } void KOEditorGeneralTodo::setCompletedDate() { if (mCompletedCombo->currentItem() == 5 && mCompleted.isValid()) { - mCompletedLabel->setText(i18n("completed on %1") - .arg(KGlobal::locale()->formatDateTime(mCompleted))); + if ( QApplication::desktop()->width() < 480 ) { + mCompletedLabel->setText(i18n(" on")); + } + else + mCompletedLabel->setText(i18n(" completed on ")); + mCompleteDateEdit->show(); + mCompleteTimeEdit->show(); + mCompleteTimeEdit->setTime( mCompleted.time() ); + mCompleteDateEdit->setDate( mCompleted.date() ); } else { mCompletedLabel->setText(i18n("completed")); + mCompleteDateEdit->hide(); + mCompleteTimeEdit->hide(); } } void KOEditorGeneralTodo::modified (Todo* todo, int modification) diff --git a/korganizer/koeditorgeneraltodo.h b/korganizer/koeditorgeneraltodo.h index 5f1c3cc..98f43dd 100644 --- a/korganizer/koeditorgeneraltodo.h +++ b/korganizer/koeditorgeneraltodo.h @@ -87,8 +87,10 @@ class KOEditorGeneralTodo : public KOEditorGeneral private: friend class KOTodoEditor; KDateEdit *mStartDateEdit; KOTimeEdit *mStartTimeEdit; + KDateEdit *mCompleteDateEdit; + KOTimeEdit *mCompleteTimeEdit; QCheckBox *mTimeButton; QCheckBox *mDueCheck; KDateEdit *mDueDateEdit; KOTimeEdit *mDueTimeEdit; |