summaryrefslogtreecommitdiff
path: root/core/pim/todo
authorzecke <zecke>2002-05-09 15:51:20 (UTC)
committer zecke <zecke>2002-05-09 15:51:20 (UTC)
commit168d7dcdaee8555365af4c918dc941d8cc0dcb68 (patch) (side-by-side diff)
treece5b6b357c4247345797ae7c8c059532b3aa142d /core/pim/todo
parent7999411de407eaaf57cae9e2d0cb3767c714d161 (diff)
downloadopie-168d7dcdaee8555365af4c918dc941d8cc0dcb68.zip
opie-168d7dcdaee8555365af4c918dc941d8cc0dcb68.tar.gz
opie-168d7dcdaee8555365af4c918dc941d8cc0dcb68.tar.bz2
Patch from Stefan Eilers to make the Table align better and the viewing of events more easy
Diffstat (limited to 'core/pim/todo') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp3
-rw-r--r--core/pim/todo/todotable.cpp17
2 files changed, 13 insertions, 7 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index 5609211..b7b1da0 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -248,24 +248,27 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f ) :
currentEntryChanged( 0, 0 );
connect( table, SIGNAL( signalEdit() ),
this, SLOT( slotEdit() ) );
connect( table, SIGNAL(signalShowMenu(const QPoint &)),
this, SLOT( slotShowPopup(const QPoint &)) );
// qDebug("mainwindow #3: t=%d", t.elapsed() );
table->updateVisible();
table->setUpdatesEnabled( TRUE );
table->setPaintingEnabled( TRUE );
table->viewport()->setUpdatesEnabled( TRUE );
+ // Initialize the table
+ table->updateVisible();
+
connect( completedAction, SIGNAL( toggled(bool) ), this, SLOT( showCompleted(bool) ) );
connect( showdeadlineAction, SIGNAL( toggled(bool) ), this, SLOT( showDeadline(bool) ) );
connect( catMenu, SIGNAL(activated(int)), this, SLOT(setCategory(int)) );
connect( table, SIGNAL( currentChanged( int, int ) ),
this, SLOT( currentEntryChanged( int, int ) ) );
connect( table, SIGNAL(showDetails(const ToDoEvent &) ),
this, SLOT(slotShowDetails(const ToDoEvent & ) ) );
// qDebug("done: t=%d", t.elapsed() );
}
void TodoWindow::slotNew()
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()
{
@@ -661,33 +658,39 @@ 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:
+ 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 {
+ } 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 )