-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 @@ -37,2 +37,4 @@ +#include <opie/orecur.h> + #include "mainwindow.h" @@ -122,3 +124,3 @@ TableView::~TableView() { void TableView::slotShowMenu() { - QPopupMenu *menu = todoWindow()->contextMenu( current() ); + QPopupMenu *menu = todoWindow()->contextMenu( current(), sorted()[currentRow()].recurrence().doesRecur() ); menu->exec(QCursor::pos() ); @@ -131,3 +133,3 @@ int TableView::current() { int uid = sorted().uidAt(currentRow() ); - qWarning("uid %d", uid ); + return uid; @@ -135,3 +137,4 @@ int TableView::current() { QString TableView::currentRepresentation() { - return text( currentRow(), 2); + OTodo to = sorted()[currentRow()]; + return to.summary().isEmpty() ? to.description().left(20) : to.summary() ; } @@ -147,3 +150,3 @@ void TableView::updateView( ) { static int id; - id = startTimer(2000 ); + id = startTimer(4000 ); /* FIXME we want one page to be read! @@ -244,6 +247,3 @@ void TableView::slotClicked(int row, int col, int, y <= ( h - BoxSize ) / 2 + BoxSize ) { - OTodo todo = sorted()[row]; - todo.setCompleted( !todo.isCompleted() ); - TodoView::update( todo.uid(), todo ); - updateView(); + TodoView::complete(sorted()[row] ); } @@ -371,3 +371,3 @@ 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(); @@ -464,3 +464,3 @@ void TableView::slotPriority() { void TableView::timerEvent( QTimerEvent* ev ) { - qWarning("sorted %d", sorted().count() ); +// qWarning("sorted %d", sorted().count() ); if (sorted().count() == 0 ) @@ -515,7 +515,4 @@ void TableView::contentsMouseReleaseEvent( QMouseEvent* e) { colOld != colNew ) { - OTodo todo = sorted()[row]; - todo.setCompleted( !todo.isCompleted() ); - TodoView::update( todo.uid(), todo ); - updateView(); - return; + TodoView::complete( sorted()[row] ); + return; } |