Closed Bug 344036 Opened 18 years ago Closed 18 years ago

Give certain pref checkboxes 'mixed state' look when neither on nor off

Categories

(Camino Graveyard :: Preferences, enhancement)

PowerPC
macOS
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: froodian, Assigned: froodian)

References

Details

(Keywords: fixed1.8.1)

Attachments

(5 files, 6 obsolete files)

Certain prefs (SWM, for instance) can be set to neither on nor off via about:config.  When a user has done this, it'd be nice to give the checkbox the 'mixed state' look instead of just turning it off.
I'm fairly certain we decided this was a good idea on IRC, so confirming.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: nobody → stridey
Attached patch Enables mixed state (obsolete) — Splinter Review
Enables a mixed state look for all nonboolean prefs that we map to boolean in the UI, except for 

browser.startup.page
browser.tabs.startPage

because setting them to values other than those exposed in the UI didn't seem to do anything.

The code in WebFeatures.mm for |mEnableAnnoyanceBlocker| is kinda ugly - I'm almost certain there's a more elegant way to do that.
Attachment #228746 - Flags: review?(hwaara)
Can't you do the equivalent of setAllowsMixedState: in the nib on those checkboxes where it makes sense? Or is there some special reason to set it on every click in the action method?
We'll still need to set it to NO every click (because otherwise the checkboxes can be clicked into the mixed state, which doesn't mean anything), but yeah, we can set the mixed state to YES in the nib, and avoid having to set it to YES in the |mainViewDidLoad| methods.

Marking dependent on a bug currently holding up the webfeatures nib. :(
Depends on: 277706
Attachment #228746 - Attachment is obsolete: true
Attachment #229108 - Flags: review?(hwaara)
Attachment #228746 - Flags: review?(hwaara)
Attached file New Privacy.nib (obsolete) —
This (and the following two nibs) just check the mixed state checkbox for the appropriate checkboxes.
Attached file New Tabs.nib (obsolete) —
Attached file New WebFeatures.nib (obsolete) —
Status: NEW → ASSIGNED
One thing I find sort of confusing is that you can only get into the mixed states by editing your about:config. So it's sort of a special case.

But I guess it's ok then, as long as users don't run into this and can't get back into the mixed state.
Comment on attachment 229108 [details] [diff] [review]
Relies on nibs to give initial allowsMixedState value

See last comment.
Attachment #229108 - Flags: review?(hwaara) → review+
(In reply to comment #9)
> One thing I find sort of confusing is that you can only get into the mixed
> states by editing your about:config. So it's sort of a special case.

Wasn't that the whole point of this bug in the first place?

cl
Comment on attachment 229108 [details] [diff] [review]
Relies on nibs to give initial allowsMixedState value

Yeah, this is sort of a "by the way, you messed with your about:config" bug.  Normal users will never see its products.
Attachment #229108 - Flags: review?(bugzilla)
Attachment #229108 - Flags: review?(bugzilla) → superreview?(mikepinkerton)
+  if([self getBooleanPref:"dom.disable_window_status_change" withSuccess:&gotPref] &&
+     [self getBooleanPref:"dom.disable_window_move_resize" withSuccess:&gotPref] &&
+     [self getBooleanPref:"dom.disable_window_flip" withSuccess:&gotPref])

rather than duplicating this code and inverting it, why not break it out into separate routines? Will make the init code easier to parse.

+  if ([preventAnimation isEqualToString:@"once"])
+    [mPreventAnimation setState:NSOnState];
+  else if ([preventAnimation isEqualToString:@"normal"])
+    [mPreventAnimation setState:NSOffState];
+  else
+    [mPreventAnimation setState:NSMixedState];

move this into a function that returns the button state? happens two or three times.
Attached patch Moves the work to methods (obsolete) — Splinter Review
I'm not quit sure I understood you right.  Is this what you wanted?
Attachment #229108 - Attachment is obsolete: true
Attachment #230761 - Flags: superreview?(mikepinkerton)
Attachment #229108 - Flags: superreview?(mikepinkerton)
Comment on attachment 230761 [details] [diff] [review]
Moves the work to methods

+  if([self getBooleanPref:"dom.disable_window_status_change" withSuccess:NULL] &&
+     [self getBooleanPref:"dom.disable_window_move_resize" withSuccess:NULL] &&
+     [self getBooleanPref:"dom.disable_window_flip" withSuccess:NULL])
+    return kAnnoyancePrefAll;
+  if(![self getBooleanPref:"dom.disable_window_status_change" withSuccess:NULL] &&
+     ![self getBooleanPref:"dom.disable_window_move_resize" withSuccess:NULL] &&
+     ![self getBooleanPref:"dom.disable_window_flip" withSuccess:NULL])
+    return kAnnoyancePrefNone;

can you rework this slightly such that you only fetch each pref once rather than mutliple times?

sr=pink with that.
Attachment #230761 - Flags: superreview?(mikepinkerton) → superreview+
Attached patch sr=pink patchSplinter Review
Attachment #230761 - Attachment is obsolete: true
Whiteboard: [needs checkin]
Blocks: 174070
All three of the attached nib's are old and have conflicts on the trunk! The patch has been checked in so we need these new nibs asap.

(I don't know what changes have been made to the nibs or I would do it myself)

cvs commit: file `camino/PreferencePanes/Privacy/English.lproj/Privacy.nib/info.nib' had a conflict and has not been modified
cvs commit: file `camino/PreferencePanes/Tabs/English.lproj/Tabs.nib/keyedobjects.nib' had a conflict and has not been modified
cvs commit: file `camino/PreferencePanes/WebFeatures/English.lproj/WebFeatures.nib/info.nib' had a conflict and has not been modified
cvs commit: file `camino/PreferencePanes/WebFeatures/English.lproj/WebFeatures.nib/keyedobjects.nib' had a conflict and has not been modified
Attached patch Diff problems.Splinter Review
Attached file New Webfeatures.nib
These should be better.  In case they're not, all I did was make the following checked boxes have mixed state:

- Prevent sites from changing, moving or resizing windows
- Play animated images only once
- Ask before accepting each cookie
- SWM
Attachment #229111 - Attachment is obsolete: true
Attached file New Tabs.nib
Attachment #229110 - Attachment is obsolete: true
Attached file New Privacy.nib
Attachment #229109 - Attachment is obsolete: true
Checked in on the trunk and MOZILLA_1_8_BRANCH.
Keywords: fixed1.8.1
Whiteboard: [needs checkin]
No longer blocks: 174070
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: