Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index a28fc3e..294f37c 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -327,106 +327,107 @@ void TodoWindow::slotDelete() | |||
327 | 327 | ||
328 | 328 | ||
329 | 329 | ||
330 | table->setPaintingEnabled( false ); | 330 | table->setPaintingEnabled( false ); |
331 | table->removeCurrentEntry(); | 331 | table->removeCurrentEntry(); |
332 | table->setPaintingEnabled( true ); | 332 | table->setPaintingEnabled( true ); |
333 | 333 | ||
334 | if ( table->numRows() == 0 ) { | 334 | if ( table->numRows() == 0 ) { |
335 | currentEntryChanged( -1, 0 ); | 335 | currentEntryChanged( -1, 0 ); |
336 | findAction->setEnabled( FALSE ); | 336 | findAction->setEnabled( FALSE ); |
337 | } | 337 | } |
338 | mStack->raiseWidget(1); | 338 | mStack->raiseWidget(1); |
339 | } | 339 | } |
340 | void TodoWindow::slotDeleteAll() | 340 | void TodoWindow::slotDeleteAll() |
341 | { | 341 | { |
342 | if(syncing) { | 342 | if(syncing) { |
343 | QMessageBox::warning(this, tr("Todo"), | 343 | QMessageBox::warning(this, tr("Todo"), |
344 | tr("Can not edit data, currently syncing")); | 344 | tr("Can not edit data, currently syncing")); |
345 | return; | 345 | return; |
346 | } | 346 | } |
347 | 347 | ||
348 | //QString strName = table->text( table->currentRow(), 2 ).left( 30 ); | 348 | //QString strName = table->text( table->currentRow(), 2 ).left( 30 ); |
349 | 349 | ||
350 | if ( !QPEMessageBox::confirmDelete( this, tr( "Todo" ), tr("Delete all tasks?") ) ) | 350 | if ( !QPEMessageBox::confirmDelete( this, tr( "Todo" ), tr("Delete all tasks?") ) ) |
351 | return; | 351 | return; |
352 | 352 | ||
353 | 353 | ||
354 | 354 | ||
355 | table->setPaintingEnabled( false ); | 355 | table->setPaintingEnabled( false ); |
356 | table->removeAllEntries(); | 356 | table->removeAllEntries(); |
357 | table->setPaintingEnabled( true ); | 357 | table->setPaintingEnabled( true ); |
358 | 358 | ||
359 | if ( table->numRows() == 0 ) { | 359 | if ( table->numRows() == 0 ) { |
360 | currentEntryChanged( -1, 0 ); | 360 | currentEntryChanged( -1, 0 ); |
361 | findAction->setEnabled( FALSE ); | 361 | findAction->setEnabled( FALSE ); |
362 | } | 362 | } |
363 | mStack->raiseWidget(1 ); | 363 | mStack->raiseWidget(1 ); |
364 | } | 364 | } |
365 | 365 | ||
366 | void TodoWindow::slotEdit() | 366 | void TodoWindow::slotEdit() |
367 | { | 367 | { |
368 | if(syncing) { | 368 | if(syncing) { |
369 | QMessageBox::warning(this, tr("Todo"), | 369 | QMessageBox::warning(this, tr("Todo"), |
370 | tr("Can not edit data, currently syncing")); | 370 | tr("Can not edit data, currently syncing")); |
371 | return; | 371 | return; |
372 | } | 372 | } |
373 | 373 | ||
374 | ToDoEvent todo = table->currentEntry(); | 374 | ToDoEvent todo = table->currentEntry(); |
375 | 375 | qWarning("slotEdit" ); | |
376 | NewTaskDialog e( todo, this, 0, TRUE ); | 376 | NewTaskDialog e( todo, this, 0, TRUE ); |
377 | e.setCaption( tr( "Edit Task" ) ); | 377 | e.setCaption( tr( "Edit Task" ) ); |
378 | 378 | ||
379 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 379 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
380 | e.showMaximized(); | 380 | e.showMaximized(); |
381 | #endif | 381 | #endif |
382 | int ret = e.exec(); | 382 | int ret = e.exec(); |
383 | 383 | ||
384 | if ( ret == QDialog::Accepted ) { | 384 | if ( ret == QDialog::Accepted ) { |
385 | qWarning("Replacing now" ); | ||
385 | table->setPaintingEnabled( false ); | 386 | table->setPaintingEnabled( false ); |
386 | todo = e.todoEntry(); | 387 | todo = e.todoEntry(); |
387 | table->replaceCurrentEntry( todo ); | 388 | table->replaceCurrentEntry( todo ); |
388 | table->setPaintingEnabled( true ); | 389 | table->setPaintingEnabled( true ); |
389 | } | 390 | } |
390 | populateCategories(); | 391 | populateCategories(); |
391 | mStack->raiseWidget( 1 ); | 392 | mStack->raiseWidget( 1 ); |
392 | } | 393 | } |
393 | void TodoWindow::slotDuplicate() | 394 | void TodoWindow::slotDuplicate() |
394 | { | 395 | { |
395 | if(syncing) { | 396 | if(syncing) { |
396 | QMessageBox::warning(this, tr("Todo"), | 397 | QMessageBox::warning(this, tr("Todo"), |
397 | tr("Can not edit data, currently syncing")); | 398 | tr("Can not edit data, currently syncing")); |
398 | return; | 399 | return; |
399 | } | 400 | } |
400 | ToDoEvent ev = table->currentEntry(); | 401 | ToDoEvent ev = table->currentEntry(); |
401 | ToDoEvent ev2 = ToDoEvent( ev ); // what about the uid | 402 | ToDoEvent ev2 = ToDoEvent( ev ); // what about the uid |
402 | int uid; | 403 | int uid; |
403 | { // uid | 404 | { // uid |
404 | Qtopia::UidGen *uidgen = new Qtopia::UidGen(); | 405 | Qtopia::UidGen *uidgen = new Qtopia::UidGen(); |
405 | uid = uidgen->generate(); | 406 | uid = uidgen->generate(); |
406 | delete uidgen; | 407 | delete uidgen; |
407 | } | 408 | } |
408 | ev2.setUid( uid ); | 409 | ev2.setUid( uid ); |
409 | table->setPaintingEnabled( false ); | 410 | table->setPaintingEnabled( false ); |
410 | table->addEntry( ev2 ); | 411 | table->addEntry( ev2 ); |
411 | table->setPaintingEnabled( true ); | 412 | table->setPaintingEnabled( true ); |
412 | 413 | ||
413 | mStack->raiseWidget( 1 ); | 414 | mStack->raiseWidget( 1 ); |
414 | } | 415 | } |
415 | void TodoWindow::slotShowPopup( const QPoint &p ) | 416 | void TodoWindow::slotShowPopup( const QPoint &p ) |
416 | { | 417 | { |
417 | contextMenu->popup( p ); | 418 | contextMenu->popup( p ); |
418 | } | 419 | } |
419 | 420 | ||
420 | void TodoWindow::showCompleted( bool s ) | 421 | void TodoWindow::showCompleted( bool s ) |
421 | { | 422 | { |
422 | if ( !table->isUpdatesEnabled() ) | 423 | if ( !table->isUpdatesEnabled() ) |
423 | return; | 424 | return; |
424 | table->setPaintingEnabled( false ); | 425 | table->setPaintingEnabled( false ); |
425 | table->setShowCompleted( s ); | 426 | table->setShowCompleted( s ); |
426 | table->setPaintingEnabled( true ); | 427 | table->setPaintingEnabled( true ); |
427 | mStack->raiseWidget( 1 ); | 428 | mStack->raiseWidget( 1 ); |
428 | } | 429 | } |
429 | 430 | ||
430 | void TodoWindow::currentEntryChanged( int r, int ) | 431 | void TodoWindow::currentEntryChanged( int r, int ) |
431 | { | 432 | { |
432 | if ( r != -1 && table->rowHeight( r ) > 0 ) { | 433 | if ( r != -1 && table->rowHeight( r ) > 0 ) { |