How to define default preferences (prefpane)

243 Views Asked by At

I've successuflly created a custom prefpane for my application (in thunderbird) and defined some preferences.

At the moment, the values in my prefpane are empty by default. However, when I do enter/select and save them, everything is good and they get written into the default database.

    <preferences>
        <preference id="myextension.settings.autosync_time"
                    name="myextension.settings.autosync_time"
                    type="int"/>
        <preference id="myextension.settings.autosync_server"
                    name="myextension.settings.autosync_server"
                    type="string"/>
    </preferences>

How can I predefine values to my preferences (eg. autosync_time = int(60) and autosync_server = string(dlc://mydlc.com) for my application ?

1

There are 1 best solutions below

0
On BEST ANSWER

If you are packaging an extension, you put a JavaScript file with default preferences into the defaults/preferences directory:

pref("myextension.settings.autosync_time", 60);
pref("myextension.settings.autosync_server", "dlc://mydlc.com");

If you are packaging a XULRunner application or changing Thunderbird the same file goes into the defaults/prefs directory of the application.