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.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp
index ab1ce94..d1e50f7 100644
--- a/core/pim/todo/otaskeditor.cpp
+++ b/core/pim/todo/otaskeditor.cpp
@@ -1,90 +1,90 @@
1#include <qlayout.h> 1#include <qlayout.h>
2 2
3#include "taskeditoroverview.h" 3#include "taskeditoroverview.h"
4#include "taskeditorstatus.h" 4#include "taskeditorstatus.h"
5#include "taskeditoralarms.h" 5#include "taskeditoralarms.h"
6 6
7#include "otaskeditor.h" 7#include "otaskeditor.h"
8 8
9OTaskEditor::OTaskEditor(int cur) 9OTaskEditor::OTaskEditor(int cur)
10 : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) { 10 : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) {
11 init(); 11 init();
12 init( cur ); 12 init( cur );
13} 13}
14OTaskEditor::OTaskEditor( const OPimTodo& to) 14OTaskEditor::OTaskEditor( const OPimTodo& to)
15 : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) { 15 : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) {
16 init(); 16 init();
17 init( to ); 17 init( to );
18} 18}
19OTaskEditor::~OTaskEditor() { 19OTaskEditor::~OTaskEditor() {
20 20
21} 21}
22void OTaskEditor::init( int cur ) { 22void OTaskEditor::init( int cur ) {
23 OPimTodo to; 23 OPimTodo to;
24 to.setUid( 1 ); // generate a new uid 24 to.setUid( 1 ); // generate a new uid
25 if ( cur != 0 ) 25 if ( cur != 0 )
26 to.setCategories( cur ); 26 to.setCategories( cur );
27 load(to); 27 load(to);
28} 28}
29void OTaskEditor::init( const OPimTodo& to ) { 29void OTaskEditor::init( const OPimTodo& to ) {
30 load( to ); 30 load( to );
31} 31}
32OPimTodo OTaskEditor::todo()const{ 32OPimTodo OTaskEditor::todo()const{
33 qWarning("saving!"); 33 qWarning("saving!");
34 OPimTodo to ( m_todo ); 34 OPimTodo to ( m_todo );
35 m_overView->save( to ); 35 m_overView->save( to );
36 m_stat->save( to ); 36 m_stat->save( to );
37 to.setRecurrence( m_rec->recurrence() ); 37 to.setRecurrence( m_rec->recurrence() );
38 m_alarm->save( to ); 38 m_alarm->save( to );
39 39
40 return to; 40 return to;
41} 41}
42void OTaskEditor::load(const OPimTodo& to) { 42void OTaskEditor::load(const OPimTodo& to) {
43 m_overView->load( to ); 43 m_overView->load( to );
44 m_stat->load( to ); 44 m_stat->load( to );
45 m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() ); 45 m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() );
46 m_alarm->load( to ); 46 m_alarm->load( to );
47 47
48 m_todo = to; 48 m_todo = to;
49} 49}
50void OTaskEditor::init() { 50void OTaskEditor::init() {
51 setCaption(tr("Task Editor") ); 51 setCaption(tr("Task Editor") );
52 52
53 QVBoxLayout* layo = new QVBoxLayout( this ); 53 QVBoxLayout* layo = new QVBoxLayout( this );
54 m_tab = new OTabWidget( this ); 54 m_tab = new OTabWidget( this );
55 layo->addWidget( m_tab ); 55 layo->addWidget( m_tab );
56 56
57 /* 57 /*
58 * Add the Widgets 58 * Add the Widgets
59 */ 59 */
60 m_overView = new TaskEditorOverView( m_tab ); 60 m_overView = new TaskEditorOverView( m_tab );
61 m_tab->addTab( m_overView, "todo/info", tr("Information") ); 61 m_tab->addTab( m_overView, "todo/info", tr("Information") );
62 62
63 m_stat = new TaskEditorStatus( m_tab ); 63 m_stat = new TaskEditorStatus( m_tab );
64 m_tab->addTab( m_stat, "todo/TodoList", tr("Status") ); 64 m_tab->addTab( m_stat, "todo/TodoList", tr("Status") );
65 65
66 m_alarm = new TaskEditorAlarms( m_tab ); 66 m_alarm = new TaskEditorAlarms( m_tab );
67 m_tab->addTab( m_alarm, "todo/alarm", tr("Alarms") ); 67 m_tab->addTab( m_alarm, "todo/alarm", tr("Alarms") );
68 68
69// m_remind = new TaskEditorAlarms( m_tab ); 69// m_remind = new TaskEditorAlarms( m_tab );
70// m_tab->addTab( m_remind, "todo/reminder", tr("Reminders") ); 70// m_tab->addTab( m_remind, "todo/reminder", tr("Reminders") );
71 71
72// QLabel* lbl = new QLabel( m_tab ); 72// QLabel* lbl = new QLabel( m_tab );
73// lbl->setText( tr("X-Ref") ); 73// lbl->setText( tr("X-Ref") );
74// m_tab->addTab( lbl, "todo/xref", tr("X-Ref") ); 74// m_tab->addTab( lbl, "todo/xref", tr("X-Ref") );
75 75
76 m_rec = new OPimRecurrenceWidget( true, QDate::currentDate(), this ); 76 m_rec = new OPimRecurrenceWidget( true, QDate::currentDate(), this );
77 m_tab->addTab( m_rec, "repeat", tr("Recurrence") ); 77 m_tab->addTab( m_rec, "repeat", tr("Recurrence") );
78 78
79 79
80 /* signal and slots */ 80 /* signal and slots */
81 connect(m_overView, SIGNAL(recurranceEnabled(bool) ), 81 connect(m_overView, SIGNAL(recurranceEnabled(bool) ),
82 m_rec, SLOT(setEnabled(bool) ) ); 82 m_rec, SLOT(setEnabled(bool) ) );
83 83
84 /* connect due date changed to the recurrence tab */ 84 /* connect due date changed to the recurrence tab */
85 connect(m_stat, SIGNAL(dueDateChanged(const QDate&) ), 85 connect(m_stat, SIGNAL(dueDateChanged(const QDate&) ),
86 m_rec, SLOT(setStartDate(const QDate& ) ) ); 86 m_rec, SLOT(setStartDate(const QDate&) ) );
87 87
88 88
89 m_tab->setCurrentTab( m_overView ); 89 m_tab->setCurrentTab( m_overView );
90} 90}