Browse Source

- Fixed several issues with Web UI

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
34ba69e319
  1. 7
      src/eventmanager.cpp
  2. 2
      src/httpconnection.cpp
  3. 5
      src/webui/scripts/client.js
  4. 6
      src/webui/scripts/dynamicTable.js
  5. 6
      src/webui/scripts/mocha-init.js
  6. 2
      src/webui/uploadframe.html

7
src/eventmanager.cpp

@ -109,9 +109,12 @@ void EventManager::modifiedTorrent(QTorrentHandle h) @@ -109,9 +109,12 @@ void EventManager::modifiedTorrent(QTorrentHandle h)
event["progress"] = QVariant(h.progress());
event["dlspeed"] = QVariant(tr("%1/s", "e.g. 120 KiB/s").arg(misc::friendlyUnit(h.download_payload_rate())));
if(BTSession->isQueueingEnabled()) {
event["priority"] = QVariant(h.queue_position());
if(h.queue_position() >= 0)
event["priority"] = QVariant(QString::number(h.queue_position()));
else
event["priority"] = "*";
} else {
event["priority"] = -1;
event["priority"] = "*";
}
event["upspeed"] = QVariant(tr("%1/s", "e.g. 120 KiB/s").arg(misc::friendlyUnit(h.upload_payload_rate())));
QString seeds = QString::number(h.num_seeds());

2
src/httpconnection.cpp

@ -107,7 +107,7 @@ QString HttpConnection::translateDocument(QString data) { @@ -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());

5
src/webui/scripts/client.js

@ -93,11 +93,12 @@ window.addEvent('domready', function(){ @@ -93,11 +93,12 @@ window.addEvent('domready', function(){
row[8] = event.upspeed;
row[9] = event.eta;
row[10] = event.ratio;
if(row[2] != -1)
if(row[2] != "*")
queueing_enabled = true;
if(!torrent_hashes.contains(event.hash)) {
// New unfinished torrent
//torrent_hashes[torrent_hashes.length] = event.hash;
torrent_hashes[torrent_hashes.length] = event.hash;
//alert("Inserting row");
myTable.insertRow(event.hash, row);
} else {
// Update torrent data

6
src/webui/scripts/dynamicTable.js

@ -78,7 +78,7 @@ var dynamicTable = new Class ({ @@ -78,7 +78,7 @@ var dynamicTable = new Class ({
var trs = this.table.getElements('tr');
trs.each(function(tr,i){
var tds = tr.getElements('td');
tds.getLast().removeClass('invisible');
tds[2].removeClass('invisible');
}.bind(this));
this.priority_hidden = false;
},
@ -126,8 +126,6 @@ var dynamicTable = new Class ({ @@ -126,8 +126,6 @@ var dynamicTable = new Class ({
//this.removeRow(id);
var tr = new Element('tr');
this.rows[id] = tr;
// Apply filter
this.applyFilterOnRow(tr, status);
for(var i=0; i<row.length; i++)
{
var td = new Element('td');
@ -209,6 +207,8 @@ var dynamicTable = new Class ({ @@ -209,6 +207,8 @@ var dynamicTable = new Class ({
tr.injectInside(this.table);
this.altRow();
// Apply filter
//this.applyFilterOnRow(tr, status);
},
selectAll: function() {

6
src/webui/scripts/mocha-init.js

@ -23,7 +23,7 @@ initializeWindows = function(){ @@ -23,7 +23,7 @@ initializeWindows = function(){
new Event(e).stop();
new MochaUI.Window({
id: 'downloadPage',
title: 'Download from URLs',
title: "(Download from URL)",
loadMethod: 'iframe',
contentURL:'download.html',
scrollbars: false,
@ -41,7 +41,7 @@ initializeWindows = function(){ @@ -41,7 +41,7 @@ initializeWindows = function(){
new Event(e).stop();
new MochaUI.Window({
id: 'uploadPage',
title: 'Upload torrent file',
title: "_(Download local torrent)",
loadMethod: 'iframe',
contentURL:'upload.html',
scrollbars: false,
@ -106,7 +106,7 @@ initializeWindows = function(){ @@ -106,7 +106,7 @@ initializeWindows = function(){
new Event(e).stop();
new MochaUI.Window({
id: 'bugPage',
title: 'Report a Bug',
title: '_(Report a bug)',
loadMethod: 'iframe',
contentURL: 'http://bugs.qbittorrent.org/',
width: 650,

2
src/webui/uploadframe.html

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
<link rel="stylesheet" href="css/style.css" type="text/css" />
<link rel="stylesheet" href="css/mocha.css" type="text/css" />
<script type="text/javascript" src="scripts/mootools-1.2-core-yc.js" charset="utf-8"></script>
<script type="text/javascript" src="scripts/mocha.js"></script>
<!-- <script type="text/javascript" src="scripts/upload.js" charset="utf-8"></script> -->
<script type="text/javascript">
function submitForm(form) {
@ -15,6 +16,7 @@ function submitForm(form) { @@ -15,6 +16,7 @@ function submitForm(form) {
}
document.uploadForm.submit();
window.parent.showSuccess();
//MochaUI.closeAll();
}
</script>
</head>

Loading…
Cancel
Save