Summary: | Plasma calendar doesn't distinguish holiday types | ||
---|---|---|---|
Product: | [Unmaintained] plasma4 | Reporter: | John Layt <jlayt> |
Component: | widget-clock | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | annma, aseigo, davide.bettio |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
John Layt
2009-12-13 18:52:43 UTC
*** Bug 218511 has been marked as a duplicate of this bug. *** Yes KHolidays can make the distinction between workDay and non working day but it does not seem possible to honor colors in the Plasma Calendar. My idea was to keep the red color and display "Holiday: Christmas" for non-working days and display only the special days titles for work days like "Spring" (without the "Holiday:" bit). Displaying also only the non working holidays would be an easy fix though! As for the KHolidays rewrite I talked to Allen but he is not sure he'll have time for it for 4.5. The DESIGN document is however sketching it nicely! Thanks John for filing this clearly and separately! Proposed patch for displaying only the Non Work holidays which would be a quick fix for 4.4 but should not be left for 4.5 where we should parse all calendar days. CCing Davide Index: calendarengine.cpp =================================================================== --- calendarengine.cpp (revision 1062832) +++ calendarengine.cpp (working copy) @@ -73,12 +73,14 @@ if (!holidays.isEmpty()) { QString summary; foreach (const KHolidays::Holiday &holiday, holidays) { - if (!summary.isEmpty()) { - summary.append("\n"); - } + if (holiday.dayType()==1) { + if (!summary.isEmpty()) { + summary.append("\n"); + } - summary.append(holiday.text()); + summary.append(holiday.text()); } + } data.insert(dateArg.toString(Qt::ISODate), summary); } Beat me to it :-) Looks good, thanks for that Anne-Marie. Plasma patches normally go up on ReviewBoard, I'd want to get sign-off from Aaron or Marco, but I don't see a problem there. The above is my less prefered way. My idea was to display "Holiday: summary" for holiday.dayType()==1 for ex "Holiday: Christmas" and only "summary" for holiday.dayType()==0 for ex "Spring" so that all days in the calendars are displayed. Davide, is that easily doable? Given that the "Holiday:" string is in DateExtenderWidget. Do you mean have the engine add 'Holiday: ' to the summary string it returns? Could be a good compromise if it's OK to move the translation. A grep doesn't appear to show anything besides CalendarTable and ClockApplet that uses the Calendar engine so it could be safe. The tooltip might look a little strange, would need to check the visuals of that if done. Otherwise if you mean doing that in the applet, then it's a change to the engine api and the CalendarTable method of caching holidays and a few other things which are too big before 4.5. John: you are right, it's too big for 4.4. Then we can commit the above patch but maybe leave the bug report open for the 4.5 real fixe. Yes, please leave open for 4.5. I plan to make changes in 4.5 to allow multiple holidays on the same day, have multiple holiday regions, and maybe even an akonadi interface for calendar events, so I can fix this then. Thanks! SVN commit 1063953 by annma: fix holidays parsing in order to display only non work holidays - will get a true fix for 4.5 to allow displaying of all holiday days from the calendar and more (thanks to John Layt) CCBUG=218549 M +6 -4 calendarengine.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1063953 John: has this been satisfactorially addressed in 4.5? No, the KHolidays api to provide holiday classifications wasn't finished in time for 4.5. I could quickly whip up the other solution where the dataengine returns all the holidays again but with the existing DayType flag attached. The plasmoid would then only highlight in red the days off but the tooltip could list all the holidays returned. See review on http://reviewboard.kde.org/r/4236/, there's room for discussion about how each holiday and event type gets displayed. Implemented for 4.5 all holidays are shown again, but only days off are highlighted in red and have their description prefixed with "Holiday". All other holidays are highlighted in green and are not labeled as Holiday. This is sufficient to close this bug as it resolves the original issue of not distinguishing between days off and not days off. Proper classification and control of what types of holidays to display is a whole new feature for consideration in 4.6. |