-rw-r--r-- | core/pim/todo/otaskeditor.cpp | 2 | ||||
-rw-r--r-- | core/pim/todo/otaskeditor.h | 11 | ||||
-rw-r--r-- | core/pim/todo/todoeditor.cpp | 1 | ||||
-rw-r--r-- | core/pim/todo/todoeditor.h | 6 |
4 files changed, 12 insertions, 8 deletions
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp index f0128bc..a8349c1 100644 --- a/core/pim/todo/otaskeditor.cpp +++ b/core/pim/todo/otaskeditor.cpp @@ -1,91 +1,93 @@ #include <qlayout.h> #include "taskeditoroverview.h" #include "taskeditorstatus.h" #include "taskeditoralarms.h" #include "otaskeditor.h" using namespace Opie::Ui; +using namespace Opie; + OTaskEditor::OTaskEditor(int cur) : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) { init(); init( cur ); } OTaskEditor::OTaskEditor( const OPimTodo& to) : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) { init(); init( to ); } OTaskEditor::~OTaskEditor() { } void OTaskEditor::init( int cur ) { OPimTodo to; to.setUid( 1 ); // generate a new uid if ( cur != 0 ) to.setCategories( cur ); load(to); } void OTaskEditor::init( const OPimTodo& to ) { load( to ); } OPimTodo OTaskEditor::todo()const{ qWarning("saving!"); OPimTodo to ( m_todo ); m_overView->save( to ); m_stat->save( to ); to.setRecurrence( m_rec->recurrence() ); m_alarm->save( to ); return to; } void OTaskEditor::load(const OPimTodo& to) { m_overView->load( to ); m_stat->load( to ); m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() ); m_alarm->load( to ); m_todo = to; } void OTaskEditor::init() { setCaption(tr("Task Editor") ); QVBoxLayout* layo = new QVBoxLayout( this ); m_tab = new OTabWidget( this ); layo->addWidget( m_tab ); /* * Add the Widgets */ m_overView = new TaskEditorOverView( m_tab ); m_tab->addTab( m_overView, "todo/info", tr("Information") ); m_stat = new TaskEditorStatus( m_tab ); m_tab->addTab( m_stat, "todo/TodoList", tr("Status") ); m_alarm = new TaskEditorAlarms( m_tab ); m_tab->addTab( m_alarm, "todo/alarm", tr("Alarms") ); // m_remind = new TaskEditorAlarms( m_tab ); // m_tab->addTab( m_remind, "todo/reminder", tr("Reminders") ); // QLabel* lbl = new QLabel( m_tab ); // lbl->setText( tr("X-Ref") ); // m_tab->addTab( lbl, "todo/xref", tr("X-Ref") ); m_rec = new OPimRecurrenceWidget( true, QDate::currentDate(), this ); m_tab->addTab( m_rec, "repeat", tr("Recurrence") ); /* signal and slots */ connect(m_overView, SIGNAL(recurranceEnabled(bool) ), m_rec, SLOT(setEnabled(bool) ) ); /* connect due date changed to the recurrence tab */ connect(m_stat, SIGNAL(dueDateChanged(const QDate&) ), m_rec, SLOT(setStartDate(const QDate&) ) ); m_tab->setCurrentTab( m_overView ); } diff --git a/core/pim/todo/otaskeditor.h b/core/pim/todo/otaskeditor.h index 4a00018..65e7bda 100644 --- a/core/pim/todo/otaskeditor.h +++ b/core/pim/todo/otaskeditor.h @@ -1,43 +1,44 @@ #ifndef OPIE_TASK_EDITOR_H #define OPIE_TASK_EDITOR_H #include <qdialog.h> #include <opie2/opimtodo.h> #include <opie2/otabwidget.h> #include <opie2/opimrecurrencewidget.h> +#include <opie2/opimrecurrencewidget.h> class TaskEditorOverView; class TaskEditorStatus; class TaskEditorAlarms; class QMultiLineEdit; class OTaskEditor : public QDialog { Q_OBJECT public: OTaskEditor(int cur); - OTaskEditor( const OPimTodo& todo ); + OTaskEditor( const Opie::OPimTodo& todo ); ~OTaskEditor(); /* * same as the c'tor but this gives us the * power to 'preload' the dialog */ void init( int cur ); - void init( const OPimTodo& todo ); + void init( const Opie::OPimTodo& todo ); - OPimTodo todo()const; + Opie::OPimTodo todo()const; private: - void load( const OPimTodo& ); + void load( const Opie::OPimTodo& ); void init(); Opie::Ui::OTabWidget *m_tab; TaskEditorOverView *m_overView; TaskEditorStatus *m_stat; TaskEditorAlarms *m_alarm; TaskEditorAlarms *m_remind; OPimRecurrenceWidget *m_rec; - OPimTodo m_todo; + Opie::OPimTodo m_todo; }; #endif diff --git a/core/pim/todo/todoeditor.cpp b/core/pim/todo/todoeditor.cpp index 879d809..4b5ecb1 100644 --- a/core/pim/todo/todoeditor.cpp +++ b/core/pim/todo/todoeditor.cpp @@ -1,62 +1,63 @@ #include <qpe/qpeapplication.h> #include "otaskeditor.h" #include "todoeditor.h" +using namespace Opie; using namespace Todo; Editor::Editor() { m_accepted = false; m_self = 0l; } Editor::~Editor() { delete m_self; m_self = 0; } OPimTodo Editor::newTodo( int cur, QWidget*) { OTaskEditor *e = self(); e->setCaption( QObject::tr("Enter Task") ); e->init( cur ); int ret = QPEApplication::execDialog( e ); if ( QDialog::Accepted == ret ) { m_accepted = true; }else m_accepted = false; OPimTodo ev = e->todo(); qWarning("Todo uid"); qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() ); ev.setUid(1); return ev; } OPimTodo Editor::edit( QWidget *, const OPimTodo& todo ) { OTaskEditor *e = self(); e->init( todo ); e->setCaption( QObject::tr( "Edit Task" ) ); int ret = QPEApplication::execDialog( e ); OPimTodo ev = e->todo(); if ( ret == QDialog::Accepted ) m_accepted = true; else m_accepted = false; return ev; } bool Editor::accepted()const { return m_accepted; } OTaskEditor* Editor::self() { if (!m_self ) m_self = new OTaskEditor(0); return m_self; } diff --git a/core/pim/todo/todoeditor.h b/core/pim/todo/todoeditor.h index bcfd205..1ac7f8a 100644 --- a/core/pim/todo/todoeditor.h +++ b/core/pim/todo/todoeditor.h @@ -1,29 +1,29 @@ #ifndef OPIE_TODO_EDITOR_H #define OPIE_TODO_EDITOR_H #include <opie2/opimtodo.h> class OTaskEditor; namespace Todo { class Editor { public: Editor(); ~Editor(); - OPimTodo newTodo( int currentCatId, + Opie::OPimTodo newTodo( int currentCatId, QWidget* par ); - OPimTodo edit( QWidget* par, - const OPimTodo& ev = OPimTodo() ); + Opie::OPimTodo edit( QWidget* par, + const Opie::OPimTodo& ev = Opie::OPimTodo() ); bool accepted()const; protected: OTaskEditor* self(); private: bool m_accepted: 1; OTaskEditor* m_self; }; }; #endif |