rest of fix for #15845, #15843, and #15861. for check boxes, see if

"reversed" attribute is true.  if so, reverse the value.
This commit is contained in:
sspitzer%netscape.com 1999-12-24 09:57:49 +00:00
parent f5a6026e45
commit dc6f96ac32
2 changed files with 16 additions and 6 deletions

View File

@ -83,7 +83,7 @@
<html:fieldset>
<html:div>
<html:input id="pref:1:bool:mail.play_sound" type="checkbox"/>
<html:input id="pref:1:bool:mail.play_sound" reversed="true" type="checkbox"/>
<html:label for="pref:1:bool:mail.play_sound">&playSound.label;</html:label>
</html:div>
@ -93,7 +93,7 @@
</html:div>
<html:div>
<html:input id="pref:1:bool:mailnews.confirm.moveFoldersToTrash" reverse="true" type="checkbox"/>
<html:input id="pref:1:bool:mailnews.confirm.moveFoldersToTrash" reversed="true" type="checkbox"/>
<html:label for="pref:1:bool:mailnews.confirm.moveFoldersToTrash">&confirmMove.label;</html:label>
</html:div>
@ -104,7 +104,7 @@
</html:div>
<!--html:table>
<html:tr><html:td><html:input type="checkbox" reversed="true" id="pref:1:bool:mail.play_sound"/>
<html:tr><html:td><html:input type="checkbox" id="pref:1:bool:mail.play_sound"/>
<html:label>&playSound.label;</html:label></html:td></html:tr>
<html:tr><html:td><html:input type="checkbox" id="pref:1:bool:mailnews.remember_selected_message"/>
<html:label>&rememberLastMsg.label;</html:label></html:td></html:tr>

View File

@ -365,8 +365,13 @@ nsresult nsPrefWindow::InitializeOneInputWidget(
if (WIDGET_IS_TYPE(inWidgetType,"checkbox"))
{
boolVal = (PRBool)(boolVal ^ inPrefOrdinal);
inElement->SetDefaultChecked(boolVal);
inElement->SetChecked(boolVal);
nsAutoString val;
(void)inElement->GetAttribute("reversed",val);
if (val.Equals("true")) {
boolVal = !boolVal;
}
inElement->SetDefaultChecked(boolVal);
inElement->SetChecked(boolVal);
}
else if (WIDGET_IS_TYPE(inWidgetType,"radio") && inPrefOrdinal == boolVal)
{
@ -722,7 +727,12 @@ nsresult nsPrefWindow::FinalizeOneInputWidget(
return rv;
if (WIDGET_IS_TYPE(inWidgetType,"checkbox"))
{
boolVal = (PRBool)(boolVal ^ inPrefOrdinal);
boolVal = (PRBool)(boolVal ^ inPrefOrdinal);
nsAutoString val;
(void)inElement->GetAttribute("reversed",val);
if (val.Equals("true")) {
boolVal = !boolVal;
}
mPrefs->SetBoolPref(tempPrefName, boolVal);
}
else if (WIDGET_IS_TYPE(inWidgetType,"radio") && boolVal)