-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 @@ -32,32 +32,33 @@ #include <qapplication.h> #include <kiconloader.h> #include <klocale.h> #include <kfiledialog.h> #include <kstandarddirs.h> #include <kmessagebox.h> #include <libkdepim/categoryselectdialog.h> #include <libkcal/calendarlocal.h> #include <libkcal/calendarresources.h> #include <libkcal/resourcecalendar.h> #include <libkcal/icalformat.h> #include <kresources/resourceselectdialog.h> #include "koprefs.h" +#include "kolocationbox.h" #include "kotodoeditor.h" extern int globalFlagBlockAgenda; KOTodoEditor::KOTodoEditor( Calendar *calendar, QWidget *parent ) : KOIncidenceEditor( i18n("Edit To-Do"), calendar, parent ) { mTodo = 0; mRelatedTodo = 0; findButton(User1)->hide(); init(); } KOTodoEditor::~KOTodoEditor() { emit dialogClose( mTodo ); @@ -263,35 +264,42 @@ void KOTodoEditor::deleteTodo() } } else { reject(); } } void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay) { mRelatedTodo = relatedEvent; mGeneral->setDefaults(due,allDay); mDetails->setDefaults(); showPage( 0 ); if ( mRelatedTodo ) { mGeneral->setCategories (mRelatedTodo->categoriesStr ()); mGeneral->setSecrecy (mRelatedTodo->secrecy ()); + if ( mRelatedTodo->priority() < 3 ) + mGeneral->mPriorityCombo->setCurrentItem(mRelatedTodo->priority()-1); + mGeneral->mSummaryEdit->lineEdit()->setText(mRelatedTodo->summary()+": "); + int len = mRelatedTodo->summary().length(); + mGeneral->mSummaryEdit->lineEdit()->setSelection ( 0, len+2 ); + mGeneral->mSummaryEdit->lineEdit()->setCursorPosition ( len+2 ); + mGeneral->mSummaryEdit->lineEdit()->setFocus(); - } - mGeneral->setFocusOn( 2 ); + } else + mGeneral->setFocusOn( 2 ); } void KOTodoEditor::readTodo(Todo *todo) { mGeneral->readTodo(todo); mDetails->readEvent(todo); mRelatedTodo = 0;//todo->relatedTo(); // categories // mCategoryDialog->setSelected(todo->categories()); // We should handle read-only events here. } void KOTodoEditor::writeTodo(Todo *event) { mGeneral->writeTodo(event); |