- Fixed several issues with Web UI

This commit is contained in:
Christophe Dumez 2009-11-23 13:35:46 +00:00
parent 74f0737903
commit 34ba69e319
6 changed files with 17 additions and 11 deletions

View file

@ -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());

View file

@ -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());

View file

@ -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

View file

@ -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 ({
//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 ({
tr.injectInside(this.table);
this.altRow();
// Apply filter
//this.applyFilterOnRow(tr, status);
},
selectAll: function() {

View file

@ -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(){
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(){
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,

View file

@ -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) {
}
document.uploadForm.submit();
window.parent.showSuccess();
//MochaUI.closeAll();
}
</script>
</head>