summaryrefslogtreecommitdiff
path: root/core/pim/todo/otaskeditor.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/otaskeditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/otaskeditor.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp
index 84f854f..1ed20b4 100644
--- a/core/pim/todo/otaskeditor.cpp
+++ b/core/pim/todo/otaskeditor.cpp
@@ -1,7 +1,4 @@
1#include <qdatetime.h>
2#include <qlabel.h>
3#include <qlayout.h> 1#include <qlayout.h>
4#include <qmultilineedit.h>
5 2
6#include <opie/orecurrancewidget.h> 3#include <opie/orecurrancewidget.h>
7 4
@@ -26,19 +23,17 @@ OTaskEditor::~OTaskEditor() {
26} 23}
27void OTaskEditor::init( int cur ) { 24void OTaskEditor::init( int cur ) {
28 OTodo to; 25 OTodo to;
26 to.setUid( 1 ); // generate a new uid
29 if ( cur != 0 ) 27 if ( cur != 0 )
30 to.setCategories( cur ); 28 to.setCategories( cur );
31 load(to); 29 load(to);
32 m_uid = 1; // generate a new one
33} 30}
34void OTaskEditor::init( const OTodo& to ) { 31void OTaskEditor::init( const OTodo& to ) {
35 load( to ); 32 load( to );
36 m_uid = to.uid();
37} 33}
38OTodo OTaskEditor::todo()const{ 34OTodo OTaskEditor::todo()const{
39 qWarning("saving!"); 35 qWarning("saving!");
40 OTodo to; 36 OTodo to ( m_todo );
41 to.setUid(m_uid );
42 m_overView->save( to ); 37 m_overView->save( to );
43 m_stat->save( to ); 38 m_stat->save( to );
44 to.setRecurrence( m_rec->recurrence() ); 39 to.setRecurrence( m_rec->recurrence() );
@@ -50,11 +45,12 @@ void OTaskEditor::load(const OTodo& to) {
50 m_overView->load( to ); 45 m_overView->load( to );
51 m_stat->load( to ); 46 m_stat->load( to );
52 m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() ); 47 m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() );
53 m_alarm->setEnabled( !to.hasRecurrence() );
54 m_alarm->load( to ); 48 m_alarm->load( to );
49
50 m_todo = to;
55} 51}
56void OTaskEditor::init() { 52void OTaskEditor::init() {
57 setCaption("Task Editor"); 53 setCaption(tr("Task Editor") );
58 54
59 QVBoxLayout* layo = new QVBoxLayout( this ); 55 QVBoxLayout* layo = new QVBoxLayout( this );
60 m_tab = new OTabWidget( this ); 56 m_tab = new OTabWidget( this );