Diffstat (limited to 'korganizer/koeditorgeneraltodo.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/koeditorgeneraltodo.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index e86b4d0..0a734ee 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp | |||
@@ -106,49 +106,50 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) | |||
106 | mDueDateEdit = new KDateEdit(timeBoxFrame); | 106 | mDueDateEdit = new KDateEdit(timeBoxFrame); |
107 | layoutTimeBox->addWidget(mDueDateEdit,1,1); | 107 | layoutTimeBox->addWidget(mDueDateEdit,1,1); |
108 | 108 | ||
109 | mDueTimeEdit = new KOTimeEdit(timeBoxFrame); | 109 | mDueTimeEdit = new KOTimeEdit(timeBoxFrame); |
110 | layoutTimeBox->addWidget(mDueTimeEdit,1,2); | 110 | layoutTimeBox->addWidget(mDueTimeEdit,1,2); |
111 | 111 | ||
112 | 112 | ||
113 | mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); | 113 | mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); |
114 | layoutTimeBox->addWidget(mStartCheck,0,0); | 114 | layoutTimeBox->addWidget(mStartCheck,0,0); |
115 | connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); | 115 | connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); |
116 | 116 | ||
117 | mStartDateEdit = new KDateEdit(timeBoxFrame); | 117 | mStartDateEdit = new KDateEdit(timeBoxFrame); |
118 | layoutTimeBox->addWidget(mStartDateEdit,0,1); | 118 | layoutTimeBox->addWidget(mStartDateEdit,0,1); |
119 | 119 | ||
120 | mStartTimeEdit = new KOTimeEdit(timeBoxFrame); | 120 | mStartTimeEdit = new KOTimeEdit(timeBoxFrame); |
121 | layoutTimeBox->addWidget(mStartTimeEdit,0,2); | 121 | layoutTimeBox->addWidget(mStartTimeEdit,0,2); |
122 | 122 | ||
123 | 123 | ||
124 | mTimeButton = new QCheckBox(i18n("Time associated"),timeBoxFrame); | 124 | mTimeButton = new QCheckBox(i18n("Time associated"),timeBoxFrame); |
125 | layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1); | 125 | layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1); |
126 | 126 | ||
127 | connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool))); | 127 | connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool))); |
128 | connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime))); | 128 | connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime))); |
129 | connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime))); | 129 | connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime))); |
130 | 130 | connect(mStartDateEdit, SIGNAL(dateChanged(QDate)), | |
131 | this, SLOT(startDateChanged(QDate))); | ||
131 | // some more layouting | 132 | // some more layouting |
132 | //layoutTimeBox->setColStretch(3,1); | 133 | //layoutTimeBox->setColStretch(3,1); |
133 | } | 134 | } |
134 | 135 | ||
135 | 136 | ||
136 | void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) | 137 | void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) |
137 | { | 138 | { |
138 | mCompletedCombo = new QComboBox(parent); | 139 | mCompletedCombo = new QComboBox(parent); |
139 | // xgettext:no-c-format | 140 | // xgettext:no-c-format |
140 | mCompletedCombo->insertItem(i18n(" 0 %")); | 141 | mCompletedCombo->insertItem(i18n(" 0 %")); |
141 | // xgettext:no-c-format | 142 | // xgettext:no-c-format |
142 | mCompletedCombo->insertItem(i18n(" 20 %")); | 143 | mCompletedCombo->insertItem(i18n(" 20 %")); |
143 | // xgettext:no-c-format | 144 | // xgettext:no-c-format |
144 | mCompletedCombo->insertItem(i18n(" 40 %")); | 145 | mCompletedCombo->insertItem(i18n(" 40 %")); |
145 | // xgettext:no-c-format | 146 | // xgettext:no-c-format |
146 | mCompletedCombo->insertItem(i18n(" 60 %")); | 147 | mCompletedCombo->insertItem(i18n(" 60 %")); |
147 | // xgettext:no-c-format | 148 | // xgettext:no-c-format |
148 | mCompletedCombo->insertItem(i18n(" 80 %")); | 149 | mCompletedCombo->insertItem(i18n(" 80 %")); |
149 | // xgettext:no-c-format | 150 | // xgettext:no-c-format |
150 | mCompletedCombo->insertItem(i18n("100 %")); | 151 | mCompletedCombo->insertItem(i18n("100 %")); |
151 | connect(mCompletedCombo,SIGNAL(activated(int)),SLOT(completedChanged(int))); | 152 | connect(mCompletedCombo,SIGNAL(activated(int)),SLOT(completedChanged(int))); |
152 | topLayout->addWidget(mCompletedCombo); | 153 | topLayout->addWidget(mCompletedCombo); |
153 | 154 | ||
154 | mCompletedLabel = new QLabel(i18n("completed"),parent); | 155 | mCompletedLabel = new QLabel(i18n("completed"),parent); |
@@ -374,49 +375,53 @@ void KOEditorGeneralTodo::enableDueEdit(bool enable) | |||
374 | mDueTimeEdit->setEnabled( false ); | 375 | mDueTimeEdit->setEnabled( false ); |
375 | } | 376 | } |
376 | emit datesChecked(); | 377 | emit datesChecked(); |
377 | } | 378 | } |
378 | 379 | ||
379 | void KOEditorGeneralTodo::enableStartEdit( bool enable ) | 380 | void KOEditorGeneralTodo::enableStartEdit( bool enable ) |
380 | { | 381 | { |
381 | mStartDateEdit->setEnabled( enable ); | 382 | mStartDateEdit->setEnabled( enable ); |
382 | 383 | ||
383 | if(mDueCheck->isChecked() || mStartCheck->isChecked()) { | 384 | if(mDueCheck->isChecked() || mStartCheck->isChecked()) { |
384 | mTimeButton->setEnabled(true); | 385 | mTimeButton->setEnabled(true); |
385 | } | 386 | } |
386 | else { | 387 | else { |
387 | mTimeButton->setEnabled(false); | 388 | mTimeButton->setEnabled(false); |
388 | mTimeButton->setChecked(false); | 389 | mTimeButton->setChecked(false); |
389 | } | 390 | } |
390 | 391 | ||
391 | if (enable) { | 392 | if (enable) { |
392 | mStartTimeEdit->setEnabled( mTimeButton->isChecked() ); | 393 | mStartTimeEdit->setEnabled( mTimeButton->isChecked() ); |
393 | } else { | 394 | } else { |
394 | mStartTimeEdit->setEnabled( false ); | 395 | mStartTimeEdit->setEnabled( false ); |
395 | } | 396 | } |
396 | emit datesChecked(); | 397 | emit datesChecked(); |
397 | } | 398 | } |
398 | 399 | void KOEditorGeneralTodo::startDateChanged(QDate newdate) | |
400 | { | ||
401 | if ( mDueCheck->isChecked() ) | ||
402 | emit dateTimesChanged(newdate,mDueDateEdit->date()); | ||
403 | } | ||
399 | void KOEditorGeneralTodo::enableTimeEdits(bool enable) | 404 | void KOEditorGeneralTodo::enableTimeEdits(bool enable) |
400 | { | 405 | { |
401 | if(mStartCheck->isChecked()) { | 406 | if(mStartCheck->isChecked()) { |
402 | mStartTimeEdit->setEnabled( enable ); | 407 | mStartTimeEdit->setEnabled( enable ); |
403 | } | 408 | } |
404 | if(mDueCheck->isChecked()) { | 409 | if(mDueCheck->isChecked()) { |
405 | mDueTimeEdit->setEnabled( enable ); | 410 | mDueTimeEdit->setEnabled( enable ); |
406 | } | 411 | } |
407 | } | 412 | } |
408 | 413 | ||
409 | void KOEditorGeneralTodo::showAlarm() | 414 | void KOEditorGeneralTodo::showAlarm() |
410 | { | 415 | { |
411 | if ( mDueCheck->isChecked() ) { | 416 | if ( mDueCheck->isChecked() ) { |
412 | alarmDisable(false); | 417 | alarmDisable(false); |
413 | } | 418 | } |
414 | else { | 419 | else { |
415 | alarmDisable(true); | 420 | alarmDisable(true); |
416 | } | 421 | } |
417 | } | 422 | } |
418 | 423 | ||
419 | bool KOEditorGeneralTodo::validateInput() | 424 | bool KOEditorGeneralTodo::validateInput() |
420 | { | 425 | { |
421 | if (mDueCheck->isChecked()) { | 426 | if (mDueCheck->isChecked()) { |
422 | if (!mDueDateEdit->inputIsValid()) { | 427 | if (!mDueDateEdit->inputIsValid()) { |