-rw-r--r-- | core/pim/todo/tableview.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp index ded2dbd..0f683c9 100644 --- a/core/pim/todo/tableview.cpp +++ b/core/pim/todo/tableview.cpp @@ -36,4 +36,6 @@ #include <qpe/config.h> +#include <opie/orecur.h> + #include "mainwindow.h" //#include "tableitems.h" @@ -121,5 +123,5 @@ TableView::~TableView() { } void TableView::slotShowMenu() { - QPopupMenu *menu = todoWindow()->contextMenu( current() ); + QPopupMenu *menu = todoWindow()->contextMenu( current(), sorted()[currentRow()].recurrence().doesRecur() ); menu->exec(QCursor::pos() ); delete menu; @@ -130,9 +132,10 @@ QString TableView::type() const { int TableView::current() { int uid = sorted().uidAt(currentRow() ); - qWarning("uid %d", uid ); + return uid; } QString TableView::currentRepresentation() { - return text( currentRow(), 2); + OTodo to = sorted()[currentRow()]; + return to.summary().isEmpty() ? to.description().left(20) : to.summary() ; } /* show overdue */ @@ -146,5 +149,5 @@ void TableView::updateView( ) { m_row = false; static int id; - id = startTimer(2000 ); + id = startTimer(4000 ); /* FIXME we want one page to be read! * @@ -243,8 +246,5 @@ void TableView::slotClicked(int row, int col, int, y >= ( h - BoxSize ) / 2 && y <= ( h - BoxSize ) / 2 + BoxSize ) { - OTodo todo = sorted()[row]; - todo.setCompleted( !todo.isCompleted() ); - TodoView::update( todo.uid(), todo ); - updateView(); + TodoView::complete(sorted()[row] ); } } @@ -370,5 +370,5 @@ void TableView::paintCell(QPainter* p, int row, int col, const QRect& cr, bool { QString text = task.summary().isEmpty() ? - task.description() : + task.description().left(20) : task.summary(); p->drawText(2,2 + fm.ascent(), text); @@ -463,5 +463,5 @@ void TableView::slotPriority() { */ void TableView::timerEvent( QTimerEvent* ev ) { - qWarning("sorted %d", sorted().count() ); +// qWarning("sorted %d", sorted().count() ); if (sorted().count() == 0 ) return; @@ -514,9 +514,6 @@ void TableView::contentsMouseReleaseEvent( QMouseEvent* e) { if ( row == rowAt( e->y() ) && row != -1 && colOld != colNew ) { - OTodo todo = sorted()[row]; - todo.setCompleted( !todo.isCompleted() ); - TodoView::update( todo.uid(), todo ); - updateView(); - return; + TodoView::complete( sorted()[row] ); + return; } QTable::contentsMouseReleaseEvent( e ); |