author | zecke <zecke> | 2002-03-21 00:26:39 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-03-21 00:26:39 (UTC) |
commit | 8bfe366ce8667addc539f11fc560250c306340ae (patch) (side-by-side diff) | |
tree | 4b890a47d86621d3e1f0aacde2485457862f02c8 /core/pim/todo/todoentryimpl.cpp | |
parent | e8f15a98c611b0c6030e8210672b249b42107526 (diff) | |
download | opie-8bfe366ce8667addc539f11fc560250c306340ae.zip opie-8bfe366ce8667addc539f11fc560250c306340ae.tar.gz opie-8bfe366ce8667addc539f11fc560250c306340ae.tar.bz2 |
Move todolist to tododb
Please test todolist
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 @@ -19,14 +19,17 @@ **********************************************************************/ #include "todoentryimpl.h" +#include <opie/todoevent.h> +#include <opie/tododb.h> + #include <qpe/categoryselect.h> #include <qpe/datebookmonth.h> #include <qpe/global.h> #include <qpe/imageedit.h> -#include <qpe/task.h> #include <qpe/timestring.h> +#include <qpe/palmtoprecord.h> #include <qmessagebox.h> #include <qpopupmenu.h> #include <qtoolbutton.h> @@ -38,24 +41,25 @@ #include <qtimer.h> #include <qapplication.h> -NewTaskDialog::NewTaskDialog( const Task& task, QWidget *parent, +NewTaskDialog::NewTaskDialog( const ToDoEvent& task, QWidget *parent, const char *name, bool modal, WFlags fl ) : NewTaskDialogBase( parent, name, modal, fl ), todo( task ) { - todo.setCategories( task.categories() ); - if ( todo.hasDueDate() ) - date = todo.dueDate(); + qWarning("setting category" ); + todo.setCategory( task.category() ); + if ( todo.hasDate() ) + date = todo.date(); else date = QDate::currentDate(); init(); comboPriority->setCurrentItem( task.priority() - 1 ); checkCompleted->setChecked( task.isCompleted() ); - checkDate->setChecked( task.hasDueDate() ); + checkDate->setChecked( task.hasDate() ); buttonDate->setText( TimeString::longDateString( date ) ); txtTodo->setText( task.description() ); } @@ -74,9 +78,9 @@ NewTaskDialog::NewTaskDialog( int id, QWidget* parent, const char* name, bool m { if ( id != -1 ) { QArray<int> ids( 1 ); ids[0] = id; - todo.setCategories( ids ); + todo.setCategory( Qtopia::Record::idsToString( ids ) ); } init(); } @@ -99,8 +103,9 @@ void NewTaskDialog::init() * Destroys the object and frees any allocated resources */ NewTaskDialog::~NewTaskDialog() { + qWarning("d'tor" ); // no need to delete child widgets, Qt does it all for us } void NewTaskDialog::dateChanged( int y, int m, int d ) { @@ -110,13 +115,24 @@ void NewTaskDialog::dateChanged( int y, int m, int d ) /*! */ -Task NewTaskDialog::todoEntry() +ToDoEvent NewTaskDialog::todoEntry() { - todo.setDueDate( date, checkDate->isChecked() ); + qWarning("todoEntry()" ); + if( checkDate->isChecked() ){ + todo.setDate( date ); + todo.setHasDate( true ); + }else{ + todo.setHasDate( false ); + } + qWarning("todoEntry::category()" ); if ( comboCategory->currentCategory() != -1 ) { - todo.setCategories( comboCategory->currentCategories() ); + 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() ); @@ -131,8 +147,9 @@ Task NewTaskDialog::todoEntry() */ void NewTaskDialog::accept() { + qWarning("accept" ); QString strText = txtTodo->text(); if ( strText.isEmpty() ) { // hmm... just decline it then, the user obviously didn't care about it QDialog::reject(); |