summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index 27e76d9..974951e 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -291,129 +291,129 @@ void TodoWindow::slotNew()
291 291
292 ToDoEvent todo; 292 ToDoEvent todo;
293 293
294#if defined(Q_WS_QWS) || defined(_WS_QWS_) 294#if defined(Q_WS_QWS) || defined(_WS_QWS_)
295 e.showMaximized(); 295 e.showMaximized();
296#endif 296#endif
297 int ret = e.exec(); 297 int ret = e.exec();
298// qWarning("finished" ); 298// qWarning("finished" );
299 if ( ret == QDialog::Accepted ) { 299 if ( ret == QDialog::Accepted ) {
300 table->setPaintingEnabled( false ); 300 table->setPaintingEnabled( false );
301 todo = e.todoEntry(); 301 todo = e.todoEntry();
302 //todo.assignUid(); 302 //todo.assignUid();
303 table->addEntry( todo ); 303 table->addEntry( todo );
304 table->setPaintingEnabled( true ); 304 table->setPaintingEnabled( true );
305 findAction->setEnabled( TRUE ); 305 findAction->setEnabled( TRUE );
306 } 306 }
307 // I'm afraid we must call this every time now, otherwise 307 // I'm afraid we must call this every time now, otherwise
308 // spend expensive time comparing all these strings... 308 // spend expensive time comparing all these strings...
309 populateCategories(); 309 populateCategories();
310 mStack->raiseWidget(1 ); 310 mStack->raiseWidget(1 );
311} 311}
312 312
313TodoWindow::~TodoWindow() 313TodoWindow::~TodoWindow()
314{ 314{
315} 315}
316 316
317void TodoWindow::slotDelete() 317void TodoWindow::slotDelete()
318{ 318{
319 if(syncing) { 319 if(syncing) {
320 QMessageBox::warning(this, tr("Todo"), 320 QMessageBox::warning(this, tr("Todo"),
321 tr("Can not edit data, currently syncing")); 321 tr("Can not edit data, currently syncing"));
322 return; 322 return;
323 } 323 }
324 324
325 if ( table->currentRow() == -1 ) 325 if ( table->currentRow() == -1 )
326 return; 326 return;
327 327
328 QString strName = table->text( table->currentRow(), 2 ).left( 30 ); 328 QString strName = table->text( table->currentRow(), 2 ).left( 30 );
329 329
330 if ( !QPEMessageBox::confirmDelete( this, tr( "Todo" ), strName ) ) 330 if ( !QPEMessageBox::confirmDelete( this, tr( "Todo" ), strName ) )
331 return; 331 return;
332 332
333 333
334 334
335 table->setPaintingEnabled( false ); 335 table->setPaintingEnabled( false );
336 table->removeCurrentEntry(); 336 table->removeCurrentEntry();
337 table->setPaintingEnabled( true ); 337 table->setPaintingEnabled( true );
338 338
339 if ( table->numRows() == 0 ) { 339 if ( table->numRows() == 0 ) {
340 currentEntryChanged( -1, 0 ); 340 currentEntryChanged( -1, 0 );
341 findAction->setEnabled( FALSE ); 341 findAction->setEnabled( FALSE );
342 } 342 }
343 mStack->raiseWidget(1); 343 mStack->raiseWidget(1);
344} 344}
345void TodoWindow::slotDeleteAll() 345void TodoWindow::slotDeleteAll()
346{ 346{
347 if(syncing) { 347 if(syncing) {
348 QMessageBox::warning(this, tr("Todo"), 348 QMessageBox::warning(this, tr("Todo"),
349 tr("Can not edit data, currently syncing")); 349 tr("Can not edit data, currently syncing"));
350 return; 350 return;
351 } 351 }
352 352
353 //QString strName = table->text( table->currentRow(), 2 ).left( 30 ); 353 //QString strName = table->text( table->currentRow(), 2 ).left( 30 );
354 354
355 if ( !QPEMessageBox::confirmDelete( this, tr( "Todo" ), tr("Delete all tasks?") ) ) 355 if ( !QPEMessageBox::confirmDelete( this, tr( "Todo" ), tr("all tasks") ) )
356 return; 356 return;
357 357
358 358
359 359
360 table->setPaintingEnabled( false ); 360 table->setPaintingEnabled( false );
361 table->removeAllEntries(); 361 table->removeAllEntries();
362 table->setPaintingEnabled( true ); 362 table->setPaintingEnabled( true );
363 363
364 if ( table->numRows() == 0 ) { 364 if ( table->numRows() == 0 ) {
365 currentEntryChanged( -1, 0 ); 365 currentEntryChanged( -1, 0 );
366 findAction->setEnabled( FALSE ); 366 findAction->setEnabled( FALSE );
367 } 367 }
368 mStack->raiseWidget(1 ); 368 mStack->raiseWidget(1 );
369} 369}
370 370
371void TodoWindow::slotEdit() 371void TodoWindow::slotEdit()
372{ 372{
373 if(syncing) { 373 if(syncing) {
374 QMessageBox::warning(this, tr("Todo"), 374 QMessageBox::warning(this, tr("Todo"),
375 tr("Can not edit data, currently syncing")); 375 tr("Can not edit data, currently syncing"));
376 return; 376 return;
377 } 377 }
378 378
379 ToDoEvent todo = table->currentEntry(); 379 ToDoEvent todo = table->currentEntry();
380 qWarning("slotEdit" ); 380 qWarning("slotEdit" );
381 NewTaskDialog e( todo, this, 0, TRUE ); 381 NewTaskDialog e( todo, this, 0, TRUE );
382 e.setCaption( tr( "Edit Task" ) ); 382 e.setCaption( tr( "Edit Task" ) );
383 383
384#if defined(Q_WS_QWS) || defined(_WS_QWS_) 384#if defined(Q_WS_QWS) || defined(_WS_QWS_)
385 e.showMaximized(); 385 e.showMaximized();
386#endif 386#endif
387 int ret = e.exec(); 387 int ret = e.exec();
388 388
389 if ( ret == QDialog::Accepted ) { 389 if ( ret == QDialog::Accepted ) {
390 qWarning("Replacing now" ); 390 qWarning("Replacing now" );
391 table->setPaintingEnabled( false ); 391 table->setPaintingEnabled( false );
392 todo = e.todoEntry(); 392 todo = e.todoEntry();
393 table->replaceCurrentEntry( todo ); 393 table->replaceCurrentEntry( todo );
394 table->setPaintingEnabled( true ); 394 table->setPaintingEnabled( true );
395 } 395 }
396 populateCategories(); 396 populateCategories();
397 mStack->raiseWidget( 1 ); 397 mStack->raiseWidget( 1 );
398} 398}
399void TodoWindow::slotDuplicate() 399void TodoWindow::slotDuplicate()
400{ 400{
401 if(syncing) { 401 if(syncing) {
402 QMessageBox::warning(this, tr("Todo"), 402 QMessageBox::warning(this, tr("Todo"),
403 tr("Can not edit data, currently syncing")); 403 tr("Can not edit data, currently syncing"));
404 return; 404 return;
405 } 405 }
406 ToDoEvent ev = table->currentEntry(); 406 ToDoEvent ev = table->currentEntry();
407 ToDoEvent ev2 = ToDoEvent( ev ); // what about the uid 407 ToDoEvent ev2 = ToDoEvent( ev ); // what about the uid
408 int uid; 408 int uid;
409 { // uid 409 { // uid
410 Qtopia::UidGen *uidgen = new Qtopia::UidGen(); 410 Qtopia::UidGen *uidgen = new Qtopia::UidGen();
411 uid = uidgen->generate(); 411 uid = uidgen->generate();
412 delete uidgen; 412 delete uidgen;
413 } 413 }
414 ev2.setUid( uid ); 414 ev2.setUid( uid );
415 table->setPaintingEnabled( false ); 415 table->setPaintingEnabled( false );
416 table->addEntry( ev2 ); 416 table->addEntry( ev2 );
417 table->setPaintingEnabled( true ); 417 table->setPaintingEnabled( true );
418 418
419 mStack->raiseWidget( 1 ); 419 mStack->raiseWidget( 1 );