author | zecke <zecke> | 2002-04-13 19:58:17 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-04-13 19:58:17 (UTC) |
commit | 244495af9bd629fe565b5c753d066cc4fde684ae (patch) (side-by-side diff) | |
tree | 8f20084c688b627223a431f02875703418e6d999 /core/pim/todo/todotable.h | |
parent | 84f5e0817231fa3721c781b0538659f5a7149349 (diff) | |
download | opie-244495af9bd629fe565b5c753d066cc4fde684ae.zip opie-244495af9bd629fe565b5c753d066cc4fde684ae.tar.gz opie-244495af9bd629fe565b5c753d066cc4fde684ae.tar.bz2 |
Fix Stefan Eilers patch
Extend the due column
better sorting
and colors ;)
-rw-r--r-- | core/pim/todo/todotable.h | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/core/pim/todo/todotable.h b/core/pim/todo/todotable.h index 288ff90..32df514 100644 --- a/core/pim/todo/todotable.h +++ b/core/pim/todo/todotable.h @@ -79,2 +79,15 @@ public: +class DueTextItem : public QTableItem +{ + public: + DueTextItem( QTable *t, ToDoEvent *ev ); + QString key() const; + void setToDoEvent( const ToDoEvent *ev ); + void paint( QPainter *p, const QColorGroup &cg, const QRect &cr, bool selected ); + private: + int m_off; + bool m_hasDate:1; + bool m_completed:1; + +}; @@ -100,3 +113,2 @@ public: - /* added 20.01.2k2 by se */ void setShowDeadline (bool sd) {showDeadl = sd; updateVisible();} @@ -165,5 +177,3 @@ private: int currFindRow; - - /* added 20.01.2k2 by se */ - bool showDeadl; + bool showDeadl:1; }; @@ -183,15 +193,4 @@ inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) - /* 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); + DueTextItem *due = new DueTextItem(this, todo ); + setItem( row, 3, due); @@ -207,5 +206,6 @@ inline void TodoTable::realignTable( int row ) { - QTableItem *ti1, - *ti2, - *ti3; + QTableItem *ti1, + *ti2, + *ti3, + *ti4; int totalRows = numRows(); @@ -219,2 +219,3 @@ inline void TodoTable::realignTable( int row ) ti3 = item( curr + 1, 2 ); + ti4 = item( curr + 1, 3 ); takeItem( ti1 ); @@ -222,2 +223,3 @@ inline void TodoTable::realignTable( int row ) takeItem( ti3 ); + takeItem( ti4 ); setItem( curr, 0, ti1 ); @@ -225,2 +227,3 @@ inline void TodoTable::realignTable( int row ) setItem( curr, 2, ti3 ); + setItem( curr, 3, ti4 ); } |