summaryrefslogtreecommitdiff
path: root/core/pim/todo/todoentryimpl.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/todo/todoentryimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/todoentryimpl.cpp53
1 files changed, 35 insertions, 18 deletions
diff --git a/core/pim/todo/todoentryimpl.cpp b/core/pim/todo/todoentryimpl.cpp
index c957715..1dc1d44 100644
--- a/core/pim/todo/todoentryimpl.cpp
+++ b/core/pim/todo/todoentryimpl.cpp
@@ -22,2 +22,5 @@
+#include <opie/todoevent.h>
+#include <opie/tododb.h>
+
#include <qpe/categoryselect.h>
@@ -26,4 +29,4 @@
#include <qpe/imageedit.h>
-#include <qpe/task.h>
#include <qpe/timestring.h>
+#include <qpe/palmtoprecord.h>
@@ -41,3 +44,3 @@
-NewTaskDialog::NewTaskDialog( const Task& task, QWidget *parent,
+NewTaskDialog::NewTaskDialog( const ToDoEvent& task, QWidget *parent,
const char *name, bool modal, WFlags fl )
@@ -46,5 +49,6 @@ NewTaskDialog::NewTaskDialog( const Task& task, QWidget *parent,
{
- todo.setCategories( task.categories() );
- if ( todo.hasDueDate() )
- date = todo.dueDate();
+ qWarning("setting category" );
+ todo.setCategory( task.category() );
+ if ( todo.hasDate() )
+ date = todo.date();
else
@@ -56,3 +60,3 @@ NewTaskDialog::NewTaskDialog( const Task& task, QWidget *parent,
checkCompleted->setChecked( task.isCompleted() );
- checkDate->setChecked( task.hasDueDate() );
+ checkDate->setChecked( task.hasDate() );
buttonDate->setText( TimeString::longDateString( date ) );
@@ -77,3 +81,3 @@ NewTaskDialog::NewTaskDialog( int id, QWidget* parent, const char* name, bool m
ids[0] = id;
- todo.setCategories( ids );
+ todo.setCategory( Qtopia::Record::idsToString( ids ) );
}
@@ -102,2 +106,3 @@ NewTaskDialog::~NewTaskDialog()
{
+ qWarning("d'tor" );
// no need to delete child widgets, Qt does it all for us
@@ -113,14 +118,25 @@ void NewTaskDialog::dateChanged( int y, int m, int d )
-Task NewTaskDialog::todoEntry()
+ToDoEvent NewTaskDialog::todoEntry()
{
- todo.setDueDate( date, checkDate->isChecked() );
- if ( comboCategory->currentCategory() != -1 ) {
- todo.setCategories( comboCategory->currentCategories() );
- }
- todo.setPriority( comboPriority->currentItem() + 1 );
- todo.setCompleted( checkCompleted->isChecked() );
-
- todo.setDescription( txtTodo->text() );
-
- return todo;
+ qWarning("todoEntry()" );
+ if( checkDate->isChecked() ){
+ todo.setDate( date );
+ todo.setHasDate( true );
+ }else{
+ todo.setHasDate( false );
+ }
+ qWarning("todoEntry::category()" );
+ if ( comboCategory->currentCategory() != -1 ) {
+ QArray<int> arr = comboCategory->currentCategories();
+ int id = arr[0];
+ qWarning("id 0: %d",id );
+ todo.setCategory( Qtopia::Record::idsToString( arr ) );
+ qWarning("saving category");
+ }
+ todo.setPriority( comboPriority->currentItem() + 1 );
+ todo.setCompleted( checkCompleted->isChecked() );
+
+ todo.setDescription( txtTodo->text() );
+
+ return todo;
}
@@ -134,2 +150,3 @@ void NewTaskDialog::accept()
{
+ qWarning("accept" );
QString strText = txtTodo->text();