diff --git a/src/Icons/skin/knob.gif b/src/Icons/skin/knob.gif
new file mode 100644
index 000000000..755e06e0d
Binary files /dev/null and b/src/Icons/skin/knob.gif differ
diff --git a/src/Icons/skin/slider-area.gif b/src/Icons/skin/slider-area.gif
new file mode 100644
index 000000000..f22edcdfd
Binary files /dev/null and b/src/Icons/skin/slider-area.gif differ
diff --git a/src/httpconnection.cpp b/src/httpconnection.cpp
index 8d54f5216..92f50aea2 100644
--- a/src/httpconnection.cpp
+++ b/src/httpconnection.cpp
@@ -107,7 +107,7 @@ QString HttpConnection::translateDocument(QString data) {
bool found = false;
do {
found = false;
- QRegExp regex("_\\(([\\w\\s?!:\\.]+)\\)");
+ QRegExp regex("_\\(([\\w\\s?!:\\/\\.]+)\\)");
i = regex.indexIn(data, i);
if(i >= 0) {
//qDebug("Found translatable string: %s", regex.cap(1).toUtf8().data());
@@ -319,6 +319,44 @@ void HttpConnection::respondCommand(QString command)
h.file_priority(file_id, priority);
}
}
+ if(command == "getTorrentUpLimit") {
+ QString hash = parser.post("hash");
+ QTorrentHandle h = BTSession->getTorrentHandle(hash);
+ if(h.is_valid()) {
+ generator.setStatusLine(200, "OK");
+ generator.setContentTypeByExt("html");
+ generator.setMessage(QString::number(h.upload_limit()));
+ write();
+ }
+ }
+ if(command == "getTorrentDlLimit") {
+ QString hash = parser.post("hash");
+ QTorrentHandle h = BTSession->getTorrentHandle(hash);
+ if(h.is_valid()) {
+ generator.setStatusLine(200, "OK");
+ generator.setContentTypeByExt("html");
+ generator.setMessage(QString::number(h.download_limit()));
+ write();
+ }
+ }
+ if(command == "setTorrentUpLimit") {
+ QString hash = parser.post("hash");
+ qlonglong limit = parser.post("limit").toLongLong();
+ if(limit == 0) limit = -1;
+ QTorrentHandle h = BTSession->getTorrentHandle(hash);
+ if(h.is_valid()) {
+ h.set_upload_limit(limit);
+ }
+ }
+ if(command == "setTorrentDlLimit") {
+ QString hash = parser.post("hash");
+ qlonglong limit = parser.post("limit").toLongLong();
+ if(limit == 0) limit = -1;
+ QTorrentHandle h = BTSession->getTorrentHandle(hash);
+ if(h.is_valid()) {
+ h.set_download_limit(limit);
+ }
+ }
if(command == "pause") {
emit pauseTorrent(parser.post("hash"));
return;
diff --git a/src/icons.qrc b/src/icons.qrc
index 1cee22384..58adabf6a 100644
--- a/src/icons.qrc
+++ b/src/icons.qrc
@@ -22,6 +22,7 @@
Icons/skin/delete.png
Icons/skin/handle-icon-horizontal.gif
Icons/skin/handle-icon.gif
+ Icons/skin/knob.gif
Icons/skin/url.png
Icons/skin/stalledUP.png
Icons/skin/delete_perm22.png
@@ -40,6 +41,7 @@
Icons/skin/open.png
Icons/skin/play22.png
Icons/skin/qbittorrent16.png
+ Icons/skin/slider-area.gif
Icons/skin/downloading.png
Icons/skin/filterinactive.png
Icons/skin/pause22.png
diff --git a/src/webui.qrc b/src/webui.qrc
index 6af00ad25..640058592 100644
--- a/src/webui.qrc
+++ b/src/webui.qrc
@@ -11,6 +11,7 @@
webui/prop-trackers.html
webui/prop-files.html
webui/properties.html
+ webui/uploadlimit.html
webui/css/mocha.css
webui/css/dynamicTable.css
webui/css/style.css
@@ -24,5 +25,6 @@
webui/scripts/download.js
webui/scripts/progressbar.js
webui/scripts/contextmenu.js
+ webui/scripts/parametrics.js
diff --git a/src/webui/css/mocha.css b/src/webui/css/mocha.css
index 7a2e999ac..ea94f38b6 100644
--- a/src/webui/css/mocha.css
+++ b/src/webui/css/mocha.css
@@ -845,7 +845,7 @@ div.mochaToolbarWrapper.bottom {
position: relative;
font-size: 12px;
font-weight: bold;
- width: 200px;
+ width: 400px;
margin-bottom: 15px;
}
@@ -854,7 +854,8 @@ div.mochaToolbarWrapper.bottom {
font-size: 1px;
line-height: 1px;
height: 9px;
- width: 222px;
+ width: 422px;
+ margin-left: 1px;
}
.sliderarea {
@@ -862,10 +863,10 @@ div.mochaToolbarWrapper.bottom {
top: 0;
left: 0;
height: 7px;
- width: 220px;
+ width: 420px;
font-size: 1px;
line-height: 1px;
- background: url(../images/slider-area.gif) repeat-x;
+ background: url(../images/skin/slider-area.gif) repeat-x;
border: 1px solid #a3a3a3;
border-bottom: 1px solid #ccc;
border-left: 1px solid #ccc;
@@ -882,7 +883,7 @@ div.mochaToolbarWrapper.bottom {
width: 19px;
font-size: 1px;
line-height: 1px;
- background: url(../images/knob.gif) no-repeat;
+ background: url(../images/skin/knob.gif) no-repeat;
cursor: pointer;
overflow: hidden;
z-index: 2;
diff --git a/src/webui/css/style.css b/src/webui/css/style.css
index ae798abb3..b2e583198 100644
--- a/src/webui/css/style.css
+++ b/src/webui/css/style.css
@@ -170,3 +170,5 @@ a.propButton img {
#contextmenu li a.recheck { background-image:url(../images/oxygen/gear.png); }
#contextmenu li a.delete { background-image:url(../images/skin/delete22.png); }
#contextmenu li a.deleteHD { background-image:url(../images/skin/delete_perm22.png); }
+#contextmenu li a.uploadLimit { background-image:url(../images/skin/seeding.png); }
+#contextmenu li a.downloadLimit { background-image:url(../images/skin/download.png); }
diff --git a/src/webui/index.html b/src/webui/index.html
index bd9e3e07a..dba5df031 100644
--- a/src/webui/index.html
+++ b/src/webui/index.html
@@ -80,6 +80,8 @@
_(Start)
_(Pause)
_(Force recheck)
+ _(Limit upload rate)
+ _(Limit download rate)
_(Delete)
_(Delete from HD)
diff --git a/src/webui/scripts/mocha-init.js b/src/webui/scripts/mocha-init.js
index 85f29a30b..7a29ceabb 100644
--- a/src/webui/scripts/mocha-init.js
+++ b/src/webui/scripts/mocha-init.js
@@ -54,7 +54,45 @@ initializeWindows = function(){
});
});
+ uploadLimitFN = function() {
+ var h = myTable.selectedIds();
+ if(h.length){
+ var hash = h[0];
+ new MochaUI.Window({
+ id: 'uploadLimitPage',
+ title: "_(Torrent Upload Speed Limiting)",
+ loadMethod: 'iframe',
+ contentURL:'uploadlimit.html?hash='+hash,
+ scrollbars: false,
+ resizable: false,
+ maximizable: false,
+ paddingVertical: 0,
+ paddingHorizontal: 0,
+ width: 424,
+ height: 80
+ });
+ }
+ };
+ downloadLimitFN = function() {
+ var h = myTable.selectedIds();
+ if(h.length){
+ var hash = h[0];
+ new MochaUI.Window({
+ id: 'downloadLimitPage',
+ title: "_(Torrent Download Speed Limiting)",
+ loadMethod: 'iframe',
+ contentURL:'downloadlimit.html?hash='+hash,
+ scrollbars: false,
+ resizable: false,
+ maximizable: false,
+ paddingVertical: 0,
+ paddingHorizontal: 0,
+ width: 424,
+ height: 80
+ });
+ }
+ };
deleteFN = function() {
var h = myTable.selectedIds();
diff --git a/src/webui/scripts/mocha.js b/src/webui/scripts/mocha.js
index 0fa4ff6d1..d6733341b 100644
--- a/src/webui/scripts/mocha.js
+++ b/src/webui/scripts/mocha.js
@@ -930,6 +930,8 @@ MochaUI.Windows.windowOptions = {
};
MochaUI.Window = new Class({
+ Implements: [Events, Options],
+
options: MochaUI.Windows.windowOptions,
initialize: function(options){
this.setOptions(options);
@@ -2420,7 +2422,6 @@ MochaUI.Window = new Class({
}
}
});
-MochaUI.Window.implement(new Options, new Events);
/*
Script: Modal.js
diff --git a/src/webui/scripts/mootools-1.2-core-yc.js b/src/webui/scripts/mootools-1.2-core-yc.js
index 752b98ce0..67da947a8 100644
--- a/src/webui/scripts/mootools-1.2-core-yc.js
+++ b/src/webui/scripts/mootools-1.2-core-yc.js
@@ -1,349 +1,349 @@
-//MooTools, , My Object Oriented (JavaScript) Tools. Copyright (c) 2006-2008 Valerio Proietti, , MIT Style License.
+//MooTools, , My Object Oriented (JavaScript) Tools. Copyright (c) 2006-2009 Valerio Proietti, , MIT Style License.
-var MooTools={version:"1.2.1",build:"0d4845aab3d9a4fdee2f0d4a6dd59210e4b697cf"};var Native=function(K){K=K||{};var A=K.name;var I=K.legacy;var B=K.protect;
-var C=K.implement;var H=K.generics;var F=K.initialize;var G=K.afterImplement||function(){};var D=F||I;H=H!==false;D.constructor=Native;D.$family={name:"native"};
-if(I&&F){D.prototype=I.prototype;}D.prototype.constructor=D;if(A){var E=A.toLowerCase();D.prototype.$family={name:E};Native.typize(D,E);}var J=function(N,L,O,M){if(!B||M||!N.prototype[L]){N.prototype[L]=O;
-}if(H){Native.genericize(N,L,B);}G.call(N,L,O);return N;};D.alias=function(N,L,O){if(typeof N=="string"){if((N=this.prototype[N])){return J(this,L,N,O);
-}}for(var M in N){this.alias(M,N[M],L);}return this;};D.implement=function(M,L,O){if(typeof M=="string"){return J(this,M,L,O);}for(var N in M){J(this,N,M[N],L);
-}return this;};if(C){D.implement(C);}return D;};Native.genericize=function(B,C,A){if((!A||!B[C])&&typeof B.prototype[C]=="function"){B[C]=function(){var D=Array.prototype.slice.call(arguments);
-return B.prototype[C].apply(D.shift(),D);};}};Native.implement=function(D,C){for(var B=0,A=D.length;B-1:this.indexOf(A)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim();
-},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(A){return("-"+A.charAt(0).toLowerCase());
-});},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");
-},toInt:function(A){return parseInt(this,A||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(B){var A=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);
-return(A)?A.slice(1).hexToRgb(B):null;},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):null;},stripScripts:function(B){var A="";
-var C=this.replace(/
+
+
+
+
+
+
+
+
_(Upload limit:) 0 _(KiB/s)
+
+
+
+
+
+
+
+
+
+
+