Closed Bug 467855 Opened 16 years ago Closed 15 years ago

Folderpane should make it possible for extensions to specify bundles for new text to use in label for new modes

Categories

(Thunderbird :: Mail Window Front End, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0b2

People

(Reporter: davida, Assigned: jminta)

Details

Attachments

(1 file)

right now an addon can provide a new mode for the folder pane, but the current folderPane.js code doesn't know how to get a label.

The current code looks like:

      let key = "folderPaneHeader_" + this.mode;
      let string = document.getElementById("bundle_messenger").getString(key);

we should figure out a way to let the add-on specify an alternate bundle. something like:

       let key = "folderPaneHeader_" + this.mode;
       let string = document.getElementById("bundle_messenger").getString(key);
+      // detect failure (does getString return null on failure?)
+      if (!string) 
+         string = document.getElementById("bundle_" + this.mode).getString(key);

Marking as blocking as it's a big extensibility limitation and it should be fairly trivial to fix.
Flags: blocking-thunderbird3+
giving to jminta since I think he's doing other work on making the folder pane extensible.
Assignee: nobody → jminta
Attached patch patch v1Splinter Review
This solves this bug through implementing the register/unregister functions mentioned in bug 467947. If we have a registered mode, we'll use the localized name it was registered with, otherwise we'll look in our string-bundle.

None of this code is currently exercised, but I tested it by simply putting gFolderTreeView.registerMode("foo", function() { return []; }, "Foo"); at the bottom (top-level) of folderPane.js. That gave a new blank mode in the cycle.
Attachment #355341 - Flags: review?(bienvenu)
Attachment #355341 - Flags: review?(bienvenu) → review+
fix checked in http://hg.mozilla.org/comm-central/rev/4cfbdb787aa3
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.