author | zautrix <zautrix> | 2005-04-18 10:41:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-18 10:41:31 (UTC) |
commit | 409e329447a7d00a93a56855fcddadbb0f793163 (patch) (unidiff) | |
tree | 1c92498d2dfb4c89358c64a6944aca1300a27d11 /korganizer/kolistview.cpp | |
parent | 0ff0dca7ccb94ebb1381351e4e4081fe0bac500a (diff) | |
download | kdepimpi-409e329447a7d00a93a56855fcddadbb0f793163.zip kdepimpi-409e329447a7d00a93a56855fcddadbb0f793163.tar.gz kdepimpi-409e329447a7d00a93a56855fcddadbb0f793163.tar.bz2 |
morefixes
-rw-r--r-- | korganizer/kolistview.cpp | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index bbf83d9..fd86095 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -372,6 +372,4 @@ void KOListView::setAlarm() | |||
372 | if ( !kap.exec() ) | 372 | if ( !kap.exec() ) |
373 | return; | 373 | return; |
374 | |||
375 | |||
376 | QStringList itemList; | 374 | QStringList itemList; |
377 | QPtrList<KOListViewItem> sel ; | 375 | QPtrList<KOListViewItem> sel ; |
@@ -429,9 +427,7 @@ void KOListView::setAlarm() | |||
429 | } | 427 | } |
430 | } | 428 | } |
431 | temp = item; | 429 | ListItemVisitor v(item, mStartDate ); |
432 | item = sel.next(); | 430 | inc->accept(v); |
433 | mUidDict.remove( inc->uid() ); | 431 | item = sel.next(); |
434 | delete temp;; | ||
435 | addIncidence( inc ); | ||
436 | } | 432 | } |
437 | topLevelWidget()->setCaption( i18n("Canged alarm for %1 items").arg( count ) ); | 433 | topLevelWidget()->setCaption( i18n("Canged alarm for %1 items").arg( count ) ); |
@@ -444,4 +440,5 @@ void KOListView::setCategories( bool removeOld ) | |||
444 | 440 | ||
445 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); | 441 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); |
442 | csd->setColorEnabled(); | ||
446 | if (! csd->exec()) { | 443 | if (! csd->exec()) { |
447 | delete csd; | 444 | delete csd; |
@@ -452,5 +449,5 @@ void KOListView::setCategories( bool removeOld ) | |||
452 | // if ( catList.count() == 0 ) | 449 | // if ( catList.count() == 0 ) |
453 | // return; | 450 | // return; |
454 | catList.sort(); | 451 | //catList.sort(); |
455 | QString categoriesStr = catList.join(","); | 452 | QString categoriesStr = catList.join(","); |
456 | int i; | 453 | int i; |
@@ -466,23 +463,27 @@ void KOListView::setCategories( bool removeOld ) | |||
466 | KOListViewItem * item, *temp; | 463 | KOListViewItem * item, *temp; |
467 | item = sel.first(); | 464 | item = sel.first(); |
468 | Incidence* inc; | 465 | if( item ) { |
469 | while ( item ) { | 466 | Incidence* inc = item->data() ; |
470 | inc = item->data(); | 467 | bool setSub = false; |
471 | if ( removeOld ) { | 468 | if( inc->type() == "Todo" && sel.count() == 1 && inc->relations().count() > 0 ) { |
472 | inc->setCategories( categoriesStr ); | 469 | int result = KMessageBox::warningYesNoCancel(this, |
473 | } else { | 470 | i18n("The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?").arg( inc->summary().left ( 25 ) ), |
474 | itemList = QStringList::split (",", inc->categoriesStr() ); | 471 | i18n("Todo has subtodos"), |
475 | for( i = 0; i< catList.count(); ++i ) { | 472 | i18n("Yes"), |
476 | if ( !itemList.contains (catList[i])) | 473 | i18n("No")); |
477 | itemList.append( catList[i] ); | 474 | if (result == KMessageBox::Cancel) item = 0; |
478 | } | 475 | if (result == KMessageBox::Yes) setSub = true; |
479 | itemList.sort(); | 476 | } |
480 | inc->setCategories( itemList.join(",") ); | 477 | while ( item ) { |
478 | inc = item->data(); | ||
479 | if ( removeOld ) { | ||
480 | inc->setCategories( catList, setSub ); | ||
481 | } else { | ||
482 | inc->addCategories( catList, setSub ); | ||
483 | } | ||
484 | ListItemVisitor v(item, mStartDate ); | ||
485 | inc->accept(v); | ||
486 | item = sel.next(); | ||
481 | } | 487 | } |
482 | temp = item; | ||
483 | item = sel.next(); | ||
484 | mUidDict.remove( inc->uid() ); | ||
485 | delete temp;; | ||
486 | addIncidence( inc ); | ||
487 | } | 488 | } |
488 | QTimer::singleShot( 1, this, SLOT ( resetFocus() ) ); | 489 | QTimer::singleShot( 1, this, SLOT ( resetFocus() ) ); |