Closed Bug 556388 Opened 11 years ago Closed 11 years ago

customizable folder views


(Thunderbird :: Folder and Message Lists, defect)

Not set


(Not tracked)



(Reporter: mixedpuppy, Unassigned)



(2 files)

This is a simple patch that allows me to completely override the view on a folder.  It uses the same mechanism as account central, and reuses the iframe that account central uses.  It depends on a virtual folder being created that has the string property customViewURL.  I do that with:

baseFolder = rootFolder.addSubfolder(parentFolderName);
baseFolder.setStringProperty("customViewURL", "chrome://maillistfilter/content/folderview.xul")
I like it.  My only quibble is whether we should be renaming "accountCentralPane" given that it's not just for accountCentral.
Attachment #436310 - Flags: review?(bugmail)
Comment on attachment 436310 [details] [diff] [review]
folder display patch

I suspect asuth can give his 2c there.  Not sure how to think about mozmill here.
the patch is weird.  what kind of command produced it?
(In reply to comment #4)
> the patch is weird.  what kind of command produced it?

sorry, Komodo with hg. It's only the first line that's different though
Comment on attachment 436310 [details] [diff] [review]
folder display patch

The main danger with functionality like this is what happens when the extension is no longer installed.

I would:
1) just rename _showAccountCentral to _showCustomView
2) treat account central as the fallback case for custom views
3) fall back to account central if the URL in question does not exist.  I'm assuming there's a way to synchronously check if a chrome URL exists without dilly dallying.  If there isn't, it might be better to require the extension to register a mapping at startup.  If there is no mapping, then we know the extension is gone and to fall back to account central.  If there is a mapping, we use it.

The ideal way to test this is to augment sid0's recently added folder pane test that defines a custom folder pane mode.  Also have the extension register a custom URL thing, then have the unit test select the folder for display and verify that the URL gets displayed.

That manner of testing has the advantage that we can point would-be extension developers at the unit test as an example of how to do it.
Attachment #436310 - Flags: review?(bugmail) → review-
Also, if you would be able to furnish diffs that indicate they are diff gits in the future, that would be great, as it lets me use my review board tool without adding a guessed heuristic.  Or if you can tell me what hg command is being invoked, that will let me add a correct heuristic.
Er, and the unit test would also want to add a folder whose URL mapping is bad and verify that the account central page does get displayed.
Closing this, using the select event to override the view, patch not required.
Closed: 11 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.