summaryrefslogtreecommitdiff
path: root/core/pim/todo/todotable.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/todotable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/todotable.cpp68
1 files changed, 64 insertions, 4 deletions
diff --git a/core/pim/todo/todotable.cpp b/core/pim/todo/todotable.cpp
index 2bb95a2..3cd0c0e 100644
--- a/core/pim/todo/todotable.cpp
+++ b/core/pim/todo/todotable.cpp
@@ -19,3 +19,4 @@
19**********************************************************************/ 19**********************************************************************/
20 20/* Show Deadline was added by Stefan Eilers (se, eilers.stefan@epost.de)
21 */
21#include "todotable.h" 22#include "todotable.h"
@@ -40,2 +41,4 @@
40 41
42#include <stdio.h>
43
41 44
@@ -166,3 +169,3 @@ TodoTable::TodoTable( QWidget *parent, const char *name )
166// #else 169// #else
167 : QTable( 0, 3, parent, name ), 170 : QTable( 0, 4, parent, name ),
168// #endif 171// #endif
@@ -171,3 +174,4 @@ TodoTable::TodoTable( QWidget *parent, const char *name )
171 mCat( 0 ), 174 mCat( 0 ),
172 currFindRow( -2 ) 175 currFindRow( -2 ),
176 showDeadl( true)
173{ 177{
@@ -179,2 +183,3 @@ TodoTable::TodoTable( QWidget *parent, const char *name )
179 setColumnWidth( 1, 35 ); 183 setColumnWidth( 1, 35 );
184
180 setLeftMargin( 0 ); 185 setLeftMargin( 0 );
@@ -184,2 +189,13 @@ TodoTable::TodoTable( QWidget *parent, const char *name )
184 horizontalHeader()->setLabel( 2, tr( "Description" ) ); 189 horizontalHeader()->setLabel( 2, tr( "Description" ) );
190
191 setColumnStretchable( 3, FALSE );
192 setColumnWidth( 3, 20 );
193 horizontalHeader()->setLabel( 3, tr( "Deadline" ) );
194
195 if (showDeadl){
196 showColumn (3);
197 }else{
198 hideColumn (3);
199 }
200
185 connect( this, SIGNAL( clicked( int, int, int, const QPoint & ) ), 201 connect( this, SIGNAL( clicked( int, int, int, const QPoint & ) ),
@@ -236,2 +252,7 @@ void TodoTable::slotClicked( int row, int col, int, const QPoint &pos )
236 break; 252 break;
253 case 3: /* added 20.01.2k2 by se */
254 // may as well edit it...
255 menuTimer->stop();
256 emit signalEdit();
257 break;
237 } 258 }
@@ -267,2 +288,4 @@ ToDoEvent TodoTable::currentEntry() const
267{ 288{
289 printf ("in currentEntry\n");
290
268 QTableItem *i = item( currentRow(), 0 ); 291 QTableItem *i = item( currentRow(), 0 );
@@ -356,2 +379,11 @@ void TodoTable::updateVisible()
356 379
380 /* added 20.01.2k2 by se */
381 if (showDeadl){
382 showColumn (3);
383 adjustColumn(3);
384 }else{
385 hideColumn (3);
386 adjustColumn(2);
387 }
388
357 int visible = 0; 389 int visible = 0;
@@ -457,3 +489,3 @@ void TodoTable::slotCheckPriority(int row, int col )
457 489
458void TodoTable::updateJournal( const ToDoEvent &todo, journal_action action, int row ) 490void TodoTable::updateJournal( const ToDoEvent &/*todo*/, journal_action action, int row )
459{ 491{
@@ -510,2 +542,16 @@ void TodoTable::journalFreeReplaceEntry( const ToDoEvent &todo, int row )
510 item( row, 2 )->setText( strTodo ); 542 item( row, 2 )->setText( strTodo );
543
544 /* added 20.01.2k2 by se */
545 if (showDeadl){
546 if (todo.hasDate()){
547 QDate *today = new QDate (QDate::currentDate());
548 if (today){
549 item (row, 3)->setText (tr ("%1").arg(today->daysTo(todo.date())));
550 delete (today);
551 }
552 }else{
553 item (row, 3)->setText ("n.d.");
554 }
555 }
556
511 *(*it) = todo; 557 *(*it) = todo;
@@ -520,2 +566,16 @@ void TodoTable::journalFreeReplaceEntry( const ToDoEvent &todo, int row )
520 item( row, 2 )->setText( strTodo ); 566 item( row, 2 )->setText( strTodo );
567
568 /* added 20.01.2k2 by se */
569 if (showDeadl){
570 if (todo.hasDate()){
571 QDate *today = new QDate (QDate::currentDate());
572 if (today){
573 item (row, 3)->setText (tr ("%1").arg(today->daysTo(todo.date())));
574 delete (today);
575 }
576 }else{
577 item (row, 3)->setText ("n.d.");
578 }
579 }
580
521 todoList.insert( static_cast<CheckItem*>(item(row,0)), new ToDoEvent(todo) ); 581 todoList.insert( static_cast<CheckItem*>(item(row,0)), new ToDoEvent(todo) );