author | zautrix <zautrix> | 2005-06-15 10:22:38 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-15 10:22:38 (UTC) |
commit | 13c00953a9d521873b03f861e54e83e33b30bc96 (patch) (side-by-side diff) | |
tree | 05bc1f7b6d95b68e0d579e70a487c8a48f250a6f /korganizer | |
parent | 37175a31a8fa8772403e9588ff3f8bd7de3979cc (diff) | |
download | kdepimpi-13c00953a9d521873b03f861e54e83e33b30bc96.zip kdepimpi-13c00953a9d521873b03f861e54e83e33b30bc96.tar.gz kdepimpi-13c00953a9d521873b03f861e54e83e33b30bc96.tar.bz2 |
fixxx
-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 @@ -118,35 +118,40 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) QStringList categories = mIncidence->categories(); QString cat = categories.first(); if (cat.isEmpty()) { if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; else mBackgroundColor =KOPrefs::instance()->defaultColor( incidence->calID() ); } else { mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) { if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) mBackgroundColor = KOPrefs::instance()->mTodoDoneColor; } } } - mColorGroup = QColorGroup( mBackgroundColor.light(), - mBackgroundColor.dark(),mBackgroundColor.light(), - mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; + + QColor BackgroundColor ( mBackgroundColor ); + if ( mIncidence->calID() > 1 ) { + BackgroundColor = KOPrefs::instance()->defaultColor( mIncidence->calID() ); + } + mColorGroup = QColorGroup( BackgroundColor.light(), + BackgroundColor.dark(),BackgroundColor.light(), + BackgroundColor.dark(),BackgroundColor, black, BackgroundColor) ; setBackgroundColor( mBackgroundColor ); mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); mConflictItems.clear(); setCellXY(0,0,1); setCellXWidth(0); setSubCell(0); setSubCells(1); setMultiItem(0,0,0); startMove(); mSelected = true; select(false); QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); mFontPixelSize = fontinf.height();; hide(); xPaintCoord = -1; yPaintCoord = -1; diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index 52bc463..a653c18 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp @@ -331,38 +331,38 @@ void KOCalEditView::readConfig() lab = new QLabel ( i18n(" "), mw ); mainLayout->addWidget( lab,row,++iii ); cb = new KOCalCheckButton( mw ); mainLayout->addWidget( cb,row,++iii );mAlarmB.append( cb ); cb->setChecked( kkf->isAlarmEnabled ); cb->setNum( kkf->mCalNumber ); connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCalAlarm(int,bool) ) ); if ( kkf->mErrorOnLoad ) cb->setEnabled( false ); cb = new KOCalCheckButton( mw ); mainLayout->addWidget( cb,row,++iii );mROB.append( cb ); cb->setChecked( kkf->isReadOnly ); cb->setNum( kkf->mCalNumber ); connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectReadOnly(int,bool) ) ); if ( kkf->mErrorOnLoad ) cb->setEnabled( false ); + if ( row > 1) { KColorButton *colb = new KColorButton( mw ); mainLayout->addWidget( colb,row,++iii ); colb->setID( kkf->mCalNumber ); colb->setColor( kkf->mDefaultColor ); connect (colb, SIGNAL (changedID(const QColor&, int )), SLOT ( setColor(const QColor&,int) ) ); - if ( row > 1) { KOCalButton* calb = new KOCalButton( mw ); mainLayout->addWidget( calb,row,++iii ); calb->setNum( kkf->mCalNumber ); calb->setPixmap ( SmallIcon("minus")); connect (calb, SIGNAL (selectNum(int)), SLOT ( deleteCal(int) ) ); int hei = calb->sizeHint().height(); //calb->setMaximumSize( hei*9/10, hei*9/10 ); } ++row; kkf = KOPrefs::instance()->mCalendars.next(); } lab = new QLabel ( "", mw ); mainLayout->addWidget( lab,row,0 ); mw->show(); } diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 96f2502..2150654 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -717,40 +717,42 @@ int MonthViewCell::insertEvent(Event *event) if ( mAvailItemList.count() ) { item = mAvailItemList.first(); mAvailItemList.remove( item ); item->recycle( event, mDate, text ); } else { item = new MonthViewItem( event, mDate, text ); } QPalette pal; if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { QStringList categories = event->categories(); QString cat = categories.first(); if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { pal = getPalette(); if (cat.isEmpty()) { - pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); + //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); + pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( event->calID() )); } else { pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); } } else { if (cat.isEmpty()) { - pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); + //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); + pal = QPalette( KOPrefs::instance()->defaultColor( event->calID() ), KOPrefs::instance()->defaultColor( event->calID() )); } else { pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); } } } else { pal = mStandardPalette ; } item->setPalette( pal ); item->setRecur( event->recurrence()->doesRecur() ); item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() ); item->setMoreInfo( event->description().length() > 0 ); #ifdef DESKTOP_VERSION Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, KOPrefs::instance()->email()); if ( me != 0 ) { @@ -798,40 +800,42 @@ void MonthViewCell::insertTodo(Todo *todo) if ( mAvailItemList.count() ) { item = mAvailItemList.first(); mAvailItemList.remove( item ); item->recycle( todo, mDate, text ); } else { item = new MonthViewItem( todo, mDate, text ); } //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); //item->setPalette( mStandardPalette ); QPalette pal; if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { QStringList categories = todo->categories(); QString cat = categories.first(); if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { pal = getPalette(); if (cat.isEmpty()) { - pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); + //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); + pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( todo->calID() )); } else { pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); } } else { if (cat.isEmpty()) { - pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); + //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); + pal = QPalette(KOPrefs::instance()->defaultColor( todo->calID() ), KOPrefs::instance()->defaultColor( todo->calID() )); } else { pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); } } } else { pal = mStandardPalette ; } item->setPalette( pal ); item->setRecur( todo->recurrence()->doesRecur() ); item->setAlarm( todo->isAlarmEnabled() && todo->alarmEnabled() ); item->setMoreInfo( todo->description().length() > 0 ); insertItem( item , count()); #ifdef DESKTOP_VERSION mToolTip.append( text ); #endif diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index e679bd3..65f0342 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -484,32 +484,33 @@ KopiCalendarFile * KOPrefs::getNewCalendar() } void KOPrefs::deleteCalendar( int num ) { KopiCalendarFile * kkf = mCalendars.first(); while ( kkf ) { if ( kkf->mCalNumber == num ) { qDebug("KOPrefs::deleteCalendar %d ", num ); mCalendars.remove( kkf ); delete kkf; return; } kkf = mCalendars.next(); } } QColor KOPrefs::defaultColor( int calNum ) const { + if ( calNum == 1 ) return mEventColor; return (mDefCalColors[calNum-1])->mDefaultColor; } void KOPrefs::usrWriteConfig() { config()->setGroup("General"); config()->writeEntry("Custom Categories",mCustomCategories); config()->setGroup("Personal Settings"); config()->writeEntry("user_name",mName); config()->writeEntry("user_email",mEmail); config()->setGroup("Category Colors"); QDictIterator<QColor> it(mCategoryColors); while (it.current()) { config()->writeEntry(it.currentKey(),*(it.current())); ++it; diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 3ee9a22..35a56ca 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -1452,33 +1452,32 @@ void KOPrefsDialog::usrWriteConfig() KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); KOPrefs::instance()->mAdditionalMails.clear(); // QListViewItem *item; // item = mAMails->firstChild(); // while (item) // { // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); // item = item->nextSibling(); // } KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; - } void KOPrefsDialog::updateCategories() { mCategoryCombo->clear(); mCategoryDict.clear(); mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); updateCategoryColor(); } void KOPrefsDialog::toggleEmailSettings(bool on) { if (on) { mEmailEdit->setEnabled(false); mNameEdit->setEnabled(false); mEmailLabel->setEnabled(false); |