summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/.cvsignore4
-rw-r--r--core/pim/todo/otaskeditor.cpp35
-rw-r--r--core/pim/todo/otaskeditor.h15
-rw-r--r--core/pim/todo/quickeditimpl.cpp3
-rw-r--r--core/pim/todo/tableview.cpp3
-rw-r--r--core/pim/todo/taskeditoralarms.cpp76
-rw-r--r--core/pim/todo/taskeditoralarms.h52
-rw-r--r--core/pim/todo/taskeditoralarms.ui144
-rw-r--r--core/pim/todo/taskeditoroverview.cpp317
-rw-r--r--core/pim/todo/taskeditoroverview.h92
-rw-r--r--core/pim/todo/taskeditoroverview.ui542
-rw-r--r--core/pim/todo/taskeditoroverviewimpl.cpp221
-rw-r--r--core/pim/todo/taskeditoroverviewimpl.h55
-rw-r--r--core/pim/todo/todo.pro16
14 files changed, 572 insertions, 1003 deletions
diff --git a/core/pim/todo/.cvsignore b/core/pim/todo/.cvsignore
index dd22a2a..c212d11 100644
--- a/core/pim/todo/.cvsignore
+++ b/core/pim/todo/.cvsignore
@@ -1,10 +1,6 @@
1Makefile* 1Makefile*
2moc_* 2moc_*
3taskeditoradvanced.cpp 3taskeditoradvanced.cpp
4taskeditoradvanced.h 4taskeditoradvanced.h
5taskeditoralarms.cpp
6taskeditoralarms.h
7taskeditoroverview.cpp
8taskeditoroverview.h
9todoentry.cpp 5todoentry.cpp
10todoentry.h 6todoentry.h
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp
index eeb3c0c..e6ebf60 100644
--- a/core/pim/todo/otaskeditor.cpp
+++ b/core/pim/todo/otaskeditor.cpp
@@ -1,100 +1,93 @@
1#include <qdatetime.h> 1#include <qdatetime.h>
2#include <qlayout.h> 2#include <qlayout.h>
3#include <qlabel.h> 3#include <qlabel.h>
4#include <qmultilineedit.h> 4#include <qmultilineedit.h>
5#include <qscrollview.h>
6 5
7#include <opie/orecurrancewidget.h> 6#include <opie/orecurrancewidget.h>
8 7
9#include "taskeditoroverviewimpl.h" 8#include "taskeditoroverview.h"
10#include "taskeditoradvancedimpl.h" 9#include "taskeditoradvancedimpl.h"
11#include "taskeditoralarms.h" 10#include "taskeditoralarms.h"
12 11
13#include "otaskeditor.h" 12#include "otaskeditor.h"
14 13
15OTaskEditor::OTaskEditor(int cur) 14OTaskEditor::OTaskEditor(int cur)
16 : QDialog(0, 0, TRUE ) { 15 : QDialog(0, 0, TRUE ) {
17 init(); 16 init();
18 init( cur ); 17 init( cur );
19} 18}
20OTaskEditor::OTaskEditor( const OTodo& to) 19OTaskEditor::OTaskEditor( const OTodo& to)
21 : QDialog(0, 0, TRUE ) { 20 : QDialog(0, 0, TRUE ) {
22 init(); 21 init();
23 init( to ); 22 init( to );
24} 23}
25OTaskEditor::~OTaskEditor() { 24OTaskEditor::~OTaskEditor() {
26 25
27} 26}
28void OTaskEditor::init( int cur ) { 27void OTaskEditor::init( int cur ) {
29 OTodo to; 28 OTodo to;
30 if ( cur != 0 ) 29 if ( cur != 0 )
31 to.setCategories( cur ); 30 to.setCategories( cur );
32 load(to); 31 load(to);
33 m_uid = 1; // generate a new one 32 m_uid = 1; // generate a new one
34} 33}
35void OTaskEditor::init( const OTodo& to ) { 34void OTaskEditor::init( const OTodo& to ) {
36 load( to ); 35 load( to );
37 m_uid = to.uid(); 36 m_uid = to.uid();
38} 37}
39OTodo OTaskEditor::todo()const{ 38OTodo OTaskEditor::todo()const{
40 qWarning("saving!"); 39 qWarning("saving!");
41 OTodo to; 40 OTodo to;
42 to.setUid(m_uid ); 41 to.setUid(m_uid );
43 m_overView->save( to ); 42 m_overView->save( to );
44 m_adv->save( to ); 43 //m_adv->save( to );
45 to.setRecurrence( m_rec->recurrence() ); 44 to.setRecurrence( m_rec->recurrence() );
46 45
47 return to; 46 return to;
48} 47}
49void OTaskEditor::load(const OTodo& to) { 48void OTaskEditor::load(const OTodo& to) {
50 m_overView->load( to ); 49 m_overView->load( to );
51 m_adv->load( to ); 50 //m_adv->load( to );
52 m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() ); 51 m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() );
53} 52}
54void OTaskEditor::init() { 53void OTaskEditor::init() {
55 QVBoxLayout* lay = new QVBoxLayout(this );
56 QScrollView* view = new QScrollView( this );
57 view->setResizePolicy( QScrollView::AutoOneFit );
58 lay->addWidget( view );
59
60 setCaption("Task Editor"); 54 setCaption("Task Editor");
61 QWidget* container = new QWidget( view->viewport() );
62 view->addChild( container );
63 55
64 QVBoxLayout* layo = new QVBoxLayout( container ); 56 QVBoxLayout* layo = new QVBoxLayout( this );
65 m_tab = new OTabWidget(container ); 57 m_tab = new OTabWidget( this );
66 layo->addWidget( m_tab ); 58 layo->addWidget( m_tab );
59
67 /* 60 /*
68 * Add the Widgets 61 * Add the Widgets
69 */ 62 */
70 m_overView = new TaskEditorOverViewImpl(m_tab ); 63 m_overView = new TaskEditorOverView( m_tab );
71 m_tab->addTab( m_overView, QString::null, tr("Overview") ); 64 m_tab->addTab( m_overView, "TodoList", tr("Overview") );
72 65
73 m_adv = new TaskEditorAdvancedImpl( m_tab ); 66 m_adv = new TaskEditorAdvancedImpl( m_tab );
74 m_tab->addTab( m_adv, QString::null, tr("Advanced") ); 67 m_tab->addTab( m_adv, "todo/advanced", tr("Advanced") );
75 68
76 m_alarm = new TaskEditorAlarms( m_tab ); 69 m_alarm = new TaskEditorAlarms( m_tab );
77 m_tab->addTab( m_alarm, QString::null, tr("Alarms") ); 70 m_tab->addTab( m_alarm, "todo/alarm", tr("Alarms") );
78 71
79 m_remind = new TaskEditorAlarms( m_tab ); 72 m_remind = new TaskEditorAlarms( m_tab );
80 m_tab->addTab( m_remind, QString::null, tr("Reminders") ); 73 m_tab->addTab( m_remind, "todo/reminder", tr("Reminders") );
81 74
82 QLabel* lbl = new QLabel(m_tab ); 75 QLabel* lbl = new QLabel( m_tab );
83 lbl->setText( tr("X-Ref") ); 76 lbl->setText( tr("X-Ref") );
84 m_tab->addTab( lbl, QString::null, tr("X-Ref") ); 77 m_tab->addTab( lbl, "todo/xref", tr("X-Ref") );
85 78
86 m_rec = new ORecurranceWidget( true, QDate::currentDate(), this ); 79 m_rec = new ORecurranceWidget( true, QDate::currentDate(), this );
87 m_tab->addTab( m_rec, QString::null, tr("Recurrance") ); 80 m_tab->addTab( m_rec, "repeat", tr("Recurrance") );
88 81
89 82
90 /* signal and slots */ 83 /* signal and slots */
91 connect(m_overView, SIGNAL(recurranceEnabled(bool) ), 84 connect(m_overView, SIGNAL(recurranceEnabled(bool) ),
92 m_rec, SLOT(setEnabled(bool) ) ); 85 m_rec, SLOT(setEnabled(bool) ) );
93 86
94 /* connect due date changed to the recurrence tab */ 87 /* connect due date changed to the recurrence tab */
95 connect(m_overView, SIGNAL(dueDateChanged(const QDate&) ), 88 connect(m_overView, SIGNAL(dueDateChanged(const QDate&) ),
96 m_rec, SLOT(setStartDate(const QDate& ) ) ); 89 m_rec, SLOT(setStartDate(const QDate& ) ) );
97 90
98 91
99 m_tab->setCurrentTab( m_overView ); 92 m_tab->setCurrentTab( m_overView );
100} 93}
diff --git a/core/pim/todo/otaskeditor.h b/core/pim/todo/otaskeditor.h
index b43abbf..d13e157 100644
--- a/core/pim/todo/otaskeditor.h
+++ b/core/pim/todo/otaskeditor.h
@@ -1,43 +1,44 @@
1#ifndef OPIE_TASK_EDITOR_H 1#ifndef OPIE_TASK_EDITOR_H
2#define OPIE_TASK_EDITOR_H 2#define OPIE_TASK_EDITOR_H
3 3
4#include <qdialog.h> 4#include <qdialog.h>
5 5
6#include <opie/otodo.h> 6#include <opie/otodo.h>
7#include <opie/otabwidget.h> 7#include <opie/otabwidget.h>
8 8
9class TaskEditorOverViewImpl; 9class TaskEditorOverView;
10class TaskEditorAdvancedImpl; 10class TaskEditorAdvancedImpl;
11class TaskEditorAlarms; 11class TaskEditorAlarms;
12class ORecurranceWidget; 12class ORecurranceWidget;
13class QMultiLineEdit; 13class QMultiLineEdit;
14
14class OTaskEditor : public QDialog { 15class OTaskEditor : public QDialog {
15 Q_OBJECT 16 Q_OBJECT
16public: 17public:
17 OTaskEditor(int cur); 18 OTaskEditor(int cur);
18 OTaskEditor( const OTodo& todo ); 19 OTaskEditor( const OTodo& todo );
19 ~OTaskEditor(); 20 ~OTaskEditor();
20 21
21 /* 22 /*
22 * same as the c'tor but this gives us the 23 * same as the c'tor but this gives us the
23 * power to 'preload' the dialog 24 * power to 'preload' the dialog
24 */ 25 */
25 void init( int cur ); 26 void init( int cur );
26 void init( const OTodo& todo ); 27 void init( const OTodo& todo );
27 28
28 OTodo todo()const; 29 OTodo todo()const;
29private: 30private:
30 void load( const OTodo& ); 31 void load( const OTodo& );
31 void init(); 32 void init();
32 33
33 OTabWidget *m_tab; 34 OTabWidget *m_tab;
34 TaskEditorOverViewImpl* m_overView; 35 TaskEditorOverView *m_overView;
35 TaskEditorAdvancedImpl *m_adv; 36 TaskEditorAdvancedImpl *m_adv;
36 TaskEditorAlarms *m_alarm; 37 TaskEditorAlarms *m_alarm;
37 TaskEditorAlarms* m_remind; 38 TaskEditorAlarms *m_remind;
38 ORecurranceWidget* m_rec; 39 ORecurranceWidget *m_rec;
39 int m_uid; 40 int m_uid;
40 41
41}; 42};
42 43
43#endif 44#endif
diff --git a/core/pim/todo/quickeditimpl.cpp b/core/pim/todo/quickeditimpl.cpp
index 7664ee4..91d3131 100644
--- a/core/pim/todo/quickeditimpl.cpp
+++ b/core/pim/todo/quickeditimpl.cpp
@@ -1,110 +1,111 @@
1#include <qaction.h> 1#include <qaction.h>
2#include <qlineedit.h> 2#include <qlineedit.h>
3#include <qwhatsthis.h> 3#include <qwhatsthis.h>
4 4
5#include <qpe/resource.h> 5#include <qpe/resource.h>
6 6
7#include <opie/oclickablelabel.h> 7#include <opie/oclickablelabel.h>
8 8
9#include "mainwindow.h" 9#include "mainwindow.h"
10#include "quickeditimpl.h" 10#include "quickeditimpl.h"
11 11
12 12
13QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible ) 13QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible )
14 : QPEToolBar( (QMainWindow *)parent ), Todo::QuickEdit( (Todo::MainWindow *)parent ) { 14 : QPEToolBar( (QMainWindow *)parent ), Todo::QuickEdit( (Todo::MainWindow *)parent ) {
15 setHorizontalStretchable( TRUE ); 15 setHorizontalStretchable( TRUE );
16 16
17 // Load priority icons 17 // Load priority icons
18 // TODO - probably should be done globally somewhere else, see also tableview.cpp/h 18 // TODO - probably should be done globally somewhere else,
19 // see also tableview.cpp/h, taskeditoroverview.cpp/h
19 priority1 = Resource::loadPixmap( "todo/priority1" ); 20 priority1 = Resource::loadPixmap( "todo/priority1" );
20 priority3 = Resource::loadPixmap( "todo/priority3" ); 21 priority3 = Resource::loadPixmap( "todo/priority3" );
21 priority5 = Resource::loadPixmap( "todo/priority5" ); 22 priority5 = Resource::loadPixmap( "todo/priority5" );
22 23
23 m_lbl = new OClickableLabel( this ); 24 m_lbl = new OClickableLabel( this );
24 m_lbl->setMinimumWidth( 15 ); 25 m_lbl->setMinimumWidth( 15 );
25 m_lbl->setPixmap( priority3 ); 26 m_lbl->setPixmap( priority3 );
26 connect(m_lbl, SIGNAL(clicked() ), this, SLOT(slotPrio()) ); 27 connect(m_lbl, SIGNAL(clicked() ), this, SLOT(slotPrio()) );
27 QWhatsThis::add( m_lbl, tr( "Click here to set the priority of new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); 28 QWhatsThis::add( m_lbl, tr( "Click here to set the priority of new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
28 29
29 m_edit = new QLineEdit( this ); 30 m_edit = new QLineEdit( this );
30 setStretchableWidget( m_edit ); 31 setStretchableWidget( m_edit );
31 QWhatsThis::add( m_edit, tr( "Enter description of new task here.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); 32 QWhatsThis::add( m_edit, tr( "Enter description of new task here.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
32 33
33 QAction *a = new QAction( tr( "More" ), Resource::loadPixmap( "todo/more" ), QString::null, 0, this, 0 ); 34 QAction *a = new QAction( tr( "More" ), Resource::loadPixmap( "todo/more" ), QString::null, 0, this, 0 );
34 connect( a, SIGNAL( activated() ), this, SLOT( slotMore() ) ); 35 connect( a, SIGNAL( activated() ), this, SLOT( slotMore() ) );
35 a->addTo( this ); 36 a->addTo( this );
36 a->setWhatsThis( tr( "Click here to enter additional information for new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); 37 a->setWhatsThis( tr( "Click here to enter additional information for new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
37 38
38 a = new QAction( tr( "Enter" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 ); 39 a = new QAction( tr( "Enter" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 );
39 connect( a, SIGNAL( activated() ), this, SLOT( slotEnter() ) ); 40 connect( a, SIGNAL( activated() ), this, SLOT( slotEnter() ) );
40 a->addTo( this ); 41 a->addTo( this );
41 a->setWhatsThis( tr( "Click here to add new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); 42 a->setWhatsThis( tr( "Click here to add new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
42 43
43 a = new QAction( tr( "Cancel" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 44 a = new QAction( tr( "Cancel" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
44 connect( a, SIGNAL( activated() ), this, SLOT( slotCancel() ) ); 45 connect( a, SIGNAL( activated() ), this, SLOT( slotCancel() ) );
45 a->addTo( this ); 46 a->addTo( this );
46 a->setWhatsThis( tr( "Click here to reset new task information.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); 47 a->setWhatsThis( tr( "Click here to reset new task information.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
47 48
48 m_visible = visible; 49 m_visible = visible;
49 if ( !m_visible ) { 50 if ( !m_visible ) {
50 hide(); 51 hide();
51 } 52 }
52 53
53 m_menu = 0l; 54 m_menu = 0l;
54 reinit(); 55 reinit();
55} 56}
56QuickEditImpl::~QuickEditImpl() { 57QuickEditImpl::~QuickEditImpl() {
57 58
58} 59}
59OTodo QuickEditImpl::todo()const { 60OTodo QuickEditImpl::todo()const {
60 return m_todo; 61 return m_todo;
61} 62}
62QWidget* QuickEditImpl::widget() { 63QWidget* QuickEditImpl::widget() {
63 return this; 64 return this;
64} 65}
65void QuickEditImpl::slotEnter() { 66void QuickEditImpl::slotEnter() {
66 OTodo todo; 67 OTodo todo;
67 68
68 69
69 if (!m_edit->text().isEmpty() ) { 70 if (!m_edit->text().isEmpty() ) {
70 todo.setUid(1 ); // new uid 71 todo.setUid(1 ); // new uid
71 todo.setPriority( m_state ); 72 todo.setPriority( m_state );
72 todo.setSummary( m_edit->text() ); 73 todo.setSummary( m_edit->text() );
73 if ( ((Todo::MainWindow *)parent())->currentCatId() != 0 ) 74 if ( ((Todo::MainWindow *)parent())->currentCatId() != 0 )
74 todo.setCategories( ((Todo::MainWindow *)parent())->currentCatId() ); 75 todo.setCategories( ((Todo::MainWindow *)parent())->currentCatId() );
75 76
76 m_todo = todo; 77 m_todo = todo;
77 commit(); 78 commit();
78 } 79 }
79 m_todo = todo; 80 m_todo = todo;
80 reinit(); 81 reinit();
81} 82}
82void QuickEditImpl::slotPrio() { 83void QuickEditImpl::slotPrio() {
83 m_state -= 2; 84 m_state -= 2;
84 if ( m_state < 1 ) 85 if ( m_state < 1 )
85 m_state = 5; 86 m_state = 5;
86 87
87 switch( m_state ) { 88 switch( m_state ) {
88 case 1: 89 case 1:
89 m_lbl->setPixmap( priority1 ); 90 m_lbl->setPixmap( priority1 );
90 break; 91 break;
91 case 5: 92 case 5:
92 m_lbl->setPixmap( priority5 ); 93 m_lbl->setPixmap( priority5 );
93 break; 94 break;
94 case 3: 95 case 3:
95 default: 96 default:
96 m_lbl->setPixmap( priority3 ); 97 m_lbl->setPixmap( priority3 );
97 break; 98 break;
98 } 99 }
99} 100}
100void QuickEditImpl::slotMore() { 101void QuickEditImpl::slotMore() {
101 // TODO - implement 102 // TODO - implement
102} 103}
103void QuickEditImpl::slotCancel() { 104void QuickEditImpl::slotCancel() {
104 reinit(); 105 reinit();
105} 106}
106void QuickEditImpl::reinit() { 107void QuickEditImpl::reinit() {
107 m_state = 3; 108 m_state = 3;
108 m_lbl->setPixmap( priority3 ); 109 m_lbl->setPixmap( priority3 );
109 m_edit->clear(); 110 m_edit->clear();
110} 111}
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp
index cd6740a..48b4dcc 100644
--- a/core/pim/todo/tableview.cpp
+++ b/core/pim/todo/tableview.cpp
@@ -1,256 +1,257 @@
1/* 1/*
2               =. This file is part of the OPIE Project 2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 <zecke> 3             .=l. Copyright (c) 2002 <zecke>
4           .>+-= 4           .>+-=
5 _;:,     .>    :=|. This program is free software; you can 5 _;:,     .>    :=|. This program is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under 6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public 7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software 8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License, 9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version. 10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_. 11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This program is distributed in the hope that 12    .i_,=:_.      -<s. This program is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more 17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details. 18++=   -.     .`     .: details.
19 :     =  ...= . :.=- 19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU 20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with 21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB. 22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28#include <stdlib.h> 28#include <stdlib.h>
29#include <cmath> 29#include <cmath>
30 30
31#include <qcombobox.h> 31#include <qcombobox.h>
32#include <qlineedit.h> 32#include <qlineedit.h>
33#include <qtimer.h> 33#include <qtimer.h>
34#include <qpoint.h> 34#include <qpoint.h>
35#include <qpopupmenu.h> 35#include <qpopupmenu.h>
36 36
37#include <qpe/config.h> 37#include <qpe/config.h>
38#include <qpe/resource.h> 38#include <qpe/resource.h>
39 39
40#include <opie/orecur.h> 40#include <opie/orecur.h>
41 41
42#include "mainwindow.h" 42#include "mainwindow.h"
43//#include "tableitems.h" 43//#include "tableitems.h"
44#include "tableview.h" 44#include "tableview.h"
45 45
46using namespace Todo; 46using namespace Todo;
47 47
48namespace { 48namespace {
49 static const int BoxSize = 14; 49 static const int BoxSize = 14;
50 static const int RowHeight = 20; 50 static const int RowHeight = 20;
51} 51}
52 52
53 53
54void TableView::initConfig() { 54void TableView::initConfig() {
55 Config config( "todo" ); 55 Config config( "todo" );
56 config.setGroup( "Options" ); 56 config.setGroup( "Options" );
57 m_completeStrokeWidth = config.readNumEntry( "CompleteStrokeWidth", 8 ); 57 m_completeStrokeWidth = config.readNumEntry( "CompleteStrokeWidth", 8 );
58} 58}
59 59
60TableView::TableView( MainWindow* window, QWidget* wid ) 60TableView::TableView( MainWindow* window, QWidget* wid )
61 : QTable( wid ), TodoView( window ) { 61 : QTable( wid ), TodoView( window ) {
62 62
63 // Load icons 63 // Load icons
64 // TODO - probably should be done globally somewhere else, see also quickeditimpl.cpp/h 64 // TODO - probably should be done globally somewhere else,
65 // see also quickeditimpl.cpp/h, taskeditoroverview.cpp/h
65 m_pic_completed = Resource::loadPixmap( "todo/completed" ); 66 m_pic_completed = Resource::loadPixmap( "todo/completed" );
66 QString namestr; 67 QString namestr;
67 for ( unsigned int i = 1; i < 6; i++ ) { 68 for ( unsigned int i = 1; i < 6; i++ ) {
68 namestr = "todo/priority"; 69 namestr = "todo/priority";
69 namestr.append( QString::number( i ) ); 70 namestr.append( QString::number( i ) );
70 m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr ); 71 m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr );
71 } 72 }
72 73
73 setUpdatesEnabled( false ); 74 setUpdatesEnabled( false );
74 viewport()->setUpdatesEnabled( false ); 75 viewport()->setUpdatesEnabled( false );
75 m_enablePaint = false; 76 m_enablePaint = false;
76 setNumRows(0); 77 setNumRows(0);
77 setNumCols(4); 78 setNumCols(4);
78 79
79 horizontalHeader()->setLabel( 0, tr("C.") ); 80 horizontalHeader()->setLabel( 0, tr("C.") );
80 horizontalHeader()->setLabel( 1, tr("Priority") ); 81 horizontalHeader()->setLabel( 1, tr("Priority") );
81 horizontalHeader()->setLabel( 2, tr("Description" ) ); 82 horizontalHeader()->setLabel( 2, tr("Description" ) );
82 horizontalHeader()->setLabel( 3, tr("Deadline") ); 83 horizontalHeader()->setLabel( 3, tr("Deadline") );
83 84
84 setShowDeadline( todoWindow()->showDeadline() ); 85 setShowDeadline( todoWindow()->showDeadline() );
85 86
86 setSorting( TRUE ); 87 setSorting( TRUE );
87 setSelectionMode( NoSelection ); 88 setSelectionMode( NoSelection );
88 89
89 setLeftMargin( 0 ); 90 setLeftMargin( 0 );
90 verticalHeader()->hide(); 91 verticalHeader()->hide();
91 92
92 connect((QTable*)this, SIGNAL( clicked( int, int, int, const QPoint& ) ), 93 connect((QTable*)this, SIGNAL( clicked( int, int, int, const QPoint& ) ),
93 this, SLOT( slotClicked(int, int, int, const QPoint& ) ) ); 94 this, SLOT( slotClicked(int, int, int, const QPoint& ) ) );
94 connect((QTable*)this, SIGNAL( pressed( int, int, int, const QPoint& ) ), 95 connect((QTable*)this, SIGNAL( pressed( int, int, int, const QPoint& ) ),
95 this, SLOT( slotPressed(int, int, int, const QPoint& ) ) ); 96 this, SLOT( slotPressed(int, int, int, const QPoint& ) ) );
96 connect((QTable*)this, SIGNAL(valueChanged(int, int) ), 97 connect((QTable*)this, SIGNAL(valueChanged(int, int) ),
97 this, SLOT( slotValueChanged(int, int) ) ); 98 this, SLOT( slotValueChanged(int, int) ) );
98 connect((QTable*)this, SIGNAL(currentChanged(int, int) ), 99 connect((QTable*)this, SIGNAL(currentChanged(int, int) ),
99 this, SLOT( slotCurrentChanged(int, int) ) ); 100 this, SLOT( slotCurrentChanged(int, int) ) );
100 101
101 m_menuTimer = new QTimer( this ); 102 m_menuTimer = new QTimer( this );
102 connect( m_menuTimer, SIGNAL(timeout()), 103 connect( m_menuTimer, SIGNAL(timeout()),
103 this, SLOT(slotShowMenu()) ); 104 this, SLOT(slotShowMenu()) );
104 105
105 m_enablePaint = true; 106 m_enablePaint = true;
106 setUpdatesEnabled( true ); 107 setUpdatesEnabled( true );
107 viewport()->setUpdatesEnabled( true ); 108 viewport()->setUpdatesEnabled( true );
108 viewport()->update(); 109 viewport()->update();
109 setSortOrder( 0 ); 110 setSortOrder( 0 );
110 setAscending( TRUE ); 111 setAscending( TRUE );
111 m_first = true; 112 m_first = true;
112 113
113 /* now let's init the config */ 114 /* now let's init the config */
114 initConfig(); 115 initConfig();
115} 116}
116/* a new day has started 117/* a new day has started
117 * update the day 118 * update the day
118 */ 119 */
119void TableView::newDay() { 120void TableView::newDay() {
120 clear(); 121 clear();
121 updateView(); 122 updateView();
122} 123}
123TableView::~TableView() { 124TableView::~TableView() {
124 125
125} 126}
126void TableView::slotShowMenu() { 127void TableView::slotShowMenu() {
127 QPopupMenu *menu = todoWindow()->contextMenu( current(), sorted()[currentRow()].recurrence().doesRecur() ); 128 QPopupMenu *menu = todoWindow()->contextMenu( current(), sorted()[currentRow()].recurrence().doesRecur() );
128 menu->exec(QCursor::pos() ); 129 menu->exec(QCursor::pos() );
129 delete menu; 130 delete menu;
130} 131}
131QString TableView::type() const { 132QString TableView::type() const {
132 return QString::fromLatin1( tr("Table View") ); 133 return QString::fromLatin1( tr("Table View") );
133} 134}
134int TableView::current() { 135int TableView::current() {
135 int uid = sorted().uidAt(currentRow() ); 136 int uid = sorted().uidAt(currentRow() );
136 137
137 return uid; 138 return uid;
138} 139}
139QString TableView::currentRepresentation() { 140QString TableView::currentRepresentation() {
140 OTodo to = sorted()[currentRow()]; 141 OTodo to = sorted()[currentRow()];
141 return to.summary().isEmpty() ? to.description().left(20) : to.summary() ; 142 return to.summary().isEmpty() ? to.description().left(20) : to.summary() ;
142} 143}
143/* show overdue */ 144/* show overdue */
144void TableView::showOverDue( bool ) { 145void TableView::showOverDue( bool ) {
145 clear(); 146 clear();
146 updateView(); 147 updateView();
147} 148}
148 149
149void TableView::updateView( ) { 150void TableView::updateView( ) {
150 qWarning("update view"); 151 qWarning("update view");
151 m_row = false; 152 m_row = false;
152 static int id; 153 static int id;
153 id = startTimer(4000 ); 154 id = startTimer(4000 );
154 /* FIXME we want one page to be read! 155 /* FIXME we want one page to be read!
155 * 156 *
156 * Calculate that screensize 157 * Calculate that screensize
157 */ 158 */
158 todoWindow()->setReadAhead( 4 ); 159 todoWindow()->setReadAhead( 4 );
159 sort(); 160 sort();
160 OTodoAccess::List::Iterator it, end; 161 OTodoAccess::List::Iterator it, end;
161 it = sorted().begin(); 162 it = sorted().begin();
162 end = sorted().end(); 163 end = sorted().end();
163 164
164 qWarning("setTodos"); 165 qWarning("setTodos");
165 QTime time; 166 QTime time;
166 time.start(); 167 time.start();
167 m_enablePaint = false; 168 m_enablePaint = false;
168 setUpdatesEnabled( false ); 169 setUpdatesEnabled( false );
169 viewport()->setUpdatesEnabled( false ); 170 viewport()->setUpdatesEnabled( false );
170 171
171 setNumRows( it.count() ); 172 setNumRows( it.count() );
172 if ( it.count() == 0 ) 173 if ( it.count() == 0 )
173 killTimer(id); 174 killTimer(id);
174 175
175// int elc = time.elapsed(); 176// int elc = time.elapsed();
176 setUpdatesEnabled( true ); 177 setUpdatesEnabled( true );
177 viewport()->setUpdatesEnabled( true ); 178 viewport()->setUpdatesEnabled( true );
178 viewport()->update(); 179 viewport()->update();
179 180
180 m_enablePaint = true; 181 m_enablePaint = true;
181// int el = time.elapsed(); 182// int el = time.elapsed();
182} 183}
183void TableView::setTodo( int, const OTodo&) { 184void TableView::setTodo( int, const OTodo&) {
184 sort(); 185 sort();
185 186
186 /* repaint */ 187 /* repaint */
187 repaint(); 188 repaint();
188} 189}
189void TableView::addEvent( const OTodo&) { 190void TableView::addEvent( const OTodo&) {
190 191
191 /* fix problems of not showing the 'Haken' */ 192 /* fix problems of not showing the 'Haken' */
192 updateView(); 193 updateView();
193} 194}
194/* 195/*
195 * find the event 196 * find the event
196 * and then replace the complete row 197 * and then replace the complete row
197 */ 198 */
198void TableView::replaceEvent( const OTodo& ev) { 199void TableView::replaceEvent( const OTodo& ev) {
199 addEvent( ev ); 200 addEvent( ev );
200} 201}
201/* 202/*
202 * re aligning table can be slow too 203 * re aligning table can be slow too
203 * FIXME: look what performs better 204 * FIXME: look what performs better
204 * either this or the old align table 205 * either this or the old align table
205 */ 206 */
206void TableView::removeEvent( int ) { 207void TableView::removeEvent( int ) {
207 updateView(); 208 updateView();
208} 209}
209void TableView::setShowCompleted( bool b) { 210void TableView::setShowCompleted( bool b) {
210 qWarning("Show Completed %d" + b ); 211 qWarning("Show Completed %d" + b );
211 updateView(); 212 updateView();
212} 213}
213void TableView::setShowDeadline( bool b ) { 214void TableView::setShowDeadline( bool b ) {
214 qWarning( "Show DeadLine %d" + b ); 215 qWarning( "Show DeadLine %d" + b );
215 if ( b ) 216 if ( b )
216 showColumn( 3 ); 217 showColumn( 3 );
217 else 218 else
218 hideColumn( 3 ); 219 hideColumn( 3 );
219 220
220 // Try to intelligently size columns 221 // Try to intelligently size columns
221 // TODO - would use width() below, but doesn't have valid value at time of c'tor 222 // TODO - would use width() below, but doesn't have valid value at time of c'tor
222 int col2width = 238; 223 int col2width = 238;
223 int width = m_pic_completed.width(); 224 int width = m_pic_completed.width();
224 setColumnWidth( 0, width ); 225 setColumnWidth( 0, width );
225 col2width -= width; 226 col2width -= width;
226 width = fontMetrics().boundingRect( horizontalHeader()->label( 1 ) ).width() + 8; 227 width = fontMetrics().boundingRect( horizontalHeader()->label( 1 ) ).width() + 8;
227 setColumnWidth( 1, width ); 228 setColumnWidth( 1, width );
228 col2width -= width; 229 col2width -= width;
229 if ( b ) { 230 if ( b ) {
230 width = fontMetrics().boundingRect( horizontalHeader()->label( 3 ) ).width() + 8; 231 width = fontMetrics().boundingRect( horizontalHeader()->label( 3 ) ).width() + 8;
231 setColumnWidth( 3, width ); 232 setColumnWidth( 3, width );
232 col2width -= width; 233 col2width -= width;
233 } 234 }
234 setColumnWidth( 2, col2width ); 235 setColumnWidth( 2, col2width );
235} 236}
236void TableView::setShowCategory( const QString& str) { 237void TableView::setShowCategory( const QString& str) {
237 qWarning("setShowCategory"); 238 qWarning("setShowCategory");
238 if ( str != m_oleCat || m_first ) 239 if ( str != m_oleCat || m_first )
239 updateView(); 240 updateView();
240 241
241 m_oleCat = str; 242 m_oleCat = str;
242 m_first = false; 243 m_first = false;
243 244
244} 245}
245void TableView::clear() { 246void TableView::clear() {
246 setNumRows(0); 247 setNumRows(0);
247} 248}
248void TableView::slotClicked(int row, int col, int, 249void TableView::slotClicked(int row, int col, int,
249 const QPoint& point) { 250 const QPoint& point) {
250 if ( !cellGeometry(row, col ).contains(point ) ) 251 if ( !cellGeometry(row, col ).contains(point ) )
251 return; 252 return;
252 253
253 int ui= sorted().uidAt( row ); 254 int ui= sorted().uidAt( row );
254 255
255 256
256 switch( col ) { 257 switch( col ) {
diff --git a/core/pim/todo/taskeditoralarms.cpp b/core/pim/todo/taskeditoralarms.cpp
new file mode 100644
index 0000000..3cb5576
--- a/dev/null
+++ b/core/pim/todo/taskeditoralarms.cpp
@@ -0,0 +1,76 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 <>
4           .>+-=
5 _;:,     .>    :=|. This program is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This program is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#include "taskeditoralarms.h"
30
31#include <qpe/resource.h>
32
33#include <qlistview.h>
34#include <qpushbutton.h>
35#include <qlayout.h>
36#include <qwhatsthis.h>
37
38TaskEditorAlarms::TaskEditorAlarms( QWidget* parent, const char* name, WFlags fl )
39 : QWidget( parent, name, fl )
40{
41 QGridLayout *layout = new QGridLayout( this, 2, 3, 4, 4 );
42
43 lstAlarms = new QListView( this );
44 layout->addMultiCellWidget( lstAlarms, 0, 0, 0, 2 );
45
46 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), this );
47 //QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) );
48 //connect( btn, SIGNAL( clicked() ), this, SLOT( slotNew() ) );
49 layout->addWidget( btn, 1, 0 );
50
51 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), this );
52 //QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) );
53 //connect( btn, SIGNAL( clicked() ), this, SLOT( slotEdit() ) );
54 layout->addWidget( btn, 1, 1 );
55
56 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), this );
57 //QWhatsThis::add( btn, tr( "Select a checkbook and then click here to delete it." ) );
58 //connect( btn, SIGNAL( clicked() ), this, SLOT( slotDelete() ) );
59 layout->addWidget( btn, 1, 2 );
60}
61
62TaskEditorAlarms::~TaskEditorAlarms()
63{
64}
65
66void TaskEditorAlarms::slotNew()
67{
68}
69
70void TaskEditorAlarms::slotEdit()
71{
72}
73
74void TaskEditorAlarms::slotDelete()
75{
76}
diff --git a/core/pim/todo/taskeditoralarms.h b/core/pim/todo/taskeditoralarms.h
new file mode 100644
index 0000000..f77ded5
--- a/dev/null
+++ b/core/pim/todo/taskeditoralarms.h
@@ -0,0 +1,52 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 <>
4           .>+-=
5 _;:,     .>    :=|. This program is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This program is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#ifndef TASKEDITORALARMS_H
30#define TASKEDITORALARMS_H
31
32#include <qwidget.h>
33
34class QListView;
35
36class TaskEditorAlarms : public QWidget
37{
38 Q_OBJECT
39
40public:
41 TaskEditorAlarms( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
42 ~TaskEditorAlarms();
43
44 QListView* lstAlarms;
45
46protected slots:
47 void slotNew();
48 void slotEdit();
49 void slotDelete();
50};
51
52#endif // TASKEDITORALARMS_H
diff --git a/core/pim/todo/taskeditoralarms.ui b/core/pim/todo/taskeditoralarms.ui
deleted file mode 100644
index 9f8f58b..0000000
--- a/core/pim/todo/taskeditoralarms.ui
+++ b/dev/null
@@ -1,144 +0,0 @@
1<!DOCTYPE UI><UI>
2<class>TaskEditorAlarms</class>
3<author>zecke</author>
4<widget>
5 <class>QWidget</class>
6 <property stdset="1">
7 <name>name</name>
8 <cstring>TaskEditorAlarms</cstring>
9 </property>
10 <property stdset="1">
11 <name>geometry</name>
12 <rect>
13 <x>0</x>
14 <y>0</y>
15 <width>195</width>
16 <height>271</height>
17 </rect>
18 </property>
19 <property>
20 <name>layoutMargin</name>
21 </property>
22 <grid>
23 <property stdset="1">
24 <name>margin</name>
25 <number>8</number>
26 </property>
27 <property stdset="1">
28 <name>spacing</name>
29 <number>6</number>
30 </property>
31 <widget row="0" column="0" >
32 <class>QLayoutWidget</class>
33 <property stdset="1">
34 <name>name</name>
35 <cstring>Layout19</cstring>
36 </property>
37 <vbox>
38 <property stdset="1">
39 <name>margin</name>
40 <number>0</number>
41 </property>
42 <property stdset="1">
43 <name>spacing</name>
44 <number>6</number>
45 </property>
46 <widget>
47 <class>QLabel</class>
48 <property stdset="1">
49 <name>name</name>
50 <cstring>txtAlarm</cstring>
51 </property>
52 <property stdset="1">
53 <name>text</name>
54 <string>empty</string>
55 </property>
56 </widget>
57 <widget>
58 <class>QListView</class>
59 <property stdset="1">
60 <name>name</name>
61 <cstring>lstAlarms</cstring>
62 </property>
63 </widget>
64 </vbox>
65 </widget>
66 <widget row="1" column="0" >
67 <class>QLayoutWidget</class>
68 <property stdset="1">
69 <name>name</name>
70 <cstring>Layout23</cstring>
71 </property>
72 <hbox>
73 <property stdset="1">
74 <name>margin</name>
75 <number>0</number>
76 </property>
77 <property stdset="1">
78 <name>spacing</name>
79 <number>6</number>
80 </property>
81 <widget>
82 <class>QPushButton</class>
83 <property stdset="1">
84 <name>name</name>
85 <cstring>alAdd</cstring>
86 </property>
87 <property stdset="1">
88 <name>sizePolicy</name>
89 <sizepolicy>
90 <hsizetype>4</hsizetype>
91 <vsizetype>0</vsizetype>
92 </sizepolicy>
93 </property>
94 <property stdset="1">
95 <name>text</name>
96 <string>&amp;Add</string>
97 </property>
98 <property stdset="1">
99 <name>autoResize</name>
100 <bool>true</bool>
101 </property>
102 </widget>
103 <widget>
104 <class>QPushButton</class>
105 <property stdset="1">
106 <name>name</name>
107 <cstring>alEdit</cstring>
108 </property>
109 <property stdset="1">
110 <name>sizePolicy</name>
111 <sizepolicy>
112 <hsizetype>4</hsizetype>
113 <vsizetype>0</vsizetype>
114 </sizepolicy>
115 </property>
116 <property stdset="1">
117 <name>text</name>
118 <string>&amp;Edit</string>
119 </property>
120 <property stdset="1">
121 <name>autoResize</name>
122 <bool>true</bool>
123 </property>
124 </widget>
125 <widget>
126 <class>QPushButton</class>
127 <property stdset="1">
128 <name>name</name>
129 <cstring>alRemove</cstring>
130 </property>
131 <property stdset="1">
132 <name>text</name>
133 <string>&amp;Remove</string>
134 </property>
135 <property stdset="1">
136 <name>autoResize</name>
137 <bool>true</bool>
138 </property>
139 </widget>
140 </hbox>
141 </widget>
142 </grid>
143</widget>
144</UI>
diff --git a/core/pim/todo/taskeditoroverview.cpp b/core/pim/todo/taskeditoroverview.cpp
new file mode 100644
index 0000000..9aab76a
--- a/dev/null
+++ b/core/pim/todo/taskeditoroverview.cpp
@@ -0,0 +1,317 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 <>
4           .>+-=
5 _;:,     .>    :=|. This program is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This program is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#include "taskeditoroverview.h"
30
31#include <opie/orecur.h>
32
33#include <qpe/categoryselect.h>
34#include <qpe/datebookmonth.h>
35#include <qpe/resource.h>
36#include <qpe/timestring.h>
37
38#include <qcheckbox.h>
39#include <qcombobox.h>
40#include <qlabel.h>
41#include <qlayout.h>
42#include <qpushbutton.h>
43#include <qtooltip.h>
44#include <qvariant.h>
45#include <qwhatsthis.h>
46
47TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFlags fl )
48 : QWidget( parent, name, fl )
49{
50 // Load icons
51 // TODO - probably should be done globally somewhere else,
52 // see also quickeditimpl.cpp/h, tableview.cpp/h
53 QString namestr;
54 for ( unsigned int i = 1; i < 6; i++ ) {
55 namestr = "todo/priority";
56 namestr.append( QString::number( i ) );
57 m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr );
58 }
59
60 QDate curDate = QDate::currentDate();
61 m_start = m_comp = m_due = curDate;
62 QString curDateStr = TimeString::longDateString( curDate );
63
64 // TODO - add QScrollView for contents
65 QVBoxLayout *vb = new QVBoxLayout( this );
66
67 QScrollView *sv = new QScrollView( this );
68 vb->addWidget( sv );
69 sv->setResizePolicy( QScrollView::AutoOneFit );
70 sv->setFrameStyle( QFrame::NoFrame );
71
72 QWidget *container = new QWidget( sv->viewport() );
73 sv->addChild( container );
74
75 QGridLayout *layout = new QGridLayout( container, 10, 2, 4, 4 );
76
77 // Summary
78 QLabel *label = new QLabel( tr( "Summary:" ), container );
79 layout->addWidget( label, 0, 0 );
80 cmbSum = new QComboBox( TRUE, container );
81 cmbSum->insertItem( tr( "Complete " ) );
82 cmbSum->insertItem( tr( "Work on " ) );
83 cmbSum->insertItem( tr( "Buy " ) );
84 cmbSum->insertItem( tr( "Organize " ) );
85 cmbSum->insertItem( tr( "Get " ) );
86 cmbSum->insertItem( tr( "Update " ) );
87 cmbSum->insertItem( tr( "Create " ) );
88 cmbSum->insertItem( tr( "Plan " ) );
89 cmbSum->insertItem( tr( "Call " ) );
90 cmbSum->insertItem( tr( "Mail " ) );
91 cmbSum->clearEdit();
92 layout->addMultiCellWidget( cmbSum, 1, 1, 0, 1 );
93
94 // Priority
95 label = new QLabel( tr( "Priority:" ), container );
96 layout->addWidget( label, 2, 0 );
97 cmbPrio = new QComboBox( FALSE, container );
98 cmbPrio->setMinimumHeight( 26 );
99 cmbPrio->insertItem( m_pic_priority[ 0 ], tr( "Very High" ) );
100 cmbPrio->insertItem( m_pic_priority[ 1 ], tr( "High" ) );
101 cmbPrio->insertItem( m_pic_priority[ 2 ], tr( "Normal" ) );
102 cmbPrio->insertItem( m_pic_priority[ 3 ], tr( "Low" ) );
103 cmbPrio->insertItem( m_pic_priority[ 4 ], tr( "Very Low" ) );
104 cmbPrio->setCurrentItem( 2 );
105 layout->addWidget( cmbPrio, 2, 1 );
106
107 // Category
108 label = new QLabel( tr( "Category:" ), container );
109 layout->addWidget( label, 3, 0 );
110 comboCategory = new CategorySelect( container );
111 layout->addWidget( comboCategory, 3, 1 );
112
113 // Recurrance
114 CheckBox7 = new QCheckBox( tr( "Recurring task" ), container );
115 layout->addMultiCellWidget( CheckBox7, 4, 4, 0, 1 );
116 connect( CheckBox7, SIGNAL(clicked() ), this, SLOT( slotRecClicked() ) );
117
118 QSpacerItem *spacer = new QSpacerItem( 5, 5, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding );
119 layout->addItem( spacer, 5, 0 );
120
121 // Start date
122 ckbStart = new QCheckBox( tr( "Start Date:" ), container );
123 layout->addWidget( ckbStart, 6, 0 );
124 connect( ckbStart, SIGNAL( clicked() ), this, SLOT( slotStartChecked() ) );
125 btnStart = new QPushButton( curDateStr, container );
126 btnStart->setEnabled( FALSE );
127 layout->addWidget( btnStart, 6, 1 );
128
129 QPopupMenu *popup = new QPopupMenu( this );
130 m_startBook = new DateBookMonth( popup, 0, TRUE );
131 popup->insertItem( m_startBook );
132 btnStart->setPopup( popup );
133 connect( m_startBook, SIGNAL( dateClicked( int, int, int ) ),
134 this, SLOT( slotStartChanged( int, int, int ) ) );
135
136 // Due date
137 ckbDue = new QCheckBox( tr( "Due Date:" ), container );
138 layout->addWidget( ckbDue, 7, 0 );
139 connect( ckbDue, SIGNAL( clicked() ), this, SLOT( slotDueChecked() ) );
140 btnDue = new QPushButton( curDateStr, container );
141 btnDue->setEnabled( FALSE );
142 layout->addWidget( btnDue, 7, 1 );
143
144 popup = new QPopupMenu( this );
145 m_dueBook = new DateBookMonth( popup, 0, TRUE );
146 popup->insertItem( m_dueBook );
147 btnDue->setPopup( popup );
148 connect( m_dueBook, SIGNAL( dateClicked( int, int, int ) ),
149 this, SLOT( slotDueChanged( int, int, int ) ) );
150
151 // Progress
152 label = new QLabel( tr( "Progress:" ), container );
153 layout->addWidget( label, 8, 0 );
154 cmbProgress = new QComboBox( FALSE, container );
155 cmbProgress->insertItem( tr( "0 %" ) );
156 cmbProgress->insertItem( tr( "20 %" ) );
157 cmbProgress->insertItem( tr( "40 %" ) );
158 cmbProgress->insertItem( tr( "60 %" ) );
159 cmbProgress->insertItem( tr( "80 %" ) );
160 cmbProgress->insertItem( tr( "100 %" ) );
161 layout->addWidget( cmbProgress, 8, 1 );
162
163 // Completed
164 ckbComp = new QCheckBox( tr( "Completed:" ), container );
165 layout->addWidget( ckbComp, 9, 0 );
166 connect( ckbComp, SIGNAL( clicked() ), this, SLOT( slotCompChecked() ) );
167 btnComp = new QPushButton( curDateStr, container );
168 btnComp->setEnabled( FALSE );
169 layout->addWidget( btnComp, 9, 1 );
170
171 popup = new QPopupMenu( this );
172 m_compBook = new DateBookMonth( popup, 0, TRUE );
173 popup->insertItem( m_compBook );
174 btnComp->setPopup( popup );
175 connect( m_compBook, SIGNAL( dateClicked( int, int, int ) ),
176 this, SLOT( slotCompChanged( int, int, int ) ) );
177}
178
179TaskEditorOverView::~TaskEditorOverView()
180{
181}
182
183void TaskEditorOverView::load( const OTodo& todo )
184{
185 /*
186 * now that we're 'preloaded' we
187 * need to disable the buttons
188 * holding the dat
189 */
190 btnDue->setEnabled( FALSE );
191 btnComp->setEnabled( FALSE );
192 btnStart->setEnabled( FALSE );
193
194 /*
195 * get some basic dateinfos for now
196 */
197 QDate date = QDate::currentDate();
198 QString str = TimeString::longDateString( date );
199
200 CheckBox7->setChecked( todo.recurrence().doesRecur() );
201 emit recurranceEnabled( todo.recurrence().doesRecur() );
202
203 ckbStart->setChecked( todo.hasStartDate() );
204 btnStart->setEnabled( todo.hasStartDate() );
205 if ( todo.hasStartDate() )
206 {
207 m_start = todo.startDate();
208 btnStart->setText( TimeString::longDateString( m_start ) );
209 }
210 else
211 btnStart->setText( str );
212
213 ckbComp->setChecked( todo.hasCompletedDate() );
214 btnComp->setEnabled( todo.hasCompletedDate() );
215 if ( todo.hasCompletedDate() )
216 {
217 m_comp = todo.completedDate();
218 btnComp->setText( TimeString::longDateString( m_comp ) );
219 }
220 else
221 btnComp->setText( str );
222
223 cmbProgress->setCurrentItem( todo.progress() / 20 );
224 cmbSum->insertItem( todo.summary(), 0 );
225 cmbSum->setCurrentItem( 0 );
226
227 ckbDue->setChecked( todo.hasDueDate() );
228 btnDue->setText( TimeString::longDateString( todo.dueDate() ) );
229 btnDue->setEnabled( todo.hasDueDate() );
230 m_due = todo.dueDate();
231
232 cmbPrio->setCurrentItem( todo.priority() - 1 );
233 ckbComp->setChecked( todo.isCompleted() );
234
235 comboCategory->setCategories( todo.categories(), "Todo List", tr( "Todo List" ) );
236}
237
238void TaskEditorOverView::save( OTodo &to )
239{
240 /* a invalid date */
241 QDate inval;
242 /* save our info back */
243
244 /* due date */
245 if ( ckbDue->isChecked() )
246 {
247 to.setDueDate( m_due );
248 to.setHasDueDate( true );
249 }
250 else
251 to.setHasDueDate( false );
252
253 /* start date */
254 if ( ckbStart->isChecked() )
255 {
256 to.setStartDate( m_start );
257 }
258 else
259 to.setStartDate( inval );
260
261 /* comp date */
262 if ( ckbComp->isChecked() )
263 {
264 to.setCompletedDate( m_comp );
265 }
266 else
267 to.setCompletedDate( inval );
268
269
270 if ( comboCategory->currentCategory() != -1 )
271 {
272 QArray<int> arr = comboCategory->currentCategories();
273 to.setCategories( arr );
274 }
275 to.setPriority( cmbPrio->currentItem() + 1 );
276 to.setCompleted( ckbComp->isChecked() );
277 to.setSummary( cmbSum->currentText() );
278 to.setProgress( cmbProgress->currentItem() * 20 );
279}
280
281void TaskEditorOverView::slotRecClicked()
282{
283 emit recurranceEnabled( CheckBox7->isChecked() );
284}
285
286void TaskEditorOverView::slotStartChecked()
287{
288 btnStart->setEnabled( ckbStart->isChecked() );
289}
290
291void TaskEditorOverView::slotCompChecked()
292{
293 btnComp->setEnabled( ckbComp->isChecked() );
294}
295
296void TaskEditorOverView::slotDueChecked()
297{
298 btnDue->setEnabled( ckbDue->isChecked() );
299}
300
301void TaskEditorOverView::slotStartChanged(int y, int m, int d)
302{
303 m_start.setYMD( y, m, d );
304 btnStart->setText( TimeString::longDateString( m_start ) );
305}
306
307void TaskEditorOverView::slotCompChanged(int y, int m, int d)
308{
309 m_comp.setYMD( y, m, d );
310 btnComp->setText( TimeString::longDateString( m_comp ) );
311}
312
313void TaskEditorOverView::slotDueChanged(int y, int m, int d)
314{
315 m_due.setYMD( y, m, d );
316 btnDue->setText( TimeString::longDateString( m_due ) );
317}
diff --git a/core/pim/todo/taskeditoroverview.h b/core/pim/todo/taskeditoroverview.h
new file mode 100644
index 0000000..223b72c
--- a/dev/null
+++ b/core/pim/todo/taskeditoroverview.h
@@ -0,0 +1,92 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 <>
4           .>+-=
5 _;:,     .>    :=|. This program is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This program is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#ifndef TASKEDITOROVERVIEW_H
30#define TASKEDITOROVERVIEW_H
31
32#include <opie/otodo.h>
33
34#include <qdatetime.h>
35#include <qpixmap.h>
36#include <qwidget.h>
37
38class CategorySelect;
39class DateBookMonth;
40class QCheckBox;
41class QComboBox;
42class QPushButton;
43
44class TaskEditorOverView : public QWidget
45{
46 Q_OBJECT
47
48public:
49 TaskEditorOverView( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
50 ~TaskEditorOverView();
51
52 QComboBox *cmbSum;
53 QComboBox *cmbPrio;
54 QComboBox *cmbProgress;
55 QCheckBox *ckbDue;
56 QPushButton *btnDue;
57 QCheckBox *ckbStart;
58 QPushButton *btnStart;
59 QCheckBox *ckbComp;
60 QPushButton *btnComp;
61 CategorySelect *comboCategory;
62 QCheckBox *CheckBox7;
63
64 void load( const OTodo & );
65 void save( OTodo & );
66
67signals:
68 void recurranceEnabled( bool );
69 void dueDateChanged( const QDate& date );
70
71protected:
72 QPixmap m_pic_priority[ 5 ];
73
74private:
75 QDate m_start;
76 QDate m_comp;
77 QDate m_due;
78 DateBookMonth *m_startBook;
79 DateBookMonth *m_compBook;
80 DateBookMonth *m_dueBook;
81
82protected slots:
83 void slotRecClicked();
84 void slotStartChecked();
85 void slotCompChecked();
86 void slotDueChecked();
87 void slotStartChanged( int, int, int );
88 void slotCompChanged( int, int, int );
89 void slotDueChanged( int, int, int );
90};
91
92#endif // TASKEDITOROVERVIEW_H
diff --git a/core/pim/todo/taskeditoroverview.ui b/core/pim/todo/taskeditoroverview.ui
deleted file mode 100644
index a6bf645..0000000
--- a/core/pim/todo/taskeditoroverview.ui
+++ b/dev/null
@@ -1,542 +0,0 @@
1<!DOCTYPE UI><UI>
2<class>TaskEditorOverView</class>
3<author>zecke</author>
4<widget>
5 <class>QWidget</class>
6 <property stdset="1">
7 <name>name</name>
8 <cstring>TaskEditorOverView</cstring>
9 </property>
10 <property stdset="1">
11 <name>geometry</name>
12 <rect>
13 <x>0</x>
14 <y>0</y>
15 <width>308</width>
16 <height>445</height>
17 </rect>
18 </property>
19 <property stdset="1">
20 <name>caption</name>
21 <string>Form1</string>
22 </property>
23 <property>
24 <name>layoutMargin</name>
25 </property>
26 <grid>
27 <property stdset="1">
28 <name>margin</name>
29 <number>4</number>
30 </property>
31 <property stdset="1">
32 <name>spacing</name>
33 <number>6</number>
34 </property>
35 <widget row="5" column="0" rowspan="1" colspan="2" >
36 <class>QLayoutWidget</class>
37 <property stdset="1">
38 <name>name</name>
39 <cstring>Layout11</cstring>
40 </property>
41 <hbox>
42 <property stdset="1">
43 <name>margin</name>
44 <number>0</number>
45 </property>
46 <property stdset="1">
47 <name>spacing</name>
48 <number>6</number>
49 </property>
50 <widget>
51 <class>QLabel</class>
52 <property stdset="1">
53 <name>name</name>
54 <cstring>txtPrio</cstring>
55 </property>
56 <property stdset="1">
57 <name>text</name>
58 <string>Priority</string>
59 </property>
60 </widget>
61 <widget>
62 <class>QComboBox</class>
63 <item>
64 <property>
65 <name>text</name>
66 <string>1 - Very High</string>
67 </property>
68 </item>
69 <item>
70 <property>
71 <name>text</name>
72 <string>2 - High</string>
73 </property>
74 </item>
75 <item>
76 <property>
77 <name>text</name>
78 <string>3 - Normal</string>
79 </property>
80 </item>
81 <item>
82 <property>
83 <name>text</name>
84 <string>4 - Low</string>
85 </property>
86 </item>
87 <item>
88 <property>
89 <name>text</name>
90 <string>5 - Very Low</string>
91 </property>
92 </item>
93 <property stdset="1">
94 <name>name</name>
95 <cstring>cmbPrio</cstring>
96 </property>
97 </widget>
98 </hbox>
99 </widget>
100 <widget row="4" column="0" rowspan="1" colspan="2" >
101 <class>QLayoutWidget</class>
102 <property stdset="1">
103 <name>name</name>
104 <cstring>Layout11</cstring>
105 </property>
106 <hbox>
107 <property stdset="1">
108 <name>margin</name>
109 <number>0</number>
110 </property>
111 <property stdset="1">
112 <name>spacing</name>
113 <number>6</number>
114 </property>
115 <widget>
116 <class>QLabel</class>
117 <property stdset="1">
118 <name>name</name>
119 <cstring>txtProgress</cstring>
120 </property>
121 <property stdset="1">
122 <name>text</name>
123 <string>Progress</string>
124 </property>
125 </widget>
126 <widget>
127 <class>QComboBox</class>
128 <item>
129 <property>
130 <name>text</name>
131 <string>0 %</string>
132 </property>
133 </item>
134 <item>
135 <property>
136 <name>text</name>
137 <string>20 %</string>
138 </property>
139 </item>
140 <item>
141 <property>
142 <name>text</name>
143 <string>40 %</string>
144 </property>
145 </item>
146 <item>
147 <property>
148 <name>text</name>
149 <string>60 %</string>
150 </property>
151 </item>
152 <item>
153 <property>
154 <name>text</name>
155 <string>80 %</string>
156 </property>
157 </item>
158 <item>
159 <property>
160 <name>text</name>
161 <string>100 %</string>
162 </property>
163 </item>
164 <property stdset="1">
165 <name>name</name>
166 <cstring>cmbProgress</cstring>
167 </property>
168 </widget>
169 </hbox>
170 </widget>
171 <widget row="2" column="0" rowspan="1" colspan="2" >
172 <class>QLayoutWidget</class>
173 <property stdset="1">
174 <name>name</name>
175 <cstring>Layout9</cstring>
176 </property>
177 <hbox>
178 <property stdset="1">
179 <name>margin</name>
180 <number>0</number>
181 </property>
182 <property stdset="1">
183 <name>spacing</name>
184 <number>6</number>
185 </property>
186 <widget>
187 <class>QCheckBox</class>
188 <property stdset="1">
189 <name>name</name>
190 <cstring>ckbDue</cstring>
191 </property>
192 <property stdset="1">
193 <name>text</name>
194 <string>Due Date:</string>
195 </property>
196 </widget>
197 <widget>
198 <class>QPushButton</class>
199 <property stdset="1">
200 <name>name</name>
201 <cstring>btnDue</cstring>
202 </property>
203 <property stdset="1">
204 <name>enabled</name>
205 <bool>false</bool>
206 </property>
207 <property stdset="1">
208 <name>text</name>
209 <string>1 Januar 2002</string>
210 </property>
211 </widget>
212 </hbox>
213 </widget>
214 <widget row="1" column="0" rowspan="1" colspan="2" >
215 <class>QLayoutWidget</class>
216 <property stdset="1">
217 <name>name</name>
218 <cstring>Layout8</cstring>
219 </property>
220 <hbox>
221 <property stdset="1">
222 <name>margin</name>
223 <number>0</number>
224 </property>
225 <property stdset="1">
226 <name>spacing</name>
227 <number>6</number>
228 </property>
229 <widget>
230 <class>QCheckBox</class>
231 <property stdset="1">
232 <name>name</name>
233 <cstring>ckbStart</cstring>
234 </property>
235 <property stdset="1">
236 <name>text</name>
237 <string>Start Date:</string>
238 </property>
239 </widget>
240 <widget>
241 <class>QPushButton</class>
242 <property stdset="1">
243 <name>name</name>
244 <cstring>btnStart</cstring>
245 </property>
246 <property stdset="1">
247 <name>enabled</name>
248 <bool>false</bool>
249 </property>
250 <property stdset="1">
251 <name>text</name>
252 <string>1 Januar 2001</string>
253 </property>
254 </widget>
255 </hbox>
256 </widget>
257 <widget row="0" column="0" rowspan="1" colspan="2" >
258 <class>QLayoutWidget</class>
259 <property stdset="1">
260 <name>name</name>
261 <cstring>Layout7</cstring>
262 </property>
263 <hbox>
264 <property stdset="1">
265 <name>margin</name>
266 <number>0</number>
267 </property>
268 <property stdset="1">
269 <name>spacing</name>
270 <number>6</number>
271 </property>
272 <widget>
273 <class>QLabel</class>
274 <property stdset="1">
275 <name>name</name>
276 <cstring>lblSum</cstring>
277 </property>
278 <property stdset="1">
279 <name>text</name>
280 <string>Summary</string>
281 </property>
282 </widget>
283 <widget>
284 <class>QComboBox</class>
285 <item>
286 <property>
287 <name>text</name>
288 <string>Complete</string>
289 </property>
290 </item>
291 <item>
292 <property>
293 <name>text</name>
294 <string>work on</string>
295 </property>
296 </item>
297 <item>
298 <property>
299 <name>text</name>
300 <string>buy</string>
301 </property>
302 </item>
303 <item>
304 <property>
305 <name>text</name>
306 <string>organize</string>
307 </property>
308 </item>
309 <item>
310 <property>
311 <name>text</name>
312 <string>get</string>
313 </property>
314 </item>
315 <item>
316 <property>
317 <name>text</name>
318 <string>Update</string>
319 </property>
320 </item>
321 <item>
322 <property>
323 <name>text</name>
324 <string>Create</string>
325 </property>
326 </item>
327 <item>
328 <property>
329 <name>text</name>
330 <string>Plan</string>
331 </property>
332 </item>
333 <item>
334 <property>
335 <name>text</name>
336 <string>Call</string>
337 </property>
338 </item>
339 <item>
340 <property>
341 <name>text</name>
342 <string>Mail</string>
343 </property>
344 </item>
345 <property stdset="1">
346 <name>name</name>
347 <cstring>cmbSum</cstring>
348 </property>
349 <property stdset="1">
350 <name>editable</name>
351 <bool>true</bool>
352 </property>
353 </widget>
354 </hbox>
355 </widget>
356 <widget row="3" column="0" rowspan="1" colspan="2" >
357 <class>QLayoutWidget</class>
358 <property stdset="1">
359 <name>name</name>
360 <cstring>Layout10</cstring>
361 </property>
362 <hbox>
363 <property stdset="1">
364 <name>margin</name>
365 <number>0</number>
366 </property>
367 <property stdset="1">
368 <name>spacing</name>
369 <number>6</number>
370 </property>
371 <widget>
372 <class>QCheckBox</class>
373 <property stdset="1">
374 <name>name</name>
375 <cstring>ckbComp</cstring>
376 </property>
377 <property stdset="1">
378 <name>enabled</name>
379 <bool>true</bool>
380 </property>
381 <property stdset="1">
382 <name>text</name>
383 <string>Completed Date</string>
384 </property>
385 </widget>
386 <widget>
387 <class>QPushButton</class>
388 <property stdset="1">
389 <name>name</name>
390 <cstring>btnComp</cstring>
391 </property>
392 <property stdset="1">
393 <name>enabled</name>
394 <bool>false</bool>
395 </property>
396 <property stdset="1">
397 <name>text</name>
398 <string>1 Januar 2002</string>
399 </property>
400 </widget>
401 </hbox>
402 </widget>
403 <widget row="6" column="0" >
404 <class>QCheckBox</class>
405 <property stdset="1">
406 <name>name</name>
407 <cstring>ckbCompleted</cstring>
408 </property>
409 <property stdset="1">
410 <name>text</name>
411 <string>Completed</string>
412 </property>
413 </widget>
414 <widget row="7" column="0" rowspan="1" colspan="2" >
415 <class>QLayoutWidget</class>
416 <property stdset="1">
417 <name>name</name>
418 <cstring>Layout12</cstring>
419 </property>
420 <hbox>
421 <property stdset="1">
422 <name>margin</name>
423 <number>0</number>
424 </property>
425 <property stdset="1">
426 <name>spacing</name>
427 <number>6</number>
428 </property>
429 <widget>
430 <class>QLabel</class>
431 <property stdset="1">
432 <name>name</name>
433 <cstring>txtCategory</cstring>
434 </property>
435 <property stdset="1">
436 <name>text</name>
437 <string>Category</string>
438 </property>
439 </widget>
440 <widget>
441 <class>CategorySelect</class>
442 <property stdset="1">
443 <name>name</name>
444 <cstring>comboCategory</cstring>
445 </property>
446 <property stdset="1">
447 <name>sizePolicy</name>
448 <sizepolicy>
449 <hsizetype>7</hsizetype>
450 <vsizetype>0</vsizetype>
451 </sizepolicy>
452 </property>
453 <property stdset="1">
454 <name>minimumSize</name>
455 <size>
456 <width>60</width>
457 <height>20</height>
458 </size>
459 </property>
460 </widget>
461 </hbox>
462 </widget>
463 <widget row="8" column="0" rowspan="1" colspan="2" >
464 <class>QCheckBox</class>
465 <property stdset="1">
466 <name>name</name>
467 <cstring>CheckBox7</cstring>
468 </property>
469 <property stdset="1">
470 <name>text</name>
471 <string>Enable Recurrance</string>
472 </property>
473 </widget>
474 <spacer row="9" column="1" >
475 <property>
476 <name>name</name>
477 <cstring>Spacer1</cstring>
478 </property>
479 <property stdset="1">
480 <name>orientation</name>
481 <enum>Vertical</enum>
482 </property>
483 <property stdset="1">
484 <name>sizeType</name>
485 <enum>Expanding</enum>
486 </property>
487 <property>
488 <name>sizeHint</name>
489 <size>
490 <width>20</width>
491 <height>20</height>
492 </size>
493 </property>
494 </spacer>
495 </grid>
496</widget>
497<customwidgets>
498 <customwidget>
499 <class>CategorySelect</class>
500 <header location="global">qpe/categoryselect.h</header>
501 <sizehint>
502 <width>-1</width>
503 <height>-1</height>
504 </sizehint>
505 <container>0</container>
506 <sizepolicy>
507 <hordata>7</hordata>
508 <verdata>1</verdata>
509 </sizepolicy>
510 <pixmap>image0</pixmap>
511 </customwidget>
512</customwidgets>
513<images>
514 <image>
515 <name>image0</name>
516 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
517 </image>
518</images>
519<connections>
520 <connection>
521 <sender>ckbStart</sender>
522 <signal>clicked()</signal>
523 <receiver>TaskEditorOverView</receiver>
524 <slot>slotStartChecked()</slot>
525 </connection>
526 <connection>
527 <sender>ckbDue</sender>
528 <signal>clicked()</signal>
529 <receiver>TaskEditorOverView</receiver>
530 <slot>slotDueChecked()</slot>
531 </connection>
532 <connection>
533 <sender>ckbComp</sender>
534 <signal>clicked()</signal>
535 <receiver>TaskEditorOverView</receiver>
536 <slot>slotCompletedChecked()</slot>
537 </connection>
538 <slot access="protected">slotCompletedChecked()</slot>
539 <slot access="protected">slotDueChecked()</slot>
540 <slot access="protected">slotStartChecked()</slot>
541</connections>
542</UI>
diff --git a/core/pim/todo/taskeditoroverviewimpl.cpp b/core/pim/todo/taskeditoroverviewimpl.cpp
deleted file mode 100644
index aef3b1d..0000000
--- a/core/pim/todo/taskeditoroverviewimpl.cpp
+++ b/dev/null
@@ -1,221 +0,0 @@
1#include <qapplication.h>
2#include <qcheckbox.h>
3#include <qcombobox.h>
4#include <qpopupmenu.h>
5
6#include <qpe/datebookmonth.h>
7#include <qpe/categoryselect.h>
8#include <qpe/timestring.h>
9
10#include <opie/orecur.h>
11
12#include "taskeditoroverviewimpl.h"
13
14/*
15 * we need to hack
16 */
17
18TaskEditorOverViewImpl::TaskEditorOverViewImpl( QWidget* parent, const char* name )
19 : TaskEditorOverView( parent, name ) {
20 init();
21}
22TaskEditorOverViewImpl::~TaskEditorOverViewImpl() {
23}
24void TaskEditorOverViewImpl::load( const OTodo& todo) {
25 /*
26 * now that we're 'preloaded' we
27 * need to disable the buttons
28 * holding the dat
29 */
30 btnDue-> setEnabled( FALSE );
31 btnComp-> setEnabled( FALSE );
32 btnStart->setEnabled( FALSE );
33
34 /*
35 * get some basic dateinfos for now
36 */
37 QDate date = QDate::currentDate();
38 QString str = TimeString::longDateString( date );
39
40 CheckBox7->setChecked( todo.recurrence().doesRecur() );
41 emit recurranceEnabled( todo.recurrence().doesRecur() );
42
43
44 ckbStart->setChecked( todo.hasStartDate() );
45 btnStart->setEnabled( todo.hasStartDate() );
46 if ( todo.hasStartDate() ) {
47 m_start = todo.startDate();
48 btnStart->setText( TimeString::longDateString( m_start ) );
49 } else
50 btnStart->setText( str );
51
52 ckbComp->setChecked( todo.hasCompletedDate() );
53 btnComp->setEnabled( todo.hasCompletedDate() );
54 if ( todo.hasCompletedDate() ) {
55 m_comp = todo.completedDate();
56 btnComp->setText( TimeString::longDateString( m_comp ) );
57 }else
58 btnComp->setText( str );
59
60 cmbProgress->setCurrentItem( todo.progress()/20 );
61 cmbSum->insertItem( todo.summary(), 0 );
62 cmbSum->setCurrentItem( 0 );
63
64 ckbDue->setChecked( todo.hasDueDate() );
65 btnDue->setText( TimeString::longDateString( todo.dueDate() ) );
66 btnDue->setEnabled( todo.hasDueDate() );
67 m_due = todo.dueDate();
68
69 cmbPrio->setCurrentItem( todo.priority() -1 );
70 ckbCompleted->setChecked( todo.isCompleted() );
71
72 comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") );
73
74}
75void TaskEditorOverViewImpl::save( OTodo& to) {
76 /* a invalid date */
77 QDate inval;
78 /* save our info back */
79
80 /* due date */
81 if ( ckbDue->isChecked() ) {
82 to.setDueDate( m_due );
83 to.setHasDueDate( true );
84 }else
85 to.setHasDueDate( false );
86
87 /* start date */
88 if ( ckbStart->isChecked() ) {
89 to.setStartDate( m_start );
90 }else
91 to.setStartDate( inval );
92
93 /* comp date */
94 if ( ckbComp->isChecked() ) {
95 qWarning("completed checked");
96 to.setCompletedDate( m_comp );
97 }else
98 to.setCompletedDate( inval );
99
100
101 if ( comboCategory->currentCategory() != -1 ) {
102 QArray<int> arr = comboCategory->currentCategories();
103 to.setCategories( arr );
104 }
105 to.setPriority( cmbPrio->currentItem() + 1 );
106 to.setCompleted( ckbCompleted->isChecked() );
107 to.setSummary( cmbSum->currentText() );
108 to.setProgress( cmbProgress->currentItem() * 20 );
109}
110/*
111 * here we will init the basic view
112 * one Popup for each Date Button
113 * and some other signal and slots connection
114 */
115void TaskEditorOverViewImpl::init() {
116 QDate curDate = QDate::currentDate();
117 m_start = m_comp = m_due = curDate;
118 QString str = TimeString::longDateString( curDate );
119
120
121
122 /* Start Date Picker */
123 m_startPop = new QPopupMenu(this);
124 m_startBook = new DateBookMonth(m_startPop, 0, TRUE );
125 m_startPop->insertItem( m_startBook );
126 connect( m_startBook, SIGNAL( dateClicked(int, int, int) ),
127 this, SLOT(slotStartChanged(int, int, int) ) );
128
129
130 /* Due Date Picker */
131 m_duePop = new QPopupMenu(this);
132 m_dueBook = new DateBookMonth(m_duePop, 0, TRUE );
133 m_duePop->insertItem( m_dueBook );
134 connect( m_dueBook, SIGNAL( dateClicked(int, int, int) ),
135 this, SLOT(slotDueChanged(int, int, int) ) );
136
137 m_compPop = new QPopupMenu(this);
138 m_compBook = new DateBookMonth(m_compPop, 0, TRUE );
139 m_compPop->insertItem(m_compBook );
140 connect( m_compBook, SIGNAL(dateClicked(int, int, int) ),
141 this, SLOT(slotCompletedChanged(int, int, int) ) );
142
143
144 /*
145 * another part of the hack
146 * it's deprecated in Qt2 but
147 * still available in my qt-copy of Qt3.1beta2
148 */
149 btnDue->setIsMenuButton( TRUE );
150 btnStart->setIsMenuButton( TRUE );
151 btnComp->setIsMenuButton( TRUE );
152
153 /* now connect the hack */
154 connect(btnDue, SIGNAL(clicked() ),
155 this, SLOT(hackySlotHack2() ) );
156 connect(btnStart, SIGNAL(clicked() ),
157 this, SLOT(hackySlotHack1() ) );
158 connect(btnComp, SIGNAL(clicked() ),
159 this, SLOT(hackySlotHack3() ) );
160
161 /* recurrance */
162 connect(CheckBox7, SIGNAL(clicked() ),
163 this, SLOT(slotRecClicked() ) );
164}
165
166void TaskEditorOverViewImpl::slotStartChecked() {
167 qWarning("slotStartChecked");
168 btnStart->setEnabled( ckbStart->isChecked() );
169}
170void TaskEditorOverViewImpl::slotStartChanged(int y, int m, int d) {
171 m_start.setYMD( y, m, d );
172 btnStart->setText( TimeString::longDateString( m_start ) );
173}
174void TaskEditorOverViewImpl::slotDueChecked() {
175 btnDue->setEnabled( ckbDue->isChecked() );
176 emit dueDateChanged( m_due );
177 qWarning("slotDueChecked");
178}
179void TaskEditorOverViewImpl::slotDueChanged(int y, int m, int d ) {
180 m_due.setYMD(y, m, d );
181 btnDue->setText( TimeString::longDateString( m_due ) );
182 emit dueDateChanged( m_due );
183}
184void TaskEditorOverViewImpl::slotCompletedChecked() {
185 btnComp->setEnabled( ckbComp->isChecked() );
186 qWarning("slotCompletedChecked");
187}
188void TaskEditorOverViewImpl::slotCompletedChanged(int y, int m, int d) {
189 m_comp.setYMD( y, m, d );
190 btnComp->setText( TimeString::longDateString( m_comp ) );
191}
192/*
193 * called by a button pressed event...
194 * three slots to avoid ugly name() tests
195 * to sender()
196 */
197void TaskEditorOverViewImpl::hackySlotHack1() {
198 btnStart->setDown( FALSE );
199 popup( btnStart, m_startPop );
200}
201void TaskEditorOverViewImpl::hackySlotHack2() {
202 btnDue->setDown( FALSE );
203 popup( btnDue, m_duePop );
204}
205void TaskEditorOverViewImpl::hackySlotHack3() {
206 btnComp->setDown( FALSE );
207 popup( btnComp, m_compPop );
208}
209void TaskEditorOverViewImpl::slotRecClicked() {
210 qWarning("enabled recurrance");
211 emit recurranceEnabled( CheckBox7->isChecked() );
212}
213/*
214 * GPL from TT QPushButton code
215 */
216void TaskEditorOverViewImpl::popup( QPushButton* pu, QPopupMenu* pop) {
217 if ( pu->mapToGlobal( QPoint(0, pu->rect().bottom() ) ).y() + pop->sizeHint().height() <= qApp->desktop()->height() )
218 pop->exec( pu->mapToGlobal( pu->rect().bottomLeft() ) );
219 else
220 pop->exec( pu->mapToGlobal( pu->rect().topLeft() - QPoint(0, pu->sizeHint().height() ) ) );
221}
diff --git a/core/pim/todo/taskeditoroverviewimpl.h b/core/pim/todo/taskeditoroverviewimpl.h
deleted file mode 100644
index 5ee985e..0000000
--- a/core/pim/todo/taskeditoroverviewimpl.h
+++ b/dev/null
@@ -1,55 +0,0 @@
1#ifndef OPIE_TASK_EDITOR_VIEW_IMPL_H
2#define OPIE_TASK_EDITOR_VIEW_IMPL_H
3
4#include <qsize.h>
5
6#include <opie/otodo.h>
7
8#include "taskeditoroverview.h"
9
10class DateBookMonth;
11class QPushButton;
12class QPopupMenu;
13class TaskEditorOverViewImpl : public TaskEditorOverView {
14 Q_OBJECT
15public:
16 TaskEditorOverViewImpl(QWidget* parent, const char* name = 0);
17 ~TaskEditorOverViewImpl();
18
19 void load( const OTodo& );
20 void save( OTodo& );
21signals:
22 void recurranceEnabled( bool );
23 void dueDateChanged( const QDate& date );
24
25private:
26 void init();
27 void popup(QPushButton*, QPopupMenu*);
28 DateBookMonth* m_dueBook;
29 DateBookMonth* m_startBook;
30 DateBookMonth* m_compBook;
31 QDate m_start;
32 QDate m_comp;
33 QDate m_due;
34 QPopupMenu* m_startPop;
35 QPopupMenu* m_compPop;
36 QPopupMenu* m_duePop;
37 bool m_bDue : 1;
38
39private slots:
40 void slotStartChecked();
41 void slotStartChanged(int, int, int );
42 void slotDueChecked();
43 void slotDueChanged(int, int, int );
44 void slotCompletedChecked();
45 void slotCompletedChanged(int, int, int );
46
47 void hackySlotHack1();
48 void hackySlotHack2();
49 void hackySlotHack3();
50
51 void slotRecClicked();
52};
53
54
55#endif
diff --git a/core/pim/todo/todo.pro b/core/pim/todo/todo.pro
index 2714f30..9960c65 100644
--- a/core/pim/todo/todo.pro
+++ b/core/pim/todo/todo.pro
@@ -1,63 +1,65 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on release 2 CONFIG = qt warn_on release
3 DESTDIR = $(OPIEDIR)/bin 3 DESTDIR = $(OPIEDIR)/bin
4 4
5 HEADERS= smalltodo.h \ 5 HEADERS= smalltodo.h \
6 todomanager.h \ 6 todomanager.h \
7 mainwindow.h \ 7 mainwindow.h \
8 todoview.h \ 8 todoview.h \
9 tableview.h \ 9 tableview.h \
10 todotemplatemanager.h \ 10 todotemplatemanager.h \
11 todoeditor.h \ 11 todoeditor.h \
12 todoshow.h \ 12 todoshow.h \
13 textviewshow.h \ 13 textviewshow.h \
14 templateeditor.h \ 14 templateeditor.h \
15 templatedialog.h \ 15 templatedialog.h \
16 templatedialogimpl.h \ 16 templatedialogimpl.h \
17 quickedit.h \ 17 quickedit.h \
18 quickeditimpl.h \ 18 quickeditimpl.h \
19 otaskeditor.h \ 19 otaskeditor.h \
20 taskeditoroverviewimpl.h \ 20 taskeditoroverview.h \
21 taskeditoradvancedimpl.h 21 taskeditoradvancedimpl.h \
22 taskeditoralarms.h
22 23
23 SOURCES= smalltodo.cpp \ 24 SOURCES= smalltodo.cpp \
24 todomanager.cpp \ 25 todomanager.cpp \
25 mainwindow.cpp \ 26 mainwindow.cpp \
26 main.cpp \ 27 main.cpp \
27 tableview.cpp \ 28 tableview.cpp \
28 todoview.cpp \ 29 todoview.cpp \
29 todotemplatemanager.cpp \ 30 todotemplatemanager.cpp \
30 todoeditor.cpp \ 31 todoeditor.cpp \
31 todoshow.cpp \ 32 todoshow.cpp \
32 textviewshow.cpp \ 33 textviewshow.cpp \
33 templateeditor.cpp \ 34 templateeditor.cpp \
34 templatedialog.cpp \ 35 templatedialog.cpp \
35 templatedialogimpl.cpp \ 36 templatedialogimpl.cpp \
36 quickeditimpl.cpp \ 37 quickeditimpl.cpp \
37 quickedit.cpp \ 38 quickedit.cpp \
38 otaskeditor.cpp \ 39 otaskeditor.cpp \
39 taskeditoroverviewimpl.cpp \ 40 taskeditoroverview.cpp \
40 taskeditoradvancedimpl.cpp 41 taskeditoradvancedimpl.cpp \
42 taskeditoralarms.cpp
41 43
42 INTERFACES= taskeditoradvanced.ui taskeditoralarms.ui taskeditoroverview.ui 44 INTERFACES= taskeditoradvanced.ui
43 TARGET = todolist 45 TARGET = todolist
44INCLUDEPATH += $(OPIEDIR)/include 46INCLUDEPATH += $(OPIEDIR)/include
45 DEPENDPATH+= $(OPIEDIR)/include 47 DEPENDPATH+= $(OPIEDIR)/include
46LIBS += -lqpe -lopie 48LIBS += -lqpe -lopie
47 49
48TRANSLATIONS = ../../../i18n/de/todolist.ts \ 50TRANSLATIONS = ../../../i18n/de/todolist.ts \
49 ../../../i18n/da/todolist.ts \ 51 ../../../i18n/da/todolist.ts \
50 ../../../i18n/xx/todolist.ts \ 52 ../../../i18n/xx/todolist.ts \
51 ../../../i18n/en/todolist.ts \ 53 ../../../i18n/en/todolist.ts \
52 ../../../i18n/es/todolist.ts \ 54 ../../../i18n/es/todolist.ts \
53 ../../../i18n/fr/todolist.ts \ 55 ../../../i18n/fr/todolist.ts \
54 ../../../i18n/hu/todolist.ts \ 56 ../../../i18n/hu/todolist.ts \
55 ../../../i18n/ja/todolist.ts \ 57 ../../../i18n/ja/todolist.ts \
56 ../../../i18n/ko/todolist.ts \ 58 ../../../i18n/ko/todolist.ts \
57 ../../../i18n/no/todolist.ts \ 59 ../../../i18n/no/todolist.ts \
58 ../../../i18n/pl/todolist.ts \ 60 ../../../i18n/pl/todolist.ts \
59 ../../../i18n/pt/todolist.ts \ 61 ../../../i18n/pt/todolist.ts \
60 ../../../i18n/pt_BR/todolist.ts \ 62 ../../../i18n/pt_BR/todolist.ts \
61 ../../../i18n/sl/todolist.ts \ 63 ../../../i18n/sl/todolist.ts \
62 ../../../i18n/zh_CN/todolist.ts \ 64 ../../../i18n/zh_CN/todolist.ts \
63 ../../../i18n/zh_TW/todolist.ts 65 ../../../i18n/zh_TW/todolist.ts