-rw-r--r-- | core/pim/todo/todotable.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/core/pim/todo/todotable.h b/core/pim/todo/todotable.h index 2746ce7..288ff90 100644 --- a/core/pim/todo/todotable.h +++ b/core/pim/todo/todotable.h @@ -95,12 +95,16 @@ public: QStringList categories(); void setShowCompleted( bool sc ) { showComp = sc; updateVisible(); } bool showCompleted() const { return showComp; } + /* added 20.01.2k2 by se */ + void setShowDeadline (bool sd) {showDeadl = sd; updateVisible();} + bool showDeadline() const { return showDeadl;} + void setShowCategory( const QString &c ) { showCat = c; updateVisible(); } const QString &showCategory() const { return showCat; } int showCategoryId() const; bool save( const QString &fn ); void load( const QString &fn ); @@ -156,12 +160,15 @@ private: bool showComp; QString showCat; QTimer *menuTimer; bool enablePainting; Categories mCat; int currFindRow; + + /* added 20.01.2k2 by se */ + bool showDeadl; }; inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) { QString sortKey = (char) ((todo->isCompleted() ? 'a' : 'A') @@ -171,16 +178,31 @@ inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) chk->setChecked( todo->isCompleted() ); ComboItem *cmb = new ComboItem( this, QTableItem::WhenCurrent ); cmb->setText( QString::number( todo->priority() ) ); QTableItem *ti = new TodoTextItem( this, todo->description().left(40).simplifyWhiteSpace() ); ti->setReplaceable( false ); + /* added 20.01.2k2 by se */ + QTableItem *dl = NULL; + if (todo->hasDate()){ + QDate *today = new QDate (QDate::currentDate()); + if (today){ + dl = new TodoTextItem (this, tr ("%1"). + arg(today->daysTo(todo->date()))); + delete (today); + } + }else{ + dl = new TodoTextItem (this,"n.d."); + } + setItem( row, 3, dl); + setItem( row, 0, chk ); setItem( row, 1, cmb ); setItem( row, 2, ti ); + todoList.insert( chk, todo ); } inline void TodoTable::realignTable( int row ) { QTableItem *ti1, |