bug 285416 - Access to Firefox Options from Start Menu broken, patch by gavin.sharp@gmail.com, r=me, a=asa

This commit is contained in:
mconnor%steelgryphon.com 2005-05-05 02:17:23 +00:00
Родитель 66071670c8
Коммит b482b21f44
2 изменённых файлов: 29 добавлений и 6 удалений

Просмотреть файл

@ -84,8 +84,7 @@ function needHomepageOverride(prefb) {
return true;
}
function openWindow(parent, url, target, features, args)
{
function openWindow(parent, url, target, features, args) {
var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(nsIWindowWatcher);
@ -98,6 +97,18 @@ function openWindow(parent, url, target, features, args)
return wwatch.openWindow(parent, url, target, features, argstring);
}
function openPreferences() {
var features = "chrome,titlebar,toolbar,centerscreen,dialog=no";
var url = "chrome://browser/content/preferences/preferences.xul";
var win = getMostRecentWindow("Browser:Preferences");
if (win) {
win.focus();
} else {
openWindow(null, url, "_blank", features);
}
}
function getMostRecentWindow(aType) {
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(nsIWindowMediator);
@ -117,6 +128,7 @@ var nsBrowserContentHandler = {
var prefb = Components.classes["@mozilla.org/preferences-service;1"]
.getService(nsIPrefBranch);
this.mChromeURL = prefb.getCharPref("browser.chromeURL");
return this.mChromeURL;
},
@ -215,8 +227,19 @@ var nsBrowserContentHandler = {
var chromeParam = cmdLine.handleFlagWithParam("chrome", false);
if (chromeParam) {
openWindow(null, chromeParam, "_blank",
"chrome,dialog=no,all" + this.getFeatures(cmdLine), null);
// Handle the old preference dialog URL separately (bug 285416)
if (chromeParam == "chrome://browser/content/pref/pref.xul") {
openPreferences();
} else {
var features = "chrome,dialog=no,all" + this.getFeatures(cmdLine);
openWindow(null, chromeParam, "_blank", features, null);
}
cmdLine.preventDefault = true;
}
if (cmdLine.handleFlag("preferences", false)) {
openPreferences();
cmdLine.preventDefault = true;
}
},

Просмотреть файл

@ -160,7 +160,7 @@ OpenKeyForWriting(const char* aKeyName, HKEY* aKey, PRBool aForAllUsers, PRBool
// firefox.exe\DefaultIcon (default) REG_SZ <appname>,0
// firefox.exe\shell\open\command (default) REG_SZ <appname>
// firefox.exe\shell\properties (default) REG_SZ Firefox &Options
// firefox.exe\shell\properties\command(default) REG_SZ <appname> -chrome "chrome://browser/content/pref.xul"
// firefox.exe\shell\properties\command(default) REG_SZ <appname> -preferences
//
// - Uninstall Information
// ---------------------
@ -247,7 +247,7 @@ static SETTING gSettings[] = {
PATH_SUBSTITUTION | EXE_SUBSTITUTION | NON_ESSENTIAL },
{ MAKE_KEY_NAME1(SMI, "%APPEXE%\\shell\\properties\\command"),
"",
"%APPPATH% -chrome \"chrome://browser/content/pref/pref.xul\"",
"%APPPATH% -preferences",
PATH_SUBSTITUTION | EXE_SUBSTITUTION | NON_ESSENTIAL }
// The value of the menu must be set by hand, since it contains a localized