summaryrefslogtreecommitdiff
path: root/core/pim/todo/otaskeditor.cpp
authorzecke <zecke>2002-10-21 13:45:10 (UTC)
committer zecke <zecke>2002-10-21 13:45:10 (UTC)
commit5e2e1e70e6cc7cadce96e42f83951b87e3f2209e (patch) (side-by-side diff)
tree6350fbbaf5a4494817a133f46fea44baeb1e3098 /core/pim/todo/otaskeditor.cpp
parent2c61d682a74f9ce2a216cf59c33c3dcecf00a213 (diff)
downloadopie-5e2e1e70e6cc7cadce96e42f83951b87e3f2209e.zip
opie-5e2e1e70e6cc7cadce96e42f83951b87e3f2209e.tar.gz
opie-5e2e1e70e6cc7cadce96e42f83951b87e3f2209e.tar.bz2
Fix a bug where newly added items did not show up in the view
Now we add the Entry to the backend first and then update the view next step is to make place for the new EditorWidget It features Completed/Start Date State Began, Postponed... Maintainer Mode: needs to be done by... Maintainer: Choose a person who is responsible for ( once implemented I hope he master of our feeds is happy ) Recurrance Widget Alarms + Reminders Widget Parent to be added Most of it is not implemented cause first of all OTodo does not know anything about these attributes but this will change soon. I'll start to implement it very soon
Diffstat (limited to 'core/pim/todo/otaskeditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/otaskeditor.cpp83
1 files changed, 83 insertions, 0 deletions
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp
new file mode 100644
index 0000000..e8e922f
--- a/dev/null
+++ b/core/pim/todo/otaskeditor.cpp
@@ -0,0 +1,83 @@
+#include <qdatetime.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qmultilineedit.h>
+
+#include <opie/orecurrancewidget.h>
+
+#include "taskeditoroverviewimpl.h"
+#include "taskeditoradvanced.h"
+#include "taskeditoralarms.h"
+
+#include "otaskeditor.h"
+
+OTaskEditor::OTaskEditor(int cur)
+ : QDialog(0, 0, TRUE ) {
+ init();
+ OTodo to;
+ to.setCategories( cur );
+ load(to);
+ m_uid = 1; // generate a new one
+}
+OTaskEditor::OTaskEditor( const OTodo& to)
+ : QDialog(0, 0, TRUE ) {
+ init();
+ load( to );
+ m_uid = to.uid();
+}
+OTaskEditor::~OTaskEditor() {
+
+}
+OTodo OTaskEditor::todo()const{
+ qWarning("saving!");
+ OTodo to;
+ to.setUid(m_uid );
+ m_overView->save( to );
+ to.setDescription( m_line->text() );
+
+ return to;
+}
+void OTaskEditor::load(const OTodo& to) {
+ m_overView->load( to );
+ m_line->setText( to.description() );
+}
+void OTaskEditor::init() {
+ QVBoxLayout* lay = new QVBoxLayout(this);
+ setCaption("Task Editor");
+ m_tab = new OTabWidget(this);
+
+ /*
+ * Add the Widgets
+ */
+ m_overView = new TaskEditorOverViewImpl(m_tab );
+ m_tab->addTab( m_overView, QString::null, tr("Overview") );
+
+ m_adv = new TaskEditorAdvanced( m_tab );
+ m_line = new QMultiLineEdit(m_adv );
+ QLabel* label = new QLabel(m_adv );
+ label->setText( tr("Description") );
+ ((QGridLayout*) m_adv->layout() )->addWidget( label,3, 0 );
+ ((QGridLayout*) m_adv->layout())->addWidget( m_line,4,0 );
+ m_tab->addTab( m_adv, QString::null, tr("Advanced") );
+
+ m_alarm = new TaskEditorAlarms( m_tab );
+ m_tab->addTab( m_alarm, QString::null, tr("Alarms") );
+
+ m_remind = new TaskEditorAlarms( m_tab );
+ m_tab->addTab( m_remind, QString::null, tr("Reminders") );
+
+ QLabel* lbl = new QLabel(m_tab );
+ lbl->setText( tr("X-Ref") );
+ m_tab->addTab( lbl, QString::null, tr("X-Ref") );
+
+ m_rec = new ORecurranceWidget( true, QDate::currentDate(), this );
+ m_tab->addTab( m_rec, QString::null, tr("Recurrance") );
+
+ lay->addWidget(m_tab );
+
+ /* signal and slots */
+ connect(m_overView, SIGNAL(recurranceEnabled(bool) ),
+ m_rec, SLOT(setEnabled(bool) ) );
+
+ m_tab->setCurrentTab( m_overView );
+}