-rw-r--r-- | core/pim/todo/tableview.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp index 0d298f4..0b1c579 100644 --- a/core/pim/todo/tableview.cpp +++ b/core/pim/todo/tableview.cpp | |||
@@ -26,21 +26,22 @@ | |||
26 | 26 | ||
27 | */ | 27 | */ |
28 | #include <stdlib.h> | 28 | #include <stdlib.h> |
29 | #include <cmath> | 29 | #include <cmath> |
30 | #include <cctype> | 30 | #include <cctype> |
31 | 31 | ||
32 | #include <qcombobox.h> | 32 | #include <opie2/odebug.h> |
33 | #include <qlineedit.h> | 33 | #include <opie2/opimrecurrence.h> |
34 | #include <qtimer.h> | ||
35 | #include <qpopupmenu.h> | ||
36 | 34 | ||
37 | #include <qpe/config.h> | 35 | #include <qpe/config.h> |
38 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
39 | 37 | ||
40 | #include <opie2/opimrecurrence.h> | 38 | #include <qcombobox.h> |
39 | #include <qlineedit.h> | ||
40 | #include <qtimer.h> | ||
41 | #include <qpopupmenu.h> | ||
41 | 42 | ||
42 | #include "mainwindow.h" | 43 | #include "mainwindow.h" |
43 | //#include "tableitems.h" | 44 | //#include "tableitems.h" |
44 | #include "tableview.h" | 45 | #include "tableview.h" |
45 | 46 | ||
46 | using namespace Todo; | 47 | using namespace Todo; |
@@ -191,13 +192,13 @@ QString TableView::currentRepresentation() { | |||
191 | void TableView::showOverDue( bool ) { | 192 | void TableView::showOverDue( bool ) { |
192 | clear(); | 193 | clear(); |
193 | updateView(); | 194 | updateView(); |
194 | } | 195 | } |
195 | 196 | ||
196 | void TableView::updateView( ) { | 197 | void TableView::updateView( ) { |
197 | qWarning("update view"); | 198 | Opie::Core::owarn << "update view" << oendl; |
198 | m_row = false; | 199 | m_row = false; |
199 | static int id; | 200 | static int id; |
200 | id = startTimer(4000 ); | 201 | id = startTimer(4000 ); |
201 | /* FIXME we want one page to be read! | 202 | /* FIXME we want one page to be read! |
202 | * | 203 | * |
203 | * Calculate that screensize | 204 | * Calculate that screensize |
@@ -205,13 +206,13 @@ void TableView::updateView( ) { | |||
205 | todoWindow()->setReadAhead( 4 ); | 206 | todoWindow()->setReadAhead( 4 ); |
206 | sort(); | 207 | sort(); |
207 | OPimTodoAccess::List::Iterator it, end; | 208 | OPimTodoAccess::List::Iterator it, end; |
208 | it = sorted().begin(); | 209 | it = sorted().begin(); |
209 | end = sorted().end(); | 210 | end = sorted().end(); |
210 | 211 | ||
211 | qWarning("setTodos"); | 212 | Opie::Core::owarn << "setTodos" << oendl; |
212 | QTime time; | 213 | QTime time; |
213 | time.start(); | 214 | time.start(); |
214 | m_enablePaint = false; | 215 | m_enablePaint = false; |
215 | setUpdatesEnabled( false ); | 216 | setUpdatesEnabled( false ); |
216 | viewport()->setUpdatesEnabled( false ); | 217 | viewport()->setUpdatesEnabled( false ); |
217 | 218 | ||
@@ -251,17 +252,17 @@ void TableView::replaceEvent( const OPimTodo& ev) { | |||
251 | * either this or the old align table | 252 | * either this or the old align table |
252 | */ | 253 | */ |
253 | void TableView::removeEvent( int ) { | 254 | void TableView::removeEvent( int ) { |
254 | updateView(); | 255 | updateView(); |
255 | } | 256 | } |
256 | void TableView::setShowCompleted( bool b) { | 257 | void TableView::setShowCompleted( bool b) { |
257 | qWarning("Show Completed %d" , b ); | 258 | Opie::Core::owarn << "Show Completed " << b << oendl; |
258 | updateView(); | 259 | updateView(); |
259 | } | 260 | } |
260 | void TableView::setShowDeadline( bool b ) { | 261 | void TableView::setShowDeadline( bool b ) { |
261 | qWarning( "Show DeadLine %d" , b ); | 262 | Opie::Core::owarn << "Show Deadline " << b << oendl; |
262 | if ( b ) | 263 | if ( b ) |
263 | showColumn( 3 ); | 264 | showColumn( 3 ); |
264 | else | 265 | else |
265 | hideColumn( 3 ); | 266 | hideColumn( 3 ); |
266 | 267 | ||
267 | // Try to intelligently size columns | 268 | // Try to intelligently size columns |
@@ -278,13 +279,13 @@ void TableView::setShowDeadline( bool b ) { | |||
278 | setColumnWidth( 3, width ); | 279 | setColumnWidth( 3, width ); |
279 | col2width -= width; | 280 | col2width -= width; |
280 | } | 281 | } |
281 | setColumnWidth( 2, col2width ); | 282 | setColumnWidth( 2, col2width ); |
282 | } | 283 | } |
283 | void TableView::setShowCategory( const QString& str) { | 284 | void TableView::setShowCategory( const QString& str) { |
284 | qWarning("setShowCategory"); | 285 | Opie::Core::owarn << "setShowCategory" << oendl; |
285 | if ( str != m_oleCat || m_first ) | 286 | if ( str != m_oleCat || m_first ) |
286 | updateView(); | 287 | updateView(); |
287 | 288 | ||
288 | m_oleCat = str; | 289 | m_oleCat = str; |
289 | m_first = false; | 290 | m_first = false; |
290 | 291 | ||
@@ -343,20 +344,21 @@ void TableView::slotClicked(int row, int col, int, | |||
343 | 344 | ||
344 | 345 | ||
345 | } | 346 | } |
346 | void TableView::slotPressed(int row, int col, int, | 347 | void TableView::slotPressed(int row, int col, int, |
347 | const QPoint& point) { | 348 | const QPoint& point) { |
348 | 349 | ||
349 | qWarning("pressed row %d col %d x:%d+y:%d", row,col,point.x(),point.y() ); | 350 | Opie::Core::owarn << "pressed row " << row << " col " << col << " x:" << point.x() |
351 | << "+y:" << point.y() << oendl; | ||
350 | m_prevP = point; | 352 | m_prevP = point; |
351 | /* TextColumn column */ | 353 | /* TextColumn column */ |
352 | if ( col == 2 && cellGeometry( row, col ).contains( point ) ) | 354 | if ( col == 2 && cellGeometry( row, col ).contains( point ) ) |
353 | m_menuTimer->start( 750, TRUE ); | 355 | m_menuTimer->start( 750, TRUE ); |
354 | } | 356 | } |
355 | void TableView::slotValueChanged( int, int ) { | 357 | void TableView::slotValueChanged( int, int ) { |
356 | qWarning("Value Changed"); | 358 | Opie::Core::owarn << "Value Changed" << oendl; |
357 | } | 359 | } |
358 | void TableView::slotCurrentChanged(int, int ) { | 360 | void TableView::slotCurrentChanged(int, int ) { |
359 | m_menuTimer->stop(); | 361 | m_menuTimer->stop(); |
360 | } | 362 | } |
361 | QWidget* TableView::widget() { | 363 | QWidget* TableView::widget() { |
362 | return this; | 364 | return this; |
@@ -366,13 +368,13 @@ QWidget* TableView::widget() { | |||
366 | * because we want to sort whole row | 368 | * because we want to sort whole row |
367 | * based | 369 | * based |
368 | * We event want to set the setOrder | 370 | * We event want to set the setOrder |
369 | * to a sort() and update() | 371 | * to a sort() and update() |
370 | */ | 372 | */ |
371 | void TableView::sortColumn( int col, bool asc, bool ) { | 373 | void TableView::sortColumn( int col, bool asc, bool ) { |
372 | qWarning("bool %d", asc ); | 374 | Opie::Core::owarn << "bool " << asc << oendl; |
373 | setSortOrder( col ); | 375 | setSortOrder( col ); |
374 | setAscending( asc ); | 376 | setAscending( asc ); |
375 | updateView(); | 377 | updateView(); |
376 | } | 378 | } |
377 | void TableView::viewportPaintEvent( QPaintEvent* e) { | 379 | void TableView::viewportPaintEvent( QPaintEvent* e) { |
378 | if (m_enablePaint ) | 380 | if (m_enablePaint ) |
@@ -489,13 +491,13 @@ QWidget* TableView::createEditor(int row, int col, bool )const { | |||
489 | case 0: | 491 | case 0: |
490 | default: | 492 | default: |
491 | return 0l; | 493 | return 0l; |
492 | } | 494 | } |
493 | } | 495 | } |
494 | void TableView::setCellContentFromEditor(int row, int col ) { | 496 | void TableView::setCellContentFromEditor(int row, int col ) { |
495 | qWarning("set cell content from editor"); | 497 | Opie::Core::owarn << "set cell content from editor" << oendl; |
496 | if ( col == 1 ) { | 498 | if ( col == 1 ) { |
497 | QWidget* wid = cellWidget(row, 1 ); | 499 | QWidget* wid = cellWidget(row, 1 ); |
498 | if ( wid->inherits("QComboBox") ) { | 500 | if ( wid->inherits("QComboBox") ) { |
499 | int pri = ((QComboBox*)wid)->currentItem() + 1; | 501 | int pri = ((QComboBox*)wid)->currentItem() + 1; |
500 | OPimTodo todo = sorted()[row]; | 502 | OPimTodo todo = sorted()[row]; |
501 | if ( todo.priority() != pri ) { | 503 | if ( todo.priority() != pri ) { |
@@ -525,13 +527,13 @@ void TableView::slotPriority() { | |||
525 | * filled enough. | 527 | * filled enough. |
526 | * We will try to read ahead 4 items in both ways | 528 | * We will try to read ahead 4 items in both ways |
527 | * up and down. On odd or even we will currentRow()+-4 or +-9 | 529 | * up and down. On odd or even we will currentRow()+-4 or +-9 |
528 | * | 530 | * |
529 | */ | 531 | */ |
530 | void TableView::timerEvent( QTimerEvent* ) { | 532 | void TableView::timerEvent( QTimerEvent* ) { |
531 | // qWarning("sorted %d", sorted().count() ); | 533 | // Opie::Core::owarn << "sorted " << sorted().count() << oendl; |
532 | if (sorted().count() == 0 ) | 534 | if (sorted().count() == 0 ) |
533 | return; | 535 | return; |
534 | 536 | ||
535 | int row = currentRow(); | 537 | int row = currentRow(); |
536 | if ( m_row ) { | 538 | if ( m_row ) { |
537 | int ro = row-4; | 539 | int ro = row-4; |
@@ -573,13 +575,13 @@ void TableView::timerEvent( QTimerEvent* ) { | |||
573 | * row and two columns! | 575 | * row and two columns! |
574 | */ | 576 | */ |
575 | void TableView::contentsMouseReleaseEvent( QMouseEvent* e) { | 577 | void TableView::contentsMouseReleaseEvent( QMouseEvent* e) { |
576 | int row = rowAt(m_prevP.y()); | 578 | int row = rowAt(m_prevP.y()); |
577 | int colOld = columnAt(m_prevP.x() ); | 579 | int colOld = columnAt(m_prevP.x() ); |
578 | int colNew = columnAt(e->x() ); | 580 | int colNew = columnAt(e->x() ); |
579 | qWarning("colNew: %d colOld: %d", colNew, colOld ); | 581 | Opie::Core::owarn << "colNew: " << colNew << " colOld: " << colOld << oendl; |
580 | if ( row == rowAt( e->y() ) && row != -1 && | 582 | if ( row == rowAt( e->y() ) && row != -1 && |
581 | colOld != colNew ) { | 583 | colOld != colNew ) { |
582 | TodoView::complete( sorted()[row] ); | 584 | TodoView::complete( sorted()[row] ); |
583 | return; | 585 | return; |
584 | } | 586 | } |
585 | QTable::contentsMouseReleaseEvent( e ); | 587 | QTable::contentsMouseReleaseEvent( e ); |