Closed Bug 333375 Opened 18 years ago Closed 18 years ago

Task tooltip displays priority as number and not as string value


(Calendar :: Sunbird Only, defect)

Not set


(Not tracked)



(Reporter: ssitter, Assigned: jminta)



(1 file, 1 obsolete file)

Task tooltip displays priority as number and not as string value

Steps to Reproduce:
1. Create a task and set the priority to low, medium or high
2. Hover mouse pointer over task in Sunbirds task list and watch tooltip

Actual Results:
Tooltip shows the real priority value as internal stored, e.g. "Priority: 9" for low, "Priority: 5" for medium and "Priority: 1" for high.

Expected Results:
Tooltip should show the priority as string, e.g. "Priority: low".

Open point: 
How to handle/display imported task with e.g. priority=3?

Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20060408 Mozilla Sunbird/0.3a1+ with new profile.
Attached patch more stringbundles (obsolete) — Splinter Review
Patch converts the priority to High/Medium/Low strings in the same way that calendar-event-dialog does.
Assignee: nobody → jminta
Attachment #217786 - Flags: first-review?(mvl)
Comment on attachment 217786 [details] [diff] [review]
more stringbundles

>Index: calendar/resources/content/mouseoverPreviews.js
>+      function getPriorityString(stringName) {
>+          var sbs = Components.classes[";1"]
>+                              .getService(Components.interfaces.nsIStringBundleService);
>+          var props = sbs.createBundle("chrome://calendar/locale/");
>+          return props.GetStringFromName(stringName);
>+      }

I don't see the need for a special function here. Move the initialization to before the if-blocks, and then use GetStringFromName  instead of getPriorityString.

>+      if (priorityInteger >= 1 && priorityInteger <= 4) {
Can a priority ever be 0?

>+      } else {
>+          priorityString = getPriorityString('lowPriority'); // low priority

calendar-event-dialog.js also has a 'no priority'. But you skipped that, and it ends up with low priority. In the end, it won't be a big deal, but we should try to be consistent.
Attachment #217786 - Flags: first-review?(mvl) → first-review-
Now without the extra function declaration.  Neither patch has the problem mentioned about 'Not Specified' priority tasks, since we check first to make sure that .priority is non-null and non-zero.  Since previous versions never included the information in the tooltip if the priority was Not Specified, I've continued this behavior.
Attachment #217786 - Attachment is obsolete: true
Attachment #218419 - Flags: first-review?(mvl)
Comment on attachment 218419 [details] [diff] [review]
more stringbundles v2

Attachment #218419 - Flags: first-review?(mvl) → first-review+
Whiteboard: [needs landing]
patch checked in on trunk and MOZILLA_1_8_BRANCH
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
verified with
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060929 Sunbird/0.3
Whiteboard: [litmus testcase wanted]
Litmus testcase 2617 created
Whiteboard: [litmus testcase wanted]
You need to log in before you can comment on or make changes to this bug.