Problem with prefwindow in TB3
Hello
I have a pref window opened from a button on Account Settings
\Copies&Folders
Here is the XUL of the prefwindow
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE prefwindow SYSTEM "chrome://messagearchiveoptions/locale/
prefwindow.dtd">
<prefwindow id="messagearchiveoptionsPreferences" xmlns="http://
www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&prefwindow.title" style="height: 300px">
<prefpane id="pane1" label="&pane1.title;"
onpaneload="granularitySwitch();">
<preferences>
<preference id="pref_keepstructure"
name="extensions.messagearchiveoptions@eviljeff.com.keepstructure"
type="bool"/>
<preference id="pref_semester"
name="extensions.messagearchiveoptions@eviljeff.com.semesterstring"
type="unichar"/>
<preference id="pref_quarter"
name="extensions.messagearchiveoptions@eviljeff.com.quartertring"
type="unichar"/>
<preference id="pref_month"
name="extensions.messagearchiveoptions@eviljeff.com.monthstring"
type="unichar"/>
<preference id="pref_year"
name="extensions.messagearchiveoptions@eviljeff.com.yearstring"
type="unichar"/>
<preference id="pref_granularity2"
name="extensions.messagearchiveoptions@eviljeff.com.granularity2"
type="int"/>
<preference id="pref_granularity"
name="mail.server.default.archive_granularity" type="int"/>
<preference id="pref_keyalt"
name="extensions.messagearchiveoptions@eviljeff.com.key.alt"
type="bool"/>
<preference id="pref_keyshift"
name="extensions.messagearchiveoptions@eviljeff.com.key.shift"
type="bool"/>
<preference id="pref_keycontrol"
name="extensions.messagearchiveoptions@eviljeff.com.key.control"
type="bool"/>
</preferences>
<script>
<![CDATA[
function granularitySwitch() {
alert('Hello world');
var yearradio=document.getElementById('granularityY');
var monthradio=document.getElementById('granularityM');
var yearField=document.getElementById('year');
var monthField=document.getElementById('month');
if (monthradio.selected) monthField.removeAttribute("disabled");
else monthField.setAttribute("disabled", "true");
if (yearradio.selected || monthradio.selected)
yearField.removeAttribute("disabled");
else yearField.setAttribute("disabled", "true");
}
]]>
</script>
<vbox>
<label value="&keepstructurechoice.label;" />
<checkbox label="&keepstructure.label;"
preference="pref_keepstructure" />
</vbox>
<groupbox>
<caption label="&granularity.label;"/>
<radiogroup id="granularity" preference="pref_granularity">
<radio id="granularityN" value="0"
label="&granularity.levelN.label;" oncommand="granularitySwitch();"/>
<radio id="granularityY" value="1"
label="&granularity.levelY.label;" oncommand="granularitySwitch();"/>
<label accesskey="&year.accesskey;" control="year">&year.label;</
label><textbox id="year" preference="pref_year"/>
<radio id="granularityM" value="2"
label="&granularity.levelM.label;" oncommand="granularitySwitch();"/>
<label accesskey="&month.accesskey;" control="month">&month.label;</
label><textbox id="month" preference="pref_month"/>
</radiogroup>
</groupbox>
<label value="&dateformatref.label;" class="text-link" href="http://
www.opengroup.org/onlinepubs/007908799/xsh/strftime.html"/>
<vbox>
<label value="&key.label;" />
<checkbox label="&key.alt.label;" preference="pref_keyalt" />
<checkbox label="&key.shift.label;" preference="pref_keyshift" />
<checkbox label="&key.control.label;" preference="pref_keycontrol" />
</vbox>
</prefpane>
</prefwindow>
My problem is the prefwindow does not fit to content.
I have try with flex, window.sizeToContent(), autosize but nothing
seems to work.
I am a total newbie to this so please be patient if the problem seems
obvious.
Thansk a lot in advance for your help.