mozdev.org

 Mnenhy    

resources:
Custom Headers, incl. X-Faces Contents Text Codecs

Folder Storage (SeaMonkey, Mozilla, Thunderbird)

Folder TreeIs InheritingIs Data FolderUsed Data Folder
(global)
|
+- Local Folders
|  +- Folder1
|  |  +- Folder2
|  +- Folder3
|     +- Folder4
|
+- News Account
|  +- Folder5
|  +- Folder6
|  +- Folder7
|
+- POP3 Account
|  +- Folder8
|     +- Folder9
...
(has no parent)

yes
no
yes
yes
no

no
yes
yes
no

yes
yes
yes
(always yes)

no
yes
no
no
yes

yes
no
no
yes

no
no
no
(global)

(global)
Folder1
Folder1
(global)
Folder4

News Account
News Account
News Account
Folder7

(global)
(global)
(global)
Data Folder Inheritance

Concept

As the module name "Folder Storage" suggests, every folder gets the ability to store related data like threadpane layouts or preferences. A folder that does store such customized data is called a data folder.

But a folder does not need to be a data folder. If it has no data of its own, it is said to be inheriting the data of its parent folder. If this parent folder does not store any data either, the next ancestors are looked upon until a data folder is found or the global settings are reached.

The table Data Folder Inheritance shows some examples, with data folders set in bold type.

Customizing

Folder Storage Context Menu
Folder Storage Context Menu

Mnenhy adds a new item "Folder Storage" to the folder pane context menu. This menu both informs about the current folder's inheritance state and provides means of customizing the related data. All changes will be visible in every folder that is using the same data folder!

Example (based upon the table Data Folder Inheritance above):

Per default (e.g. if the file mnenhy-folderstore.rdf in your profile is empty), all folders are inheriting the global settings. To reduce the amount of data stored, you can turn off the strict inheritance in the Folder Storage Preferences Panel (see screenshot below). When "Store only account-dependent data" is checked, only account folder can be data folders.

Layout

Without Mnenhy, every change to the threadpane column layout is visible to any folder. With Folder Storage in default configuration, it's the same. So how can this be changed?

That's all! Now every changes made to the threadpane layout while in this folder are only visible to this folder and all those that are inheriting his data, i.e. subfolders without own data. And if you want the folder to inherit its parent data again, just restore the checkmark. (You will be asked if you really want to lose its customized data.)

To ease the pain of customizing folders that do not fit nicely into the inheritance hierarchy but should have the same data, the context menu presents two more items:

If you want to edit the layout for folders where the threadpane isn't accessible (e.g. global or account layout), just edit the layout of any folder inheriting it.

Watching Preferences

Folder Storage Configuration Dialog
Folder Storage Configuration Dialog

Folder Storage Preferences Panel
Folder Storage Preferences Panel

Apart from just storing threadpane layouts, a data folder can also watch preferences: you can define lists of preferences whose current value will be saved when leaving and restored when reentering the folder. This allows, for instance, to have HTML display enabled for all mails except those in the Junk folder.

To configure a folder's watched preferences, choose "Folder Configuration..." from its context menu. Make sure that the data folder is correct, you may want to make the current folder a data folder itself.

Use the "Add" and "Remove" buttons to customize the list of preferences watched by this data folder. The list is (currently) not sorted, entries appear in the order they were added.

Manipulating the list of watched preferences via these buttons can be tedious, though, so there is an import/export mechanism available:

Sharing such files is still not very comfortable when having many different folder configurations. And thus the Folder Storage Preferences Panel provides the "Export watched preferences"/"Import watched preferences" buttons that export/import all/many of such folder preferences at once.

If you don't want to watch user preferences, you can gain some machine cycles by turning the feature off in the Folder Storage Preferences Panel, but the effect is scarcely visible.

Tips & Tricks

  • To (de)activate the HTML display for a specific folder, watch these preferences:
    user_pref("mailnews.display.html_as", 0);
    user_pref("mailnews.display.prefer_plaintext", false);
    user_pref("mailnews.display.disallow_mime_handlers", 0);
    
    This is especially useful for Thunderbird's RSS feature where you may need to see HTML, even though you don't like it for mail or news!
  • You can evaluate custom scripts whenever a folder is entered, if you watch this preference:
    user_pref("extensions.mnenhy.folderstore.onenter", "alert('murp!');");
    
    The preference value (here: an alert) will be evaluated in the context of the current window.
  • You can evaluate custom scripts whenever a folder is left, if you watch this preference:
    user_pref("extensions.mnenhy.folderstore.onexit", "alert('murp!');");
    
    The preference value (here: an alert) will be evaluated in the context of the current window.
  • You can use the onenter/onexit handlers above to deactivate the messagepane for a specific folder by watching them there and setting their values there to the following:
    extensions.mnenhy.folderstore.onenter
    document.getElementById("threadpane-splitter").setAttribute("state","collapsed");
    ChangeMessagePaneVisibility(IsMessagePaneCollapsed());
    extensions.mnenhy.folderstore.onexit
    document.getElementById("threadpane-splitter").setAttribute("state",null);
    ChangeMessagePaneVisibility(IsMessagePaneCollapsed());
    This will work SeaMonkey 1.0+ and for Thunderbird 1.5+ at least.

Debug

You can activate logging of the Folder Storage by adding the following line to your user.js:

user_pref("extensions.mnenhy.log.folderstore", true);