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