summaryrefslogtreecommitdiffabout
path: root/korganizer/koeditorgeneraltodo.cpp
Unidiff
Diffstat (limited to 'korganizer/koeditorgeneraltodo.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koeditorgeneraltodo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp
index a9d1ed3..a03ec52 100644
--- a/korganizer/koeditorgeneraltodo.cpp
+++ b/korganizer/koeditorgeneraltodo.cpp
@@ -170,103 +170,104 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout)
170} 170}
171 171
172void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) 172void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout)
173{ 173{
174 174
175 QHBox* h = new QHBox ( parent ); 175 QHBox* h = new QHBox ( parent );
176 topLayout->addWidget( h ); 176 topLayout->addWidget( h );
177 QLabel *priorityLabel = new QLabel(i18n("Priority:"), h); 177 QLabel *priorityLabel = new QLabel(i18n("Priority:"), h);
178 // topLayout->addWidget(priorityLabel); 178 // topLayout->addWidget(priorityLabel);
179 mPriorityCombo = new QComboBox( h ); 179 mPriorityCombo = new QComboBox( h );
180 mPriorityCombo->insertItem(i18n("1 (high)")); 180 mPriorityCombo->insertItem(i18n("1 (high)"));
181 mPriorityCombo->insertItem(i18n("2")); 181 mPriorityCombo->insertItem(i18n("2"));
182 mPriorityCombo->insertItem(i18n("3")); 182 mPriorityCombo->insertItem(i18n("3"));
183 mPriorityCombo->insertItem(i18n("4")); 183 mPriorityCombo->insertItem(i18n("4"));
184 mPriorityCombo->insertItem(i18n("5 (low)")); 184 mPriorityCombo->insertItem(i18n("5 (low)"));
185 //topLayout->addWidget(mPriorityCombo); 185 //topLayout->addWidget(mPriorityCombo);
186} 186}
187 187
188void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout) 188void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout)
189{ 189{
190 QBoxLayout *statusLayout = new QHBoxLayout(topLayout); 190 QBoxLayout *statusLayout = new QHBoxLayout(topLayout);
191 191
192 initCompletion( parent, statusLayout ); 192 initCompletion( parent, statusLayout );
193 193
194 statusLayout->addStretch( 1 ); 194 statusLayout->addStretch( 1 );
195 195
196 initPriority( parent, statusLayout ); 196 initPriority( parent, statusLayout );
197} 197}
198 198
199void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay) 199void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay)
200{ 200{
201 201
202 mSummaryEdit->load(KOLocationBox::SUMMARYTODO); 202 mSummaryEdit->load(KOLocationBox::SUMMARYTODO);
203 mLocationEdit->load(KOLocationBox::LOCATION); 203 mLocationEdit->load(KOLocationBox::LOCATION);
204 KOEditorGeneral::setDefaults(allDay); 204 KOEditorGeneral::setDefaults(allDay);
205 205
206 mTimeButton->setChecked( !allDay ); 206 mTimeButton->setChecked( !allDay );
207 if(mTimeButton->isChecked()) { 207 if(mTimeButton->isChecked()) {
208 mTimeButton->setEnabled(true); 208 mTimeButton->setEnabled(true);
209 } 209 }
210 else { 210 else {
211 mTimeButton->setEnabled(false); 211 mTimeButton->setEnabled(false);
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 alarmDisable(false);
218 } else { 219 } else {
219 mDueCheck->setChecked(false); 220 mDueCheck->setChecked(false);
220 enableDueEdit(false); 221 enableDueEdit(false);
221 due = QDateTime::currentDateTime().addDays(7); 222 due = QDateTime::currentDateTime().addDays(7);
223 alarmDisable(true);
222 } 224 }
223 225
224 alarmDisable(true);
225 226
226 mStartCheck->setChecked(false); 227 mStartCheck->setChecked(false);
227 enableStartEdit(false); 228 enableStartEdit(false);
228 229
229 mDueDateEdit->setDate(due.date()); 230 mDueDateEdit->setDate(due.date());
230 mDueTimeEdit->setTime(due.time()); 231 mDueTimeEdit->setTime(due.time());
231 due = due.addDays(-7); 232 due = due.addDays(-7);
232 mStartDateEdit->setDate(due.date()); 233 mStartDateEdit->setDate(due.date());
233 mStartTimeEdit->setTime(due.time()); 234 mStartTimeEdit->setTime(due.time());
234 235
235 mPriorityCombo->setCurrentItem(2); 236 mPriorityCombo->setCurrentItem(2);
236 mCompletedLabel->setText(i18n(" completed"));; 237 mCompletedLabel->setText(i18n(" completed"));;
237 mCompletedCombo->setCurrentItem(0); 238 mCompletedCombo->setCurrentItem(0);
238 mCompleteDateEdit->hide(); 239 mCompleteDateEdit->hide();
239 mCompleteTimeEdit->hide(); 240 mCompleteTimeEdit->hide();
240} 241}
241 242
242void KOEditorGeneralTodo::readTodo(Todo *todo) 243void KOEditorGeneralTodo::readTodo(Todo *todo)
243{ 244{
244 245
245 mSummaryEdit->load(KOLocationBox::SUMMARYTODO); 246 mSummaryEdit->load(KOLocationBox::SUMMARYTODO);
246 mLocationEdit->load(KOLocationBox::LOCATION); 247 mLocationEdit->load(KOLocationBox::LOCATION);
247 KOEditorGeneral::readIncidence(todo); 248 KOEditorGeneral::readIncidence(todo);
248 249
249 QDateTime dueDT; 250 QDateTime dueDT;
250 251
251 if (todo->hasDueDate()) { 252 if (todo->hasDueDate()) {
252 enableAlarmEdit(true); 253 enableAlarmEdit(true);
253 dueDT = todo->dtDue(); 254 dueDT = todo->dtDue();
254 mDueDateEdit->setDate(todo->dtDue().date()); 255 mDueDateEdit->setDate(todo->dtDue().date());
255 mDueTimeEdit->setTime(todo->dtDue().time()); 256 mDueTimeEdit->setTime(todo->dtDue().time());
256 mDueCheck->setChecked(true); 257 mDueCheck->setChecked(true);
257 } else { 258 } else {
258 alarmDisable(true); 259 alarmDisable(true);
259 mDueDateEdit->setEnabled(false); 260 mDueDateEdit->setEnabled(false);
260 mDueTimeEdit->setEnabled(false); 261 mDueTimeEdit->setEnabled(false);
261 mDueDateEdit->setDate(QDate::currentDate()); 262 mDueDateEdit->setDate(QDate::currentDate());
262 mDueTimeEdit->setTime(QTime::currentTime()); 263 mDueTimeEdit->setTime(QTime::currentTime());
263 mDueCheck->setChecked(false); 264 mDueCheck->setChecked(false);
264 } 265 }
265 266
266 if (todo->hasStartDate()) { 267 if (todo->hasStartDate()) {
267 mStartDateEdit->setDate(todo->dtStart().date()); 268 mStartDateEdit->setDate(todo->dtStart().date());
268 mStartTimeEdit->setTime(todo->dtStart().time()); 269 mStartTimeEdit->setTime(todo->dtStart().time());
269 mStartCheck->setChecked(true); 270 mStartCheck->setChecked(true);
270 } else { 271 } else {
271 mStartDateEdit->setEnabled(false); 272 mStartDateEdit->setEnabled(false);
272 mStartTimeEdit->setEnabled(false); 273 mStartTimeEdit->setEnabled(false);