Closed Bug 402534 Opened 18 years ago Closed 17 years ago

Provide a default set of categories

Categories

(Calendar :: Lightning Only, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: michael.buettner, Assigned: ssitter)

References

Details

Attachments

(2 files)

Currently, we don't come up with a default set for categories in the preference panel. That's because we initialize the categories with an empty string, see [1]. There's already a list of categories available (categories.properties, see [2]), but it doesn't get installed in the preferences and we don't provide a default set of color for those. [1] http://lxr.mozilla.org/mozilla1.8/source/calendar/lightning/content/lightning.js#97 [2] http://lxr.mozilla.org/mozilla1.8/source/calendar/locales/en-US/chrome/calendar/categories.properties#39
Flags: wanted-calendar0.8?
This only applies to Lightning because Lightning can't ship localized preferences. See existing Bug 382967.
It would be good to have this in 0.8
Assignee: michael.buettner → nobody
Component: General → Lightning Only
Flags: wanted-calendar0.8? → wanted-calendar0.8+
QA Contact: general → lightning
Assignee: nobody → ssitter
Status: NEW → ASSIGNED
Attachment #293302 - Flags: review?(daniel.boelzle)
Blocks: 382967
Comment on attachment 293302 [details] [diff] [review] init categories from categories.properties > var categories = document.getElementById("calendar.categories.names").value; >+ >+ // If no categories are configured load a default set from properties file >+ if ( !categories || categories == "" ) { remove spaces ^ ^ >+ categories = calGetString("categories", "categories"); >+ document.getElementById("calendar.categories.names").value = categories; >+ } >+ > gCategoryList = categories.split(","); I'd prefer to outsource the above code to e.g. calGetCategories() in calUtils.js (unless bug 409950 is resolved). looks fine, r=dbo
Attachment #293302 - Flags: review?(daniel.boelzle) → review+
forget my comment about outsourcing that stuff; it's different
Stefan, what's up with the patch here in the bug? Can it be checked in?
This already can be checked in with the styling nits (spaces) from Comment #4 fixed. Otherwise I'll provide an updated patch within the next days.
Checked in on HEAD and MOZILLA_1_8_BRANCH.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.8
VERIFIED with 2008012320 and Win XP.
Status: RESOLVED → VERIFIED
This needs to be reopened because the fix has been removed by Bug 321010, at least the fix in mozilla/calendar/base/content/preferences/categories.js.
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
To test the patch directly go to the preference dialog after installing Lightning. Without the patch no categories are displayed, with the patch the default set should be displayed.
Attachment #305017 - Flags: review?(philipp)
Comment on attachment 305017 [details] [diff] [review] apply the fix again Moving review to berend since I will be away until thursday
Attachment #305017 - Flags: review?(philipp) → review?(Berend.Cornelius)
Comment on attachment 305017 [details] [diff] [review] apply the fix again Your patch works, but you should use the function "getPrefCategoriesArray" in calUtils.js; r=berend
Attachment #305017 - Flags: review?(Berend.Cornelius) → review+
getPrefCategoriesArray() can't be used because we don't read/write the preference but the dialog item that is connected to the preference system.
Keywords: checkin-needed
But why is this use-case different from the other usecases (see 'appendCategoryItens' used by the calender-event dialog and by the task-category menu). There we also fill up menus and initialize the preferences if no categories are set on the way.
patch checked in on trunk and MOZILLA_1_8_BRANCH => FIXED
Status: REOPENED → RESOLVED
Closed: 18 years ago17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: