-rw-r--r-- | core/pim/todo/todoeditor.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/core/pim/todo/todoeditor.cpp b/core/pim/todo/todoeditor.cpp new file mode 100644 index 0000000..c9ade20 --- a/dev/null +++ b/core/pim/todo/todoeditor.cpp | |||
@@ -0,0 +1,53 @@ | |||
1 | |||
2 | #include "todoentryimpl.h" | ||
3 | #include "todoeditor.h" | ||
4 | |||
5 | using namespace Todo; | ||
6 | |||
7 | Editor::Editor() { | ||
8 | m_accepted = false; | ||
9 | } | ||
10 | Editor::~Editor() { | ||
11 | } | ||
12 | OTodo Editor::newTodo( int cur, | ||
13 | QWidget* par) { | ||
14 | |||
15 | NewTaskDialog e( cur, par, 0, TRUE ); | ||
16 | |||
17 | |||
18 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | ||
19 | e.showMaximized(); | ||
20 | #endif | ||
21 | |||
22 | int ret = e.exec(); | ||
23 | if ( QDialog::Accepted == ret ) { | ||
24 | m_accepted = true; | ||
25 | }else | ||
26 | m_accepted = false; | ||
27 | |||
28 | OTodo ev = e.todoEntry(); | ||
29 | ev.setUid(1); | ||
30 | |||
31 | return ev; | ||
32 | } | ||
33 | OTodo Editor::edit( QWidget *wid, | ||
34 | const OTodo& todo ) { | ||
35 | NewTaskDialog e( todo, wid, 0, TRUE ); | ||
36 | e.setCaption( QObject::tr( "Edit Task" ) ); | ||
37 | |||
38 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | ||
39 | e.showMaximized(); | ||
40 | #endif | ||
41 | int ret = e.exec(); | ||
42 | |||
43 | OTodo ev = e.todoEntry(); | ||
44 | if ( ret == QDialog::Accepted ) | ||
45 | m_accepted = true; | ||
46 | else | ||
47 | m_accepted = false; | ||
48 | |||
49 | return ev; | ||
50 | } | ||
51 | bool Editor::accepted()const { | ||
52 | return m_accepted; | ||
53 | } | ||