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)
SeaMonkey
Preferences
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: eddyk, Assigned: eddyk)
References
(Depends on 1 open bug)
Details
Attachments
(5 files)
3.69 KB,
patch
|
Details | Diff | Splinter Review | |
3.63 KB,
patch
|
Details | Diff | Splinter Review | |
1.24 KB,
patch
|
Details | Diff | Splinter Review | |
711 bytes,
patch
|
Details | Diff | Splinter Review | |
1.52 KB,
patch
|
Details | Diff | Splinter Review |
While the prefs backend already supports the locking feature, it would be
confusing if users are allowed to modify elements that are locked.
Comment 1•24 years ago
|
||
confirming. cc'ing blake, jag and alecf to see how feasible this'd be.
Comment 2•24 years ago
|
||
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]
Comment 10•24 years ago
|
||
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.
Comment 11•24 years ago
|
||
I think .disabled works for radiobuttons. On top of that, why not use a
broadcaster instead of this loop?
Comment 12•24 years ago
|
||
ignore the broadcaster comment, I was high.
Comment 13•24 years ago
|
||
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.
Comment 14•24 years ago
|
||
fix checked in, r=timeless. thanks
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 15•24 years ago
|
||
Assignee | ||
Comment 16•24 years ago
|
||
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 → ---
Assignee | ||
Comment 18•24 years ago
|
||
Comment 19•24 years ago
|
||
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;
Assignee | ||
Comment 20•24 years ago
|
||
Assignee | ||
Comment 21•24 years ago
|
||
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.
Comment 22•24 years ago
|
||
r=timeless
Assignee | ||
Comment 23•24 years ago
|
||
checked in and seems to be working (again). marking fixed
Status: REOPENED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → FIXED
Comment 25•24 years ago
|
||
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
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•