Closed Bug 413437 Opened 17 years ago Closed 17 years ago

Locking homepage buttons to disable them is broken (again)

Categories

(Firefox :: Settings UI, defect, P1)

defect

Tracking

()

RESOLVED FIXED
Firefox 3 beta4

People

(Reporter: mkaply, Assigned: dev)

Details

(Keywords: regression)

Attachments

(1 file, 4 obsolete files)

Locking the preferences: pref.browser.homepage.disable_button.current_page pref.browser.homepage.disable_button.bookmark_page pref.browser.homepage.disable_button.restore_default Is supposed to disable the three buttons on the main page of preferences. It is not. To test this, add these two preferences to your system: pref("general.config.filename","mozilla.cfg"); pref("general.config.obscure_value", 0); And create a file called mozilla.cfg in the same directory as the EXE: lockPref("pref.browser.homepage.disable_button.current_page", true); lockPref("pref.browser.homepage.disable_button.bookmark_page", true); lockPref("pref.browser.homepage.disable_button.restore_default", true); On trunk, two of the buttons disabled. On 1.8 branch, only one of the buttons disable. This is a major bug for enterprise
Flags: blocking-firefox3?
Flags: blocking-firefox3? → blocking-firefox3+
Attached patch v1 (obsolete) — Splinter Review
I'm not sure if this would constitute as a workaround or not. Never the less, it does work properly.
Attachment #302603 - Flags: review?(mano)
Michael Kaply: I'm pretty sure you're aware of this - but I figured I might as well say it... Your mozilla.cfg file must begin with "//". So in essence, your demonstration file should look like this: // lockPref("pref.browser.homepage.disable_button.current_page", true); lockPref("pref.browser.homepage.disable_button.bookmark_page", true); lockPref("pref.browser.homepage.disable_button.restore_default", true);
Attachment #302603 - Flags: ui-review?(beltzner)
Attached patch v1.2 (obsolete) — Splinter Review
New version. And its not even a workaround!
Attachment #302603 - Attachment is obsolete: true
Attachment #302764 - Flags: ui-review?(beltzner)
Attachment #302764 - Flags: review?(mano)
Attachment #302603 - Flags: ui-review?(beltzner)
Attachment #302603 - Flags: review?(mano)
Comment on attachment 302764 [details] [diff] [review] v1.2 This check should be done at the top of this function, before we even call getMostRecentWindow. Also, I think the correct check is document.getElementById("...").locked. You don't need ui-r for bug fixes.
Attachment #302764 - Flags: ui-review?(beltzner)
Attachment #302764 - Flags: review?(mano)
Attachment #302764 - Flags: review-
Why would you want to place that check at the top of the function, before the getMostRecentWindow call?
(In reply to comment #4) > (From update of attachment 302764 [details] [diff] [review]) > This check should be done at the top of this function, before we even call > getMostRecentWindow. Also, I think the correct check is > document.getElementById("...").locked. > > You don't need ui-r for bug fixes. > Why would you want to place that check at the top of the function, before the getMostRecentWindow call?
Attached patch v1.3 (obsolete) — Splinter Review
Thanks for the review ace, even though it was a -. Updated patch.
Attachment #302764 - Attachment is obsolete: true
Attachment #302777 - Flags: review?(mano)
Attached patch v1.4 (obsolete) — Splinter Review
even better!
Attachment #302777 - Attachment is obsolete: true
Attachment #302778 - Flags: review?(mano)
Attachment #302777 - Flags: review?(mano)
Comment on attachment 302778 [details] [diff] [review] v1.4 >Index: browser/components/preferences/main.js >=================================================================== >RCS file: /cvsroot/mozilla/browser/components/preferences/main.js,v >retrieving revision 1.16 >diff -u -p -8 -r1.16 main.js >--- browser/components/preferences/main.js 6 Jan 2008 03:59:16 -0000 1.16 >+++ browser/components/preferences/main.js 12 Feb 2008 09:55:57 -0000 >@@ -126,41 +126,48 @@ var gMainPane = { > > /** > * Switches the "Use Current Page" button between its singular and plural > * forms. > */ > _updateUseCurrentButton: function () { > var useCurrent = document.getElementById("useCurrent"); > >+ var windowIsPresent; > var win; > if (document.documentElement.instantApply) { > const Cc = Components.classes, Ci = Components.interfaces; > // If we're in instant-apply mode, use the most recent browser window > var wm = Cc["@mozilla.org/appshell/window-mediator;1"] > .getService(Ci.nsIWindowMediator); > win = wm.getMostRecentWindow("navigator:browser"); > } > else > win = window.opener; > > if (win && win.document.documentElement > .getAttribute("windowtype") == "navigator:browser") { >- useCurrent.disabled = false; >+ windowIsPresent = true; > > var tabbrowser = win.document.getElementById("content"); > if (tabbrowser.browsers.length > 1) > useCurrent.label = useCurrent.getAttribute("label2"); > else > useCurrent.label = useCurrent.getAttribute("label1"); > } > else { >+ windowIsPresent = false; > useCurrent.label = useCurrent.getAttribute("label1"); >- useCurrent.disabled = true; > } >+ >+ if (document.getElementById >+ ("pref.browser.homepage.disable_button.current_page").locked) >+ return; >+ >+ useCurrent.disabled = !windowIsPresent; Add a comment here explaining that the button disabled state is set by preferences.xml if the preference is locked. r=mano otherwise.
Attachment #302778 - Flags: review?(mano) → review+
Assignee: nobody → dev
Priority: -- → P1
Target Milestone: --- → Firefox 3 beta4
Attached patch for checkinSplinter Review
Commented.
Attachment #302778 - Attachment is obsolete: true
mozilla/browser/components/preferences/main.js 1.17
Status: NEW → RESOLVED
Closed: 17 years ago
Flags: in-litmus?
Keywords: checkin-needed
Resolution: --- → FIXED
Flags: in-litmus?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: