Bug 399781 - Remove headings in Download Manager UI. r=sdwilsh, b-ff3=beltzner, a1.9=mconnor, aM9=mconnor

This commit is contained in:
edward.lee@engineering.uiuc.edu 2007-10-27 13:46:50 -07:00
parent f26d95fd12
commit b315d4af15
5 changed files with 11 additions and 47 deletions

View File

@ -48,9 +48,4 @@
<!ENTITY closeWhenDone.tooltip "Closes the Downloads window when all files are done downloading">
<!ENTITY showFolder.label "Show this Folder">
<!ENTITY activeDownloads.label "Active">
<!ENTITY completedDownloads.label "Completed">
<!ENTITY searchResults.label "Search Results">
<!ENTITY searchBox.label "Search...">

View File

@ -60,9 +60,8 @@ var gDownloadManager = Cc["@mozilla.org/download-manager;1"].
getService(Ci.nsIDownloadManager);
var gDownloadListener = null;
var gDownloadsView = null;
var gDownloadsActiveTitle = null;
var gDownloadsOtherLabel = null;
var gDownloadsOtherTitle = null;
var gDownloadsActiveArea = null;
var gDownloadsDoneArea = null;
var gDownloadInfoPopup = null;
var gUserInterfered = false;
var gSearching = false;
@ -163,7 +162,7 @@ function downloadCompleted(aDownload)
// If we are displaying search results, we do not want to add it to the list
// of completed downloads
if (!gSearching)
gDownloadsView.insertBefore(dl, gDownloadsOtherTitle.nextSibling);
gDownloadsView.insertBefore(dl, gDownloadsDoneArea.nextSibling);
else
removeFromView(dl);
@ -182,10 +181,8 @@ function downloadCompleted(aDownload)
listItem.setAttribute("image", oldImage + "&contentType=" + contentType);
} catch (e) { }
if (gDownloadManager.activeDownloadCount == 0) {
gDownloadsActiveTitle.hidden = true;
if (gDownloadManager.activeDownloadCount == 0)
document.title = document.documentElement.getAttribute("statictitle");
}
}
catch (e) { }
}
@ -440,9 +437,8 @@ function onUpdateProgress()
function Startup()
{
gDownloadsView = document.getElementById("downloadView");
gDownloadsActiveTitle = document.getElementById("active-downloads-title");
gDownloadsOtherLabel = document.getElementById("other-downloads");
gDownloadsOtherTitle = document.getElementById("other-downloads-title");
gDownloadsActiveArea = document.getElementById("active-downloads-area");
gDownloadsDoneArea = document.getElementById("done-downloads-area");
gDownloadInfoPopup = document.getElementById("information");
// convert strings to those in the string bundle
@ -936,9 +932,6 @@ function buildActiveDownloadsList()
if (gDownloadManager.activeDownloadCount == 0)
return;
// unhide the label
gDownloadsActiveTitle.hidden = false;
// repopulate the list
var db = gDownloadManager.DBConnection;
var stmt = gActiveDownloadsQuery;
@ -954,7 +947,7 @@ function buildActiveDownloadsList()
stmt.bindInt32Parameter(2, Ci.nsIDownloadManager.DOWNLOAD_PAUSED);
stmt.bindInt32Parameter(3, Ci.nsIDownloadManager.DOWNLOAD_QUEUED);
stmt.bindInt32Parameter(4, Ci.nsIDownloadManager.DOWNLOAD_SCANNING);
buildDownloadList(stmt, gDownloadsActiveTitle);
buildDownloadList(stmt, gDownloadsActiveArea);
} finally {
stmt.reset();
}
@ -984,7 +977,7 @@ function buildDownloadListWithTime(aTime)
stmt.bindInt32Parameter(2, Ci.nsIDownloadManager.DOWNLOAD_FAILED);
stmt.bindInt32Parameter(3, Ci.nsIDownloadManager.DOWNLOAD_CANCELED);
stmt.bindInt32Parameter(4, Ci.nsIDownloadManager.DOWNLOAD_BLOCKED);
buildDownloadList(stmt, gDownloadsOtherTitle);
buildDownloadList(stmt, gDownloadsDoneArea);
} finally {
stmt.reset();
}
@ -1003,13 +996,11 @@ function buildDownloadListWithTime(aTime)
function buildDownloadListWithSearch(aTerms)
{
gSearching = true;
gDownloadsOtherLabel.value = gDownloadsOtherLabel.getAttribute("searchlabel");
// remove and trailing or leading whitespace first
aTerms = aTerms.replace(/^\s+|\s+$/, "");
if (aTerms.length == 0) {
gSearching = false;
gDownloadsOtherLabel.value = gDownloadsOtherLabel.getAttribute("completedlabel");
buildDefaultView();
return;
}
@ -1023,7 +1014,7 @@ function buildDownloadListWithSearch(aTerms)
stmt.bindStringParameter(0, "%" + paramForLike + "%");
stmt.bindInt32Parameter(1, Ci.nsIDownloadManager.DOWNLOAD_DOWNLOADING);
stmt.bindInt32Parameter(2, Ci.nsIDownloadManager.DOWNLOAD_PAUSED);
buildDownloadList(stmt, gDownloadsOtherTitle);
buildDownloadList(stmt, gDownloadsDoneArea);
} finally {
stmt.reset();
}

View File

@ -178,16 +178,8 @@
<richlistbox id="downloadView" flex="1" context="downloadContextMenu"
ondragover="nsDragAndDrop.dragOver(event, gDownloadDNDObserver);"
ondragdrop="nsDragAndDrop.drop(event, gDownloadDNDObserver);">
<hbox id="active-downloads-title" align="center" hidden="true">
<label id="active-downloads" value="&activeDownloads.label;"/>
<hbox class="title-line" flex="1"/>
</hbox>
<hbox id="other-downloads-title" align="center">
<label id="other-downloads" value="&completedDownloads.label;"
completedlabel="&completedDownloads.label;"
searchlabel="&searchResults.label;"/>
<hbox class="title-line" flex="1"/>
</hbox>
<hbox id="active-downloads-area" hidden="true"/>
<hbox id="done-downloads-area" hidden="true"/>
</richlistbox>
<hbox id="search">

View File

@ -87,13 +87,6 @@ richlistitem[type="download"] button,
min-width: 32px;
}
.title-line {
height: 1px;
background-color: ThreeDDarkShadow;
-moz-margin-end: 15px;
-moz-margin-start: 5px;
}
#searchbox[empty] {
color: GrayText;
}

View File

@ -84,13 +84,6 @@ richlistitem[type="download"] .name {
min-width: 32px;
}
.title-line {
height: 1px;
background-color: ThreeDDarkShadow;
-moz-margin-end: 15px;
-moz-margin-start: 5px;
}
#searchbox[empty] {
color: GrayText;
}