summaryrefslogtreecommitdiff
path: root/core
authorzecke <zecke>2002-03-20 21:45:51 (UTC)
committer zecke <zecke>2002-03-20 21:45:51 (UTC)
commite9189f8d0cc46b0532fdcbcb2377ae3d108666d5 (patch) (unidiff)
tree20af6104c262510595b82e619ee69b0958596ddd /core
parent0b39bb8d62f67a86128a6bd16afbd2aae004637c (diff)
downloadopie-e9189f8d0cc46b0532fdcbcb2377ae3d108666d5.zip
opie-e9189f8d0cc46b0532fdcbcb2377ae3d108666d5.tar.gz
opie-e9189f8d0cc46b0532fdcbcb2377ae3d108666d5.tar.bz2
vCal Resource for the tododb
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp8
-rw-r--r--core/pim/todo/mainwindow.h3
-rw-r--r--core/pim/todo/todoentryimpl.cpp2
3 files changed, 9 insertions, 4 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index fb85a09..6709811 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -15,12 +15,14 @@
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#define QTOPIA_INTERNAL_FD
22
21#include "mainwindow.h" 23#include "mainwindow.h"
22#include "todoentryimpl.h" 24#include "todoentryimpl.h"
23#include "todotable.h" 25#include "todotable.h"
24 26
25#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
26#include <qpe/config.h> 28#include <qpe/config.h>
@@ -119,21 +121,23 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
119 QAction *a = new QAction( tr( "New Task" ), Resource::loadPixmap( "new" ), 121 QAction *a = new QAction( tr( "New Task" ), Resource::loadPixmap( "new" ),
120 QString::null, 0, this, 0 ); 122 QString::null, 0, this, 0 );
121 connect( a, SIGNAL( activated() ), 123 connect( a, SIGNAL( activated() ),
122 this, SLOT( slotNew() ) ); 124 this, SLOT( slotNew() ) );
123 a->addTo( bar ); 125 a->addTo( bar );
124 a->addTo( edit ); 126 a->addTo( edit );
127
125 a = new QAction( tr( "Edit" ), Resource::loadIconSet( "edit" ), 128 a = new QAction( tr( "Edit" ), Resource::loadIconSet( "edit" ),
126 QString::null, 0, this, 0 ); 129 QString::null, 0, this, 0 );
127 connect( a, SIGNAL( activated() ), 130 connect( a, SIGNAL( activated() ),
128 this, SLOT( slotEdit() ) ); 131 this, SLOT( slotEdit() ) );
129 a->addTo( bar ); 132 a->addTo( bar );
130 a->addTo( edit ); 133 a->addTo( edit );
131 a->addTo( contextMenu ); 134 a->addTo( contextMenu );
132 a->setEnabled( FALSE ); 135 a->setEnabled( FALSE );
133 editAction = a; 136 editAction = a;
137
134 a = new QAction( tr( "Delete" ), Resource::loadIconSet( "trash" ), 138 a = new QAction( tr( "Delete" ), Resource::loadIconSet( "trash" ),
135 QString::null, 0, this, 0 ); 139 QString::null, 0, this, 0 );
136 connect( a, SIGNAL( activated() ), 140 connect( a, SIGNAL( activated() ),
137 this, SLOT( slotDelete() ) ); 141 this, SLOT( slotDelete() ) );
138 a->addTo( bar ); 142 a->addTo( bar );
139 a->addTo( edit ); 143 a->addTo( edit );
@@ -323,13 +327,13 @@ void TodoWindow::setCategory( int c )
323 return; 327 return;
324 table->setPaintingEnabled( false ); 328 table->setPaintingEnabled( false );
325 for ( unsigned int i = 1; i < catMenu->count(); i++ ) 329 for ( unsigned int i = 1; i < catMenu->count(); i++ )
326 catMenu->setItemChecked( i, c == (int)i ); 330 catMenu->setItemChecked( i, c == (int)i );
327 if ( c == 1 ) { 331 if ( c == 1 ) {
328 table->setShowCategory( QString::null ); 332 table->setShowCategory( QString::null );
329 setCaption( tr("Todo") + " - " + tr( "All" ) ); 333 setCaption( tr("Todo") + " - " + tr( "All Categories" ) );
330 } else if ( c == (int)catMenu->count() - 1 ) { 334 } else if ( c == (int)catMenu->count() - 1 ) {
331 table->setShowCategory( tr( "Unfiled" ) ); 335 table->setShowCategory( tr( "Unfiled" ) );
332 setCaption( tr("Todo") + " - " + tr( "Unfiled" ) ); 336 setCaption( tr("Todo") + " - " + tr( "Unfiled" ) );
333 } else { 337 } else {
334 QString cat = table->categories()[c - 2]; 338 QString cat = table->categories()[c - 2];
335 table->setShowCategory( cat ); 339 table->setShowCategory( cat );
@@ -345,13 +349,13 @@ void TodoWindow::populateCategories()
345 completedAction->addTo( catMenu ); 349 completedAction->addTo( catMenu );
346 completedAction->setOn( table->showCompleted() ); 350 completedAction->setOn( table->showCompleted() );
347 351
348 int id, 352 int id,
349 rememberId; 353 rememberId;
350 id = 1; 354 id = 1;
351 catMenu->insertItem( tr( "All" ), id++ ); 355 catMenu->insertItem( tr( "All Categories" ), id++ );
352// catMenu->insertSeparator(); 356// catMenu->insertSeparator();
353 QStringList categories = table->categories(); 357 QStringList categories = table->categories();
354 categories.append( tr( "Unfiled" ) ); 358 categories.append( tr( "Unfiled" ) );
355 for ( QStringList::Iterator it = categories.begin(); 359 for ( QStringList::Iterator it = categories.begin();
356 it != categories.end(); ++it ) { 360 it != categories.end(); ++it ) {
357 catMenu->insertItem( *it, id ); 361 catMenu->insertItem( *it, id );
diff --git a/core/pim/todo/mainwindow.h b/core/pim/todo/mainwindow.h
index f4fcd1b..856dcb4 100644
--- a/core/pim/todo/mainwindow.h
+++ b/core/pim/todo/mainwindow.h
@@ -1,10 +1,11 @@
1/********************************************************************** 1/**********************************************************************
2 Copyright (C) 2002 Holger 'zecke' Freyther <freyther@kde.org>
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 3** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 4**
4** This file is part of Qtopia Environment. 5** This file is part of Qtopia and Opi Environment.
5** 6**
6** This file may be distributed and/or modified under the terms of the 7** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 8** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 9** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 10** packaging of this file.
10** 11**
diff --git a/core/pim/todo/todoentryimpl.cpp b/core/pim/todo/todoentryimpl.cpp
index 79206de..c957715 100644
--- a/core/pim/todo/todoentryimpl.cpp
+++ b/core/pim/todo/todoentryimpl.cpp
@@ -130,13 +130,13 @@ Task NewTaskDialog::todoEntry()
130 130
131*/ 131*/
132 132
133void NewTaskDialog::accept() 133void NewTaskDialog::accept()
134{ 134{
135 QString strText = txtTodo->text(); 135 QString strText = txtTodo->text();
136 if ( !strText || strText == "") { 136 if ( strText.isEmpty() ) {
137 // hmm... just decline it then, the user obviously didn't care about it 137 // hmm... just decline it then, the user obviously didn't care about it
138 QDialog::reject(); 138 QDialog::reject();
139 return; 139 return;
140 } 140 }
141 QDialog::accept(); 141 QDialog::accept();
142} 142}