summaryrefslogtreecommitdiff
path: root/core/pim/todo/todotable.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/todotable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/todotable.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/core/pim/todo/todotable.cpp b/core/pim/todo/todotable.cpp
index d0bc61c..753c036 100644
--- a/core/pim/todo/todotable.cpp
+++ b/core/pim/todo/todotable.cpp
@@ -296,33 +296,39 @@ void TodoTable::slotClicked( int row, int col, int, const QPoint &pos )
296 int h = rowHeight( row ); 296 int h = rowHeight( row );
297 if ( i && x >= ( w - BoxSize ) / 2 && x <= ( w - BoxSize ) / 2 + BoxSize && 297 if ( i && x >= ( w - BoxSize ) / 2 && x <= ( w - BoxSize ) / 2 + BoxSize &&
298 y >= ( h - BoxSize ) / 2 && y <= ( h - BoxSize ) / 2 + BoxSize ) { 298 y >= ( h - BoxSize ) / 2 && y <= ( h - BoxSize ) / 2 + BoxSize ) {
299 i->toggle(); 299 i->toggle();
300 } 300 }
301 emit signalDoneChanged( i->isChecked() ); 301 emit signalDoneChanged( i->isChecked() );
302 } 302 }
303 } 303 }
304 break; 304 break;
305 case 1: 305 case 1:
306 break; 306 break;
307 case 2: 307 case 2:
308 // may as well edit it... 308 // may as well edit it...
309 // menuTimer->stop(); 309 // menuTimer->stop();
310// emit signalEdit(); 310 // emit signalEdit();
311 // fall through 311 // Show detailed view of the selected entry
312 case 3: 312 {
313 // may as well edit it...
314 menuTimer->stop(); 313 menuTimer->stop();
315 // emit signalEdit(); 314 ToDoEvent *todo = todoList[static_cast<CheckItem*>(item(row, 0))];
316 break; 315 emit showDetails( *todo );
316 }
317 break;
318 case 3:
319 // may as well edit it...
320 menuTimer->stop();
321 // emit signalEdit();
322 break;
317 } 323 }
318} 324}
319 325
320void TodoTable::slotPressed( int row, int col, int, const QPoint &pos ) 326void TodoTable::slotPressed( int row, int col, int, const QPoint &pos )
321{ 327{
322 if ( col == 2 && cellGeometry( row, col ).contains(pos) ) 328 if ( col == 2 && cellGeometry( row, col ).contains(pos) )
323 menuTimer->start( 750, TRUE ); 329 menuTimer->start( 750, TRUE );
324} 330}
325 331
326void TodoTable::slotShowMenu() 332void TodoTable::slotShowMenu()
327{ 333{
328 emit signalShowMenu( QCursor::pos() ); 334 emit signalShowMenu( QCursor::pos() );
@@ -336,25 +342,25 @@ void TodoTable::slotCurrentChanged( int, int )
336void TodoTable::internalAddEntries( QList<ToDoEvent> &list ) 342void TodoTable::internalAddEntries( QList<ToDoEvent> &list )
337{ 343{
338 setNumRows( list.count() ); 344 setNumRows( list.count() );
339 int row = 0; 345 int row = 0;
340 ToDoEvent *it; 346 ToDoEvent *it;
341 for ( it = list.first(); it; it = list.next() ) 347 for ( it = list.first(); it; it = list.next() )
342 insertIntoTable( it, row++ ); 348 insertIntoTable( it, row++ );
343} 349}
344 350
345 351
346ToDoEvent TodoTable::currentEntry() const 352ToDoEvent TodoTable::currentEntry() const
347{ 353{
348 printf ("in currentEntry\n"); 354 //qWarning ("in currentEntry\n");
349 355
350 QTableItem *i = item( currentRow(), 0 ); 356 QTableItem *i = item( currentRow(), 0 );
351 if ( !i || rowHeight( currentRow() ) <= 0 ) 357 if ( !i || rowHeight( currentRow() ) <= 0 )
352 return ToDoEvent(); 358 return ToDoEvent();
353 ToDoEvent *todo = todoList[(CheckItem*)i]; 359 ToDoEvent *todo = todoList[(CheckItem*)i];
354 todo->setCompleted( ( (CheckItem*)item( currentRow(), 0 ) )->isChecked() ); 360 todo->setCompleted( ( (CheckItem*)item( currentRow(), 0 ) )->isChecked() );
355 todo->setPriority( ( (ComboItem*)item( currentRow(), 1 ) )->text().toInt() ); 361 todo->setPriority( ( (ComboItem*)item( currentRow(), 1 ) )->text().toInt() );
356 return *todo; 362 return *todo;
357} 363}
358 364
359void TodoTable::replaceCurrentEntry( const ToDoEvent &todo, bool fromTableItem ) 365void TodoTable::replaceCurrentEntry( const ToDoEvent &todo, bool fromTableItem )
360{ 366{