-rw-r--r-- | korganizer/kotodoeditor.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp index 16c19a4..ec5c2d1 100644 --- a/korganizer/kotodoeditor.cpp +++ b/korganizer/kotodoeditor.cpp | |||
@@ -36,24 +36,25 @@ | |||
36 | #include <kfiledialog.h> | 36 | #include <kfiledialog.h> |
37 | #include <kstandarddirs.h> | 37 | #include <kstandarddirs.h> |
38 | #include <kmessagebox.h> | 38 | #include <kmessagebox.h> |
39 | 39 | ||
40 | #include <libkdepim/categoryselectdialog.h> | 40 | #include <libkdepim/categoryselectdialog.h> |
41 | #include <libkcal/calendarlocal.h> | 41 | #include <libkcal/calendarlocal.h> |
42 | #include <libkcal/calendarresources.h> | 42 | #include <libkcal/calendarresources.h> |
43 | #include <libkcal/resourcecalendar.h> | 43 | #include <libkcal/resourcecalendar.h> |
44 | #include <libkcal/icalformat.h> | 44 | #include <libkcal/icalformat.h> |
45 | #include <kresources/resourceselectdialog.h> | 45 | #include <kresources/resourceselectdialog.h> |
46 | 46 | ||
47 | #include "koprefs.h" | 47 | #include "koprefs.h" |
48 | #include "kolocationbox.h" | ||
48 | 49 | ||
49 | #include "kotodoeditor.h" | 50 | #include "kotodoeditor.h" |
50 | extern int globalFlagBlockAgenda; | 51 | extern int globalFlagBlockAgenda; |
51 | 52 | ||
52 | KOTodoEditor::KOTodoEditor( Calendar *calendar, QWidget *parent ) : | 53 | KOTodoEditor::KOTodoEditor( Calendar *calendar, QWidget *parent ) : |
53 | KOIncidenceEditor( i18n("Edit To-Do"), calendar, parent ) | 54 | KOIncidenceEditor( i18n("Edit To-Do"), calendar, parent ) |
54 | { | 55 | { |
55 | mTodo = 0; | 56 | mTodo = 0; |
56 | mRelatedTodo = 0; | 57 | mRelatedTodo = 0; |
57 | findButton(User1)->hide(); | 58 | findButton(User1)->hide(); |
58 | init(); | 59 | init(); |
59 | } | 60 | } |
@@ -267,27 +268,34 @@ void KOTodoEditor::deleteTodo() | |||
267 | } | 268 | } |
268 | 269 | ||
269 | void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay) | 270 | void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay) |
270 | { | 271 | { |
271 | mRelatedTodo = relatedEvent; | 272 | mRelatedTodo = relatedEvent; |
272 | 273 | ||
273 | mGeneral->setDefaults(due,allDay); | 274 | mGeneral->setDefaults(due,allDay); |
274 | mDetails->setDefaults(); | 275 | mDetails->setDefaults(); |
275 | showPage( 0 ); | 276 | showPage( 0 ); |
276 | if ( mRelatedTodo ) { | 277 | if ( mRelatedTodo ) { |
277 | mGeneral->setCategories (mRelatedTodo->categoriesStr ()); | 278 | mGeneral->setCategories (mRelatedTodo->categoriesStr ()); |
278 | mGeneral->setSecrecy (mRelatedTodo->secrecy ()); | 279 | mGeneral->setSecrecy (mRelatedTodo->secrecy ()); |
280 | if ( mRelatedTodo->priority() < 3 ) | ||
281 | mGeneral->mPriorityCombo->setCurrentItem(mRelatedTodo->priority()-1); | ||
282 | mGeneral->mSummaryEdit->lineEdit()->setText(mRelatedTodo->summary()+": "); | ||
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(); | ||
279 | 287 | ||
280 | } | 288 | } else |
281 | mGeneral->setFocusOn( 2 ); | 289 | mGeneral->setFocusOn( 2 ); |
282 | } | 290 | } |
283 | 291 | ||
284 | void KOTodoEditor::readTodo(Todo *todo) | 292 | void KOTodoEditor::readTodo(Todo *todo) |
285 | { | 293 | { |
286 | mGeneral->readTodo(todo); | 294 | mGeneral->readTodo(todo); |
287 | mDetails->readEvent(todo); | 295 | mDetails->readEvent(todo); |
288 | mRelatedTodo = 0;//todo->relatedTo(); | 296 | mRelatedTodo = 0;//todo->relatedTo(); |
289 | // categories | 297 | // categories |
290 | // mCategoryDialog->setSelected(todo->categories()); | 298 | // mCategoryDialog->setSelected(todo->categories()); |
291 | 299 | ||
292 | // We should handle read-only events here. | 300 | // We should handle read-only events here. |
293 | } | 301 | } |