summaryrefslogtreecommitdiff
path: root/core/pim/todo/todoeditor.cpp
blob: c9ade20d6558a8cfd8fe0913f4af52ed70980a84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

#include "todoentryimpl.h"
#include "todoeditor.h"

using namespace Todo;

Editor::Editor() {
    m_accepted = false;
}
Editor::~Editor() {
}
OTodo Editor::newTodo( int cur,
                           QWidget* par) {

    NewTaskDialog e( cur, par, 0, TRUE );


#if defined(Q_WS_QWS) || defined(_WS_QWS_)
    e.showMaximized();
#endif

    int ret = e.exec();
    if ( QDialog::Accepted == ret ) {
        m_accepted = true;
    }else
        m_accepted = false;

    OTodo ev = e.todoEntry();
    ev.setUid(1);

    return ev;
}
OTodo Editor::edit( QWidget *wid,
                        const OTodo& todo ) {
    NewTaskDialog e( todo, wid, 0, TRUE );
    e.setCaption( QObject::tr( "Edit Task" ) );

#if defined(Q_WS_QWS) || defined(_WS_QWS_)
    e.showMaximized();
#endif
    int ret = e.exec();

    OTodo ev = e.todoEntry();
    if ( ret == QDialog::Accepted )
        m_accepted = true;
    else
        m_accepted = false;

    return ev;
}
bool Editor::accepted()const {
    return m_accepted;
}