Last Comment Bug 344036 - Give certain pref checkboxes 'mixed state' look when neither on nor off
: Give certain pref checkboxes 'mixed state' look when neither on nor off
Status: RESOLVED FIXED
: fixed1.8.1
Product: Camino Graveyard
Classification: Graveyard
Component: Preferences (show other bugs)
: Trunk
: PowerPC Mac OS X
-- enhancement (vote)
: ---
Assigned To: froodian (Ian Leue)
:
:
Mentors:
Depends on: 277706
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-09 10:17 PDT by froodian (Ian Leue)
Modified: 2006-08-15 16:17 PDT (History)
3 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Enables mixed state (8.23 KB, patch)
2006-07-10 16:49 PDT, froodian (Ian Leue)
no flags Details | Diff | Splinter Review
Relies on nibs to give initial allowsMixedState value (8.02 KB, patch)
2006-07-13 09:45 PDT, froodian (Ian Leue)
hwaara: review+
Details | Diff | Splinter Review
New Privacy.nib (17.97 KB, application/zip)
2006-07-13 09:46 PDT, froodian (Ian Leue)
no flags Details
New Tabs.nib (10.85 KB, application/zip)
2006-07-13 09:47 PDT, froodian (Ian Leue)
no flags Details
New WebFeatures.nib (12.79 KB, application/zip)
2006-07-13 09:47 PDT, froodian (Ian Leue)
no flags Details
Moves the work to methods (9.43 KB, patch)
2006-07-26 10:40 PDT, froodian (Ian Leue)
mikepinkerton: superreview+
Details | Diff | Splinter Review
sr=pink patch (9.43 KB, patch)
2006-08-02 10:27 PDT, froodian (Ian Leue)
no flags Details | Diff | Splinter Review
Diff problems. (4.29 KB, patch)
2006-08-13 10:46 PDT, Nick Kreeger
no flags Details | Diff | Splinter Review
New Webfeatures.nib (12.79 KB, application/zip)
2006-08-14 16:36 PDT, froodian (Ian Leue)
no flags Details
New Tabs.nib (10.87 KB, application/zip)
2006-08-14 16:36 PDT, froodian (Ian Leue)
no flags Details
New Privacy.nib (21.01 KB, application/zip)
2006-08-14 16:36 PDT, froodian (Ian Leue)
no flags Details

Description User image froodian (Ian Leue) 2006-07-09 10:17:42 PDT
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.
Comment 1 User image Chris Lawson (gone) 2006-07-09 10:29:30 PDT
I'm fairly certain we decided this was a good idea on IRC, so confirming.
Comment 2 User image froodian (Ian Leue) 2006-07-10 16:49:11 PDT
Created attachment 228746 [details] [diff] [review]
Enables mixed state

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.
Comment 3 User image Håkan Waara 2006-07-11 18:11:21 PDT
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?
Comment 4 User image froodian (Ian Leue) 2006-07-11 18:38:37 PDT
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. :(
Comment 5 User image froodian (Ian Leue) 2006-07-13 09:45:25 PDT
Created attachment 229108 [details] [diff] [review]
Relies on nibs to give initial allowsMixedState value
Comment 6 User image froodian (Ian Leue) 2006-07-13 09:46:53 PDT
Created attachment 229109 [details]
New Privacy.nib

This (and the following two nibs) just check the mixed state checkbox for the appropriate checkboxes.
Comment 7 User image froodian (Ian Leue) 2006-07-13 09:47:11 PDT
Created attachment 229110 [details]
New Tabs.nib
Comment 8 User image froodian (Ian Leue) 2006-07-13 09:47:32 PDT
Created attachment 229111 [details]
New WebFeatures.nib
Comment 9 User image Håkan Waara 2006-07-13 17:43:57 PDT
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 10 User image Håkan Waara 2006-07-13 17:44:29 PDT
Comment on attachment 229108 [details] [diff] [review]
Relies on nibs to give initial allowsMixedState value

See last comment.
Comment 11 User image Chris Lawson (gone) 2006-07-13 17:50:15 PDT
(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 12 User image froodian (Ian Leue) 2006-07-13 17:53:18 PDT
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.
Comment 13 User image Mike Pinkerton (not reading bugmail) 2006-07-24 05:58:08 PDT
+  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.
Comment 14 User image froodian (Ian Leue) 2006-07-26 10:40:37 PDT
Created attachment 230761 [details] [diff] [review]
Moves the work to methods

I'm not quit sure I understood you right.  Is this what you wanted?
Comment 15 User image Mike Pinkerton (not reading bugmail) 2006-08-02 08:00:56 PDT
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.
Comment 16 User image froodian (Ian Leue) 2006-08-02 10:27:02 PDT
Created attachment 231771 [details] [diff] [review]
sr=pink patch
Comment 17 User image Nick Kreeger 2006-08-13 10:43:29 PDT
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
Comment 18 User image Nick Kreeger 2006-08-13 10:46:35 PDT
Created attachment 233476 [details] [diff] [review]
Diff problems.
Comment 19 User image froodian (Ian Leue) 2006-08-14 16:36:26 PDT
Created attachment 233679 [details]
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
Comment 20 User image froodian (Ian Leue) 2006-08-14 16:36:44 PDT
Created attachment 233680 [details]
New Tabs.nib
Comment 21 User image froodian (Ian Leue) 2006-08-14 16:36:59 PDT
Created attachment 233681 [details]
New Privacy.nib
Comment 22 User image Mark Mentovai 2006-08-15 08:47:52 PDT
Checked in on the trunk and MOZILLA_1_8_BRANCH.

Note You need to log in before you can comment on or make changes to this bug.