-rw-r--r-- | core/pim/todo/TODO | 1 | ||||
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 9 | ||||
-rw-r--r-- | core/pim/todo/mainwindow.h | 3 |
3 files changed, 12 insertions, 1 deletions
diff --git a/core/pim/todo/TODO b/core/pim/todo/TODO index e5d2f9d..040f163 100644 --- a/core/pim/todo/TODO +++ b/core/pim/todo/TODO @@ -1,3 +1,4 @@ -fix the journal -fix day wrapping update all DueDateItems -when checking the C. box update the deadline
\ No newline at end of file +-TodoLabel : public TextView diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index a34bcf2..b5cace9 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp @@ -7,48 +7,49 @@ ** ** 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 ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #define QTOPIA_INTERNAL_FD #include "mainwindow.h" #include "todoentryimpl.h" #include "todotable.h" #include <opie/tododb.h> #include <opie/todovcalresource.h> +#include <opie/ofontmenu.h> #include <qpe/qpeapplication.h> #include <qpe/config.h> #include <qpe/finddialog.h> #include <qpe/global.h> #include <qpe/ir.h> #include <qpe/qpemenubar.h> #include <qpe/qpemessagebox.h> #include <qpe/resource.h> //#include <qpe/task.h> #include <qpe/qpetoolbar.h> #include <qaction.h> #include <qarray.h> #include <qdatastream.h> #include <qdatetime.h> #include <qfile.h> #include <qmessagebox.h> #include <qpopupmenu.h> #include <sys/stat.h> #include <sys/types.h> #include <fcntl.h> #include <unistd.h> @@ -164,49 +165,49 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f = 0 ) : } a = new QAction( tr( "Find" ), Resource::loadIconSet( "mag" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( slotFind() ) ); a->addTo( bar ); a->addTo( edit ); if ( table->numRows() ) a->setEnabled( TRUE ); else a->setEnabled( FALSE ); //a->setEnabled( FALSE ); findAction = a; // qDebug("mainwindow #2: t=%d", t.elapsed() ); completedAction = new QAction( QString::null, tr("Completed tasks"), 0, this, 0, TRUE ); showdeadlineAction = new QAction( QString::null, tr( "Show Deadline" ), 0, this, 0, TRUE ); catMenu->setCheckable( true ); populateCategories(); - mb->insertItem( tr( "Task" ), edit ); + mb->insertItem( tr( "Data" ), edit ); mb->insertItem( tr( "View" ), catMenu ); resize( 200, 300 ); if ( table->numRows() > 0 ) 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 ); 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() ); } @@ -337,48 +338,54 @@ void TodoWindow::setCategory( int c ) if ( c <= 0 ) return; if ( !table->isUpdatesEnabled() ) return; table->setPaintingEnabled( false ); for ( unsigned int i = 1; i < catMenu->count(); i++ ) catMenu->setItemChecked( i, c == (int)i ); if ( c == 1 ) { table->setShowCategory( QString::null ); setCaption( tr("Todo") + " - " + tr( "All Categories" ) ); } else if ( c == (int)catMenu->count() - 1 ) { table->setShowCategory( tr( "Unfiled" ) ); setCaption( tr("Todo") + " - " + tr( "Unfiled" ) ); } else { QString cat = table->categories()[c - 2]; table->setShowCategory( cat ); setCaption( tr("Todo") + " - " + cat ); } table->setPaintingEnabled( true ); } void TodoWindow::populateCategories() { catMenu->clear(); + QList<QWidget> list; + list.append(table ); + OFontMenu *menu = new OFontMenu(this, "menu",list ); + menu->forceSize( table->horizontalHeader(), 10 ); + catMenu->insertItem(tr("Fonts"), menu ); + completedAction->addTo( catMenu ); completedAction->setOn( table->showCompleted() ); showdeadlineAction->addTo( catMenu ); showdeadlineAction->setOn( table->showDeadline() ); catMenu->insertSeparator(); int id, rememberId; id = 1; catMenu->insertItem( tr( "All Categories" ), id++ ); // catMenu->insertSeparator(); QStringList categories = table->categories(); categories.append( tr( "Unfiled" ) ); for ( QStringList::Iterator it = categories.begin(); it != categories.end(); ++it ) { catMenu->insertItem( *it, id ); if ( *it == table->showCategory() ) rememberId = id; ++id; } if ( table->showCategory().isEmpty() ) setCategory( 1 ); else setCategory( rememberId ); } diff --git a/core/pim/todo/mainwindow.h b/core/pim/todo/mainwindow.h index a81c27c..9be7c66 100644 --- a/core/pim/todo/mainwindow.h +++ b/core/pim/todo/mainwindow.h @@ -7,48 +7,49 @@ ** 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 ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <qmainwindow.h> class TodoTable; class QAction; class QPopupMenu; class Ir; +class OFontMenu; class TodoWindow : public QMainWindow { Q_OBJECT public: TodoWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); ~TodoWindow(); public slots: void flush(); void reload(); protected slots: void slotNew(); void slotDelete(); void slotEdit(); void slotShowPopup( const QPoint & ); void showCompleted( bool ); /* added 20.01.2k2 by se */ void showDeadline( bool ); void currentEntryChanged( int r, int c ); @@ -56,24 +57,26 @@ protected slots: void slotFind(); void setDocument( const QString & ); void slotBeam(); void beamDone( Ir * ); protected: void closeEvent( QCloseEvent *e ); private: void populateCategories(); private: TodoTable *table; QAction *editAction, *deleteAction, *findAction, * completedAction, *showdeadlineAction ; QPopupMenu *contextMenu, *catMenu; bool syncing; }; #endif + + |