From 5e2e1e70e6cc7cadce96e42f83951b87e3f2209e Mon Sep 17 00:00:00 2001 From: zecke Date: Mon, 21 Oct 2002 13:45:10 +0000 Subject: 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 --- (limited to 'core/pim') diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index 8377573..bf9fc23 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp @@ -426,8 +426,9 @@ void MainWindow::slotNew() { if ( currentEditor()->accepted() ) { //todo.assignUid(); - currentView()->addEvent( todo ); m_todoMgr.add( todo ); + currentView()->addEvent( todo ); + // I'm afraid we must call this every time now, otherwise // spend expensive time comparing all these strings... 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 +#include +#include +#include + +#include + +#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 ); +} diff --git a/core/pim/todo/otaskeditor.h b/core/pim/todo/otaskeditor.h new file mode 100644 index 0000000..5842fdc --- a/dev/null +++ b/core/pim/todo/otaskeditor.h @@ -0,0 +1,37 @@ +#ifndef OPIE_TASK_EDITOR_H +#define OPIE_TASK_EDITOR_H + +#include + +#include +#include + +class TaskEditorOverViewImpl; +class TaskEditorAdvanced; +class TaskEditorAlarms; +class ORecurranceWidget; +class QMultiLineEdit; +class OTaskEditor : public QDialog { + Q_OBJECT +public: + OTaskEditor(int cur); + OTaskEditor( const OTodo& todo ); + ~OTaskEditor(); + + OTodo todo()const; +private: + void load( const OTodo& ); + void init(); + + OTabWidget *m_tab; + TaskEditorOverViewImpl* m_overView; + TaskEditorAdvanced *m_adv; + TaskEditorAlarms *m_alarm; + TaskEditorAlarms* m_remind; + ORecurranceWidget* m_rec; + QMultiLineEdit* m_line; + int m_uid; + +}; + +#endif diff --git a/core/pim/todo/taskeditoradvanced.ui b/core/pim/todo/taskeditoradvanced.ui new file mode 100644 index 0000000..3ea1346 --- a/dev/null +++ b/core/pim/todo/taskeditoradvanced.ui @@ -0,0 +1,222 @@ + +TaskEditorAdvanced + + QWidget + + name + TaskEditorAdvanced + + + geometry + + 0 + 0 + 236 + 307 + + + + caption + Form2 + + + layoutMargin + + + layoutSpacing + + + + margin + 8 + + + spacing + 6 + + + QLayoutWidget + + name + Layout13 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + lblState + + + text + State: + + + + QComboBox + + + text + Started + + + + + text + Postponed + + + + + text + Finished + + + + + text + Not started + + + + name + cmbState + + + + + + QLayoutWidget + + name + Layout17 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + lblMaintainer + + + text + Maintainer + + + + QLabel + + name + txtMaintainer + + + text + test + + + textFormat + RichText + + + + QLayoutWidget + + name + Layout16 + + + + margin + 0 + + + spacing + 6 + + + QToolButton + + name + tbtMaintainer + + + text + ... + + + + + + + + QLayoutWidget + + name + Layout4 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + txtMode + + + text + Maintain Mode: + + + + QComboBox + + + text + Responsible + + + + + text + Done By + + + + + text + Coordinating + + + + name + cmbMode + + + + + + + diff --git a/core/pim/todo/taskeditoralarms.ui b/core/pim/todo/taskeditoralarms.ui new file mode 100644 index 0000000..ab21796 --- a/dev/null +++ b/core/pim/todo/taskeditoralarms.ui @@ -0,0 +1,148 @@ + +TaskEditorAlarms +zecke + + QWidget + + name + TaskEditorAlarms + + + geometry + + 0 + 0 + 195 + 271 + + + + caption + Form3 + + + layoutMargin + + + + margin + 8 + + + spacing + 6 + + + QLayoutWidget + + name + Layout19 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + txtAlarm + + + text + empty + + + + QListView + + name + lstAlarms + + + + + + QLayoutWidget + + name + Layout23 + + + + margin + 0 + + + spacing + 6 + + + QPushButton + + name + alAdd + + + sizePolicy + + 4 + 0 + + + + text + &Add + + + autoResize + true + + + + QPushButton + + name + alEdit + + + sizePolicy + + 4 + 0 + + + + text + &Edit + + + autoResize + true + + + + QPushButton + + name + alRemove + + + text + &Remove + + + autoResize + true + + + + + + + diff --git a/core/pim/todo/taskeditoroverview.ui b/core/pim/todo/taskeditoroverview.ui new file mode 100644 index 0000000..a6bf645 --- a/dev/null +++ b/core/pim/todo/taskeditoroverview.ui @@ -0,0 +1,542 @@ + +TaskEditorOverView +zecke + + QWidget + + name + TaskEditorOverView + + + geometry + + 0 + 0 + 308 + 445 + + + + caption + Form1 + + + layoutMargin + + + + margin + 4 + + + spacing + 6 + + + QLayoutWidget + + name + Layout11 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + txtPrio + + + text + Priority + + + + QComboBox + + + text + 1 - Very High + + + + + text + 2 - High + + + + + text + 3 - Normal + + + + + text + 4 - Low + + + + + text + 5 - Very Low + + + + name + cmbPrio + + + + + + QLayoutWidget + + name + Layout11 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + txtProgress + + + text + Progress + + + + QComboBox + + + text + 0 % + + + + + text + 20 % + + + + + text + 40 % + + + + + text + 60 % + + + + + text + 80 % + + + + + text + 100 % + + + + name + cmbProgress + + + + + + QLayoutWidget + + name + Layout9 + + + + margin + 0 + + + spacing + 6 + + + QCheckBox + + name + ckbDue + + + text + Due Date: + + + + QPushButton + + name + btnDue + + + enabled + false + + + text + 1 Januar 2002 + + + + + + QLayoutWidget + + name + Layout8 + + + + margin + 0 + + + spacing + 6 + + + QCheckBox + + name + ckbStart + + + text + Start Date: + + + + QPushButton + + name + btnStart + + + enabled + false + + + text + 1 Januar 2001 + + + + + + QLayoutWidget + + name + Layout7 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + lblSum + + + text + Summary + + + + QComboBox + + + text + Complete + + + + + text + work on + + + + + text + buy + + + + + text + organize + + + + + text + get + + + + + text + Update + + + + + text + Create + + + + + text + Plan + + + + + text + Call + + + + + text + Mail + + + + name + cmbSum + + + editable + true + + + + + + QLayoutWidget + + name + Layout10 + + + + margin + 0 + + + spacing + 6 + + + QCheckBox + + name + ckbComp + + + enabled + true + + + text + Completed Date + + + + QPushButton + + name + btnComp + + + enabled + false + + + text + 1 Januar 2002 + + + + + + QCheckBox + + name + ckbCompleted + + + text + Completed + + + + QLayoutWidget + + name + Layout12 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + txtCategory + + + text + Category + + + + CategorySelect + + name + comboCategory + + + sizePolicy + + 7 + 0 + + + + minimumSize + + 60 + 20 + + + + + + + QCheckBox + + name + CheckBox7 + + + text + Enable Recurrance + + + + + name + Spacer1 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + + + + CategorySelect +
qpe/categoryselect.h
+ + -1 + -1 + + 0 + + 7 + 1 + + image0 +
+
+ + + image0 + 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 + + + + + ckbStart + clicked() + TaskEditorOverView + slotStartChecked() + + + ckbDue + clicked() + TaskEditorOverView + slotDueChecked() + + + ckbComp + clicked() + TaskEditorOverView + slotCompletedChecked() + + slotCompletedChecked() + slotDueChecked() + slotStartChecked() + +
diff --git a/core/pim/todo/taskeditoroverviewimpl.cpp b/core/pim/todo/taskeditoroverviewimpl.cpp new file mode 100644 index 0000000..b9b2ae6 --- a/dev/null +++ b/core/pim/todo/taskeditoroverviewimpl.cpp @@ -0,0 +1,169 @@ +#include +#include +#include +#include + +#include +#include +#include + +#include "taskeditoroverviewimpl.h" + +/* + * we need to hack + */ + +TaskEditorOverViewImpl::TaskEditorOverViewImpl( QWidget* parent, const char* name ) + : TaskEditorOverView( parent, name ) { + init(); +} +TaskEditorOverViewImpl::~TaskEditorOverViewImpl() { +} +void TaskEditorOverViewImpl::load( const OTodo& todo) { + QDate date = QDate::currentDate(); + QString str = TimeString::longDateString( date ); + + emit recurranceEnabled( FALSE ); + ckbStart->setChecked( FALSE ); + btnStart->setText( str ); + + ckbComp->setChecked( FALSE ); + btnComp->setText( str ); + + cmbProgress->setCurrentItem( todo.progress()/20 ); + cmbSum->insertItem( todo.summary(), 0 ); + cmbSum->setCurrentItem( 0 ); + + ckbDue->setChecked( todo.hasDueDate() ); + btnDue->setText( TimeString::longDateString( todo.dueDate() ) ); + + cmbPrio->setCurrentItem( todo.priority() -1 ); + ckbCompleted->setChecked( todo.isCompleted() ); + + comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") ); + +} +void TaskEditorOverViewImpl::save( OTodo& to) { + qWarning("save it now"); + if ( ckbDue->isChecked() ) { + to.setDueDate( m_due ); + to.setHasDueDate( true ); + }else + to.setHasDueDate( false ); + if ( comboCategory->currentCategory() != -1 ) { + QArray arr = comboCategory->currentCategories(); + to.setCategories( arr ); + } + to.setPriority( cmbPrio->currentItem() + 1 ); + to.setCompleted( ckbCompleted->isChecked() ); + to.setSummary( cmbSum->currentText() ); + to.setProgress( cmbProgress->currentItem() * 20 ); +} +/* + * here we will init the basic view + * one Popup for each Date Button + * and some other signal and slots connection + */ +void TaskEditorOverViewImpl::init() { + QDate curDate = QDate::currentDate(); + m_start = m_comp = m_due = curDate; + QString str = TimeString::longDateString( curDate ); + + /* Start Date Picker */ + m_startPop = new QPopupMenu(this); + m_startBook = new DateBookMonth(m_startPop, 0, TRUE ); + m_startPop->insertItem( m_startBook ); + connect( m_startBook, SIGNAL( dateClicked(int, int, int) ), + this, SLOT(slotStartChanged(int, int, int) ) ); + + + /* Due Date Picker */ + m_duePop = new QPopupMenu(this); + m_dueBook = new DateBookMonth(m_duePop, 0, TRUE ); + m_duePop->insertItem( m_dueBook ); + connect( m_dueBook, SIGNAL( dateClicked(int, int, int) ), + this, SLOT(slotDueChanged(int, int, int) ) ); + + m_compPop = new QPopupMenu(this); + m_compBook = new DateBookMonth(m_compPop, 0, TRUE ); + m_compPop->insertItem(m_compBook ); + connect( m_compBook, SIGNAL(dateClicked(int, int, int) ), + this, SLOT(slotCompletedChanged(int, int, int) ) ); + + + /* + * another part of the hack + * it's deprecated in Qt2 but + * still available in my qt-copy of Qt3.1beta2 + */ + btnDue->setIsMenuButton( TRUE ); + btnStart->setIsMenuButton( TRUE ); + btnComp->setIsMenuButton( TRUE ); + + /* now connect the hack */ + connect(btnDue, SIGNAL(clicked() ), + this, SLOT(hackySlotHack2() ) ); + connect(btnStart, SIGNAL(clicked() ), + this, SLOT(hackySlotHack1() ) ); + connect(btnComp, SIGNAL(clicked() ), + this, SLOT(hackySlotHack3() ) ); + + /* recurrance */ + connect(CheckBox7, SIGNAL(clicked() ), + this, SLOT(slotRecClicked() ) ); +} + +void TaskEditorOverViewImpl::slotStartChecked() { + qWarning("slotStartChecked"); + btnStart->setEnabled( ckbStart->isChecked() ); +} +void TaskEditorOverViewImpl::slotStartChanged(int y, int m, int d) { + m_start.setYMD( y, m, d ); + btnStart->setText( TimeString::longDateString( m_start ) ); +} +void TaskEditorOverViewImpl::slotDueChecked() { + btnDue->setEnabled( ckbDue->isChecked() ); + qWarning("slotDueChecked"); +} +void TaskEditorOverViewImpl::slotDueChanged(int y, int m, int d ) { + m_due.setYMD(y, m, d ); + btnDue->setText( TimeString::longDateString( m_due ) ); +} +void TaskEditorOverViewImpl::slotCompletedChecked() { + btnComp->setEnabled( ckbComp->isChecked() ); + qWarning("slotCompletedChecked"); +} +void TaskEditorOverViewImpl::slotCompletedChanged(int y, int m, int d) { + m_comp.setYMD( y, m, d ); + btnComp->setText( TimeString::longDateString( m_comp ) ); +} +/* + * called by a button pressed event... + * three slots to avoid ugly name() tests + * to sender() + */ +void TaskEditorOverViewImpl::hackySlotHack1() { + btnStart->setDown( FALSE ); + popup( btnStart, m_startPop ); +} +void TaskEditorOverViewImpl::hackySlotHack2() { + btnDue->setDown( FALSE ); + popup( btnDue, m_duePop ); +} +void TaskEditorOverViewImpl::hackySlotHack3() { + btnComp->setDown( FALSE ); + popup( btnComp, m_compPop ); +} +void TaskEditorOverViewImpl::slotRecClicked() { + qWarning("enabled recurrance"); + emit recurranceEnabled( CheckBox7->isChecked() ); +} +/* + * GPL from TT QPushButton code + */ +void TaskEditorOverViewImpl::popup( QPushButton* pu, QPopupMenu* pop) { + if ( pu->mapToGlobal( QPoint(0, pu->rect().bottom() ) ).y() + pop->sizeHint().height() <= qApp->desktop()->height() ) + pop->exec( pu->mapToGlobal( pu->rect().bottomLeft() ) ); + else + pop->exec( pu->mapToGlobal( pu->rect().topLeft() - QPoint(0, pu->sizeHint().height() ) ) ); +} diff --git a/core/pim/todo/taskeditoroverviewimpl.h b/core/pim/todo/taskeditoroverviewimpl.h new file mode 100644 index 0000000..4fab381 --- a/dev/null +++ b/core/pim/todo/taskeditoroverviewimpl.h @@ -0,0 +1,54 @@ +#ifndef OPIE_TASK_EDITOR_VIEW_IMPL_H +#define OPIE_TASK_EDITOR_VIEW_IMPL_H + +#include + +#include + +#include "taskeditoroverview.h" + +class DateBookMonth; +class QPushButton; +class QPopupMenu; +class TaskEditorOverViewImpl : public TaskEditorOverView { + Q_OBJECT +public: + TaskEditorOverViewImpl(QWidget* parent, const char* name = 0); + ~TaskEditorOverViewImpl(); + + void load( const OTodo& ); + void save( OTodo& ); +signals: + void recurranceEnabled( bool ); + +private: + void init(); + void popup(QPushButton*, QPopupMenu*); + DateBookMonth* m_dueBook; + DateBookMonth* m_startBook; + DateBookMonth* m_compBook; + QDate m_start; + QDate m_comp; + QDate m_due; + QPopupMenu* m_startPop; + QPopupMenu* m_compPop; + QPopupMenu* m_duePop; + bool m_bDue : 1; + +private slots: + void slotStartChecked(); + void slotStartChanged(int, int, int ); + void slotDueChecked(); + void slotDueChanged(int, int, int ); + void slotCompletedChecked(); + void slotCompletedChanged(int, int, int ); + + void hackySlotHack1(); + void hackySlotHack2(); + void hackySlotHack3(); + + void slotRecClicked(); +}; + + +#endif diff --git a/core/pim/todo/todo.pro b/core/pim/todo/todo.pro index d432e78..8f21416 100644 --- a/core/pim/todo/todo.pro +++ b/core/pim/todo/todo.pro @@ -6,7 +6,6 @@ HEADERS = smalltodo.h \ todomanager.h \ mainwindow.h \ todoview.h \ - todoentryimpl.h \ tableview.h \ tableitems.h \ todotemplatemanager.h \ @@ -17,13 +16,14 @@ HEADERS = smalltodo.h \ templatedialog.h \ templatedialogimpl.h \ quickedit.h \ - quickeditimpl.h + quickeditimpl.h \ + otaskeditor.h \ + taskeditoroverviewimpl.h SOURCES = smalltodo.cpp \ todomanager.cpp \ mainwindow.cpp \ main.cpp \ - todoentryimpl.cpp \ tableview.cpp \ tableitems.cpp \ todoview.cpp \ @@ -35,9 +35,11 @@ SOURCES = smalltodo.cpp \ templatedialog.cpp \ templatedialogimpl.cpp \ quickeditimpl.cpp \ - quickedit.cpp + quickedit.cpp \ + otaskeditor.cpp \ + taskeditoroverviewimpl.cpp -INTERFACES = todoentry.ui +INTERFACES = taskeditoradvanced.ui taskeditoralarms.ui taskeditoroverview.ui TARGET = todolist INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include diff --git a/core/pim/todo/todoeditor.cpp b/core/pim/todo/todoeditor.cpp index c9ade20..e19ab8d 100644 --- a/core/pim/todo/todoeditor.cpp +++ b/core/pim/todo/todoeditor.cpp @@ -1,5 +1,5 @@ -#include "todoentryimpl.h" +#include "otaskeditor.h" #include "todoeditor.h" using namespace Todo; @@ -12,7 +12,7 @@ Editor::~Editor() { OTodo Editor::newTodo( int cur, QWidget* par) { - NewTaskDialog e( cur, par, 0, TRUE ); + OTaskEditor e( cur); #if defined(Q_WS_QWS) || defined(_WS_QWS_) @@ -25,14 +25,16 @@ OTodo Editor::newTodo( int cur, }else m_accepted = false; - OTodo ev = e.todoEntry(); + OTodo ev = e.todo(); + qWarning("Todo uid"); + qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() ); ev.setUid(1); return ev; } OTodo Editor::edit( QWidget *wid, const OTodo& todo ) { - NewTaskDialog e( todo, wid, 0, TRUE ); + OTaskEditor e( todo ); e.setCaption( QObject::tr( "Edit Task" ) ); #if defined(Q_WS_QWS) || defined(_WS_QWS_) @@ -40,7 +42,7 @@ OTodo Editor::edit( QWidget *wid, #endif int ret = e.exec(); - OTodo ev = e.todoEntry(); + OTodo ev = e.todo(); if ( ret == QDialog::Accepted ) m_accepted = true; else diff --git a/core/pim/todo/todoentry.ui b/core/pim/todo/todoentry.ui deleted file mode 100644 index 60547f2..0000000 --- a/core/pim/todo/todoentry.ui +++ b/dev/null @@ -1,481 +0,0 @@ - -NewTaskDialogBase -********************************************************************* -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of Qtopia Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -********************************************************************* - - QDialog - - name - NewTaskDialogBase - - - geometry - - 0 - 0 - 239 - 320 - - - - caption - New Task - - - layoutMargin - - - layoutSpacing - - - - margin - 4 - - - spacing - 4 - - - QLayoutWidget - - name - Layout19 - - - layoutSpacing - - - - margin - 0 - - - spacing - 4 - - - QLayoutWidget - - name - Layout6 - - - layoutSpacing - - - - margin - 0 - - - spacing - 4 - - - QComboBox - - - text - 0% - - - - - text - 20% - - - - - text - 40% - - - - - text - 60% - - - - - text - 80% - - - - - text - 100% - - - - name - cmbProg - - - sizePolicy - - 7 - 0 - - - - maximumSize - - 32767 - 32767 - - - - - QCheckBox - - name - checkCompleted - - - text - &Completed - - - - - - QLabel - - name - TextLabel2 - - - text - Priority: - - - - QPushButton - - name - buttonDate - - - enabled - false - - - text - 1 Jan 2001 - - - - QLabel - - name - txtProg - - - frameShape - MShape - - - frameShadow - MShadow - - - text - Progress: - - - - QPushButton - - name - selectGroupButton - - - text - Select - - - - QLabel - - name - txtProg_2 - - - frameShape - MShape - - - frameShadow - MShadow - - - text - Group: - - - - QCheckBox - - name - checkDate - - - text - D&ue - - - - CategorySelect - - name - comboCategory - - - sizePolicy - - 7 - 0 - - - - minimumSize - - 60 - 20 - - - - - QComboBox - - - text - 1 - Very High - - - - - text - 2 - High - - - - - text - 3 - Normal - - - - - text - 4 - Low - - - - - text - 5 - Very Low - - - - name - comboPriority - - - currentItem - 2 - - - - QLabel - - name - TextLabel1 - - - text - Summary: - - - - QLabel - - name - TextLabel3 - - - frameShape - NoFrame - - - text - Category: - - - - QLayoutWidget - - name - Layout8 - - - layoutSpacing - - - - margin - 0 - - - spacing - 4 - - - QLineEdit - - name - lneSum - - - - OClickableLabel - - name - lblDown - - - sizePolicy - - 0 - 0 - - - - minimumSize - - 20 - 20 - - - - maximumSize - - 20 - 20 - - - - - - - - - QMultiLineEdit - - name - txtTodo - - - sizePolicy - - 7 - 7 - - - - wordWrap - WidgetWidth - - - - - - - CategorySelect -
qpe/categoryselect.h
- - -1 - -1 - - 0 - - 7 - 1 - - image0 -
- - OClickableLabel -
opie/oclickablelabel.h
- - -1 - -1 - - 0 - - 5 - 5 - - image0 - clicked() - toggled(bool) - slotOn(bool) -
-
- - - image0 - 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 - - - - - checkDate - toggled(bool) - buttonDate - setEnabled(bool) - - - lblDown - clicked() - NewTaskDialogBase - slotCopy() - - dateChanged( const QString & ) - dateChanged( int, int, int ) - slotCopy() - - - comboPriority - comboCategory - selectGroupButton - cmbProg - checkCompleted - checkDate - buttonDate - lneSum - lblDown - txtTodo - -
diff --git a/core/pim/todo/todoentryimpl.cpp b/core/pim/todo/todoentryimpl.cpp deleted file mode 100644 index 4211ae2..0000000 --- a/core/pim/todo/todoentryimpl.cpp +++ b/dev/null @@ -1,189 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** Copyright (C) 2002 zecke -** -** This file is part of Qtopia Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "todoentryimpl.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -NewTaskDialog::NewTaskDialog( const OTodo& task, QWidget *parent, - const char *name, bool modal, WFlags fl ) - : NewTaskDialogBase( parent, name, modal, fl ), - todo( task ) -{ - todo.setCategories( task.categories() ); - if ( todo.hasDueDate() ) - date = todo.dueDate(); - else - date = QDate::currentDate(); - - init(); - comboPriority->setCurrentItem( task.priority() - 1 ); - - checkCompleted->setChecked( task.isCompleted() ); - checkDate->setChecked( task.hasDueDate() ); - buttonDate->setText( TimeString::longDateString( date ) ); - - txtTodo->setText( task.description() ); - lneSum->setText( task.summary() ); - cmbProg->setCurrentItem( task.progress()/20 ); -} - -/* - * Constructs a NewTaskDialog which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -NewTaskDialog::NewTaskDialog( int id, QWidget* parent, const char* name, bool modal, - WFlags fl ) - : NewTaskDialogBase( parent, name, modal, fl ), - date( QDate::currentDate() ) -{ - if ( id != -1 ) - todo.setCategories( id ); - init(); -} - -void NewTaskDialog::init() -{ - if( layout() != 0 ){ - layout()->setMargin( 2 ); - } - QPopupMenu *m1 = new QPopupMenu( this ); - picker = new DateBookMonth( m1, 0, TRUE ); - m1->insertItem( picker ); - buttonDate->setPopup( m1 ); - comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") ); - - connect( picker, SIGNAL( dateClicked( int, int, int ) ), - this, SLOT( dateChanged( int, int, int ) ) ); - - connect ( selectGroupButton, SIGNAL( clicked() ), - this, SLOT( groupButtonClicked () ) ); - - buttonDate->setText( TimeString::longDateString( date ) ); - picker->setDate( date.year(), date.month(), date.day() ); - lblDown->setPixmap(Resource::loadPixmap("down") ); -} - -/* - * Destroys the object and frees any allocated resources - */ -NewTaskDialog::~NewTaskDialog() -{ - // no need to delete child widgets, Qt does it all for us -} -void NewTaskDialog::dateChanged( int y, int m, int d ) -{ - date = QDate( y, m, d ); - buttonDate->setText( TimeString::longDateString( date ) ); -} -void NewTaskDialog::groupButtonClicked () -{ -/* OContactSelectorDialog cd( this ); - QArray todo_relations = todo.relations ( "addressbook" ); - QValueList selectedContacts; - - for ( uint i=0; i < todo_relations.size(); i++ ){ - printf ("old: %d\n", todo_relations[i]); - selectedContacts.append( todo_relations[i] ); - } - cd.setSelected (selectedContacts); - cd.showMaximized(); - if ( cd.exec() == QDialog::Accepted ){ - selectedContacts = cd.selected (); - QValueListIterator it; - todo.clearRelated("addressbook"); - for( it = selectedContacts.begin(); it != selectedContacts.end(); ++it ){ - printf ("Adding: %d\n", (*it)); - todo.addRelated( "addressbook", (*it) ); - } - - } -*/ -} - -OTodo NewTaskDialog::todoEntry() -{ - if( checkDate->isChecked() ){ - todo.setDueDate( date ); - todo.setHasDueDate( true ); - }else{ - todo.setHasDueDate( false ); - } - if ( comboCategory->currentCategory() != -1 ) { - QArray arr = comboCategory->currentCategories(); - QStringList list; - todo.setCategories( arr ); - } - todo.setPriority( comboPriority->currentItem() + 1 ); - todo.setCompleted( checkCompleted->isChecked() ); - - todo.setDescription( txtTodo->text() ); - todo.setSummary( lneSum->text() ); - QString text = cmbProg->currentText(); - todo.setProgress( text.remove( text.length()-1, 1 ).toUShort() ); - return todo; -} -void NewTaskDialog::slotCopy() -{ - txtTodo->clear(); - txtTodo->setText( lneSum->text() ); -} - -/*! - -*/ - -void NewTaskDialog::accept() -{ - QString strText = txtTodo->text(); - QString strSumm = lneSum->text(); - if ( strSumm.isEmpty() && strText.isEmpty() ) { - // hmm... just decline it then, the user obviously didn't care about it - QDialog::reject(); - return; - } - QDialog::accept(); -} diff --git a/core/pim/todo/todoentryimpl.h b/core/pim/todo/todoentryimpl.h deleted file mode 100644 index 2dfdd22..0000000 --- a/core/pim/todo/todoentryimpl.h +++ b/dev/null @@ -1,65 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of Qtopia Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef NEWTASKDIALOG_H -#define NEWTASKDIALOG_H - -#include "todoentry.h" - -#include -//#include - -#include -#include - -class QLabel; -class QTimer; -class DateBookMonth; - - - -class NewTaskDialog : public NewTaskDialogBase -{ - Q_OBJECT - -public: - NewTaskDialog( const OTodo& task, QWidget *parent = 0, const char* name = 0, - bool modal = FALSE, WFlags fl = 0 ); - NewTaskDialog( int id, QWidget* parent = 0, const char* name = 0, - bool modal = FALSE, WFlags fl = 0 ); - ~NewTaskDialog(); - - OTodo todoEntry(); - -protected slots: - void dateChanged( int y, int m, int d ); - void groupButtonClicked (); - void slotCopy(); -protected: - virtual void accept(); - -private: - void init(); - OTodo todo; - QDate date; - DateBookMonth *picker; -}; - -#endif // NEWTASKDIALOG_H -- cgit v0.9.0.2