summaryrefslogtreecommitdiff
path: root/core/pim/todo/todotable.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/todo/todotable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/todotable.cpp49
1 files changed, 26 insertions, 23 deletions
diff --git a/core/pim/todo/todotable.cpp b/core/pim/todo/todotable.cpp
index 877308a..52a3087 100644
--- a/core/pim/todo/todotable.cpp
+++ b/core/pim/todo/todotable.cpp
@@ -297,38 +297,35 @@ void TodoTable::slotClicked( int row, int col, int, const QPoint &pos )
int h = rowHeight( row );
if ( i && x >= ( w - BoxSize ) / 2 && x <= ( w - BoxSize ) / 2 + BoxSize &&
y >= ( h - BoxSize ) / 2 && y <= ( h - BoxSize ) / 2 + BoxSize ) {
i->toggle();
}
emit signalDoneChanged( i->isChecked() );
}
}
break;
case 1:
break;
case 2:
- // may as well edit it...
- // menuTimer->stop();
- // emit signalEdit();
// Show detailed view of the selected entry
{
menuTimer->stop();
ToDoEvent *todo = todoList[static_cast<CheckItem*>(item(row, 0))];
emit showDetails( *todo );
}
break;
case 3:
// may as well edit it...
menuTimer->stop();
- // emit signalEdit();
+ emit signalEdit();
break;
}
}
void TodoTable::slotPressed( int row, int col, int, const QPoint &pos )
{
if ( col == 2 && cellGeometry( row, col ).contains(pos) )
menuTimer->start( 750, TRUE );
}
void TodoTable::slotShowMenu()
{
@@ -650,45 +647,51 @@ void TodoTable::journalFreeRemoveEntry( int row )
{
CheckItem *chk;
chk = static_cast<CheckItem*>(item(row, 0 ));
if ( !chk )
return;
todoList.remove( chk );
realignTable( row );
}
void TodoTable::keyPressEvent( QKeyEvent *e )
{
- if ( e->key() == Key_Space || e->key() == Key_Return ) {
- switch ( currentColumn() ) {
- case 0: {
- CheckItem *i = static_cast<CheckItem*>(item(currentRow(),
- currentColumn()));
- if ( i )
- i->toggle();
- break;
- }
- case 1:
- break;
- case 2:
- emit signalEdit();
- default:
- break;
- }
- } else {
- QTable::keyPressEvent( e );
- }
+ if ( e->key() == Key_Space || e->key() == Key_Return ) {
+ switch ( currentColumn() ) {
+ case 0: {
+ CheckItem *i = static_cast<CheckItem*>(item(currentRow(),
+ currentColumn()));
+ if ( i )
+ i->toggle();
+ break;
+ }
+ case 1:
+ break;
+ case 2:{
+ ToDoEvent *todo = todoList[static_cast<CheckItem*>(item(currentRow(), 0))];
+ emit showDetails(*todo);
+ break;
+ }
+ case 3:
+ // Future: Let us change the dueDate directly...
+ emit signalEdit();
+ default:
+ break;
+ }
+ } else
+ QTable::keyPressEvent( e );
}
+
QStringList TodoTable::categories()
{
// This is called seldom, so calling a load in here
// should be fine.
mCat.load( categoryFileName() );
QStringList categoryList = mCat.labels( "Todo List" );
return categoryList;
}
void TodoTable::slotDoFind( const QString &findString, bool caseSensitive,
bool backwards, int category )
{