Add auto torrent management to webui context menu (addresses #6815)

This commit is contained in:
Thomas Piccirello
2017-07-05 01:47:23 -04:00
committed by sledgehammer999
parent dfded7bc9d
commit 1002b28c95
7 changed files with 59 additions and 0 deletions

View File

@@ -110,6 +110,7 @@ static const char KEY_TORRENT_RATIO_LIMIT[] = "ratio_limit";
static const char KEY_TORRENT_LAST_SEEN_COMPLETE_TIME[] = "seen_complete";
static const char KEY_TORRENT_LAST_ACTIVITY_TIME[] = "last_activity";
static const char KEY_TORRENT_TOTAL_SIZE[] = "total_size";
static const char KEY_TORRENT_AUTO_TORRENT_MANAGEMENT[] = "auto_tmm";
// Peer keys
static const char KEY_PEER_IP[] = "ip";
@@ -824,6 +825,7 @@ QVariantMap toMap(BitTorrent::TorrentHandle *const torrent)
ret[KEY_TORRENT_AMOUNT_COMPLETED] = torrent->completedSize();
ret[KEY_TORRENT_RATIO_LIMIT] = torrent->maxRatio();
ret[KEY_TORRENT_LAST_SEEN_COMPLETE_TIME] = torrent->lastSeenComplete().toTime_t();
ret[KEY_TORRENT_AUTO_TORRENT_MANAGEMENT] = torrent->isAutoTMMEnabled();
if (torrent->isPaused() || torrent->isChecking())
ret[KEY_TORRENT_LAST_ACTIVITY_TIME] = 0;