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 closeWhenDone.tooltip "Closes the Downloads window when all files are done downloading">
<!ENTITY showFolder.label "Show this Folder"> <!ENTITY showFolder.label "Show this Folder">
<!ENTITY activeDownloads.label "Active">
<!ENTITY completedDownloads.label "Completed">
<!ENTITY searchResults.label "Search Results">
<!ENTITY searchBox.label "Search..."> <!ENTITY searchBox.label "Search...">

View File

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

View File

@ -178,16 +178,8 @@
<richlistbox id="downloadView" flex="1" context="downloadContextMenu" <richlistbox id="downloadView" flex="1" context="downloadContextMenu"
ondragover="nsDragAndDrop.dragOver(event, gDownloadDNDObserver);" ondragover="nsDragAndDrop.dragOver(event, gDownloadDNDObserver);"
ondragdrop="nsDragAndDrop.drop(event, gDownloadDNDObserver);"> ondragdrop="nsDragAndDrop.drop(event, gDownloadDNDObserver);">
<hbox id="active-downloads-title" align="center" hidden="true"> <hbox id="active-downloads-area" hidden="true"/>
<label id="active-downloads" value="&activeDownloads.label;"/> <hbox id="done-downloads-area" hidden="true"/>
<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>
</richlistbox> </richlistbox>
<hbox id="search"> <hbox id="search">

View File

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

View File

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