mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-28 21:38:51 +03:00
Send numeric status without translation
This commit is contained in:
parent
718f66e6a2
commit
7f349732ee
3 changed files with 25 additions and 17 deletions
|
@ -44,10 +44,10 @@ namespace BitTorrent
|
|||
public:
|
||||
enum Status
|
||||
{
|
||||
NotContacted,
|
||||
Working,
|
||||
Updating,
|
||||
NotWorking
|
||||
NotContacted = 1,
|
||||
Working = 2,
|
||||
Updating = 3,
|
||||
NotWorking = 4
|
||||
};
|
||||
|
||||
TrackerEntry(const QString &url);
|
||||
|
|
|
@ -386,22 +386,11 @@ void TorrentsController::trackersAction()
|
|||
QHash<QString, BitTorrent::TrackerInfo> trackersData = torrent->trackerInfos();
|
||||
for (const BitTorrent::TrackerEntry &tracker : asConst(torrent->trackers())) {
|
||||
const BitTorrent::TrackerInfo data = trackersData.value(tracker.url());
|
||||
QString status;
|
||||
switch (tracker.status()) {
|
||||
case BitTorrent::TrackerEntry::NotContacted:
|
||||
status = tr("Not contacted yet"); break;
|
||||
case BitTorrent::TrackerEntry::Updating:
|
||||
status = tr("Updating..."); break;
|
||||
case BitTorrent::TrackerEntry::Working:
|
||||
status = tr("Working"); break;
|
||||
case BitTorrent::TrackerEntry::NotWorking:
|
||||
status = tr("Not working"); break;
|
||||
}
|
||||
|
||||
trackerList << QVariantMap {
|
||||
{KEY_TRACKER_URL, tracker.url()},
|
||||
{KEY_TRACKER_TIER, tracker.tier()},
|
||||
{KEY_TRACKER_STATUS, status},
|
||||
{KEY_TRACKER_STATUS, static_cast<int>(tracker.status())},
|
||||
{KEY_TRACKER_PEERS_COUNT, data.numPeers},
|
||||
{KEY_TRACKER_MSG, data.lastMessage.trimmed()},
|
||||
{KEY_TRACKER_SEEDS_COUNT, tracker.nativeEntry().scrape_complete},
|
||||
|
|
|
@ -90,10 +90,29 @@ var loadTrackersData = function() {
|
|||
if (trackers) {
|
||||
// Update Trackers data
|
||||
trackers.each(function(tracker) {
|
||||
var status;
|
||||
switch (tracker.status) {
|
||||
case 0:
|
||||
status = "QBT_TR(Disabled)QBT_TR[CONTEXT=TrackerListWidget]";
|
||||
break;
|
||||
case 1:
|
||||
status = "QBT_TR(Not contacted yet)QBT_TR[CONTEXT=TrackerListWidget]";
|
||||
break;
|
||||
case 2:
|
||||
status = "QBT_TR(Working)QBT_TR[CONTEXT=TrackerListWidget]";
|
||||
break;
|
||||
case 3:
|
||||
status = "QBT_TR(Updating...)QBT_TR[CONTEXT=TrackerListWidget]";
|
||||
break;
|
||||
case 4:
|
||||
status = "QBT_TR(Not working)QBT_TR[CONTEXT=TrackerListWidget]";
|
||||
break;
|
||||
}
|
||||
|
||||
var row = [
|
||||
tracker.tier,
|
||||
escapeHtml(tracker.url),
|
||||
tracker.status,
|
||||
status,
|
||||
tracker.num_peers,
|
||||
(tracker.num_seeds >= 0) ? tracker.num_seeds : "QBT_TR(N/A)QBT_TR[CONTEXT=TrackerListWidget]",
|
||||
(tracker.num_leeches >= 0) ? tracker.num_leeches : "QBT_TR(N/A)QBT_TR[CONTEXT=TrackerListWidget]",
|
||||
|
|
Loading…
Reference in a new issue