summaryrefslogtreecommitdiff
path: root/core/pim/todo/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index f3afa5f..33f13aa 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -1,8 +1,10 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
+ Copyright (C) 2002 zecke
+ Copyright (C) 2002 Stefan Eilers
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
@@ -104,12 +106,17 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
// qDebug("after load: t=%d", t.elapsed() );
Config config( "todo" );
config.setGroup( "View" );
bool complete = config.readBoolEntry( "ShowComplete", true );
table->setShowCompleted( complete );
+
+ /* added 20.01.2k2 by se */
+ bool showdeadline = config.readBoolEntry("ShowDeadLine", true);
+ table->setShowDeadline (showdeadline);
+
QString category = config.readEntry( "Category", QString::null );
table->setShowCategory( category );
QPEToolBar *bar = new QPEToolBar( this );
bar->setHorizontalStretchable( TRUE );
@@ -171,12 +178,15 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
//a->setEnabled( FALSE );
findAction = a;
// qDebug("mainwindow #2: t=%d", t.elapsed() );
completedAction = new QAction( QString::null, tr("Completed tasks"), 0, this, 0, TRUE );
+ /* added 20.01.2k2 by se */
+ showdeadlineAction = new QAction( QString::null, tr( "Show Deadline" ), 0, this, 0, TRUE );
+
catMenu->setCheckable( true );
populateCategories();
mb->insertItem( tr( "Task" ), edit );
mb->insertItem( tr( "View" ), catMenu );
@@ -192,12 +202,13 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
table->updateVisible();
table->setUpdatesEnabled( TRUE );
table->setPaintingEnabled( TRUE );
table->viewport()->setUpdatesEnabled( TRUE );
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 ) ) );
// qDebug("done: t=%d", t.elapsed() );
}
@@ -348,12 +359,14 @@ void TodoWindow::setCategory( int c )
void TodoWindow::populateCategories()
{
catMenu->clear();
completedAction->addTo( catMenu );
completedAction->setOn( table->showCompleted() );
+ showdeadlineAction->addTo( catMenu );
+ showdeadlineAction->setOn( table->showDeadline() );
int id, rememberId;
id = 1;
catMenu->insertItem( tr( "All Categories" ), id++ );
// catMenu->insertSeparator();
QStringList categories = table->categories();
@@ -399,12 +412,14 @@ void TodoWindow::closeEvent( QCloseEvent *e )
// error, but I feel that it is "ok" for us to exit
// espically since we aren't told if the write succeeded...
Config config( "todo" );
config.setGroup( "View" );
config.writeEntry( "ShowComplete", table->showCompleted() );
config.writeEntry( "Category", table->showCategory() );
+ /* added 20.01.2k2 by se */
+ config.writeEntry( "ShowDeadLine", table->showDeadline());
} else {
if ( QMessageBox::critical( this, tr("Out of space"),
tr("Todo was unable\n"
"to save your changes.\n"
"Free up some space\n"
"and try again.\n"
@@ -470,6 +485,14 @@ void TodoWindow::slotBeam()
void TodoWindow::beamDone( Ir *ir )
{
delete ir;
unlink( beamfile );
}
+
+/* added 20.01.2k2 by se */
+void TodoWindow::showDeadline( bool s )
+{
+ table->setPaintingEnabled( false );
+ table->setShowDeadline( s );
+ table->setPaintingEnabled( true );
+}