mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
bug 396610: make it possible once again to disable user configuration of handlers; r=gavin, a=mconnor
This commit is contained in:
parent
a4ad8c4b8a
commit
b838379102
@ -919,9 +919,9 @@ var gApplicationsPane = {
|
||||
item.setAttribute("actionIcon",
|
||||
this._getIconURLForPreferredAction(visibleType));
|
||||
this._list.appendChild(item);
|
||||
if (visibleType.type == this._list.getAttribute("lastSelectedType"))
|
||||
this._list.selectedItem = item;
|
||||
}
|
||||
|
||||
this._selectLastSelectedType();
|
||||
},
|
||||
|
||||
_getVisibleTypes: function() {
|
||||
@ -1036,6 +1036,25 @@ var gApplicationsPane = {
|
||||
}
|
||||
},
|
||||
|
||||
_selectLastSelectedType: function() {
|
||||
// If the list is disabled by the pref.downloads.disable_button.edit_actions
|
||||
// preference being locked, then don't select the type, as that would cause
|
||||
// it to appear selected, with a different background and an actions menu
|
||||
// that makes it seem like you can choose an action for the type.
|
||||
if (this._list.disabled)
|
||||
return;
|
||||
|
||||
var lastSelectedType = this._list.getAttribute("lastSelectedType");
|
||||
if (!lastSelectedType)
|
||||
return;
|
||||
|
||||
var item = this._list.getElementsByAttribute("type", lastSelectedType)[0];
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
this._list.selectedItem = item;
|
||||
},
|
||||
|
||||
/**
|
||||
* Whether or not the given handler app is valid.
|
||||
*
|
||||
@ -1382,8 +1401,9 @@ var gApplicationsPane = {
|
||||
// Mark which item in the list was last selected so we can reselect it
|
||||
// when we rebuild the list or when the user returns to the prefpane.
|
||||
onSelectionChanged: function() {
|
||||
this._list.setAttribute("lastSelectedType",
|
||||
this._list.selectedItem.getAttribute("type"));
|
||||
if (this._list.selectedItem)
|
||||
this._list.setAttribute("lastSelectedType",
|
||||
this._list.selectedItem.getAttribute("type"));
|
||||
},
|
||||
|
||||
_getIconURLForPreferredAction: function(aHandlerInfo) {
|
||||
|
@ -69,6 +69,9 @@
|
||||
<preference id="browser.feeds.handlers.webservice"
|
||||
name="browser.feeds.handlers.webservice"
|
||||
type="string"/>
|
||||
<preference id="pref.downloads.disable_button.edit_actions"
|
||||
name="pref.downloads.disable_button.edit_actions"
|
||||
type="bool"/>
|
||||
</preferences>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://browser/content/preferences/applications.js"/>
|
||||
@ -88,9 +91,9 @@
|
||||
|
||||
<separator class="thin"/>
|
||||
|
||||
<richlistbox id="handlersView" orient="vertical"
|
||||
onselect="gApplicationsPane.onSelectionChanged();"
|
||||
persist="lastSelectedType">
|
||||
<richlistbox id="handlersView" orient="vertical" persist="lastSelectedType"
|
||||
preference="pref.downloads.disable_button.edit_actions"
|
||||
onselect="gApplicationsPane.onSelectionChanged();">
|
||||
<listheader equalsize="always" style="border: 0; padding: 0;">
|
||||
<treecol id="typeColumn" label="&typeColumn.label;" value="type"
|
||||
accesskey="&typeColumn.accesskey;" persist="sortDirection"
|
||||
|
Loading…
Reference in New Issue
Block a user