Changeset 394 for branches/maierman/manager-trees
- Timestamp:
- 2007-06-07 23:50:35 (2 years ago)
- Files:
-
- branches/maierman/manager-trees/chrome/content/common/bindings.xml (modified) (1 diff)
- branches/maierman/manager-trees/chrome/content/common/internalFunctions.js (modified) (4 diffs)
- branches/maierman/manager-trees/chrome/content/dta/manager.js (modified) (29 diffs)
- branches/maierman/manager-trees/chrome/content/dta/manager/decompressor.js (modified) (2 diffs)
- branches/maierman/manager-trees/chrome/content/dta/manager/info.js (modified) (7 diffs)
- branches/maierman/manager-trees/chrome/content/dta/manager/metalinker.js (modified) (1 diff)
- branches/maierman/manager-trees/chrome/content/dta/manager/sessionmanager.js (modified) (2 diffs)
- branches/maierman/manager-trees/chrome/content/dta/manager/verificator.js (modified) (1 diff)
- branches/maierman/manager-trees/chrome/content/integration/saveas.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/maierman/manager-trees/chrome/content/common/bindings.xml
r393 r394 80 80 <content> 81 81 <xul:vbox flex="1"> 82 <xul:menulist anonid="list" editable="true" xbl:inherits="readonly,disabled =readonly,flex,tooltiptext,oninput=onchange,onselect=onchange">82 <xul:menulist anonid="list" editable="true" xbl:inherits="readonly,disabled,flex,tooltiptext,oninput=onchange,onselect=onchange"> 83 83 <xul:menupopup anonid="popup" xbl:inherits="onselect=onchange,oncommand=onchange"/> 84 84 </xul:menulist> branches/maierman/manager-trees/chrome/content/common/internalFunctions.js
r393 r394 295 295 } 296 296 var rv = Date.parse(str); 297 if ( isNaN(rv)) {297 if (!isFinite(rv)) { 298 298 throw new Error("invalid date"); 299 299 } … … 330 330 * @author Nils 331 331 */ 332 makeNumber: function U_makeNumber(rv, digits) {332 formatNumber: function U_formatNumber(rv, digits) { 333 333 rv = _atos(rv); 334 334 if (typeof(digits) != 'number') { … … 348 348 var s = Math.floor(aDelta % 60); 349 349 if (h) { 350 return this. makeNumber(h, 2) + ":" + this.makeNumber(m, 2) + ":" + this.makeNumber(s, 2);351 } 352 return this. makeNumber(m, 2) + ":" + this.makeNumber(s, 2);350 return this.formatNumber(h, 2) + ":" + this.formatNumber(m, 2) + ":" + this.formatNumber(s, 2); 351 } 352 return this.formatNumber(m, 2) + ":" + this.formatNumber(s, 2); 353 353 } 354 354 }; … … 598 598 step = stop - start > 0 ? 1 : -1; 599 599 } 600 if ( isNaN(start) || isNaN(stop) || isNaN(step) || step == 0) {600 if (!isFinite(start) || !isFinite(stop) || !isFinite(step) || step == 0) { 601 601 throw Components.results.NS_ERROR_INVALID_ARG; 602 602 } branches/maierman/manager-trees/chrome/content/dta/manager.js
r393 r394 53 53 const REFRESH_FREQ = 1000; 54 54 const REFRESH_NFREQ = 1000 / REFRESH_FREQ; 55 const STREAMS_FREQ = 100; 55 56 56 57 var Dialog = { … … 87 88 if (d.totalSize > 0) { 88 89 var remaining = Math.ceil((d.totalSize - d.partialSize) / ((d.partialSize - i.lastBytes) * REFRESH_NFREQ)); 89 if ( isNaN(remaining)) {90 if (!isFinite(remaining)) { 90 91 d.status = _("unknown"); 91 92 } … … 376 377 return this._urls[0].charset; 377 378 }, 378 replace: function um_replace(url, newUrl) {379 for (var i = 0, e = this._urls.length; i < e; ++i) {380 if (this._urls[i].url == url) {381 this._urls[i] = newUrl;382 break;383 }384 }385 },386 379 markBad: function um_markBad(url) { 387 380 if (this._urls.length > 1) { … … 433 426 encoding: null, 434 427 fileName: null, 435 acceptRanges: false,428 acceptRanges: 'bytes', 436 429 contentlength: 0, 437 430 time: null, … … 510 503 if (value) { 511 504 this.fileName = value[2].getUsableFileName(); 512 Debug.dump("found fn:" + this.fileName);513 505 } 514 506 } … … 732 724 set destinationName(nv) { 733 725 this.destinationNameOverride = nv; 726 this._destinationFile = this.destinationPath + this.destinationName; 734 727 this.invalidate(); 735 728 return nv; … … 914 907 }, 915 908 916 removeFromInProgressList: function QI_removeFromInProgressList() {917 //this.speeds = new Array();918 for (var i=0; i<inProgressList.length; i++)919 if (this==inProgressList[i].d) {920 inProgressList.splice(i, 1);921 break;922 }923 },924 925 909 refreshPartialSize: function QI_refreshPartialSize(){ 926 910 var size = 0; … … 946 930 947 931 try { 932 if (!this.checkNameConflict()) { 933 return; 934 } 948 935 var destination = new FileFactory(this.destinationPath); 949 936 Debug.dump(this.fileName + ": Move " + this.tmpFile.path + " to " + this.destinationFile); … … 952 939 destination.create(Ci.nsIFile.DIRECTORY_TYPE, 0766); 953 940 } 954 this.checkFilenameConflict();955 941 var df = destination.clone(); 956 942 df.append(this.destinationName); … … 1111 1097 1112 1098 var replacements = { 1113 "\\*name\\*": name, 1114 "\\*ext\\*": ext, 1115 "\\*text\\*": this.description, 1116 "\\*url\\*": uri.host, 1117 "\\*subdirs\\*": uripath, 1118 "\\*refer\\*": this.refPage.host, 1119 "\\*qstring\\*": query, 1120 "\\*curl\\*": (uri.host + ((uripath=="")?"":(SYSTEMSLASH + uripath))), 1121 "\\*num\\*": Utils.makeNumber(this.numIstance), 1122 "\\*hh\\*": Utils.makeNumber(this.startDate.getHours(), 2), 1123 "\\*mm\\*": Utils.makeNumber(this.startDate.getMinutes(), 2), 1124 "\\*ss\\*": Utils.makeNumber(this.startDate.getSeconds(), 2), 1125 "\\*d\\*": Utils.makeNumber(this.startDate.getDate(), 2), 1126 "\\*m\\*": Utils.makeNumber(this.startDate.getMonth(), 2), 1127 "\\*y\\*": String(this.startDate.getFullYear()) 1128 } 1129 1130 for (i in replacements) { 1131 mask = mask.replace(new RegExp(i, "gi"), replacements[i]); 1132 } 1099 "name": name, 1100 "ext": ext, 1101 "text": this.description, 1102 "url": uri.host, 1103 "subdirs": uripath, 1104 "refer": this.refPage.host, 1105 "qstring": query, 1106 "curl": (uri.host + ((uripath=="")?"":(SYSTEMSLASH + uripath))), 1107 "num": Utils.formatNumber(this.numIstance), 1108 "hh": Utils.formatNumber(this.startDate.getHours(), 2), 1109 "mm": Utils.formatNumber(this.startDate.getMinutes(), 2), 1110 "ss": Utils.formatNumber(this.startDate.getSeconds(), 2), 1111 "d": Utils.formatNumber(this.startDate.getDate(), 2), 1112 "m": Utils.formatNumber(this.startDate.getMonth(), 2), 1113 "y": String(this.startDate.getFullYear()) 1114 } 1115 function replacer(type) { 1116 var t = type.slice(1, u.length - 2).toLowerCase(); 1117 if (t in replacements) { 1118 return replacements[t]; 1119 } 1120 return type; 1121 } 1122 1123 mask = mask.replace(/\*\w+\*/gi, replacer); 1133 1124 1134 1125 this._destinationFile = mask = this.pathName.addFinalSlash() + mask.removeBadChars().removeFinalChar(".").trim(); … … 1143 1134 } 1144 1135 this._icon = null; 1145 }, 1146 1147 checkFilenameConflict: function QI_checkFileNameConflict() { 1148 return 0; 1149 var dn = this.destinationName, ds = this.destinationPath; 1150 var dest = new FileFactory(ds + dn), newDest = dest.clone(); 1151 1152 // figure out an unique name 1153 var basename = dn, ext = '', pos = basename.lastIndexOf('.'); 1136 this.checkNameConflict(); 1137 }, 1138 1139 checkNameConflict: function QI_checkFileNameConflict() { 1140 1141 function askForRenaming(t, s1, s2, s3) { 1142 if (Prefs.onConflictingFilenames == 3) { 1143 if (Prefs.askEveryTime) { 1144 var passingArguments = new Object(); 1145 passingArguments.text = t; 1146 passingArguments.s1 = s1; 1147 passingArguments.s2 = s2; 1148 passingArguments.s3 = s3; 1149 1150 window.openDialog( 1151 "chrome://dta/content/dta/dialog.xul","_blank","chrome,centerscreen,resizable=no,dialog,modal,close=no,dependent", 1152 passingArguments 1153 ); 1154 1155 // non faccio registrare il timeout 1156 inProgressList.forEach(function(o) { o.d.timeLastProgress = Utils.getTimestamp(); }); 1157 1158 Prefs.askEveryTime = (passingArguments.temp == 0) ? true : false; 1159 Prefs.sessionPreference = passingArguments.scelta; 1160 } 1161 return Prefs.sessionPreference; 1162 } 1163 return Prefs.onConflictingFilenames; 1164 } 1165 1166 let dn = this.destinationName, ds = this.destinationPath, df = this.destinationFile; 1167 let dest = new FileFactory(df), newDest = dest.clone(); 1168 1169 if (!this.is(RUNNING, FINISHING) || !dest.exists()) { 1170 return true; 1171 } 1172 1173 let basename = dn, ext = '', pos = basename.lastIndexOf('.'); 1154 1174 if (pos != -1) { 1155 1175 ext = basename.slice(pos); 1156 1176 basename = basename.slice(0, pos); 1157 1177 } 1158 for ( var i = 1; isInProgress(newDest.path, this) != -1 || newDest.exists(); ++i) {1159 newDest.leafName = basename + "_" + Utils. makeNumber(i) + ext;1160 }1161 if (newDest.path == dest.path) {1162 return;1178 for (let i = 1;; ++i) { 1179 newDest.leafName = basename + "_" + Utils.formatNumber(i) + ext; 1180 if (!newDest.exists()) { 1181 break; 1182 } 1163 1183 } 1164 1184 newDest = newDest.leafName; … … 1171 1191 1172 1192 var s = -1, p; 1173 if (dest.exists()) { 1174 s = askForRenaming( 1175 _('alreadyexists', [dn, ds]) + " " + _('whatdoyouwith', [shortUrl]), 1176 mc(_('reninto', [newDest]), 0), 1177 mc(_('overwrite'), 1), 1178 mc(_('skip'), 2) 1179 ); 1180 } 1181 else if (this.is(FINISHING)) { 1182 s = askForRenaming( 1183 _("alreadyexists", [dn, ds]) + " " + _("whatdoyoucomplete", [shortUrl]), 1184 mc(_('reninto', [newDest]), 0), 1185 mc(_('overwrite'), 1), 1186 mc(_('cancel'), 4) 1187 ); 1188 } 1189 else if (-1 != (p = isInProgress(dest.path, this))) { 1190 s = askForRenaming( 1191 _("samedestination", [shortUrl, dn, inProgressList[p].d.urlManager.url]) + " " + _("whatdoyou"), 1192 mc(_('reninto', [newDest]), 0), 1193 mc(_('skipfirst'), 2), 1194 mc(_('cancelsecond'), 3) 1195 ); 1196 } 1197 if (s < 0) { 1198 return; 1199 } 1200 1201 if (s == 0) { 1202 this.destinationName = newDest; 1203 } 1204 else if (s == 1) { 1205 dest.remove(false); 1206 } 1207 else if (s == 2) { 1208 this.cancel(_('skipped')); 1209 } 1210 else if (s == 3) { 1211 inProgressList[p].d.cancel(); 1212 } 1213 else { 1214 this.cancel(); 1193 s = askForRenaming( 1194 _('alreadyexists', [dn, ds]) + " " + _('whatdoyouwith', [shortUrl]), 1195 mc(_('reninto', [newDest]), 0), 1196 mc(_('overwrite'), 1), 1197 mc(_('skip'), 2) 1198 ); 1199 1200 switch (s) { 1201 case 0: this.destinationName = newDest; return true; 1202 case 1: return true; 1203 case 3: inProgressList[p].d.cancel(); return true; 1204 default: this.cancel(_('skipped')); return false; 1215 1205 } 1216 1206 }, … … 1304 1294 chunk.isRunning = true; 1305 1295 download.state = RUNNING; 1296 download.checkNameConflict(); 1306 1297 chunk.download = new Download(download, chunk, header); 1307 1298 ++download.activeChunks; … … 1415 1406 Chunk.prototype = { 1416 1407 isRunning: false, 1408 get isStarter() { 1409 return this.end <= 0; 1410 }, 1417 1411 get start() { 1418 1412 return this._start; … … 1435 1429 }, 1436 1430 get complete() { 1437 return this._total == this._written || this._end == -1; 1431 if (this._end == -1) { 1432 return this.written != 0; 1433 } 1434 return this._total == this.written; 1438 1435 }, 1439 1436 get parent() { … … 1518 1515 toString: function() { 1519 1516 let len = this.parent.totalSize ? String(this.parent.totalSize).length : 10; 1520 return Utils. makeNumber(this.start, len)1517 return Utils.formatNumber(this.start, len) 1521 1518 + "/" 1522 + Utils. makeNumber(this.end, len)1519 + Utils.formatNumber(this.end, len) 1523 1520 + "/" 1524 + Utils. makeNumber(this.total, len)1521 + Utils.formatNumber(this.total, len) 1525 1522 + " running:" 1526 1523 + this.isRunning 1527 1524 + " written/remain:" 1528 + Utils. makeNumber(this.written, len)1525 + Utils.formatNumber(this.written, len) 1529 1526 + "/" 1530 + Utils. makeNumber(this.remainder, len);1527 + Utils.formatNumber(this.remainder, len); 1531 1528 } 1532 1529 } 1533 1530 1534 function Download(d, c, headerHack) {1531 function Download(d, c, getInfo) { 1535 1532 1536 1533 this.d = d; 1537 1534 this.c = c; 1538 this.is HeaderHack = headerHack;1535 this.isInfoGetter = getInfo; 1539 1536 this.url = d.urlManager.getURL(); 1540 1537 var referrer = d.refPage; … … 1551 1548 // no-op 1552 1549 } 1553 if (referrer) { 1554 try { 1555 var http = this._chan.QueryInterface(Ci.nsIHttpChannel); 1556 //http.setRequestHeader('Accept-Encoding', 'none', false); 1557 if (c.start + c.written > 0) { 1558 http.setRequestHeader('Range', 'bytes=' + (c.start + c.written) + "-", false); 1559 } 1560 if (typeof(referrer) == 'string') { 1561 referrer = this._ios.newURI(referrer, null, null); 1562 } 1550 try { 1551 var http = this._chan.QueryInterface(Ci.nsIHttpChannel); 1552 if (c.start + c.written > 0) { 1553 http.setRequestHeader('Range', 'bytes=' + (c.start + c.written) + "-", false); 1554 } 1555 if (typeof(referrer) == 'string') { 1556 referrer = this._ios.newURI(referrer, null, null); 1557 } 1558 if (referrer instanceof Ci.nsIURI) { 1563 1559 http.referrer = referrer; 1564 1560 } 1565 catch (ex) { 1566 1567 } 1561 http.setRequestHeader('Keep-Alive', '', false); 1562 http.setRequestHeader('Connection', 'close', false); 1563 } 1564 catch (ex) { 1565 1568 1566 } 1569 1567 this.c.isRunning = true; … … 1679 1677 this._chan == newChannel; 1680 1678 this._redirectedTo = newChannel.URI.spec; 1681 1679 this.url.url = this._redirectedTo; 1680 this.d.filename = this.url.usable.getUsableFileName(); 1682 1681 } 1683 1682 catch (ex) { … … 1769 1768 var d = this.d; 1770 1769 1771 let code = 503, status = 'Server returned nothing';1770 let code = 0, status = 'Server returned nothing'; 1772 1771 try { 1773 1772 code = aChannel.responseStatus; … … 1778 1777 } 1779 1778 1780 if ( code >= 400) {1779 if (!code || code >= 400) { 1781 1780 if (!this.handleError()) { 1782 1781 Debug.dump("handleError: Cannot recover from problem!", code); 1783 1782 var file = d.fileName.length > 50 ? d.fileName.substring(0, 50) + "..." : d.fileName; 1783 code = Utils.formatNumber(code, 3); 1784 1784 d.fail( 1785 1785 _("error", [code]), … … 1795 1795 if (aChannel.responseStatus != 206 && c.start + c.written != 0) { 1796 1796 Debug.dump(d + ": Server returned a " + aChannel.responseStatus + " response instead of 206... Normal mode"); 1797 vis = {value: '', visitHeader: function(a,b) { this.value += a + ': ' + b + "\n"; }}; 1798 aChannel.visitRequestHeaders(vis); 1799 Debug.dump("Request Headers\n\n" + vis.value); 1800 vis.value = ''; 1801 aChannel.visitResponseHeaders(vis); 1802 Debug.dump("Response Headers\n\n" + vis.value); 1803 d.hasToBeRedownloaded = true; 1804 d.reDownload(); 1805 return; 1797 Debug.dump(c, this.url.url); 1798 1799 if (!this.handleError()) { 1800 vis = {value: '', visitHeader: function(a,b) { this.value += a + ': ' + b + "\n"; }}; 1801 aChannel.visitRequestHeaders(vis); 1802 Debug.dump("Request Headers\n\n" + vis.value); 1803 vis.value = ''; 1804 aChannel.visitResponseHeaders(vis); 1805 Debug.dump("Response Headers\n\n" + vis.value); 1806 d.hasToBeRedownloaded = true; 1807 d.reDownload(); 1808 return; 1809 } 1806 1810 } 1807 1811 … … 1811 1815 } 1812 1816 catch (ex) { 1813 Debug.dump("header failed! " + d .fileName, ex);1817 Debug.dump("header failed! " + d, ex); 1814 1818 // restart download from the beginning 1815 1819 d.hasToBeRedownloaded = true; … … 1818 1822 } 1819 1823 1820 // this.isHeaderHack = it's the chunk that has to test response headers 1821 if (!this.isHeaderHack) { 1824 if (!this.isInfoGetter) { 1822 1825 return; 1823 1826 } … … 1938 1941 } 1939 1942 1940 if (this.is HeaderHack) {1943 if (this.isInfoGetter) { 1941 1944 // Checks for available disk space. 1942 1945 … … 1990 1993 } 1991 1994 c.end = d.totalSize - 1; 1992 this.isHeaderHack = false; 1993 } 1994 1995 d.checkFilenameConflict(); 1996 1995 delete this.getInfo; 1996 } 1997 1997 1998 if (d.isResumable) { 1998 1999 d.resumeDownload(); … … 2018 2019 // check if we're complete now 2019 2020 let shouldFinish = false; 2020 if (d.is(RUNNING) && !d.chunks.some(function(e) { return e.isRunning; })) {2021 if (d.is(RUNNING) && d.chunks.every(function(e) { return e.complete; })) { 2021 2022 if (!d.resumeDownload()) { 2022 2023 d.dumpScoreboard(); … … 2039 2040 return; 2040 2041 } 2041 2042 // ok, chunk passed all the integrity checks!2043 2042 2044 2043 if (!d.is(RUNNING)) { 2045 2044 d.speed = ''; 2046 d.removeFromInProgressList(); 2047 } 2048 2045 for (let i = 0, e = inProgressList.length; i < e; ++i) { 2046 if (d == inProgressList[i].d) { 2047 inProgressList.splice(i, 1); 2048 break; 2049 } 2050 } 2051 } 2052 2049 2053 // rude way to determine disconnection: if connection is closed before download is started we assume a server error/disconnection 2050 if ( !this.started && d.isResumable && !d.is(CANCELED, PAUSED)) {2051 if (! this.handleError()) {2054 if (c.isStarter && !shouldFinish) { 2055 if (!d.urlManager.markBad(this.url)) { 2052 2056 Debug.dump(d + ": Server error or disconnection (type 1)"); 2053 2057 d.status = _("srver"); 2054 2058 d.speed = ''; 2055 2059 d.setPaused(); 2056 } 2057 return; 2060 return; 2061 } 2062 else { 2063 Debug.dump("caught bad server"); 2064 d.chunks = []; 2065 } 2058 2066 } 2059 2067 … … 2063 2071 d.finishDownload(); 2064 2072 } 2065 else if (d.is(RUNNING) && d.isResumable) { 2066 // if all the download space has already been occupied by chunks (= !resumeDownload) 2073 else { 2067 2074 d.resumeDownload(); 2068 2075 } … … 2175 2182 return -1; 2176 2183 } 2177 2178 function askForRenaming(t, s1, s2, s3) {2179 if (Prefs.onConflictingFilenames == 3) {2180 if (Prefs.askEveryTime) {2181 var passingArguments = new Object();2182 passingArguments.text = t;2183 passingArguments.s1 = s1;2184 passingArguments.s2 = s2;2185 passingArguments.s3 = s3;2186 2187 window.openDialog(2188 "chrome://dta/content/dta/dialog.xul","_blank","chrome,centerscreen,resizable=no,dialog,modal,close=no,dependent",2189 passingArguments2190 );2191 2192 // non faccio registrare il timeout2193 inProgressList.forEach(function(o) { o.d.timeLastProgress = Utils.getTimestamp(); });2194 2195 Prefs.askEveryTime = (passingArguments.temp == 0) ? true : false;2196 Prefs.sessionPreference = passingArguments.scelta;2197 }2198 return Prefs.sessionPreference;2199 }2200 return Prefs.onConflictingFilenames;2201 }branches/maierman/manager-trees/chrome/content/dta/manager/decompressor.js
r390 r394 117 117 this.download.invalidate(); 118 118 var thisp = this; 119 Dialog.setTimer(this._uuid, function() { thisp._invalidate(); }, 200);119 Dialog.setTimer(this._uuid, function() { thisp._invalidate(); }, STREAMS_FREQ); 120 120 }, 121 121 onStartRequest: function(r, c) { … … 159 159 } 160 160 this.download.partialSize = offset; 161 this.download.invalidate();162 161 } 163 162 catch (ex) { branches/maierman/manager-trees/chrome/content/dta/manager/info.js
r393 r394 15 15 16 16 var Dialog = { 17 get isFullyDisabled() { 18 return $('directory', 'renaming', 'hash').every( 19 function(e) { 20 return e.hasAttribute('disabled'); 21 } 22 ); 23 }, 17 24 load: function DTA_load() { 18 25 make_(); … … 41 48 $("infoURL").value = $("sourcePage").value = "---"; 42 49 $("hash").setAttribute('readonly', 'true'); 50 $("hash").setAttribute('disabled', 'true'); 43 51 44 52 var mask = downloads[0].mask; … … 63 71 } 64 72 if (downloads.every(function(d) { return d.is(COMPLETE, FINISHING); })) { 65 $('directory', 'renaming', 'mask').forEach(function(e) { e.setAttribute('readonly', 'true'); }); 66 $('browsedir').setAttribute('disabled', 'true'); 67 } 68 if ($('directory', 'renaming', 'hash').every(function(e) { return e.hasAttribute('readonly'); })) { 73 $('directory', 'renaming', 'mask', 'browsedir').forEach( 74 function(e) { 75 e.setAttribute('readonly', 'true'); 76 e.setAttribute('disabled', 'true'); 77 } 78 ); 79 } 80 if (this.isFullyDisabled) { 69 81 $('dTaDownloadInfo').buttons = 'accept'; 70 82 } … … 75 87 }, 76 88 accept: function DTA_accept() { 77 if ( $('directory', 'renaming', 'hash').every(function(e) { return e.hasAttribute('readonly'); })) {89 if (this.isFullyDisabled) { 78 90 return true; 79 91 } … … 137 149 compl.addColorStop(1, 'rgba(0,199,56,255)'); 138 150 139 var join = "#A5FE2C";140 141 151 var cancel = canvas.createLinearGradient(0,0,0,16); 142 152 cancel.addColorStop(0, 'rgba(151,58,2,100)'); … … 150 160 canvas.fillRect(0,0,300,20); 151 161 152 if (d.is(COMPLETE )) {162 if (d.is(COMPLETE, FINISHING)) { 153 163 canvas.fillStyle = compl; 154 164 canvas.fillRect(0,0,300,20); … … 167 177 function(c) { 168 178 this.canvas.fillStyle = prog; 169 this.canvas.fillRect(Math.round(c.start/d.totalSize*300),0,Math.round(c.size/d.totalSize*300),20); 179 this.canvas.fillRect( 180 Math.ceil(c.start / d.totalSize * 300), 181 0, 182 Math.ceil(c.written / d.totalSize * 300), 183 20 184 ); 170 185 }, 171 186 this 172 187 ); 173 canvas.fillStyle = join;174 canvas.fillRect(0,16,Math.round(d.chunks[d.firstChunk].chunkSize/d.totalSize*300),4);175 188 } 176 189 setTimeout('Dialog.draw();', 150); branches/maierman/manager-trees/chrome/content/dta/manager/metalinker.js
r384 r394 113 113 if (url.hasAttribute('preference')) { 114 114 var a = new Number(url.getAttribute('preference')); 115 if ( !isNaN(a)) {115 if (isFinite(a)) { 116 116 preference = a; 117 117 } branches/maierman/manager-trees/chrome/content/dta/manager/sessionmanager.js
r385 r394 84 84 ); 85 85 e.state = d.is(COMPLETE, CANCELED) ? d.state : PAUSED; 86 if (d.destinationNameOverride) { 87 e.destinationName = d.destinationNameOverride; 88 } 86 89 87 90 e.referrer = d.refPage.spec; … … 198 201 [ 199 202 'fileName', 203 'destinationName', 200 204 'isResumable', 201 205 'state', branches/maierman/manager-trees/chrome/content/dta/manager/verificator.js
r390 r394 89 89 this.download.invalidate(); 90 90 var thisp = this; 91 Dialog.setTimer(this._uuid, function() { thisp._invalidate(); }, 200);91 Dialog.setTimer(this._uuid, function() { thisp._invalidate(); }, STREAMS_FREQ); 92 92 }, 93 93 QueryInterface: function(iid) { branches/maierman/manager-trees/chrome/content/integration/saveas.js
r370 r394 50 50 this.referrer = this.url; 51 51 } 52 this.url = new DTA_URL(this.url); 52 53 53 54 this.ddDirectory = document.getElementById('tdtalist'); … … 93 94 // take care of FlashGot... for now. 94 95 // need to negotiate with the author (and possible other extension authors) 95 if (gFlashGotDMDialog) 96 { 9
