After learning how to lock preferences (bug 861471 comment #43) I've revisited the logic for bug 856454. While the individual mail.biff.alert.show_* prefs are correctly disabled on locking (and remain disabled when the entire vbox is enabled again, so that part is taken care of by the prefwindow already), the logic for unchecking one alert when selecting the other is still active.
1. lock "mail.biff.show_alert" to true
2. verify that "Show an alert" box is checked but disabled
3. check "Show a balloon" (with "Show an icon" checked)
4. note that "Show an alert" becomes unchecked despite locking
Thus, the locked status has to be verified in both instances before changing the value in response to checking the other alert's box.
Created attachment 742819 [details] [diff] [review]
This patch assigns "false" only if the preference to be changed is not locked.
In theory, this allows now both show_alert and show_balloon to be selected at the same time (e.g., one is locked "true" and the other checked by the user). It is safe to assume that, if an administrator wants to prevent that case, he or she would lock both show_alert and show_balloon preferences.
> individual mail.biff.alert.show_* prefs are correctly disabled on locking
> ([...] that part is taken care of by the prefwindow already),
Actually, that's done by EnableElement() as called from EnableElementById().
Comment on attachment 742819 [details] [diff] [review]
Thanks Neil. Push for comm-central, please.