Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index 33f13aa..a34bcf2 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -101,25 +101,24 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | |||
101 | "before you enter any data") ); | 101 | "before you enter any data") ); |
102 | 102 | ||
103 | setCentralWidget( table ); | 103 | setCentralWidget( table ); |
104 | setToolBarsMovable( FALSE ); | 104 | setToolBarsMovable( FALSE ); |
105 | 105 | ||
106 | // qDebug("after load: t=%d", t.elapsed() ); | 106 | // qDebug("after load: t=%d", t.elapsed() ); |
107 | 107 | ||
108 | Config config( "todo" ); | 108 | Config config( "todo" ); |
109 | config.setGroup( "View" ); | 109 | config.setGroup( "View" ); |
110 | bool complete = config.readBoolEntry( "ShowComplete", true ); | 110 | bool complete = config.readBoolEntry( "ShowComplete", true ); |
111 | table->setShowCompleted( complete ); | 111 | table->setShowCompleted( complete ); |
112 | 112 | ||
113 | /* added 20.01.2k2 by se */ | ||
114 | bool showdeadline = config.readBoolEntry("ShowDeadLine", true); | 113 | bool showdeadline = config.readBoolEntry("ShowDeadLine", true); |
115 | table->setShowDeadline (showdeadline); | 114 | table->setShowDeadline (showdeadline); |
116 | 115 | ||
117 | QString category = config.readEntry( "Category", QString::null ); | 116 | QString category = config.readEntry( "Category", QString::null ); |
118 | table->setShowCategory( category ); | 117 | table->setShowCategory( category ); |
119 | 118 | ||
120 | QPEToolBar *bar = new QPEToolBar( this ); | 119 | QPEToolBar *bar = new QPEToolBar( this ); |
121 | bar->setHorizontalStretchable( TRUE ); | 120 | bar->setHorizontalStretchable( TRUE ); |
122 | 121 | ||
123 | QPEMenuBar *mb = new QPEMenuBar( bar ); | 122 | QPEMenuBar *mb = new QPEMenuBar( bar ); |
124 | 123 | ||
125 | catMenu = new QPopupMenu( this ); | 124 | catMenu = new QPopupMenu( this ); |
@@ -172,25 +171,24 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | |||
172 | a->addTo( edit ); | 171 | a->addTo( edit ); |
173 | if ( table->numRows() ) | 172 | if ( table->numRows() ) |
174 | a->setEnabled( TRUE ); | 173 | a->setEnabled( TRUE ); |
175 | else | 174 | else |
176 | a->setEnabled( FALSE ); | 175 | a->setEnabled( FALSE ); |
177 | 176 | ||
178 | //a->setEnabled( FALSE ); | 177 | //a->setEnabled( FALSE ); |
179 | findAction = a; | 178 | findAction = a; |
180 | // qDebug("mainwindow #2: t=%d", t.elapsed() ); | 179 | // qDebug("mainwindow #2: t=%d", t.elapsed() ); |
181 | 180 | ||
182 | completedAction = new QAction( QString::null, tr("Completed tasks"), 0, this, 0, TRUE ); | 181 | completedAction = new QAction( QString::null, tr("Completed tasks"), 0, this, 0, TRUE ); |
183 | 182 | ||
184 | /* added 20.01.2k2 by se */ | ||
185 | showdeadlineAction = new QAction( QString::null, tr( "Show Deadline" ), 0, this, 0, TRUE ); | 183 | showdeadlineAction = new QAction( QString::null, tr( "Show Deadline" ), 0, this, 0, TRUE ); |
186 | 184 | ||
187 | catMenu->setCheckable( true ); | 185 | catMenu->setCheckable( true ); |
188 | populateCategories(); | 186 | populateCategories(); |
189 | 187 | ||
190 | mb->insertItem( tr( "Task" ), edit ); | 188 | mb->insertItem( tr( "Task" ), edit ); |
191 | mb->insertItem( tr( "View" ), catMenu ); | 189 | mb->insertItem( tr( "View" ), catMenu ); |
192 | 190 | ||
193 | resize( 200, 300 ); | 191 | resize( 200, 300 ); |
194 | if ( table->numRows() > 0 ) | 192 | if ( table->numRows() > 0 ) |
195 | currentEntryChanged( 0, 0 ); | 193 | currentEntryChanged( 0, 0 ); |
196 | connect( table, SIGNAL( signalEdit() ), | 194 | connect( table, SIGNAL( signalEdit() ), |
@@ -355,25 +353,25 @@ void TodoWindow::setCategory( int c ) | |||
355 | } | 353 | } |
356 | table->setPaintingEnabled( true ); | 354 | table->setPaintingEnabled( true ); |
357 | } | 355 | } |
358 | 356 | ||
359 | void TodoWindow::populateCategories() | 357 | void TodoWindow::populateCategories() |
360 | { | 358 | { |
361 | catMenu->clear(); | 359 | catMenu->clear(); |
362 | 360 | ||
363 | completedAction->addTo( catMenu ); | 361 | completedAction->addTo( catMenu ); |
364 | completedAction->setOn( table->showCompleted() ); | 362 | completedAction->setOn( table->showCompleted() ); |
365 | showdeadlineAction->addTo( catMenu ); | 363 | showdeadlineAction->addTo( catMenu ); |
366 | showdeadlineAction->setOn( table->showDeadline() ); | 364 | showdeadlineAction->setOn( table->showDeadline() ); |
367 | 365 | catMenu->insertSeparator(); | |
368 | int id, rememberId; | 366 | int id, rememberId; |
369 | id = 1; | 367 | id = 1; |
370 | catMenu->insertItem( tr( "All Categories" ), id++ ); | 368 | catMenu->insertItem( tr( "All Categories" ), id++ ); |
371 | // catMenu->insertSeparator(); | 369 | // catMenu->insertSeparator(); |
372 | QStringList categories = table->categories(); | 370 | QStringList categories = table->categories(); |
373 | categories.append( tr( "Unfiled" ) ); | 371 | categories.append( tr( "Unfiled" ) ); |
374 | for ( QStringList::Iterator it = categories.begin(); | 372 | for ( QStringList::Iterator it = categories.begin(); |
375 | it != categories.end(); ++it ) { | 373 | it != categories.end(); ++it ) { |
376 | catMenu->insertItem( *it, id ); | 374 | catMenu->insertItem( *it, id ); |
377 | if ( *it == table->showCategory() ) | 375 | if ( *it == table->showCategory() ) |
378 | rememberId = id; | 376 | rememberId = id; |
379 | ++id; | 377 | ++id; |