summaryrefslogtreecommitdiff
path: root/core/pim/todo/todoentryimpl.cpp
Unidiff
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 @@
22 22
23#include <opie/todoevent.h>
24#include <opie/tododb.h>
25
23#include <qpe/categoryselect.h> 26#include <qpe/categoryselect.h>
@@ -26,4 +29,4 @@
26#include <qpe/imageedit.h> 29#include <qpe/imageedit.h>
27#include <qpe/task.h>
28#include <qpe/timestring.h> 30#include <qpe/timestring.h>
31#include <qpe/palmtoprecord.h>
29 32
@@ -41,3 +44,3 @@
41 44
42NewTaskDialog::NewTaskDialog( const Task& task, QWidget *parent, 45NewTaskDialog::NewTaskDialog( const ToDoEvent& task, QWidget *parent,
43 const char *name, bool modal, WFlags fl ) 46 const char *name, bool modal, WFlags fl )
@@ -46,5 +49,6 @@ NewTaskDialog::NewTaskDialog( const Task& task, QWidget *parent,
46{ 49{
47 todo.setCategories( task.categories() ); 50 qWarning("setting category" );
48 if ( todo.hasDueDate() ) 51 todo.setCategory( task.category() );
49 date = todo.dueDate(); 52 if ( todo.hasDate() )
53 date = todo.date();
50 else 54 else
@@ -56,3 +60,3 @@ NewTaskDialog::NewTaskDialog( const Task& task, QWidget *parent,
56 checkCompleted->setChecked( task.isCompleted() ); 60 checkCompleted->setChecked( task.isCompleted() );
57 checkDate->setChecked( task.hasDueDate() ); 61 checkDate->setChecked( task.hasDate() );
58 buttonDate->setText( TimeString::longDateString( date ) ); 62 buttonDate->setText( TimeString::longDateString( date ) );
@@ -77,3 +81,3 @@ NewTaskDialog::NewTaskDialog( int id, QWidget* parent, const char* name, bool m
77 ids[0] = id; 81 ids[0] = id;
78 todo.setCategories( ids ); 82 todo.setCategory( Qtopia::Record::idsToString( ids ) );
79 } 83 }
@@ -102,2 +106,3 @@ NewTaskDialog::~NewTaskDialog()
102{ 106{
107 qWarning("d'tor" );
103 // no need to delete child widgets, Qt does it all for us 108 // 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 )
113 118
114Task NewTaskDialog::todoEntry() 119ToDoEvent NewTaskDialog::todoEntry()
115{ 120{
116 todo.setDueDate( date, checkDate->isChecked() ); 121 qWarning("todoEntry()" );
117 if ( comboCategory->currentCategory() != -1 ) { 122 if( checkDate->isChecked() ){
118 todo.setCategories( comboCategory->currentCategories() ); 123 todo.setDate( date );
119 } 124 todo.setHasDate( true );
120 todo.setPriority( comboPriority->currentItem() + 1 ); 125 }else{
121 todo.setCompleted( checkCompleted->isChecked() ); 126 todo.setHasDate( false );
122 127 }
123 todo.setDescription( txtTodo->text() ); 128 qWarning("todoEntry::category()" );
124 129 if ( comboCategory->currentCategory() != -1 ) {
125 return todo; 130 QArray<int> arr = comboCategory->currentCategories();
131 int id = arr[0];
132 qWarning("id 0: %d",id );
133 todo.setCategory( Qtopia::Record::idsToString( arr ) );
134 qWarning("saving category");
135 }
136 todo.setPriority( comboPriority->currentItem() + 1 );
137 todo.setCompleted( checkCompleted->isChecked() );
138
139 todo.setDescription( txtTodo->text() );
140
141 return todo;
126} 142}
@@ -134,2 +150,3 @@ void NewTaskDialog::accept()
134{ 150{
151 qWarning("accept" );
135 QString strText = txtTodo->text(); 152 QString strText = txtTodo->text();