-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 @@ | |||
36 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
37 | 37 | ||
38 | #include <opie/orecur.h> | ||
39 | |||
38 | #include "mainwindow.h" | 40 | #include "mainwindow.h" |
39 | //#include "tableitems.h" | 41 | //#include "tableitems.h" |
@@ -121,5 +123,5 @@ TableView::~TableView() { | |||
121 | } | 123 | } |
122 | void TableView::slotShowMenu() { | 124 | void TableView::slotShowMenu() { |
123 | QPopupMenu *menu = todoWindow()->contextMenu( current() ); | 125 | QPopupMenu *menu = todoWindow()->contextMenu( current(), sorted()[currentRow()].recurrence().doesRecur() ); |
124 | menu->exec(QCursor::pos() ); | 126 | menu->exec(QCursor::pos() ); |
125 | delete menu; | 127 | delete menu; |
@@ -130,9 +132,10 @@ QString TableView::type() const { | |||
130 | int TableView::current() { | 132 | int TableView::current() { |
131 | int uid = sorted().uidAt(currentRow() ); | 133 | int uid = sorted().uidAt(currentRow() ); |
132 | qWarning("uid %d", uid ); | 134 | |
133 | return uid; | 135 | return uid; |
134 | } | 136 | } |
135 | QString TableView::currentRepresentation() { | 137 | QString TableView::currentRepresentation() { |
136 | return text( currentRow(), 2); | 138 | OTodo to = sorted()[currentRow()]; |
139 | return to.summary().isEmpty() ? to.description().left(20) : to.summary() ; | ||
137 | } | 140 | } |
138 | /* show overdue */ | 141 | /* show overdue */ |
@@ -146,5 +149,5 @@ void TableView::updateView( ) { | |||
146 | m_row = false; | 149 | m_row = false; |
147 | static int id; | 150 | static int id; |
148 | id = startTimer(2000 ); | 151 | id = startTimer(4000 ); |
149 | /* FIXME we want one page to be read! | 152 | /* FIXME we want one page to be read! |
150 | * | 153 | * |
@@ -243,8 +246,5 @@ void TableView::slotClicked(int row, int col, int, | |||
243 | y >= ( h - BoxSize ) / 2 && | 246 | y >= ( h - BoxSize ) / 2 && |
244 | y <= ( h - BoxSize ) / 2 + BoxSize ) { | 247 | y <= ( h - BoxSize ) / 2 + BoxSize ) { |
245 | OTodo todo = sorted()[row]; | 248 | TodoView::complete(sorted()[row] ); |
246 | todo.setCompleted( !todo.isCompleted() ); | ||
247 | TodoView::update( todo.uid(), todo ); | ||
248 | updateView(); | ||
249 | } | 249 | } |
250 | } | 250 | } |
@@ -370,5 +370,5 @@ void TableView::paintCell(QPainter* p, int row, int col, const QRect& cr, bool | |||
370 | { | 370 | { |
371 | QString text = task.summary().isEmpty() ? | 371 | QString text = task.summary().isEmpty() ? |
372 | task.description() : | 372 | task.description().left(20) : |
373 | task.summary(); | 373 | task.summary(); |
374 | p->drawText(2,2 + fm.ascent(), text); | 374 | p->drawText(2,2 + fm.ascent(), text); |
@@ -463,5 +463,5 @@ void TableView::slotPriority() { | |||
463 | */ | 463 | */ |
464 | void TableView::timerEvent( QTimerEvent* ev ) { | 464 | void TableView::timerEvent( QTimerEvent* ev ) { |
465 | qWarning("sorted %d", sorted().count() ); | 465 | // qWarning("sorted %d", sorted().count() ); |
466 | if (sorted().count() == 0 ) | 466 | if (sorted().count() == 0 ) |
467 | return; | 467 | return; |
@@ -514,9 +514,6 @@ void TableView::contentsMouseReleaseEvent( QMouseEvent* e) { | |||
514 | if ( row == rowAt( e->y() ) && row != -1 && | 514 | if ( row == rowAt( e->y() ) && row != -1 && |
515 | colOld != colNew ) { | 515 | colOld != colNew ) { |
516 | OTodo todo = sorted()[row]; | 516 | TodoView::complete( sorted()[row] ); |
517 | todo.setCompleted( !todo.isCompleted() ); | 517 | return; |
518 | TodoView::update( todo.uid(), todo ); | ||
519 | updateView(); | ||
520 | return; | ||
521 | } | 518 | } |
522 | QTable::contentsMouseReleaseEvent( e ); | 519 | QTable::contentsMouseReleaseEvent( e ); |