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