summaryrefslogtreecommitdiff
path: root/core/pim/todo/mainwindow.cpp
authorzecke <zecke>2002-04-23 12:45:20 (UTC)
committer zecke <zecke>2002-04-23 12:45:20 (UTC)
commite25c5384f3f3025be64ed26d244c59afc5862711 (patch) (side-by-side diff)
tree603f32b0550ecda9cbe95a93807a2a89b32cabcd /core/pim/todo/mainwindow.cpp
parent367304a610dd618ad45ddce8256ba4d7d8ded442 (diff)
downloadopie-e25c5384f3f3025be64ed26d244c59afc5862711.zip
opie-e25c5384f3f3025be64ed26d244c59afc5862711.tar.gz
opie-e25c5384f3f3025be64ed26d244c59afc5862711.tar.bz2
Patch from Stefan Eilers for overview
merged by hand
Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp68
1 files changed, 59 insertions, 9 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index fc17c5f..d3f4cb4 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -2,4 +2,4 @@
** Copyright (C) 2000 Trolltech AS. All rights reserved.
- Copyright (C) 2002 zecke
- Copyright (C) 2002 Stefan Eilers
+** Copyright (C) 2002 zecke
+** Copyright (C) 2002 Stefan Eilers (se, eilers.stefan@epost.de)
**
@@ -27,2 +27,3 @@
#include "todotable.h"
+#include "todolabel.h"
@@ -50,2 +51,3 @@
#include <qpopupmenu.h>
+#include <qwidgetstack.h>
@@ -73,3 +75,4 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
// t.start();
-
+ mView = 0l;
+ mStack = new QWidgetStack(this, "main stack");
setCaption( tr("Todo") );
@@ -103,3 +106,5 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
- setCentralWidget( table );
+ mStack->addWidget(table, 1 );
+ mStack->raiseWidget( 1 );
+ setCentralWidget( mStack );
setToolBarsMovable( FALSE );
@@ -148,2 +153,9 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
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() ) );
+
edit->insertSeparator();
@@ -178,4 +190,6 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
duplicateAction = a;
-
edit->insertSeparator();
+
+
+
if ( Ir::supported() ) {
@@ -251,2 +265,4 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
+ connect( table, SIGNAL(showDetails(const ToDoEvent &) ),
+ this, SLOT(slotShowDetails(const ToDoEvent & ) ) );
// qDebug("done: t=%d", t.elapsed() );
@@ -288,2 +304,3 @@ void TodoWindow::slotNew()
populateCategories();
+ mStack->raiseWidget(1 );
}
@@ -320,2 +337,3 @@ void TodoWindow::slotDelete()
}
+ mStack->raiseWidget(1);
}
@@ -331,3 +349,3 @@ void TodoWindow::slotDeleteAll()
- if ( !QPEMessageBox::confirmDelete( this, tr( "Todo" ), tr("Should I delete all tasks?") ) )
+ if ( !QPEMessageBox::confirmDelete( this, tr( "Todo" ), tr("Delete all tasks?") ) )
return;
@@ -344,2 +362,3 @@ void TodoWindow::slotDeleteAll()
}
+ mStack->raiseWidget(1 );
}
@@ -371,3 +390,3 @@ void TodoWindow::slotEdit()
populateCategories();
-
+ mStack->raiseWidget( 1 );
}
@@ -381,3 +400,10 @@ void TodoWindow::slotDuplicate()
ToDoEvent ev = table->currentEntry();
- ToDoEvent ev2 = ToDoEvent( ev );
+ ToDoEvent ev2 = ToDoEvent( ev ); // what about the uid
+ int uid;
+ { // uid
+ Qtopia::UidGen *uidgen = new Qtopia::UidGen();
+ uid = uidgen->generate();
+ delete uidgen;
+ }
+ ev2.setUid( uid );
table->setPaintingEnabled( false );
@@ -385,2 +411,4 @@ void TodoWindow::slotDuplicate()
table->setPaintingEnabled( true );
+
+ mStack->raiseWidget( 1 );
}
@@ -435,2 +463,4 @@ void TodoWindow::setCategory( int c )
table->setPaintingEnabled( true );
+
+ mStack->raiseWidget( 1 );
}
@@ -442,2 +472,3 @@ void TodoWindow::populateCategories()
id = 1;
+ rememberId = 0;
catMenu->insertItem( tr( "All Categories" ), id++ );
@@ -474,2 +505,7 @@ void TodoWindow::closeEvent( QCloseEvent *e )
{
+ if( mStack->visibleWidget() != table ){
+ mStack->raiseWidget( 1 );
+ e->ignore();
+ return;
+ }
if(syncing) {
@@ -564,3 +600,2 @@ void TodoWindow::beamDone( Ir *ir )
-/* added 20.01.2k2 by se */
void TodoWindow::showDeadline( bool s )
@@ -571 +606,16 @@ void TodoWindow::showDeadline( bool s )
}
+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 );
+ }
+ mView->init( event );
+ mView->sync();
+ mStack->raiseWidget( 2);
+}