summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoeditor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp
index ec5c2d1..70dfbd1 100644
--- a/korganizer/kotodoeditor.cpp
+++ b/korganizer/kotodoeditor.cpp
@@ -236,99 +236,99 @@ bool KOTodoEditor::processInput( bool emitTime )
236 mCalendar->addTodo(todo); 236 mCalendar->addTodo(todo);
237 mTodo = todo; 237 mTodo = todo;
238 emit todoAdded(todo); 238 emit todoAdded(todo);
239 } 239 }
240 240
241 return true; 241 return true;
242} 242}
243 243
244void KOTodoEditor::deleteTodo() 244void KOTodoEditor::deleteTodo()
245{ 245{
246 if (mTodo) { 246 if (mTodo) {
247 if (KOPrefs::instance()->mConfirm) { 247 if (KOPrefs::instance()->mConfirm) {
248 switch (msgItemDelete()) { 248 switch (msgItemDelete()) {
249 case KMessageBox::Continue: // OK 249 case KMessageBox::Continue: // OK
250 emit todoToBeDeleted(mTodo); 250 emit todoToBeDeleted(mTodo);
251 emit dialogClose(mTodo); 251 emit dialogClose(mTodo);
252 mCalendar->deleteTodo(mTodo); 252 mCalendar->deleteTodo(mTodo);
253 emit todoDeleted(); 253 emit todoDeleted();
254 reject(); 254 reject();
255 break; 255 break;
256 } 256 }
257 } 257 }
258 else { 258 else {
259 emit todoToBeDeleted(mTodo); 259 emit todoToBeDeleted(mTodo);
260 emit dialogClose(mTodo); 260 emit dialogClose(mTodo);
261 mCalendar->deleteTodo(mTodo); 261 mCalendar->deleteTodo(mTodo);
262 emit todoDeleted(); 262 emit todoDeleted();
263 reject(); 263 reject();
264 } 264 }
265 } else { 265 } else {
266 reject(); 266 reject();
267 } 267 }
268} 268}
269 269
270void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay) 270void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay)
271{ 271{
272 mRelatedTodo = relatedEvent; 272 mRelatedTodo = relatedEvent;
273 273
274 mGeneral->setDefaults(due,allDay); 274 mGeneral->setDefaults(due,allDay);
275 mDetails->setDefaults(); 275 mDetails->setDefaults();
276 showPage( 0 ); 276 showPage( 0 );
277 if ( mRelatedTodo ) { 277 if ( mRelatedTodo ) {
278 mGeneral->setCategories (mRelatedTodo->categoriesStr ()); 278 mGeneral->setCategories (mRelatedTodo->categoriesStr ());
279 mGeneral->setSecrecy (mRelatedTodo->secrecy ()); 279 mGeneral->setSecrecy (mRelatedTodo->secrecy ());
280 if ( mRelatedTodo->priority() < 3 ) 280 if ( mRelatedTodo->priority() < 3 )
281 mGeneral->mPriorityCombo->setCurrentItem(mRelatedTodo->priority()-1); 281 mGeneral->mPriorityCombo->setCurrentItem(mRelatedTodo->priority()-1);
282 mGeneral->mSummaryEdit->lineEdit()->setText(mRelatedTodo->summary()+": "); 282 mGeneral->mSummaryEdit->lineEdit()->setText(mRelatedTodo->summary()+": ");
283 int len = mRelatedTodo->summary().length(); 283 int len = mRelatedTodo->summary().length();
284 mGeneral->mSummaryEdit->lineEdit()->setSelection ( 0, len+2 );
285 mGeneral->mSummaryEdit->lineEdit()->setCursorPosition ( len+2 );
286 mGeneral->mSummaryEdit->lineEdit()->setFocus(); 284 mGeneral->mSummaryEdit->lineEdit()->setFocus();
285 mGeneral->mSummaryEdit->lineEdit()->setCursorPosition ( len+2 );
286 mGeneral->mSummaryEdit->lineEdit()->setSelection ( 0, len+2 );
287 287
288 } else 288 } else
289 mGeneral->setFocusOn( 2 ); 289 mGeneral->setFocusOn( 2 );
290} 290}
291 291
292void KOTodoEditor::readTodo(Todo *todo) 292void KOTodoEditor::readTodo(Todo *todo)
293{ 293{
294 mGeneral->readTodo(todo); 294 mGeneral->readTodo(todo);
295 mDetails->readEvent(todo); 295 mDetails->readEvent(todo);
296 mRelatedTodo = 0;//todo->relatedTo(); 296 mRelatedTodo = 0;//todo->relatedTo();
297 // categories 297 // categories
298 // mCategoryDialog->setSelected(todo->categories()); 298 // mCategoryDialog->setSelected(todo->categories());
299 299
300 // We should handle read-only events here. 300 // We should handle read-only events here.
301} 301}
302 302
303void KOTodoEditor::writeTodo(Todo *event) 303void KOTodoEditor::writeTodo(Todo *event)
304{ 304{
305 mGeneral->writeTodo(event); 305 mGeneral->writeTodo(event);
306 mDetails->writeEvent(event); 306 mDetails->writeEvent(event);
307 307
308 // set related event, i.e. parent to-do in this case. 308 // set related event, i.e. parent to-do in this case.
309 if (mRelatedTodo) { 309 if (mRelatedTodo) {
310 event->setRelatedTo(mRelatedTodo); 310 event->setRelatedTo(mRelatedTodo);
311 } 311 }
312} 312}
313 313
314bool KOTodoEditor::validateInput() 314bool KOTodoEditor::validateInput()
315{ 315{
316 if (!mGeneral->validateInput()) return false; 316 if (!mGeneral->validateInput()) return false;
317 if (!mDetails->validateInput()) return false; 317 if (!mDetails->validateInput()) return false;
318 return true; 318 return true;
319} 319}
320 320
321int KOTodoEditor::msgItemDelete() 321int KOTodoEditor::msgItemDelete()
322{ 322{
323 return KMessageBox::warningContinueCancel(this, 323 return KMessageBox::warningContinueCancel(this,
324 i18n("This item will be permanently deleted."), 324 i18n("This item will be permanently deleted."),
325 i18n("KOrganizer Confirmation"),i18n("Delete")); 325 i18n("KOrganizer Confirmation"),i18n("Delete"));
326} 326}
327 327
328void KOTodoEditor::modified (int modification) 328void KOTodoEditor::modified (int modification)
329{ 329{
330 if (modification == KOGlobals::CATEGORY_MODIFIED || 330 if (modification == KOGlobals::CATEGORY_MODIFIED ||
331 KOGlobals::UNKNOWN_MODIFIED == modification ) 331 KOGlobals::UNKNOWN_MODIFIED == modification )
332 // mCategoryDialog->setSelected (mTodo->categories ()); 332 // mCategoryDialog->setSelected (mTodo->categories ());
333 mGeneral->modified (mTodo, modification); 333 mGeneral->modified (mTodo, modification);
334 334