summaryrefslogtreecommitdiffabout
path: root/korganizer/kolistview.cpp
authorzautrix <zautrix>2005-04-18 10:41:31 (UTC)
committer zautrix <zautrix>2005-04-18 10:41:31 (UTC)
commit409e329447a7d00a93a56855fcddadbb0f793163 (patch) (side-by-side diff)
tree1c92498d2dfb4c89358c64a6944aca1300a27d11 /korganizer/kolistview.cpp
parent0ff0dca7ccb94ebb1381351e4e4081fe0bac500a (diff)
downloadkdepimpi-409e329447a7d00a93a56855fcddadbb0f793163.zip
kdepimpi-409e329447a7d00a93a56855fcddadbb0f793163.tar.gz
kdepimpi-409e329447a7d00a93a56855fcddadbb0f793163.tar.bz2
morefixes
Diffstat (limited to 'korganizer/kolistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp53
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
@@ -371,8 +371,6 @@ void KOListView::setAlarm()
KOAlarmPrefs kap( this);
if ( !kap.exec() )
return;
-
-
QStringList itemList;
QPtrList<KOListViewItem> sel ;
QListViewItem *qitem = mListView->firstChild ();
@@ -428,11 +426,9 @@ void KOListView::setAlarm()
alarm->setType(Alarm::Invalid);
}
}
- temp = item;
- item = sel.next();
- mUidDict.remove( inc->uid() );
- delete temp;;
- addIncidence( inc );
+ ListItemVisitor v(item, mStartDate );
+ inc->accept(v);
+ item = sel.next();
}
topLevelWidget()->setCaption( i18n("Canged alarm for %1 items").arg( count ) );
qDebug("KO: Set alarm for %d items", count);
@@ -443,6 +439,7 @@ void KOListView::setCategories( bool removeOld )
{
KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 );
+ csd->setColorEnabled();
if (! csd->exec()) {
delete csd;
return;
@@ -451,7 +448,7 @@ void KOListView::setCategories( bool removeOld )
delete csd;
// if ( catList.count() == 0 )
// return;
- catList.sort();
+ //catList.sort();
QString categoriesStr = catList.join(",");
int i;
QStringList itemList;
@@ -465,25 +462,29 @@ void KOListView::setCategories( bool removeOld )
}
KOListViewItem * item, *temp;
item = sel.first();
- Incidence* inc;
- while ( item ) {
- inc = item->data();
- if ( removeOld ) {
- inc->setCategories( categoriesStr );
- } else {
- itemList = QStringList::split (",", inc->categoriesStr() );
- for( i = 0; i< catList.count(); ++i ) {
- if ( !itemList.contains (catList[i]))
- itemList.append( catList[i] );
- }
- itemList.sort();
- inc->setCategories( itemList.join(",") );
+ if( item ) {
+ Incidence* inc = item->data() ;
+ bool setSub = false;
+ if( inc->type() == "Todo" && sel.count() == 1 && inc->relations().count() > 0 ) {
+ int result = KMessageBox::warningYesNoCancel(this,
+ i18n("The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?").arg( inc->summary().left ( 25 ) ),
+ i18n("Todo has subtodos"),
+ i18n("Yes"),
+ i18n("No"));
+ if (result == KMessageBox::Cancel) item = 0;
+ if (result == KMessageBox::Yes) setSub = true;
+ }
+ while ( item ) {
+ inc = item->data();
+ if ( removeOld ) {
+ inc->setCategories( catList, setSub );
+ } else {
+ inc->addCategories( catList, setSub );
+ }
+ ListItemVisitor v(item, mStartDate );
+ inc->accept(v);
+ item = sel.next();
}
- temp = item;
- item = sel.next();
- mUidDict.remove( inc->uid() );
- delete temp;;
- addIncidence( inc );
}
QTimer::singleShot( 1, this, SLOT ( resetFocus() ) );
}