Closed
      
        Bug 402534
      
      
        Opened 17 years ago
          Closed 17 years ago
      
        
    
  
Provide a default set of categories
Categories
(Calendar :: Lightning Only, defect)
        Calendar
          
        
        
      
        
    
        Lightning Only
          
        
        
      
        
    Tracking
(Not tracked)
        RESOLVED
        FIXED
        
    
  
        
            0.8
        
    
  
People
(Reporter: michael.buettner, Assigned: ssitter)
References
Details
Attachments
(2 files)
| 7.14 KB,
          patch         | dbo
:
              
              review+ | Details | Diff | Splinter Review | 
| 1.49 KB,
          patch         | berend.cornelius09
:
              
              review+ | Details | Diff | Splinter Review | 
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?
| Assignee | ||
| Comment 1•17 years ago
           | ||
This only applies to Lightning because Lightning can't ship localized preferences. See existing Bug 382967.
|   | ||
| Comment 2•17 years ago
           | ||
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 | ||
| Comment 3•17 years ago
           | ||
Assignee: nobody → ssitter
Status: NEW → ASSIGNED
        Attachment #293302 -
        Flags: review?(daniel.boelzle)
|   | ||
| Comment 4•17 years ago
           | ||
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+
|   | ||
| Comment 5•17 years ago
           | ||
forget my comment about outsourcing that stuff; it's different
|   | ||
| Comment 6•17 years ago
           | ||
Stefan, what's up with the patch here in the bug? Can it be checked in?
| Assignee | ||
| Comment 7•17 years ago
           | ||
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.
|   | ||
| Comment 8•17 years ago
           | ||
Checked in on HEAD and MOZILLA_1_8_BRANCH.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.8
| Assignee | ||
| Comment 10•17 years ago
           | ||
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 → ---
| Assignee | ||
| Comment 11•17 years ago
           | ||
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 12•17 years ago
           | ||
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 13•17 years ago
           | ||
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+
| Assignee | ||
| Comment 14•17 years ago
           | ||
getPrefCategoriesArray() can't be used because we don't read/write the preference but the dialog item that is connected to the preference system.
| Assignee | ||
| Updated•17 years ago
           | 
Keywords: checkin-needed
|   | ||
| Comment 15•17 years ago
           | ||
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.
|   | ||
| Comment 16•17 years ago
           | ||
patch checked in on trunk and MOZILLA_1_8_BRANCH
=> FIXED
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
| Updated•17 years ago
           | 
Keywords: checkin-needed
          You need to log in
          before you can comment on or make changes to this bug.
        
Description
•