-rw-r--r-- | korganizer/koagendaitem.cpp | 11 | ||||
-rw-r--r-- | korganizer/kofilterview.cpp | 2 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 12 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 1 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 1 |
5 files changed, 18 insertions, 9 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index e660c32..a8e0678 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -126,19 +126,24 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | |||
126 | mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); | 126 | mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); |
127 | if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) { | 127 | if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) { |
128 | if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) | 128 | if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) |
129 | mBackgroundColor = KOPrefs::instance()->mTodoDoneColor; | 129 | mBackgroundColor = KOPrefs::instance()->mTodoDoneColor; |
130 | } | 130 | } |
131 | } | 131 | } |
132 | 132 | ||
133 | } | 133 | } |
134 | mColorGroup = QColorGroup( mBackgroundColor.light(), | 134 | |
135 | mBackgroundColor.dark(),mBackgroundColor.light(), | 135 | QColor BackgroundColor ( mBackgroundColor ); |
136 | mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; | 136 | if ( mIncidence->calID() > 1 ) { |
137 | BackgroundColor = KOPrefs::instance()->defaultColor( mIncidence->calID() ); | ||
138 | } | ||
139 | mColorGroup = QColorGroup( BackgroundColor.light(), | ||
140 | BackgroundColor.dark(),BackgroundColor.light(), | ||
141 | BackgroundColor.dark(),BackgroundColor, black, BackgroundColor) ; | ||
137 | setBackgroundColor( mBackgroundColor ); | 142 | setBackgroundColor( mBackgroundColor ); |
138 | mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); | 143 | mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); |
139 | mConflictItems.clear(); | 144 | mConflictItems.clear(); |
140 | setCellXY(0,0,1); | 145 | setCellXY(0,0,1); |
141 | setCellXWidth(0); | 146 | setCellXWidth(0); |
142 | setSubCell(0); | 147 | setSubCell(0); |
143 | setSubCells(1); | 148 | setSubCells(1); |
144 | setMultiItem(0,0,0); | 149 | setMultiItem(0,0,0); |
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index 52bc463..a653c18 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp | |||
@@ -339,22 +339,22 @@ void KOCalEditView::readConfig() | |||
339 | cb->setEnabled( false ); | 339 | cb->setEnabled( false ); |
340 | cb = new KOCalCheckButton( mw ); | 340 | cb = new KOCalCheckButton( mw ); |
341 | mainLayout->addWidget( cb,row,++iii );mROB.append( cb ); | 341 | mainLayout->addWidget( cb,row,++iii );mROB.append( cb ); |
342 | cb->setChecked( kkf->isReadOnly ); | 342 | cb->setChecked( kkf->isReadOnly ); |
343 | cb->setNum( kkf->mCalNumber ); | 343 | cb->setNum( kkf->mCalNumber ); |
344 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectReadOnly(int,bool) ) ); | 344 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectReadOnly(int,bool) ) ); |
345 | if ( kkf->mErrorOnLoad ) | 345 | if ( kkf->mErrorOnLoad ) |
346 | cb->setEnabled( false ); | 346 | cb->setEnabled( false ); |
347 | if ( row > 1) { | ||
347 | KColorButton *colb = new KColorButton( mw ); | 348 | KColorButton *colb = new KColorButton( mw ); |
348 | mainLayout->addWidget( colb,row,++iii ); | 349 | mainLayout->addWidget( colb,row,++iii ); |
349 | colb->setID( kkf->mCalNumber ); | 350 | colb->setID( kkf->mCalNumber ); |
350 | colb->setColor( kkf->mDefaultColor ); | 351 | colb->setColor( kkf->mDefaultColor ); |
351 | connect (colb, SIGNAL (changedID(const QColor&, int )), SLOT ( setColor(const QColor&,int) ) ); | 352 | connect (colb, SIGNAL (changedID(const QColor&, int )), SLOT ( setColor(const QColor&,int) ) ); |
352 | if ( row > 1) { | ||
353 | KOCalButton* calb = new KOCalButton( mw ); | 353 | KOCalButton* calb = new KOCalButton( mw ); |
354 | mainLayout->addWidget( calb,row,++iii ); | 354 | mainLayout->addWidget( calb,row,++iii ); |
355 | calb->setNum( kkf->mCalNumber ); | 355 | calb->setNum( kkf->mCalNumber ); |
356 | calb->setPixmap ( SmallIcon("minus")); | 356 | calb->setPixmap ( SmallIcon("minus")); |
357 | connect (calb, SIGNAL (selectNum(int)), SLOT ( deleteCal(int) ) ); | 357 | connect (calb, SIGNAL (selectNum(int)), SLOT ( deleteCal(int) ) ); |
358 | int hei = calb->sizeHint().height(); | 358 | int hei = calb->sizeHint().height(); |
359 | //calb->setMaximumSize( hei*9/10, hei*9/10 ); | 359 | //calb->setMaximumSize( hei*9/10, hei*9/10 ); |
360 | } | 360 | } |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 96f2502..2150654 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -725,24 +725,26 @@ int MonthViewCell::insertEvent(Event *event) | |||
725 | 725 | ||
726 | QPalette pal; | 726 | QPalette pal; |
727 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 727 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
728 | QStringList categories = event->categories(); | 728 | QStringList categories = event->categories(); |
729 | QString cat = categories.first(); | 729 | QString cat = categories.first(); |
730 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 730 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
731 | pal = getPalette(); | 731 | pal = getPalette(); |
732 | if (cat.isEmpty()) { | 732 | if (cat.isEmpty()) { |
733 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 733 | //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
734 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( event->calID() )); | ||
734 | } else { | 735 | } else { |
735 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 736 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
736 | } | 737 | } |
737 | 738 | ||
738 | } else { | 739 | } else { |
739 | if (cat.isEmpty()) { | 740 | if (cat.isEmpty()) { |
740 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 741 | //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
742 | pal = QPalette( KOPrefs::instance()->defaultColor( event->calID() ), KOPrefs::instance()->defaultColor( event->calID() )); | ||
741 | } else { | 743 | } else { |
742 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 744 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
743 | } | 745 | } |
744 | } | 746 | } |
745 | 747 | ||
746 | } else { | 748 | } else { |
747 | pal = mStandardPalette ; | 749 | pal = mStandardPalette ; |
748 | } | 750 | } |
@@ -806,24 +808,26 @@ void MonthViewCell::insertTodo(Todo *todo) | |||
806 | //item->setPalette( mStandardPalette ); | 808 | //item->setPalette( mStandardPalette ); |
807 | QPalette pal; | 809 | QPalette pal; |
808 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 810 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
809 | QStringList categories = todo->categories(); | 811 | QStringList categories = todo->categories(); |
810 | QString cat = categories.first(); | 812 | QString cat = categories.first(); |
811 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 813 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
812 | pal = getPalette(); | 814 | pal = getPalette(); |
813 | if (cat.isEmpty()) { | 815 | if (cat.isEmpty()) { |
814 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 816 | //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
817 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( todo->calID() )); | ||
815 | } else { | 818 | } else { |
816 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 819 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
817 | } | 820 | } |
818 | 821 | ||
819 | } else { | 822 | } else { |
820 | if (cat.isEmpty()) { | 823 | if (cat.isEmpty()) { |
821 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 824 | //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
825 | pal = QPalette(KOPrefs::instance()->defaultColor( todo->calID() ), KOPrefs::instance()->defaultColor( todo->calID() )); | ||
822 | } else { | 826 | } else { |
823 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 827 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
824 | } | 828 | } |
825 | } | 829 | } |
826 | 830 | ||
827 | } else { | 831 | } else { |
828 | pal = mStandardPalette ; | 832 | pal = mStandardPalette ; |
829 | } | 833 | } |
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index e679bd3..65f0342 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -492,16 +492,17 @@ void KOPrefs::deleteCalendar( int num ) | |||
492 | delete kkf; | 492 | delete kkf; |
493 | return; | 493 | return; |
494 | } | 494 | } |
495 | kkf = mCalendars.next(); | 495 | kkf = mCalendars.next(); |
496 | } | 496 | } |
497 | } | 497 | } |
498 | QColor KOPrefs::defaultColor( int calNum ) const | 498 | QColor KOPrefs::defaultColor( int calNum ) const |
499 | { | 499 | { |
500 | if ( calNum == 1 ) return mEventColor; | ||
500 | return (mDefCalColors[calNum-1])->mDefaultColor; | 501 | return (mDefCalColors[calNum-1])->mDefaultColor; |
501 | } | 502 | } |
502 | void KOPrefs::usrWriteConfig() | 503 | void KOPrefs::usrWriteConfig() |
503 | { | 504 | { |
504 | config()->setGroup("General"); | 505 | config()->setGroup("General"); |
505 | config()->writeEntry("Custom Categories",mCustomCategories); | 506 | config()->writeEntry("Custom Categories",mCustomCategories); |
506 | 507 | ||
507 | config()->setGroup("Personal Settings"); | 508 | config()->setGroup("Personal Settings"); |
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 3ee9a22..35a56ca 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp | |||
@@ -1460,17 +1460,16 @@ void KOPrefsDialog::usrWriteConfig() | |||
1460 | // { | 1460 | // { |
1461 | // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); | 1461 | // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); |
1462 | // item = item->nextSibling(); | 1462 | // item = item->nextSibling(); |
1463 | // } | 1463 | // } |
1464 | KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); | 1464 | KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); |
1465 | KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; | 1465 | KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; |
1466 | KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; | 1466 | KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; |
1467 | KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; | 1467 | KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; |
1468 | |||
1469 | } | 1468 | } |
1470 | 1469 | ||
1471 | void KOPrefsDialog::updateCategories() | 1470 | void KOPrefsDialog::updateCategories() |
1472 | { | 1471 | { |
1473 | mCategoryCombo->clear(); | 1472 | mCategoryCombo->clear(); |
1474 | mCategoryDict.clear(); | 1473 | mCategoryDict.clear(); |
1475 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); | 1474 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); |
1476 | updateCategoryColor(); | 1475 | updateCategoryColor(); |