summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp6
-rw-r--r--core/pim/todo/mainwindow.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index d419166..27e76d9 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -149,24 +149,25 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f ) :
this, SLOT( slotEdit() ) );
a->addTo( bar );
a->addTo( edit );
a->addTo( contextMenu );
a->setEnabled( FALSE );
editAction = a;
a = new QAction( QString::null, tr("View Task"), 0, this, 0 );
a->addTo( edit );
a->addTo( contextMenu );
connect( a, SIGNAL( activated() ),
this, SLOT(slotShowDetails() ) );
+ viewAction = a;
edit->insertSeparator();
a = new QAction( tr( "Delete..." ), Resource::loadIconSet( "trash" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ),
this, SLOT( slotDelete() ) );
a->addTo( bar );
a->addTo( edit );
a->addTo( contextMenu );
a->setEnabled( FALSE );
deleteAction = a;
@@ -427,29 +428,31 @@ void TodoWindow::showCompleted( bool s )
if ( !table->isUpdatesEnabled() )
return;
table->setPaintingEnabled( false );
table->setShowCompleted( s );
table->setPaintingEnabled( true );
mStack->raiseWidget( 1 );
}
void TodoWindow::currentEntryChanged( int r, int )
{
if ( r != -1 && table->rowHeight( r ) > 0 ) {
editAction->setEnabled( TRUE );
+ viewAction->setEnabled( TRUE );
deleteAction->setEnabled( TRUE );
duplicateAction->setEnabled( TRUE );
deleteAllAction->setEnabled( TRUE );
} else {
editAction->setEnabled( FALSE );
+ viewAction->setEnabled( FALSE );
deleteAction->setEnabled( FALSE );
duplicateAction->setEnabled( FALSE );
deleteAllAction->setEnabled( FALSE );
}
}
void TodoWindow::setCategory( int c )
{
if ( c <= 0 ) return;
if ( !table->isUpdatesEnabled() )
return;
table->setPaintingEnabled( false );
@@ -598,27 +601,30 @@ void TodoWindow::slotBeam()
QString description = c.summary();
ir->send( beamfile, description, "text/x-vCalendar" );
}
void TodoWindow::beamDone( Ir *ir )
{
delete ir;
unlink( beamfile );
}
void TodoWindow::showDeadline( bool s )
{
+ if ( !table->isUpdatesEnabled() )
+ return;
table->setPaintingEnabled( false );
table->setShowDeadline( s );
table->setPaintingEnabled( true );
+ mStack->raiseWidget( 1 );
}
void TodoWindow::slotShowDetails()
{
ToDoEvent event = table->currentEntry();
slotShowDetails( event );
}
void TodoWindow::slotShowDetails( const ToDoEvent &event )
{
if( mView == 0l ){
mView = new TodoLabel(mStack);
mStack->addWidget( mView, 2 );
}
diff --git a/core/pim/todo/mainwindow.h b/core/pim/todo/mainwindow.h
index f62ec6e..7e8445c 100644
--- a/core/pim/todo/mainwindow.h
+++ b/core/pim/todo/mainwindow.h
@@ -70,24 +70,25 @@ protected slots:
protected:
void closeEvent( QCloseEvent *e );
private:
void populateCategories();
//inline void switchToTable(); // move back to the normal view
private:
TodoTable *table;
TodoLabel *mView;
QAction *editAction,
+ *viewAction,
*deleteAction,
*findAction,
*completedAction,
*showdeadlineAction,
*deleteAllAction,
*duplicateAction;
QPopupMenu *contextMenu, *catMenu;
QWidgetStack *mStack;
bool syncing;
};