author | zecke <zecke> | 2004-03-14 20:55:00 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-14 20:55:00 (UTC) |
commit | 594e12002884f0e105eea3cea75504acca5730a2 (patch) (unidiff) | |
tree | 658625e7bb36a64af3f2d9632d6ccccbaa18c627 | |
parent | b7362708c9d5a1765aa22fdcc87a9b3009cda6b9 (diff) | |
download | opie-594e12002884f0e105eea3cea75504acca5730a2.zip opie-594e12002884f0e105eea3cea75504acca5730a2.tar.gz opie-594e12002884f0e105eea3cea75504acca5730a2.tar.bz2 |
Now that using namespace if out of the header fixup todo
-rw-r--r-- | core/pim/todo/otaskeditor.cpp | 2 | ||||
-rw-r--r-- | core/pim/todo/otaskeditor.h | 11 | ||||
-rw-r--r-- | core/pim/todo/todoeditor.cpp | 1 | ||||
-rw-r--r-- | core/pim/todo/todoeditor.h | 6 |
4 files changed, 12 insertions, 8 deletions
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp index f0128bc..a8349c1 100644 --- a/core/pim/todo/otaskeditor.cpp +++ b/core/pim/todo/otaskeditor.cpp | |||
@@ -1,91 +1,93 @@ | |||
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 | ||
9 | using namespace Opie::Ui; | 9 | using namespace Opie::Ui; |
10 | using namespace Opie; | ||
11 | |||
10 | OTaskEditor::OTaskEditor(int cur) | 12 | OTaskEditor::OTaskEditor(int cur) |
11 | : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) { | 13 | : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) { |
12 | init(); | 14 | init(); |
13 | init( cur ); | 15 | init( cur ); |
14 | } | 16 | } |
15 | OTaskEditor::OTaskEditor( const OPimTodo& to) | 17 | OTaskEditor::OTaskEditor( const OPimTodo& to) |
16 | : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) { | 18 | : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) { |
17 | init(); | 19 | init(); |
18 | init( to ); | 20 | init( to ); |
19 | } | 21 | } |
20 | OTaskEditor::~OTaskEditor() { | 22 | OTaskEditor::~OTaskEditor() { |
21 | 23 | ||
22 | } | 24 | } |
23 | void OTaskEditor::init( int cur ) { | 25 | void OTaskEditor::init( int cur ) { |
24 | OPimTodo to; | 26 | OPimTodo to; |
25 | to.setUid( 1 ); // generate a new uid | 27 | to.setUid( 1 ); // generate a new uid |
26 | if ( cur != 0 ) | 28 | if ( cur != 0 ) |
27 | to.setCategories( cur ); | 29 | to.setCategories( cur ); |
28 | load(to); | 30 | load(to); |
29 | } | 31 | } |
30 | void OTaskEditor::init( const OPimTodo& to ) { | 32 | void OTaskEditor::init( const OPimTodo& to ) { |
31 | load( to ); | 33 | load( to ); |
32 | } | 34 | } |
33 | OPimTodo OTaskEditor::todo()const{ | 35 | OPimTodo OTaskEditor::todo()const{ |
34 | qWarning("saving!"); | 36 | qWarning("saving!"); |
35 | OPimTodo to ( m_todo ); | 37 | OPimTodo to ( m_todo ); |
36 | m_overView->save( to ); | 38 | m_overView->save( to ); |
37 | m_stat->save( to ); | 39 | m_stat->save( to ); |
38 | to.setRecurrence( m_rec->recurrence() ); | 40 | to.setRecurrence( m_rec->recurrence() ); |
39 | m_alarm->save( to ); | 41 | m_alarm->save( to ); |
40 | 42 | ||
41 | return to; | 43 | return to; |
42 | } | 44 | } |
43 | void OTaskEditor::load(const OPimTodo& to) { | 45 | void OTaskEditor::load(const OPimTodo& to) { |
44 | m_overView->load( to ); | 46 | m_overView->load( to ); |
45 | m_stat->load( to ); | 47 | m_stat->load( to ); |
46 | m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() ); | 48 | m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() ); |
47 | m_alarm->load( to ); | 49 | m_alarm->load( to ); |
48 | 50 | ||
49 | m_todo = to; | 51 | m_todo = to; |
50 | } | 52 | } |
51 | void OTaskEditor::init() { | 53 | void OTaskEditor::init() { |
52 | setCaption(tr("Task Editor") ); | 54 | setCaption(tr("Task Editor") ); |
53 | 55 | ||
54 | QVBoxLayout* layo = new QVBoxLayout( this ); | 56 | QVBoxLayout* layo = new QVBoxLayout( this ); |
55 | m_tab = new OTabWidget( this ); | 57 | m_tab = new OTabWidget( this ); |
56 | layo->addWidget( m_tab ); | 58 | layo->addWidget( m_tab ); |
57 | 59 | ||
58 | /* | 60 | /* |
59 | * Add the Widgets | 61 | * Add the Widgets |
60 | */ | 62 | */ |
61 | m_overView = new TaskEditorOverView( m_tab ); | 63 | m_overView = new TaskEditorOverView( m_tab ); |
62 | m_tab->addTab( m_overView, "todo/info", tr("Information") ); | 64 | m_tab->addTab( m_overView, "todo/info", tr("Information") ); |
63 | 65 | ||
64 | m_stat = new TaskEditorStatus( m_tab ); | 66 | m_stat = new TaskEditorStatus( m_tab ); |
65 | m_tab->addTab( m_stat, "todo/TodoList", tr("Status") ); | 67 | m_tab->addTab( m_stat, "todo/TodoList", tr("Status") ); |
66 | 68 | ||
67 | m_alarm = new TaskEditorAlarms( m_tab ); | 69 | m_alarm = new TaskEditorAlarms( m_tab ); |
68 | m_tab->addTab( m_alarm, "todo/alarm", tr("Alarms") ); | 70 | m_tab->addTab( m_alarm, "todo/alarm", tr("Alarms") ); |
69 | 71 | ||
70 | // m_remind = new TaskEditorAlarms( m_tab ); | 72 | // m_remind = new TaskEditorAlarms( m_tab ); |
71 | // m_tab->addTab( m_remind, "todo/reminder", tr("Reminders") ); | 73 | // m_tab->addTab( m_remind, "todo/reminder", tr("Reminders") ); |
72 | 74 | ||
73 | // QLabel* lbl = new QLabel( m_tab ); | 75 | // QLabel* lbl = new QLabel( m_tab ); |
74 | // lbl->setText( tr("X-Ref") ); | 76 | // lbl->setText( tr("X-Ref") ); |
75 | // m_tab->addTab( lbl, "todo/xref", tr("X-Ref") ); | 77 | // m_tab->addTab( lbl, "todo/xref", tr("X-Ref") ); |
76 | 78 | ||
77 | m_rec = new OPimRecurrenceWidget( true, QDate::currentDate(), this ); | 79 | m_rec = new OPimRecurrenceWidget( true, QDate::currentDate(), this ); |
78 | m_tab->addTab( m_rec, "repeat", tr("Recurrence") ); | 80 | m_tab->addTab( m_rec, "repeat", tr("Recurrence") ); |
79 | 81 | ||
80 | 82 | ||
81 | /* signal and slots */ | 83 | /* signal and slots */ |
82 | connect(m_overView, SIGNAL(recurranceEnabled(bool) ), | 84 | connect(m_overView, SIGNAL(recurranceEnabled(bool) ), |
83 | m_rec, SLOT(setEnabled(bool) ) ); | 85 | m_rec, SLOT(setEnabled(bool) ) ); |
84 | 86 | ||
85 | /* connect due date changed to the recurrence tab */ | 87 | /* connect due date changed to the recurrence tab */ |
86 | connect(m_stat, SIGNAL(dueDateChanged(const QDate&) ), | 88 | connect(m_stat, SIGNAL(dueDateChanged(const QDate&) ), |
87 | m_rec, SLOT(setStartDate(const QDate&) ) ); | 89 | m_rec, SLOT(setStartDate(const QDate&) ) ); |
88 | 90 | ||
89 | 91 | ||
90 | m_tab->setCurrentTab( m_overView ); | 92 | m_tab->setCurrentTab( m_overView ); |
91 | } | 93 | } |
diff --git a/core/pim/todo/otaskeditor.h b/core/pim/todo/otaskeditor.h index 4a00018..65e7bda 100644 --- a/core/pim/todo/otaskeditor.h +++ b/core/pim/todo/otaskeditor.h | |||
@@ -1,43 +1,44 @@ | |||
1 | #ifndef OPIE_TASK_EDITOR_H | 1 | #ifndef OPIE_TASK_EDITOR_H |
2 | #define OPIE_TASK_EDITOR_H | 2 | #define OPIE_TASK_EDITOR_H |
3 | 3 | ||
4 | #include <qdialog.h> | 4 | #include <qdialog.h> |
5 | 5 | ||
6 | #include <opie2/opimtodo.h> | 6 | #include <opie2/opimtodo.h> |
7 | #include <opie2/otabwidget.h> | 7 | #include <opie2/otabwidget.h> |
8 | #include <opie2/opimrecurrencewidget.h> | 8 | #include <opie2/opimrecurrencewidget.h> |
9 | #include <opie2/opimrecurrencewidget.h> | ||
9 | 10 | ||
10 | class TaskEditorOverView; | 11 | class TaskEditorOverView; |
11 | class TaskEditorStatus; | 12 | class TaskEditorStatus; |
12 | class TaskEditorAlarms; | 13 | class TaskEditorAlarms; |
13 | class QMultiLineEdit; | 14 | class QMultiLineEdit; |
14 | 15 | ||
15 | class OTaskEditor : public QDialog { | 16 | class OTaskEditor : public QDialog { |
16 | Q_OBJECT | 17 | Q_OBJECT |
17 | public: | 18 | public: |
18 | OTaskEditor(int cur); | 19 | OTaskEditor(int cur); |
19 | OTaskEditor( const OPimTodo& todo ); | 20 | OTaskEditor( const Opie::OPimTodo& todo ); |
20 | ~OTaskEditor(); | 21 | ~OTaskEditor(); |
21 | 22 | ||
22 | /* | 23 | /* |
23 | * same as the c'tor but this gives us the | 24 | * same as the c'tor but this gives us the |
24 | * power to 'preload' the dialog | 25 | * power to 'preload' the dialog |
25 | */ | 26 | */ |
26 | void init( int cur ); | 27 | void init( int cur ); |
27 | void init( const OPimTodo& todo ); | 28 | void init( const Opie::OPimTodo& todo ); |
28 | 29 | ||
29 | OPimTodo todo()const; | 30 | Opie::OPimTodo todo()const; |
30 | private: | 31 | private: |
31 | void load( const OPimTodo& ); | 32 | void load( const Opie::OPimTodo& ); |
32 | void init(); | 33 | void init(); |
33 | 34 | ||
34 | Opie::Ui::OTabWidget *m_tab; | 35 | Opie::Ui::OTabWidget *m_tab; |
35 | TaskEditorOverView *m_overView; | 36 | TaskEditorOverView *m_overView; |
36 | TaskEditorStatus *m_stat; | 37 | TaskEditorStatus *m_stat; |
37 | TaskEditorAlarms *m_alarm; | 38 | TaskEditorAlarms *m_alarm; |
38 | TaskEditorAlarms *m_remind; | 39 | TaskEditorAlarms *m_remind; |
39 | OPimRecurrenceWidget *m_rec; | 40 | OPimRecurrenceWidget *m_rec; |
40 | OPimTodo m_todo; | 41 | Opie::OPimTodo m_todo; |
41 | }; | 42 | }; |
42 | 43 | ||
43 | #endif | 44 | #endif |
diff --git a/core/pim/todo/todoeditor.cpp b/core/pim/todo/todoeditor.cpp index 879d809..4b5ecb1 100644 --- a/core/pim/todo/todoeditor.cpp +++ b/core/pim/todo/todoeditor.cpp | |||
@@ -1,62 +1,63 @@ | |||
1 | 1 | ||
2 | #include <qpe/qpeapplication.h> | 2 | #include <qpe/qpeapplication.h> |
3 | 3 | ||
4 | #include "otaskeditor.h" | 4 | #include "otaskeditor.h" |
5 | #include "todoeditor.h" | 5 | #include "todoeditor.h" |
6 | 6 | ||
7 | using namespace Opie; | ||
7 | using namespace Todo; | 8 | using namespace Todo; |
8 | 9 | ||
9 | Editor::Editor() { | 10 | Editor::Editor() { |
10 | m_accepted = false; | 11 | m_accepted = false; |
11 | m_self = 0l; | 12 | m_self = 0l; |
12 | } | 13 | } |
13 | Editor::~Editor() { | 14 | Editor::~Editor() { |
14 | delete m_self; | 15 | delete m_self; |
15 | m_self = 0; | 16 | m_self = 0; |
16 | } | 17 | } |
17 | OPimTodo Editor::newTodo( int cur, | 18 | OPimTodo Editor::newTodo( int cur, |
18 | QWidget*) { | 19 | QWidget*) { |
19 | 20 | ||
20 | OTaskEditor *e = self(); | 21 | OTaskEditor *e = self(); |
21 | e->setCaption( QObject::tr("Enter Task") ); | 22 | e->setCaption( QObject::tr("Enter Task") ); |
22 | e->init( cur ); | 23 | e->init( cur ); |
23 | 24 | ||
24 | int ret = QPEApplication::execDialog( e ); | 25 | int ret = QPEApplication::execDialog( e ); |
25 | 26 | ||
26 | if ( QDialog::Accepted == ret ) { | 27 | if ( QDialog::Accepted == ret ) { |
27 | m_accepted = true; | 28 | m_accepted = true; |
28 | }else | 29 | }else |
29 | m_accepted = false; | 30 | m_accepted = false; |
30 | 31 | ||
31 | OPimTodo ev = e->todo(); | 32 | OPimTodo ev = e->todo(); |
32 | qWarning("Todo uid"); | 33 | qWarning("Todo uid"); |
33 | qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() ); | 34 | qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() ); |
34 | ev.setUid(1); | 35 | ev.setUid(1); |
35 | 36 | ||
36 | return ev; | 37 | return ev; |
37 | } | 38 | } |
38 | OPimTodo Editor::edit( QWidget *, | 39 | OPimTodo Editor::edit( QWidget *, |
39 | const OPimTodo& todo ) { | 40 | const OPimTodo& todo ) { |
40 | OTaskEditor *e = self(); | 41 | OTaskEditor *e = self(); |
41 | e->init( todo ); | 42 | e->init( todo ); |
42 | e->setCaption( QObject::tr( "Edit Task" ) ); | 43 | e->setCaption( QObject::tr( "Edit Task" ) ); |
43 | 44 | ||
44 | int ret = QPEApplication::execDialog( e ); | 45 | int ret = QPEApplication::execDialog( e ); |
45 | 46 | ||
46 | OPimTodo ev = e->todo(); | 47 | OPimTodo ev = e->todo(); |
47 | if ( ret == QDialog::Accepted ) | 48 | if ( ret == QDialog::Accepted ) |
48 | m_accepted = true; | 49 | m_accepted = true; |
49 | else | 50 | else |
50 | m_accepted = false; | 51 | m_accepted = false; |
51 | 52 | ||
52 | return ev; | 53 | return ev; |
53 | } | 54 | } |
54 | bool Editor::accepted()const { | 55 | bool Editor::accepted()const { |
55 | return m_accepted; | 56 | return m_accepted; |
56 | } | 57 | } |
57 | OTaskEditor* Editor::self() { | 58 | OTaskEditor* Editor::self() { |
58 | if (!m_self ) | 59 | if (!m_self ) |
59 | m_self = new OTaskEditor(0); | 60 | m_self = new OTaskEditor(0); |
60 | 61 | ||
61 | return m_self; | 62 | return m_self; |
62 | } | 63 | } |
diff --git a/core/pim/todo/todoeditor.h b/core/pim/todo/todoeditor.h index bcfd205..1ac7f8a 100644 --- a/core/pim/todo/todoeditor.h +++ b/core/pim/todo/todoeditor.h | |||
@@ -1,29 +1,29 @@ | |||
1 | #ifndef OPIE_TODO_EDITOR_H | 1 | #ifndef OPIE_TODO_EDITOR_H |
2 | #define OPIE_TODO_EDITOR_H | 2 | #define OPIE_TODO_EDITOR_H |
3 | 3 | ||
4 | #include <opie2/opimtodo.h> | 4 | #include <opie2/opimtodo.h> |
5 | 5 | ||
6 | 6 | ||
7 | class OTaskEditor; | 7 | class OTaskEditor; |
8 | namespace Todo { | 8 | namespace Todo { |
9 | class Editor { | 9 | class Editor { |
10 | public: | 10 | public: |
11 | Editor(); | 11 | Editor(); |
12 | ~Editor(); | 12 | ~Editor(); |
13 | 13 | ||
14 | OPimTodo newTodo( int currentCatId, | 14 | Opie::OPimTodo newTodo( int currentCatId, |
15 | QWidget* par ); | 15 | QWidget* par ); |
16 | OPimTodo edit( QWidget* par, | 16 | Opie::OPimTodo edit( QWidget* par, |
17 | const OPimTodo& ev = OPimTodo() ); | 17 | const Opie::OPimTodo& ev = Opie::OPimTodo() ); |
18 | 18 | ||
19 | 19 | ||
20 | bool accepted()const; | 20 | bool accepted()const; |
21 | protected: | 21 | protected: |
22 | OTaskEditor* self(); | 22 | OTaskEditor* self(); |
23 | private: | 23 | private: |
24 | bool m_accepted: 1; | 24 | bool m_accepted: 1; |
25 | OTaskEditor* m_self; | 25 | OTaskEditor* m_self; |
26 | }; | 26 | }; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | #endif | 29 | #endif |