mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 04:24:23 +00:00
- some more Web Ui fixes
This commit is contained in:
parent
d219e7afeb
commit
a65cd5c39c
@ -73,6 +73,12 @@ void EventManager::addedTorrent(QTorrentHandle& h)
|
||||
event["hash"] = QVariant(hash);
|
||||
event["name"] = QVariant(h.name());
|
||||
event["seed"] = QVariant(h.is_seed());
|
||||
event["size"] = QVariant((qlonglong)h.actual_size());
|
||||
if(!h.is_seed()) {
|
||||
event["progress"] = QVariant(h.progress());
|
||||
event["dlspeed"] = QVariant(h.download_payload_rate());
|
||||
}
|
||||
event["upspeed"] = QVariant(h.upload_payload_rate());
|
||||
if(h.is_paused()) {
|
||||
if(BTSession->isQueueingEnabled() && (BTSession->isDownloadQueued(hash) || BTSession->isUploadQueued(hash)))
|
||||
event["state"] = QVariant("queued");
|
||||
@ -267,6 +273,9 @@ void EventManager::modifiedTorrent(QTorrentHandle h)
|
||||
if(modify(hash, "state", v))
|
||||
event["state"] = v;
|
||||
|
||||
v = QVariant(h.name());
|
||||
if(modify(hash, "name", v))
|
||||
event["name"] = v;
|
||||
v = QVariant((qlonglong)h.actual_size());
|
||||
if(modify(hash, "size", v))
|
||||
event["size"] = v;
|
||||
@ -280,14 +289,8 @@ void EventManager::modifiedTorrent(QTorrentHandle h)
|
||||
event["dlspeed"] = v;
|
||||
}
|
||||
v = QVariant(h.upload_payload_rate());
|
||||
if(modify(hash, "upspeed", v)) {
|
||||
if(modify(hash, "upspeed", v))
|
||||
event["upspeed"] = v;
|
||||
if(h.is_seed())
|
||||
qDebug("upspeed changed for seed");
|
||||
} else {
|
||||
if(h.is_seed())
|
||||
qDebug("upspeed did not change for seed");
|
||||
}
|
||||
v = QVariant(h.is_seed());
|
||||
event["seed"] = v;
|
||||
|
||||
|
@ -88,6 +88,20 @@ window.addEvent('domready', function(){
|
||||
break;
|
||||
}
|
||||
row[1] = event.name;
|
||||
row[2] = fsize(event.size);
|
||||
if(!event.seed) {
|
||||
if($defined(event.progress))
|
||||
{
|
||||
row[3] = round1(event.progress*100) + ' %';
|
||||
}
|
||||
if($defined(event.dlspeed))
|
||||
row[4] = fspeed(event.dlspeed);
|
||||
if($defined(event.upspeed))
|
||||
row[5] = fspeed(event.upspeed);
|
||||
} else {
|
||||
if($defined(event.upspeed))
|
||||
row[3] = fspeed(event.upspeed);
|
||||
}
|
||||
if(event.seed)
|
||||
myTableUP.insertRow(event.hash, row);
|
||||
else
|
||||
@ -122,6 +136,9 @@ window.addEvent('domready', function(){
|
||||
break;
|
||||
}
|
||||
}
|
||||
if($defined(event.name)) {
|
||||
row[1] = event.name;
|
||||
}
|
||||
if($defined(event.size)){
|
||||
row[2] = fsize(event.size);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user