Tuesday, March 23, 2010

A new folder tree view

One complaint I have made a few times is that my hierarchy of accounts does not necessarily match up to the logical structure. For example, I have Mozilla-related folders splayed out across three accounts, one newsgroup, and two email accounts. They're different because, well, you can't combine mail folders, newsgroups, and RSS feeds all under one account.

Now, in Thunderbird 3, Joey Minta replaced the folder pane with a more extensible version. Having some time on my hands (I finally figured out the bug that was stopping me from completing part 2 of the ongoing Creating New Account Types series), I decided to try to make a simple extension that would create a categorized tree view. So this is what I made. Notes, though:

  1. It doesn't actually work in Thunderbird 3, only some of the newer nightlies. It turns out that the folder tree view stuff changed between Thunderbird 3 and Thunderbird 3.1, and the newer version is what I used to make the extension.
  2. Speaking of which, it turns out that there is a bug in gFolderTreeView.load. Just to make life fun, the strings in the bundles are different between Thunderbird 3 and 3.1. Argh!
  3. Categorizing works by setting a property on DBFolderInfo, for now at least. So this means it doesn't appear to work on server folders.
  4. Uncategorized folders fall under the categories of their parents. So, basically, at the beginning, everything is laid out like the all folders view just shifted one level down. As you categorize more stuff, portions are spliced under different categories.
  5. Categories should be marked as having new or unread messages if any folders beneath them are so marked.

Once I can get it working in TB 3.0, I'll try to get it up onto amo.

3 comments:

Andrew Sutherland said...

This sounds both very cool and useful!

Two suggestions:
1) Screenshots! :)
2) Please be make double sure that if your code triggers a message database load that it makes sure to null out the msgDatabase reference on the nsIMsgFolder.

Ludvig said...

"They're different because, well, you can't combine mail folders, newsgroups, and RSS feeds all under one account."

Always nice with new extensions, but you can actually combine messages from the different accounts, newsgroups and feeds using a Virtual Folder.

Peter Lairo said...

Yeah, please put a screen-shot in your post.

The idea of topic-based folder groups sounds really great!

Oh, did I mention: screen-shot please!