Diffstat (limited to 'core/pim/todo/todoentryimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/todo/todoentryimpl.cpp | 37 |
1 files changed, 27 insertions, 10 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 | |||
@@ -21,10 +21,13 @@ | |||
21 | #include "todoentryimpl.h" | 21 | #include "todoentryimpl.h" |
22 | 22 | ||
23 | #include <opie/todoevent.h> | ||
24 | #include <opie/tododb.h> | ||
25 | |||
23 | #include <qpe/categoryselect.h> | 26 | #include <qpe/categoryselect.h> |
24 | #include <qpe/datebookmonth.h> | 27 | #include <qpe/datebookmonth.h> |
25 | #include <qpe/global.h> | 28 | #include <qpe/global.h> |
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 | ||
30 | #include <qmessagebox.h> | 33 | #include <qmessagebox.h> |
@@ -40,12 +43,13 @@ | |||
40 | 43 | ||
41 | 44 | ||
42 | NewTaskDialog::NewTaskDialog( const Task& task, QWidget *parent, | 45 | NewTaskDialog::NewTaskDialog( const ToDoEvent& task, QWidget *parent, |
43 | const char *name, bool modal, WFlags fl ) | 46 | const char *name, bool modal, WFlags fl ) |
44 | : NewTaskDialogBase( parent, name, modal, fl ), | 47 | : NewTaskDialogBase( parent, name, modal, fl ), |
45 | todo( task ) | 48 | todo( task ) |
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 |
51 | date = QDate::currentDate(); | 55 | date = QDate::currentDate(); |
@@ -55,5 +59,5 @@ NewTaskDialog::NewTaskDialog( const Task& task, QWidget *parent, | |||
55 | 59 | ||
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 ) ); |
59 | 63 | ||
@@ -76,5 +80,5 @@ NewTaskDialog::NewTaskDialog( int id, QWidget* parent, const char* name, bool m | |||
76 | QArray<int> ids( 1 ); | 80 | QArray<int> ids( 1 ); |
77 | ids[0] = id; | 81 | ids[0] = id; |
78 | todo.setCategories( ids ); | 82 | todo.setCategory( Qtopia::Record::idsToString( ids ) ); |
79 | } | 83 | } |
80 | init(); | 84 | init(); |
@@ -101,4 +105,5 @@ void NewTaskDialog::init() | |||
101 | NewTaskDialog::~NewTaskDialog() | 105 | 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 |
104 | } | 109 | } |
@@ -112,9 +117,20 @@ void NewTaskDialog::dateChanged( int y, int m, int d ) | |||
112 | */ | 117 | */ |
113 | 118 | ||
114 | Task NewTaskDialog::todoEntry() | 119 | ToDoEvent NewTaskDialog::todoEntry() |
115 | { | 120 | { |
116 | todo.setDueDate( date, checkDate->isChecked() ); | 121 | qWarning("todoEntry()" ); |
122 | if( checkDate->isChecked() ){ | ||
123 | todo.setDate( date ); | ||
124 | todo.setHasDate( true ); | ||
125 | }else{ | ||
126 | todo.setHasDate( false ); | ||
127 | } | ||
128 | qWarning("todoEntry::category()" ); | ||
117 | if ( comboCategory->currentCategory() != -1 ) { | 129 | if ( comboCategory->currentCategory() != -1 ) { |
118 | todo.setCategories( comboCategory->currentCategories() ); | 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"); | ||
119 | } | 135 | } |
120 | todo.setPriority( comboPriority->currentItem() + 1 ); | 136 | todo.setPriority( comboPriority->currentItem() + 1 ); |
@@ -133,4 +149,5 @@ Task NewTaskDialog::todoEntry() | |||
133 | void NewTaskDialog::accept() | 149 | void NewTaskDialog::accept() |
134 | { | 150 | { |
151 | qWarning("accept" ); | ||
135 | QString strText = txtTodo->text(); | 152 | QString strText = txtTodo->text(); |
136 | if ( strText.isEmpty() ) { | 153 | if ( strText.isEmpty() ) { |