bug 397690: display full executable name instead of leaf name for applications in Applications prefpane; Patch by Jim Mathies, r=myk, a=mconnor

This commit is contained in:
myk@mozilla.org 2007-09-28 15:50:24 -07:00
Родитель b838379102
Коммит a370ce23c2
1 изменённых файлов: 6 добавлений и 3 удалений

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

@ -1005,7 +1005,7 @@ var gApplicationsPane = {
return this._prefsBundle.getString("saveFile");
case Ci.nsIHandlerInfo.useHelperApp:
return aHandlerInfo.preferredApplicationHandler.name;
return getDisplayNameForFile(aHandlerInfo.preferredApplicationHandler.executable);
case Ci.nsIHandlerInfo.handleInternally:
// For the feed type, handleInternally means live bookmarks.
@ -1065,7 +1065,7 @@ var gApplicationsPane = {
isValidHandlerApp: function(aHandlerApp) {
if (!aHandlerApp)
return false;
if (aHandlerApp instanceof Ci.nsILocalHandlerApp)
return aHandlerApp.executable &&
aHandlerApp.executable.exists() &&
@ -1150,7 +1150,10 @@ var gApplicationsPane = {
let menuItem = document.createElementNS(kXULNS, "menuitem");
menuItem.setAttribute("action", Ci.nsIHandlerInfo.useHelperApp);
menuItem.setAttribute("label", possibleApp.name);
if (possibleApp instanceof Ci.nsILocalHandlerApp)
menuItem.setAttribute("label", getDisplayNameForFile(possibleApp.executable));
else
menuItem.setAttribute("label", possibleApp.name);
menuItem.setAttribute("image", this._getIconURLForHandlerApp(possibleApp));
// Attach the handler app object to the menu item so we can use it