mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 822572 - Add a Clear Downloads button to the Library view.
r=Mano
This commit is contained in:
parent
0b5617fbb7
commit
9416d1053b
@ -4,6 +4,11 @@
|
||||
|
||||
<?xul-overlay href="chrome://browser/content/downloads/allDownloadsViewOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % downloadsDTD SYSTEM "chrome://browser/locale/downloads/downloads.dtd">
|
||||
%downloadsDTD;
|
||||
]>
|
||||
|
||||
<overlay id="downloadsViewOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
@ -15,7 +20,8 @@
|
||||
|
||||
ContentArea.setContentViewForQueryString(DOWNLOADS_QUERY,
|
||||
function() new DownloadsPlacesView(document.getElementById("downloadsRichListBox")),
|
||||
{ showDetailsPane: false });
|
||||
{ showDetailsPane: false,
|
||||
toolbarSet: "back-button, forward-button, organizeButton, clearDownloadsButton, libraryToolbarSpacer, searchFilter" });
|
||||
]]></script>
|
||||
|
||||
<window id="places">
|
||||
@ -26,4 +32,13 @@
|
||||
<deck id="placesViewsDeck">
|
||||
<richlistbox id="downloadsRichListBox"/>
|
||||
</deck>
|
||||
|
||||
<toolbar id="placesToolbar">
|
||||
<toolbarbutton id="clearDownloadsButton"
|
||||
insertbefore="libraryToolbarSpacer"
|
||||
label="&clearDownloadsButton.label;"
|
||||
command="downloadsCmd_clearDownloads"
|
||||
tooltiptext="&clearDownloadsButton.tooltip;"/>
|
||||
</toolbar>
|
||||
|
||||
</overlay>
|
||||
|
@ -1252,6 +1252,7 @@ let ContentArea = {
|
||||
|
||||
init: function CA_init() {
|
||||
this._deck = document.getElementById("placesViewsDeck");
|
||||
this._toolbar = document.getElementById("placesToolbar");
|
||||
ContentTree.init();
|
||||
},
|
||||
|
||||
@ -1315,9 +1316,25 @@ let ContentArea = {
|
||||
set currentPlace(aQueryString) {
|
||||
this.currentView = this.getContentViewForQueryString(aQueryString);
|
||||
this.currentView.place = aQueryString;
|
||||
this._updateToolbarSet();
|
||||
return aQueryString;
|
||||
},
|
||||
|
||||
_updateToolbarSet: function CA__updateToolbarSet() {
|
||||
let toolbarSet = this.currentViewOptions.toolbarSet;
|
||||
for (let elt of this._toolbar.childNodes) {
|
||||
// On Windows and Linux the menu buttons are menus wrapped in a menubar.
|
||||
if (elt.id == "placesMenu") {
|
||||
for (let menuElt of elt.childNodes) {
|
||||
menuElt.hidden = toolbarSet.indexOf(menuElt.id) == -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
elt.hidden = toolbarSet.indexOf(elt.id) == -1;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Options for the current view.
|
||||
*
|
||||
@ -1347,7 +1364,10 @@ let ContentTree = {
|
||||
|
||||
get view() this._view,
|
||||
|
||||
get viewOptions() Object.seal({ showDetailsPane: true }),
|
||||
get viewOptions() Object.seal({
|
||||
showDetailsPane: true,
|
||||
toolbarSet: "back-button, forward-button, organizeButton, viewMenu, maintenanceButton, libraryToolbarSpacer, searchFilter"
|
||||
}),
|
||||
|
||||
openSelectedNode: function CT_openSelectedNode(aEvent) {
|
||||
let view = this.view;
|
||||
|
@ -326,7 +326,7 @@
|
||||
</menubar>
|
||||
#endif
|
||||
|
||||
<spacer flex="1"/>
|
||||
<spacer id="libraryToolbarSpacer" flex="1"/>
|
||||
|
||||
<textbox id="searchFilter"
|
||||
clickSelectsAll="true"
|
||||
|
@ -74,3 +74,6 @@
|
||||
-->
|
||||
<!ENTITY downloadsHistory.label "Show All Downloads">
|
||||
<!ENTITY downloadsHistory.accesskey "S">
|
||||
|
||||
<!ENTITY clearDownloadsButton.label "Clear Downloads">
|
||||
<!ENTITY clearDownloadsButton.tooltip "Clears completed, canceled and failed downloads">
|
||||
|
Loading…
Reference in New Issue
Block a user