summaryrefslogtreecommitdiff
path: root/core/pim/todo/todoeditor.cpp
authorzecke <zecke>2002-10-25 22:12:35 (UTC)
committer zecke <zecke>2002-10-25 22:12:35 (UTC)
commitb682e9d2276c10a5c26773c6797ba1ac176ea4cf (patch) (unidiff)
tree9780ad571f14943e3ad6c3ec34a4e787f8a85217 /core/pim/todo/todoeditor.cpp
parent595407074ac5724eb33aeb151ce27e38fbca21d5 (diff)
downloadopie-b682e9d2276c10a5c26773c6797ba1ac176ea4cf.zip
opie-b682e9d2276c10a5c26773c6797ba1ac176ea4cf.tar.gz
opie-b682e9d2276c10a5c26773c6797ba1ac176ea4cf.tar.bz2
MainWindow i18n change 'Show only over due' to avoid misunderstanding
then 'share' and 'preload' the taskeditor on first request it'll be created but on destroyed until Destruction the interface. This will happen when the apps quits. This should speed up editing and entering quite a lot
Diffstat (limited to 'core/pim/todo/todoeditor.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/todo/todoeditor.cpp32
1 files changed, 22 insertions, 10 deletions
diff --git a/core/pim/todo/todoeditor.cpp b/core/pim/todo/todoeditor.cpp
index e19ab8d..9b8c5cb 100644
--- a/core/pim/todo/todoeditor.cpp
+++ b/core/pim/todo/todoeditor.cpp
@@ -6,26 +6,31 @@ using namespace Todo;
6 6
7Editor::Editor() { 7Editor::Editor() {
8 m_accepted = false; 8 m_accepted = false;
9 m_self = 0l;
9} 10}
10Editor::~Editor() { 11Editor::~Editor() {
12 delete m_self;
13 m_self = 0;
11} 14}
12OTodo Editor::newTodo( int cur, 15OTodo Editor::newTodo( int cur,
13 QWidget* par) { 16 QWidget*) {
14 17
15 OTaskEditor e( cur); 18 OTaskEditor *e = self();
19 e->setCaption( QObject::tr("Enter Task") );
20 e->init( cur );
16 21
17 22
18#if defined(Q_WS_QWS) || defined(_WS_QWS_) 23#if defined(Q_WS_QWS) || defined(_WS_QWS_)
19 e.showMaximized(); 24 e->showMaximized();
20#endif 25#endif
21 26
22 int ret = e.exec(); 27 int ret = e->exec();
23 if ( QDialog::Accepted == ret ) { 28 if ( QDialog::Accepted == ret ) {
24 m_accepted = true; 29 m_accepted = true;
25 }else 30 }else
26 m_accepted = false; 31 m_accepted = false;
27 32
28 OTodo ev = e.todo(); 33 OTodo ev = e->todo();
29 qWarning("Todo uid"); 34 qWarning("Todo uid");
30 qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() ); 35 qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() );
31 ev.setUid(1); 36 ev.setUid(1);
@@ -34,15 +39,16 @@ OTodo Editor::newTodo( int cur,
34} 39}
35OTodo Editor::edit( QWidget *wid, 40OTodo Editor::edit( QWidget *wid,
36 const OTodo& todo ) { 41 const OTodo& todo ) {
37 OTaskEditor e( todo ); 42 OTaskEditor *e = self();
38 e.setCaption( QObject::tr( "Edit Task" ) ); 43 e->init( todo );
44 e->setCaption( QObject::tr( "Edit Task" ) );
39 45
40#if defined(Q_WS_QWS) || defined(_WS_QWS_) 46#if defined(Q_WS_QWS) || defined(_WS_QWS_)
41 e.showMaximized(); 47 e->showMaximized();
42#endif 48#endif
43 int ret = e.exec(); 49 int ret = e->exec();
44 50
45 OTodo ev = e.todo(); 51 OTodo ev = e->todo();
46 if ( ret == QDialog::Accepted ) 52 if ( ret == QDialog::Accepted )
47 m_accepted = true; 53 m_accepted = true;
48 else 54 else
@@ -53,3 +59,9 @@ OTodo Editor::edit( QWidget *wid,
53bool Editor::accepted()const { 59bool Editor::accepted()const {
54 return m_accepted; 60 return m_accepted;
55} 61}
62OTaskEditor* Editor::self() {
63 if (!m_self )
64 m_self = new OTaskEditor(0);
65
66 return m_self;
67}