<?xml version="1.0"?>
<PREFSGROUP uiname="Netscape Preferences">
<PREF uiname="Open Browser on Startup" prefname="general.startup.browser"
type="bool" lockable="true" description="When the application starts, open
a browser window.">
<VALUE>true</VALUE>
<LOCKED>false</LOCKED>
</PREF>
</PREFSGROUP>
<?xml version="1.0"?>
<PREFSGROUP uiname="Netscape Preferences">
<PREFSGROUP uiname="Group 1">
<PREF uiname="Autoload What's Related" prefname="browser.related.autoload"
type="int" lockable="true" description="A good description
of this pref goes here.">
<CHOICES>
<CHOICE uiname="Always" value="0"/>
<CHOICE uiname="After First Use" value="1"/>
<CHOICE uiname="Never" value="2"/>
</CHOICES>
<VALUE>0</VALUE>
<LOCKED>false</LOCKED>
</PREF>
<PREF uiname="Start Page" prefname="browser.startup.page"
type="int" lockable="true" description="Display this page when
Navigator starts up.">
<CHOICES>
<CHOICE uiname="Blank Page" value="0"/>
<CHOICE uiname="Home Page" value="1"/>
<CHOICE uiname="Last Page Visited" value="2"/>
</CHOICES>
<VALUE>0</VALUE>
<LOCKED>false</LOCKED>
</PREF>
</PREFSGROUP>
<PREFSGROUP uiname="Group 2">
<PREF uiname="Bookmarks" prefname="browser.toolbars.showbutton.bookmarks"
type="bool" lockable="true" description="Show Booksmarks button on browser
toolbar.">
<VALUE>true</VALUE>
<LOCKED>false</LOCKED>
</PREF>
<PREF uiname="Go" prefname="browser.toolbars.showbutton.go"
type="bool" lockable="true" description="Show Go button on browser toolbar.">
<VALUE>true</VALUE>
<LOCKED>false</LOCKED>
</PREF>
</PREFSGROUP>
</PREFSGROUP>
The above example also demonstrates how to include multiple choice
prefs. These make it easier for the CCK/Factory user to select pref values
without understanding how they are implemented. This XML file results in the prefs tree structure in the example below.
| Attribute |
Example |
Description |
| uiname |
uiname="Netscape Preferences" |
This is the name of the group as it appears in the tree control. |
| Attribute |
Example |
Description |
| uiname |
uiname="Open Browser on Startup" |
This is the name of the pref as is appears in the
tree control. It doesn't have to be the name of the pref--it should be something
easy for the user to understand. |
| prefname |
prefname="general.startup.browser" |
This is the real name of the pref as it is used by the Netscape client products. |
| type |
type="bool" |
Must be one of int, bool, or string. This determines how the pref will be edited in the Pref Editor and how it is written to the prefs file in the install image. bool Pref Editor user allowed to select “true” or “false” from a drop-down. No quotes are used when writing the pref in the pref file. For example, pref("general.startup.browser", true); int Pref Editor user allowed to enter integers. No quotes are used when writing the pref in the pref file. For example, pref("network.proxy.socks_version", 5); string Pref Editor user may enter whatever he likes. Quotes are used when writing the pref in the pref file. For example, pref("general.useragent.vendorComment", "AK-MyISP"); |
| lockable |
lockable="true" |
Determines whether or not the Pref Editor user can change the lock state the pref. |
| description |
description="When the application starts, open a browser window." |
This is some text which further describes the pref
to the Pref Editor user. It appears when the user selected the pref for editing.
Any text which helps the user under the pref should go here. |
| Attribute |
Example |
Description |
| uiname |
uiname="Blank Page" |
The text of this choice in the list box for this choice. |
| value |
value="0" |
The value saved in the <VALUE> element for the <PREF> when the pref is edit and this choice is selected in the list box. The type of the value must be correct for the enclosing <PREF> element. |