Bug 284081: When software install (xpinstall.enabled) is disabled, clicking 'Edit Options' on the message bar opens an empty window. r=mconnor, a=asa

This commit is contained in:
steffen.wilberg%web.de 2005-04-28 21:49:46 +00:00
parent 6a6daeba8f
commit 8dc021c1f1
3 changed files with 24 additions and 21 deletions

View File

@ -482,16 +482,7 @@ const gXPInstallObserver = {
}
break;
case "xpinstall-install-edit-prefs":
wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var optionsWindow = wm.getMostRecentWindow("Browser:Options");
if (optionsWindow) {
optionsWindow.focus();
optionsWindow.switchPage("catFeaturesbutton");
}
else
openDialog("chrome://browser/content/pref/pref.xul", "PrefWindow",
"chrome,titlebar,resizable,modal", "catFeaturesbutton");
openPreferences("paneContent");
tabbrowser = getBrowser();
tabbrowser.hideMessage(tabbrowser.selectedBrowser, "top");
break;

View File

@ -405,7 +405,7 @@ function openAboutDialog()
#endif
}
function openPreferences()
function openPreferences(paneID)
{
var instantApply = getBoolPref("browser.preferences.instantApply", false);
var features = "chrome,titlebar,toolbar,centerscreen" + (instantApply ? ",dialog=no" : ",modal");
@ -413,11 +413,16 @@ function openPreferences()
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var win = wm.getMostRecentWindow("Browser:Preferences");
if (win)
if (win) {
win.focus();
else
openDialog("chrome://browser/content/preferences/preferences.xul",
"Preferences", features);
if (paneID) {
var pane = win.document.getElementById(paneID);
win.document.documentElement.showPane(pane);
}
}
else
openDialog("chrome://browser/content/preferences/preferences.xul",
"Preferences", features, paneID);
}
function getUILink(item)

View File

@ -496,18 +496,24 @@
keyClose.parentNode.removeChild(keyClose);
}
var panes = this.preferencePanes;
var lastPane = this.lastSelected ? document.getElementById(this.lastSelected) : panes[0];
var paneToLoad;
if ("arguments" in window && window.arguments[0])
paneToLoad = document.getElementById(window.arguments[0]);
else if (this.lastSelected)
paneToLoad = document.getElementById(this.lastSelected);
else
paneToLoad = panes[0];
for (var i = 0; i < panes.length; ++i) {
var button = this._makePaneButton(panes[i]);
if (lastPane == panes[i])
this._selector.selectedItem = button;
this._makePaneButton(panes[i]);
if (panes[i].loaded) {
// Inline pane content, fire load event to force initialization.
this._fireEvent("paneload", panes[i]);
}
}
this.showPane(lastPane);
this.showPane(paneToLoad);
if (panes.length == 1)
this._selector.setAttribute("collapsed", "true");
]]>
@ -557,6 +563,7 @@
<parameter name="aPaneElement"/>
<body>
<![CDATA[
this._selector.selectedItem = document.getAnonymousElementByAttribute(this, "pane", aPaneElement.id);
if (!aPaneElement.loaded) {
function OverlayLoadObserver(aPane)
{