summaryrefslogtreecommitdiff
path: root/core/pim/todo/tableview.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/tableview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/tableview.cpp27
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
@@ -35,6 +35,8 @@
35 35
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"
40#include "tableview.h" 42#include "tableview.h"
@@ -120,7 +122,7 @@ TableView::~TableView() {
120 122
121} 123}
122void TableView::slotShowMenu() { 124void 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;
126} 128}
@@ -129,11 +131,12 @@ QString TableView::type() const {
129} 131}
130int TableView::current() { 132int 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}
135QString TableView::currentRepresentation() { 137QString 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 */
139void TableView::showOverDue( bool ) { 142void TableView::showOverDue( bool ) {
@@ -145,7 +148,7 @@ void TableView::updateView( ) {
145 qWarning("update view"); 148 qWarning("update view");
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 *
151 * Calculate that screensize 154 * Calculate that screensize
@@ -242,10 +245,7 @@ void TableView::slotClicked(int row, int col, int,
242 x <= ( w - BoxSize ) / 2 + BoxSize && 245 x <= ( w - BoxSize ) / 2 + BoxSize &&
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 }
251 break; 251 break;
@@ -369,7 +369,7 @@ void TableView::paintCell(QPainter* p, int row, int col, const QRect& cr, bool
369 // description field 369 // description field
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);
375 } 375 }
@@ -462,7 +462,7 @@ void TableView::slotPriority() {
462 * 462 *
463 */ 463 */
464void TableView::timerEvent( QTimerEvent* ev ) { 464void 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;
468 468
@@ -513,11 +513,8 @@ void TableView::contentsMouseReleaseEvent( QMouseEvent* e) {
513 qWarning("colNew: %d colOld: %d", colNew, colOld ); 513 qWarning("colNew: %d colOld: %d", colNew, colOld );
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 );
523} 520}