From b682e9d2276c10a5c26773c6797ba1ac176ea4cf Mon Sep 17 00:00:00 2001 From: zecke Date: Fri, 25 Oct 2002 22:12:35 +0000 Subject: 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 --- (limited to 'core/pim/todo/todoeditor.cpp') 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; Editor::Editor() { m_accepted = false; + m_self = 0l; } Editor::~Editor() { + delete m_self; + m_self = 0; } OTodo Editor::newTodo( int cur, - QWidget* par) { + QWidget*) { - OTaskEditor e( cur); + OTaskEditor *e = self(); + e->setCaption( QObject::tr("Enter Task") ); + e->init( cur ); #if defined(Q_WS_QWS) || defined(_WS_QWS_) - e.showMaximized(); + e->showMaximized(); #endif - int ret = e.exec(); + int ret = e->exec(); if ( QDialog::Accepted == ret ) { m_accepted = true; }else m_accepted = false; - OTodo ev = e.todo(); + OTodo ev = e->todo(); qWarning("Todo uid"); qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() ); ev.setUid(1); @@ -34,15 +39,16 @@ OTodo Editor::newTodo( int cur, } OTodo Editor::edit( QWidget *wid, const OTodo& todo ) { - OTaskEditor e( todo ); - e.setCaption( QObject::tr( "Edit Task" ) ); + OTaskEditor *e = self(); + e->init( todo ); + e->setCaption( QObject::tr( "Edit Task" ) ); #if defined(Q_WS_QWS) || defined(_WS_QWS_) - e.showMaximized(); + e->showMaximized(); #endif - int ret = e.exec(); + int ret = e->exec(); - OTodo ev = e.todo(); + OTodo ev = e->todo(); if ( ret == QDialog::Accepted ) m_accepted = true; else @@ -53,3 +59,9 @@ OTodo Editor::edit( QWidget *wid, bool Editor::accepted()const { return m_accepted; } +OTaskEditor* Editor::self() { + if (!m_self ) + m_self = new OTaskEditor(0); + + return m_self; +} -- cgit v0.9.0.2