Download manager. Not part of build. a=asa

git-svn-id: svn://10.0.0.236/trunk@115964 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
blakeross%telocity.com 2002-03-06 20:38:50 +00:00
parent 4dcda01e26
commit 7ae7bdcccc
11 changed files with 87 additions and 27 deletions

View File

@ -21,6 +21,6 @@
DEPTH=..\..\..
DIRS=public src resources\content resources\locale resources\locale\win
DIRS=public src resources\content resources\locale\en-US
include <$(DEPTH)\config\rules.mak>

View File

@ -77,6 +77,21 @@ function Startup()
// Select the first item in the view, if any.
if (gDownloadViewChildren.hasChildNodes())
gDownloadView.selectItem(gDownloadViewChildren.firstChild);
var key;
if (navigator.platform.indexOf("Win") != -1)
key = "Win";
else if (navigator.platform.indexOf("Mac") != -1)
key = "Mac";
else
key = "Unix";
var bundle = document.getElementById("dlMgrBundle")
var label = bundle.getString("showInShellLabel" + key);
var accesskey = bundle.getString("showInShellAccesskey" + key);
var btn = document.getElementById("btn_showinshell");
btn.setAttribute("label", label);
btn.setAttribute("accesskey", accesskey);
}
function openPropertiesDialog()
@ -88,7 +103,11 @@ function openPropertiesDialog()
function onSelect(aEvent) {
if (!gStatusBar)
gStatusBar = document.getElementById("statusbar-text");
gStatusBar.label = gDownloadView.selectedItems[0].id;
if (gDownloadView.selectedItems.length)
gStatusBar.label = gDownloadView.selectedItems[0].id;
else
gStatusBar.label = "";
window.updateCommands("tree-select");
}
@ -118,6 +137,9 @@ var downloadViewController = {
var isDownloading = gDownloadManager.getDownload(gDownloadView.selectedItems[0].id);
switch (aCommand) {
case "cmd_openfile":
if (getFileForItem(gDownloadView.selectedItems[0]).isExecutable())
return false;
case "cmd_showinshell":
if (selectionCount != 1)
return false;

View File

@ -6,7 +6,7 @@
<binding id="status-progress">
<content>
<xul:progressmeter class="tree-progressmeter" inherits="value" mode="normal"/>
<xul:progressmeter class="tree-progressmeter" inherits="value,mode"/>
</content>
</binding>

View File

@ -30,8 +30,6 @@
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<!DOCTYPE window [
<!ENTITY % platformDTD SYSTEM "chrome://communicator/locale/downloadmanager/platformStrings.ent" >
%platformDTD;
<!ENTITY % downloadManagerDTD SYSTEM "chrome://communicator/locale/downloadmanager/downloadmanager.ent">
%downloadManagerDTD;
<!ENTITY % downloadProgressDTD SYSTEM "chrome://global/locale/nsProgressDialog.dtd" >
@ -57,6 +55,9 @@
<script type="application/x-javascript" src="chrome://communicator/content/downloadmanager/downloadmanager.js"/>
<stringbundle id="dlMgrBundle"
src="chrome://communicator/locale/downloadmanager/downloadmanager.properties"/>
<data id="strings.confirmCancel">&confirmCancel;</data>
<data id="strings.progressMsgNoRate">&progressMsgNoRate;</data>
<data id="strings.rateMsg">&rateMsg;</data>
@ -75,22 +76,16 @@
<commandset id="downloadCommands">
<command id="cmd_properties"
label="&cmd.properties.label;" accesskey="&cmd.properties.accesskey;"
oncommand="goDoCommand('cmd_properties');"/>
<command id="cmd_pause"
label="&cmd.pause.label;" accesskey="&cmd.pause.accesskey;"
oncommand="goDoCommand('cmd_pause');"/>
<command id="cmd_cancel"
label="&cmd.cancel.label;" accesskey="&cmd.cancel.accesskey;"
oncommand="goDoCommand('cmd_cancel');"/>
<command id="cmd_remove"
label="&cmd.remove.label;" accesskey="&cmd.remove.accesskey;"
oncommand="goDoCommand('cmd_remove');"/>
<command id="cmd_openfile"
label="&cmd.openfile.label;" accesskey="&cmd.openfile.accesskey;"
oncommand="goDoCommand('cmd_openfile');"/>
<command id="cmd_showinshell"
label="&cmd.showinshell.label;" accesskey="&cmd.showinshell.accesskey;"
oncommand="goDoCommand('cmd_showinshell');"/>
</commandset>
@ -119,14 +114,19 @@
<toolbox>
<toolbar id="download-toolbar" class="chromeclass-toolbar" persist="collapsed">
<toolbarbutton command="cmd_properties"/>
<toolbarbutton command="cmd_pause"/>
<toolbarbutton label="&cmd.properties.label;" accesskey="&cmd.properties.accesskey;"
command="cmd_properties"/>
<toolbarbutton label="&cmd.pause.label;" accesskey="&cmd.pause.accesskey;"
command="cmd_pause"/>
<toolbarseparator class="toolbarseparator-standard"/>
<toolbarbutton command="cmd_cancel"/>
<toolbarbutton command="cmd_remove"/>
<toolbarbutton label="&cmd.cancel.label;" accesskey="&cmd.cancel.accesskey;"
command="cmd_cancel"/>
<toolbarbutton label="&cmd.remove.label;" accesskey="&cmd.remove.accesskey;"
command="cmd_remove"/>
<toolbarseparator class="toolbarseparator-standard"/>
<toolbarbutton command="cmd_openfile"/>
<toolbarbutton command="cmd_showinshell"/>
<toolbarbutton label="&cmd.openfile.label;" accesskey="&cmd.openfile.accesskey;"
command="cmd_openfile"/>
<toolbarbutton id="btn_showinshell" command="cmd_showinshell"/>
</toolbar>
</toolbox>
@ -195,7 +195,8 @@
<treecell>
<downloadstatus state="rdf:http://home.netscape.com/NC-rdf#DownloadState"
value="rdf:http://home.netscape.com/NC-rdf#ProgressPercent"
statustext="rdf:http://home.netscape.com/NC-rdf#StatusText"/>
statustext="rdf:http://home.netscape.com/NC-rdf#StatusText"
mode="normal"/>
</treecell>
<treecell label="rdf:http://home.netscape.com/NC-rdf#ProgressPercent"/>
<treecell label="rdf:http://home.netscape.com/NC-rdf#TimeRemaining"/>
@ -263,7 +264,7 @@
</tree>
<statusbar id="status-bar" class="chromeclass-status">
<statusbarpanel id="statusbar-text" flex="1"/>
<statusbarpanel id="statusbar-text" label="" flex="1"/>
</statusbar>
</window>

View File

@ -1,6 +0,0 @@
transferred=%1SKB of %2SKB
downloading=Downloading
notStarted=Not Started
failed=Failed
finished=Finished
canceled=Canceled

View File

@ -0,0 +1,28 @@
<!ENTITY view.header.name.label "Name">
<!ENTITY view.header.progress.label "Progress">
<!ENTITY view.header.status.label "Status">
<!ENTITY view.header.timeremaining.label "Time Remaining">
<!ENTITY view.header.transferred.label "Transferred">
<!ENTITY view.header.transferrate.label "Speed">
<!ENTITY view.header.timeelapsed.label "Time Elapsed">
<!ENTITY view.header.progresstext.label "&#37;">
<!ENTITY view.header.source.label "Source">
<!ENTITY downloadManager.title "Download Manager">
<!ENTITY cmd.properties.label "Properties">
<!ENTITY cmd.properties.accesskey "i">
<!ENTITY cmd.properties.keybinding "i">
<!ENTITY cmd.pause.label "Pause">
<!ENTITY cmd.pause.accesskey "p">
<!ENTITY cmd.remove.label "Remove from list">
<!ENTITY cmd.remove.accesskey "r">
<!ENTITY cmd.cancel.label "Cancel">
<!ENTITY cmd.cancel.accesskey "c">
<!ENTITY cmd.openfile.label "Open File">
<!ENTITY cmd.openfile.accesskey "o">
<!ENTITY confirmCancel "Are you sure you want to cancel the saving of this file?">
<!ENTITY progressMsgNoRate "#1KB of #2KB">
<!ENTITY rateMsg "#1KB/sec">

View File

@ -0,0 +1,15 @@
transferred=%1SKB of %2SKB
downloading=Downloading
notStarted=Not Started
failed=Failed
finished=Finished
canceled=Canceled
showInShellLabelWin=Show in Explorer
showInShellAccesskeyWin=E
showInShellLabelMac=Show in Finder
showInShellAccesskeyMac=F
showInShellLabelUnix=Show in Browser
showInShellAccesskeyUnix=B

View File

@ -19,6 +19,6 @@
#
# Contributor(s):
#
DEPTH = ..\..\..\..\..
DEPTH = ..\..\..\..\..\..
include <$(DEPTH)\config\rules.mak>

View File

@ -122,7 +122,7 @@ nsDownloadProgressListener.prototype = {
percent = -1;
// Progress meter should be barber-pole in this case.
progressCol.setAttribute( "mode", "undetermined" );
progressCol.firstChild.setAttribute( "mode", "undetermined" );
}
// now that we've set the progress and the time, update # bytes downloaded...