author | zautrix <zautrix> | 2004-10-29 22:27:13 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-29 22:27:13 (UTC) |
commit | aafa695508796e86e9f267633ea5e6965d876031 (patch) (unidiff) | |
tree | 8ff03f51e99f7e90b85e8f94af157a883bcd48f8 | |
parent | 8e08679a79398def54980c0e838b242d69ca6030 (diff) | |
download | kdepimpi-aafa695508796e86e9f267633ea5e6965d876031.zip kdepimpi-aafa695508796e86e9f267633ea5e6965d876031.tar.gz kdepimpi-aafa695508796e86e9f267633ea5e6965d876031.tar.bz2 |
monthview exclude sat fix
-rw-r--r-- | korganizer/koagendaview.cpp | 19 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 2 |
2 files changed, 17 insertions, 4 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 749204b..c5acafd 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -1297,39 +1297,52 @@ void KOAgendaView::writeSettings(KConfig *config) | |||
1297 | //#ifndef KORG_NOSPLITTER | 1297 | //#ifndef KORG_NOSPLITTER |
1298 | QValueList<int> list = mSplitterAgenda->sizes(); | 1298 | QValueList<int> list = mSplitterAgenda->sizes(); |
1299 | config->writeEntry("Separator AgendaView",list); | 1299 | config->writeEntry("Separator AgendaView",list); |
1300 | //qDebug("write %d %d ", list[0],list[1] ); | 1300 | //qDebug("write %d %d ", list[0],list[1] ); |
1301 | //#endif | 1301 | //#endif |
1302 | } | 1302 | } |
1303 | 1303 | ||
1304 | void KOAgendaView::setHolidayMasks() | 1304 | void KOAgendaView::setHolidayMasks() |
1305 | { | 1305 | { |
1306 | mHolidayMask.resize(mSelectedDates.count()); | 1306 | mHolidayMask.resize(mSelectedDates.count()); |
1307 | 1307 | ||
1308 | uint i; | 1308 | uint i; |
1309 | for(i=0;i<mSelectedDates.count();++i) { | 1309 | for(i=0;i<mSelectedDates.count();++i) { |
1310 | QDate date = mSelectedDates[i]; | 1310 | QDate date = mSelectedDates[i]; |
1311 | bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6); | 1311 | bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6); |
1312 | bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); | 1312 | bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); |
1313 | bool showHoliday = false; | ||
1314 | if ( KOPrefs::instance()->mExcludeHolidays ) { | ||
1315 | QPtrList<Event> events = calendar()->events( date, true ); | ||
1316 | Event *event; | ||
1317 | for( event = events.first(); event; event = events.next() ) { | ||
1318 | if ( event->categories().contains("Holiday") || | ||
1319 | event->categories().contains(i18n("Holiday"))) { | ||
1320 | showHoliday = true; | ||
1321 | break; | ||
1322 | } | ||
1323 | } | ||
1324 | |||
1325 | } | ||
1326 | |||
1313 | #ifndef KORG_NOPLUGINS | 1327 | #ifndef KORG_NOPLUGINS |
1314 | bool showHoliday = KOPrefs::instance()->mExcludeHolidays && | 1328 | bool showHoliday = KOPrefs::instance()->mExcludeHolidays && |
1315 | !KOCore::self()->holiday(date).isEmpty(); | 1329 | !KOCore::self()->holiday(date).isEmpty(); |
1316 | bool showDay = showSaturday || showSunday || showHoliday; | ||
1317 | #else | ||
1318 | bool showDay = showSaturday || showSunday; | ||
1319 | #endif | 1330 | #endif |
1331 | bool showDay = showSaturday || showSunday || showHoliday; | ||
1332 | |||
1320 | if (showDay) { | 1333 | if (showDay) { |
1321 | mHolidayMask.at(i) = true; | 1334 | mHolidayMask.at(i) = true; |
1322 | } else { | 1335 | } else { |
1323 | mHolidayMask.at(i) = false; | 1336 | mHolidayMask.at(i) = false; |
1324 | } | 1337 | } |
1325 | } | 1338 | } |
1326 | 1339 | ||
1327 | mAgenda->setHolidayMask(&mHolidayMask); | 1340 | mAgenda->setHolidayMask(&mHolidayMask); |
1328 | mAllDayAgenda->setHolidayMask(&mHolidayMask); | 1341 | mAllDayAgenda->setHolidayMask(&mHolidayMask); |
1329 | } | 1342 | } |
1330 | 1343 | ||
1331 | void KOAgendaView::setContentsPos(int y) | 1344 | void KOAgendaView::setContentsPos(int y) |
1332 | { | 1345 | { |
1333 | mAgenda->setContentsPos(0,y); | 1346 | mAgenda->setContentsPos(0,y); |
1334 | } | 1347 | } |
1335 | 1348 | ||
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 688d9e1..7d1e82f 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -372,33 +372,33 @@ void MonthViewCell::setHoliday( const QString &holiday ) | |||
372 | mHolidayString = holiday; | 372 | mHolidayString = holiday; |
373 | 373 | ||
374 | if ( !holiday.isEmpty() ) { | 374 | if ( !holiday.isEmpty() ) { |
375 | setHoliday( true ); | 375 | setHoliday( true ); |
376 | } | 376 | } |
377 | } | 377 | } |
378 | void MonthViewCell::keyPressEvent ( QKeyEvent * e ) | 378 | void MonthViewCell::keyPressEvent ( QKeyEvent * e ) |
379 | { | 379 | { |
380 | 380 | ||
381 | e->ignore(); | 381 | e->ignore(); |
382 | 382 | ||
383 | } | 383 | } |
384 | void MonthViewCell::updateCell() | 384 | void MonthViewCell::updateCell() |
385 | { | 385 | { |
386 | 386 | ||
387 | setPrimary( mDate.month()%2 ); | 387 | setPrimary( mDate.month()%2 ); |
388 | setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() ); | 388 | setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays); |
389 | if ( mDate == QDate::currentDate() ) { | 389 | if ( mDate == QDate::currentDate() ) { |
390 | mItemList->setLineWidth( 3 ); | 390 | mItemList->setLineWidth( 3 ); |
391 | } else { | 391 | } else { |
392 | mItemList->setLineWidth( 1 ); | 392 | mItemList->setLineWidth( 1 ); |
393 | } | 393 | } |
394 | mItemList->clear(); | 394 | mItemList->clear(); |
395 | //qApp->processEvents(); | 395 | //qApp->processEvents(); |
396 | if ( !mHolidayString.isEmpty() ) { | 396 | if ( !mHolidayString.isEmpty() ) { |
397 | MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); | 397 | MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); |
398 | item->setPalette( mHolidayPalette ); | 398 | item->setPalette( mHolidayPalette ); |
399 | mItemList->insertItem( item ); | 399 | mItemList->insertItem( item ); |
400 | } | 400 | } |
401 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); | 401 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); |
402 | QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); | 402 | QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); |
403 | Event *event; | 403 | Event *event; |
404 | for( event = events.first(); event; event = events.next() ) { | 404 | for( event = events.first(); event; event = events.next() ) { |