summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/TODO3
-rw-r--r--core/pim/todo/mainwindow.cpp9
-rw-r--r--core/pim/todo/mainwindow.h3
3 files changed, 13 insertions, 2 deletions
diff --git a/core/pim/todo/TODO b/core/pim/todo/TODO
index e5d2f9d..040f163 100644
--- a/core/pim/todo/TODO
+++ b/core/pim/todo/TODO
@@ -1,3 +1,4 @@
1-fix the journal 1-fix the journal
2-fix day wrapping update all DueDateItems 2-fix day wrapping update all DueDateItems
3-when checking the C. box update the deadline \ No newline at end of file 3-when checking the C. box update the deadline
4-TodoLabel : public TextView
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index a34bcf2..b5cace9 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -15,32 +15,33 @@
15** 15**
16** See http://www.trolltech.com/gpl/ for GPL licensing information. 16** See http://www.trolltech.com/gpl/ for GPL licensing information.
17** 17**
18** Contact info@trolltech.com if any conditions of this licensing are 18** Contact info@trolltech.com if any conditions of this licensing are
19** not clear to you. 19** not clear to you.
20** 20**
21**********************************************************************/ 21**********************************************************************/
22 22
23#define QTOPIA_INTERNAL_FD 23#define QTOPIA_INTERNAL_FD
24 24
25#include "mainwindow.h" 25#include "mainwindow.h"
26#include "todoentryimpl.h" 26#include "todoentryimpl.h"
27#include "todotable.h" 27#include "todotable.h"
28 28
29#include <opie/tododb.h> 29#include <opie/tododb.h>
30#include <opie/todovcalresource.h> 30#include <opie/todovcalresource.h>
31#include <opie/ofontmenu.h>
31 32
32#include <qpe/qpeapplication.h> 33#include <qpe/qpeapplication.h>
33#include <qpe/config.h> 34#include <qpe/config.h>
34#include <qpe/finddialog.h> 35#include <qpe/finddialog.h>
35#include <qpe/global.h> 36#include <qpe/global.h>
36#include <qpe/ir.h> 37#include <qpe/ir.h>
37#include <qpe/qpemenubar.h> 38#include <qpe/qpemenubar.h>
38#include <qpe/qpemessagebox.h> 39#include <qpe/qpemessagebox.h>
39#include <qpe/resource.h> 40#include <qpe/resource.h>
40//#include <qpe/task.h> 41//#include <qpe/task.h>
41#include <qpe/qpetoolbar.h> 42#include <qpe/qpetoolbar.h>
42 43
43#include <qaction.h> 44#include <qaction.h>
44#include <qarray.h> 45#include <qarray.h>
45#include <qdatastream.h> 46#include <qdatastream.h>
46#include <qdatetime.h> 47#include <qdatetime.h>
@@ -172,33 +173,33 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
172 if ( table->numRows() ) 173 if ( table->numRows() )
173 a->setEnabled( TRUE ); 174 a->setEnabled( TRUE );
174 else 175 else
175 a->setEnabled( FALSE ); 176 a->setEnabled( FALSE );
176 177
177 //a->setEnabled( FALSE ); 178 //a->setEnabled( FALSE );
178 findAction = a; 179 findAction = a;
179// qDebug("mainwindow #2: t=%d", t.elapsed() ); 180// qDebug("mainwindow #2: t=%d", t.elapsed() );
180 181
181 completedAction = new QAction( QString::null, tr("Completed tasks"), 0, this, 0, TRUE ); 182 completedAction = new QAction( QString::null, tr("Completed tasks"), 0, this, 0, TRUE );
182 183
183 showdeadlineAction = new QAction( QString::null, tr( "Show Deadline" ), 0, this, 0, TRUE ); 184 showdeadlineAction = new QAction( QString::null, tr( "Show Deadline" ), 0, this, 0, TRUE );
184 185
185 catMenu->setCheckable( true ); 186 catMenu->setCheckable( true );
186 populateCategories(); 187 populateCategories();
187 188
188 mb->insertItem( tr( "Task" ), edit ); 189 mb->insertItem( tr( "Data" ), edit );
189 mb->insertItem( tr( "View" ), catMenu ); 190 mb->insertItem( tr( "View" ), catMenu );
190 191
191 resize( 200, 300 ); 192 resize( 200, 300 );
192 if ( table->numRows() > 0 ) 193 if ( table->numRows() > 0 )
193 currentEntryChanged( 0, 0 ); 194 currentEntryChanged( 0, 0 );
194 connect( table, SIGNAL( signalEdit() ), 195 connect( table, SIGNAL( signalEdit() ),
195 this, SLOT( slotEdit() ) ); 196 this, SLOT( slotEdit() ) );
196 connect( table, SIGNAL(signalShowMenu(const QPoint &)), 197 connect( table, SIGNAL(signalShowMenu(const QPoint &)),
197 this, SLOT( slotShowPopup(const QPoint &)) ); 198 this, SLOT( slotShowPopup(const QPoint &)) );
198 199
199// qDebug("mainwindow #3: t=%d", t.elapsed() ); 200// qDebug("mainwindow #3: t=%d", t.elapsed() );
200 table->updateVisible(); 201 table->updateVisible();
201 table->setUpdatesEnabled( TRUE ); 202 table->setUpdatesEnabled( TRUE );
202 table->setPaintingEnabled( TRUE ); 203 table->setPaintingEnabled( TRUE );
203 table->viewport()->setUpdatesEnabled( TRUE ); 204 table->viewport()->setUpdatesEnabled( TRUE );
204 205
@@ -345,32 +346,38 @@ void TodoWindow::setCategory( int c )
345 setCaption( tr("Todo") + " - " + tr( "All Categories" ) ); 346 setCaption( tr("Todo") + " - " + tr( "All Categories" ) );
346 } else if ( c == (int)catMenu->count() - 1 ) { 347 } else if ( c == (int)catMenu->count() - 1 ) {
347 table->setShowCategory( tr( "Unfiled" ) ); 348 table->setShowCategory( tr( "Unfiled" ) );
348 setCaption( tr("Todo") + " - " + tr( "Unfiled" ) ); 349 setCaption( tr("Todo") + " - " + tr( "Unfiled" ) );
349 } else { 350 } else {
350 QString cat = table->categories()[c - 2]; 351 QString cat = table->categories()[c - 2];
351 table->setShowCategory( cat ); 352 table->setShowCategory( cat );
352 setCaption( tr("Todo") + " - " + cat ); 353 setCaption( tr("Todo") + " - " + cat );
353 } 354 }
354 table->setPaintingEnabled( true ); 355 table->setPaintingEnabled( true );
355} 356}
356 357
357void TodoWindow::populateCategories() 358void TodoWindow::populateCategories()
358{ 359{
359 catMenu->clear(); 360 catMenu->clear();
360 361
362 QList<QWidget> list;
363 list.append(table );
364 OFontMenu *menu = new OFontMenu(this, "menu",list );
365 menu->forceSize( table->horizontalHeader(), 10 );
366 catMenu->insertItem(tr("Fonts"), menu );
367
361 completedAction->addTo( catMenu ); 368 completedAction->addTo( catMenu );
362 completedAction->setOn( table->showCompleted() ); 369 completedAction->setOn( table->showCompleted() );
363 showdeadlineAction->addTo( catMenu ); 370 showdeadlineAction->addTo( catMenu );
364 showdeadlineAction->setOn( table->showDeadline() ); 371 showdeadlineAction->setOn( table->showDeadline() );
365 catMenu->insertSeparator(); 372 catMenu->insertSeparator();
366 int id, rememberId; 373 int id, rememberId;
367 id = 1; 374 id = 1;
368 catMenu->insertItem( tr( "All Categories" ), id++ ); 375 catMenu->insertItem( tr( "All Categories" ), id++ );
369// catMenu->insertSeparator(); 376// catMenu->insertSeparator();
370 QStringList categories = table->categories(); 377 QStringList categories = table->categories();
371 categories.append( tr( "Unfiled" ) ); 378 categories.append( tr( "Unfiled" ) );
372 for ( QStringList::Iterator it = categories.begin(); 379 for ( QStringList::Iterator it = categories.begin();
373 it != categories.end(); ++it ) { 380 it != categories.end(); ++it ) {
374 catMenu->insertItem( *it, id ); 381 catMenu->insertItem( *it, id );
375 if ( *it == table->showCategory() ) 382 if ( *it == table->showCategory() )
376 rememberId = id; 383 rememberId = id;
diff --git a/core/pim/todo/mainwindow.h b/core/pim/todo/mainwindow.h
index a81c27c..9be7c66 100644
--- a/core/pim/todo/mainwindow.h
+++ b/core/pim/todo/mainwindow.h
@@ -15,32 +15,33 @@
15** See http://www.trolltech.com/gpl/ for GPL licensing information. 15** See http://www.trolltech.com/gpl/ for GPL licensing information.
16** 16**
17** Contact info@trolltech.com if any conditions of this licensing are 17** Contact info@trolltech.com if any conditions of this licensing are
18** not clear to you. 18** not clear to you.
19** 19**
20**********************************************************************/ 20**********************************************************************/
21 21
22#ifndef MAINWINDOW_H 22#ifndef MAINWINDOW_H
23#define MAINWINDOW_H 23#define MAINWINDOW_H
24 24
25#include <qmainwindow.h> 25#include <qmainwindow.h>
26 26
27class TodoTable; 27class TodoTable;
28class QAction; 28class QAction;
29class QPopupMenu; 29class QPopupMenu;
30class Ir; 30class Ir;
31class OFontMenu;
31 32
32class TodoWindow : public QMainWindow 33class TodoWindow : public QMainWindow
33{ 34{
34 Q_OBJECT 35 Q_OBJECT
35 36
36public: 37public:
37 TodoWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 38 TodoWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
38 ~TodoWindow(); 39 ~TodoWindow();
39 40
40public slots: 41public slots:
41 void flush(); 42 void flush();
42 void reload(); 43 void reload();
43 44
44protected slots: 45protected slots:
45 void slotNew(); 46 void slotNew();
46 void slotDelete(); 47 void slotDelete();
@@ -64,16 +65,18 @@ protected:
64private: 65private:
65 void populateCategories(); 66 void populateCategories();
66 67
67private: 68private:
68 TodoTable *table; 69 TodoTable *table;
69 QAction *editAction, 70 QAction *editAction,
70 *deleteAction, 71 *deleteAction,
71 *findAction, 72 *findAction,
72 * completedAction, 73 * completedAction,
73 *showdeadlineAction ; 74 *showdeadlineAction ;
74 QPopupMenu *contextMenu, *catMenu; 75 QPopupMenu *contextMenu, *catMenu;
75 76
76 bool syncing; 77 bool syncing;
77}; 78};
78 79
79#endif 80#endif
81
82