From 282c7fc5b72f8a6ff78a408e10a6018c290ed9f0 Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 06 Feb 2005 18:00:15 +0000 Subject: cat color better --- (limited to 'korganizer') diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index f5eb52e..496f125 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp @@ -121,6 +121,7 @@ void KOEditorGeneral::editCategories() KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); //KOGlobals::fitDialogToScreen( csd ); + csd->setColorEnabled(); csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); csd->exec(); delete csd; diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 1a1bce5..3011458 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -961,11 +961,18 @@ void KOTodoView::changedCategories(int index) { if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { QStringList categories = mActiveItem->todo()->categories (); + QString colcat = categories.first(); if (categories.find (mCategory[index]) != categories.end ()) categories.remove (mCategory[index]); else categories.insert (categories.end(), mCategory[index]); categories.sort (); + if ( !colcat.isEmpty() ) { + if ( categories.find ( colcat ) != categories.end () ) { + categories.remove( colcat ); + categories.prepend( colcat ); + } + } mActiveItem->todo()->setCategories (categories); mActiveItem->construct(); mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); -- cgit v0.9.0.2