Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

How to add a new bundled "Custom Column" (v5.0)

Mic edited this page Jan 24, 2015 · 1 revision

FOR ADDON VERSION 5.0+

From version 5.0 new columns will be added directly from the addons settings panel.

This page shows how to add a bundled custom column, that is a custom column that is shipped with the extension and cannot be deleted or modified.

The word COLNAME is a placeholder for the new custom column internal name.

To add a new custom column these files must be modified:

  • prefs.js to add the new default setting.
  • mzcw-customcolumns.js to add the new handler functions.

Under the en-US locale folder:

  • overlay.properties to add the needed text strings.
  • settings.dtd to add the needed text strings.

prefs.js

Add a line like this one:

pref("extensions.ColumnsWizard.CustCols.def.COLNAME", "");

mzcw-customcolumns.js

Add to the miczColumnsWizard_CustCols object the method checkDefaultCustomColumnPrefs must be modified.

Add a new case under switch(miczColumnsWizard_CustCols.CustColDefaultIndex[singlecolidx]){, like the following one.

case 'COLNAME':
	dcurrcol.enabled = false;
	dcurrcol.def = "";
	dcurrcol.dbHeader = "DBHEADER"; //The new dbHeader to show
	dcurrcol.isCustom=false;
break;

Finally, add COLNAME also to the miczColumnsWizard_CustCols.CustColDefaultIndex array.

overlay.properties

Append those lines at the end of the file

ColumnsWizardAddCOLNAME.label=<Write here the column header display name>
ColumnsWizardAddCOLNAMEDesc.label=<Write here the column header tooltip>

settings.dtd

Append this line at the end of the file

<!ENTITY ColumnsWizard.AddCOLNAME.label "<Column name>">

Utility

Thunderbird source browser: http://lxr.mozilla.org/comm-central/

https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMsgDBHdr

https://developer.mozilla.org/en-US/Add-ons/Thunderbird/HowTos/Common_Thunderbird_Extension_Techniques/Filter_Incoming_Mail