Closed Bug 70033 Opened 24 years ago Closed 24 years ago

UI elements need to be disabled if the PrefIsLocked is true.

Categories

(SeaMonkey :: Preferences, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: eddyk, Assigned: eddyk)

References

(Depends on 1 open bug)

Details

Attachments

(5 files)

While the prefs backend already supports the locking feature, it would be confusing if users are allowed to modify elements that are locked.
confirming. cc'ing blake, jag and alecf to see how feasible this'd be.
this is totally feasable. We just need to fix the preference window's backend to support it.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I'm almost ready to put up for review of some changes to: nsPrefWindow.js - changes the widgetStateManager to also handle disabled properties and use PrefIsLocked radioBindings.xml - changes to radiogroup to disable all children If the review of these pass, I'll probably start on some of the other pref panels that handle elements themselves, thus keeping wsm from doing its thing.
Status: NEW → ASSIGNED
who wants to review this? Some comments on the patches: nsPrefWindow.js - added function getPrefIsLocked which uses nsIPref::PrefIsLocked. Dunno if PrefIsLocked works yet, but if it doesn't -- that's a separate bug. radioBindings.xml - Given my limited experience with this stuff, I feel kinda funny about these changes, but it was all I could come up with. I'm hitching a ride in selectedAttribute to set and unset the disabled attribute which triggers the setter/getter of radiogroup. IMO, it's ugly since selectedAttribute shouldn't have anything to do with the disabled property, but I couldn't get the disabled setter/getter to be called on radiogroup init. A quick test by having the getPrefIsLocked return true shows the majority of xul elements in the pref window being disabled. The rest are works in progress.
general comments: tabs are bad inconsistent bracing {} is bad debug's are bad please try to conform to the file's prefs (esp the modeline if it generally describes the file) specifics: + var isPrefLocked = this.getPrefIsLocked(prefstring); + if (isPrefLocked) + root.disabled="true"; why not: root.disabled=this.getPrefIsLocked(prefstring); + if (v == 'true') return true; + return false; please consider return v=='true'; + if (!val) this.removeAttribute('disabled'); + return val; return should not be indented here. + if (this.disabled) + this.disabled='true'; + else + this.disabled=false; please use: this.disabled=!this.disabled; overall concepts look great.
thanks timeless. I appreciate the feedback on the diffs. However, why is debug bad? I happy to remove it, but wouldn't it make life easier if it was left it and there was a bug to track down? Or is performance greatly affected by debugs in xul?
the debug stuff is iffy, recently people have kind of requested that we not include debug stuff unless it's really necessary. If you feel it's necessary i'm not going to reject your patch because of it. [not that i have the power to reject patches in general]
Does setting the .disabled property on each child radio button work? (rather than explicitly setting the disabled attribute). If that's possible, that's preferred. Otherwise, r=ben. This looks great.
I think .disabled works for radiobuttons. On top of that, why not use a broadcaster instead of this loop?
ignore the broadcaster comment, I was high.
The problem with setting disabled is that the widget state manager only sets the attribute, not the property, so that the property setter is not used.
Depends on: 70538
fix checked in, r=timeless. thanks
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Interestingly I found that the 2/25/01 patch no longer works for radiogroups. I've modified the patch by setting the disabled attribute in the setter/getters for the radio value property. I think this is a guaranteed way to be called in order to setup the disabled property. I've also removed the previous spot where I was setting the disabled property.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
assigning QA to luke, adding sarah to Cc.
QA Contact: sairuh → lrg
element.disabled = element.getElementsByAttribute( "disabled", aDataObject.disabled ); getElementsByAttribute returns a NodeList. I think this is what you mean: element.disabled = element.disabled = element.getElementsByAttribute( "disabled", aDataObject.disabled ).length;
Instead of hacking the radio xml binding to trigger the setter/getter for the disabled attribute, this last patch hacks nsWidgetStateManager to set the disabled attribute for radio elements in order to trigger the getter/setter. sr= ben via irc.
r=timeless
checked in and seems to be working (again). marking fixed
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
updating qa contact, adding lrg to cc
QA Contact: lrg → rvelasco
verified general pref panels on 2001052308 Commercial builds (all tier 1 platforms). Some elements still need to adhere to locking standard, will update tracking bug 70538 with those bugzilla ID's.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: