i2psnark: Fix bug in status tooltips

This commit is contained in:
str4d
2017-06-04 00:33:29 +00:00
parent 4c6af7cdca
commit 6fe55529d6

View File

@ -1581,25 +1581,28 @@ public class I2PSnarkServlet extends BasicServlet {
if (isRunning) { if (isRunning) {
String img; String img;
String txt; String txt;
String tooltip;
if (remaining == 0) { if (remaining == 0) {
img = "seeding"; img = "seeding";
txt = _t("Seeding to {0} of {1} peers in swarm", curPeers, knownPeers); txt = _t("Seeding");
tooltip = _t("Seeding to {0} of {1} peers in swarm", curPeers, knownPeers);
} else { } else {
// partial // partial
img = "complete"; img = "complete";
txt = _t("Complete"); txt = _t("Complete");
tooltip = txt;
if (curPeers > 0) { if (curPeers > 0) {
txt = txt + " (" + _t("Seeding to {0} of {1} peers in swarm", curPeers, knownPeers) + ")"; tooltip = txt + " (" + _t("Seeding to {0} of {1} peers in swarm", curPeers, knownPeers) + ")";
} }
} }
if (curPeers > 0 && !showPeers) { if (curPeers > 0 && !showPeers) {
statusString = toThemeImg(img, "", txt) + "</td>" + statusString = toThemeImg(img, "", tooltip) + "</td>" +
"<td class=\"snarkTorrentStatus\"><b>" + txt + "<td class=\"snarkTorrentStatus\"><b>" + txt +
":</b> <a href=\"" + uri + getQueryString(req, b64, null, null) + '#' + b64Short + "\">" + ":</b> <a href=\"" + uri + getQueryString(req, b64, null, null) + '#' + b64Short + "\">" +
curPeers + thinsp(noThinsp) + curPeers + thinsp(noThinsp) +
ngettext("1 peer", "{0} peers", knownPeers) + "</a>"; ngettext("1 peer", "{0} peers", knownPeers) + "</a>";
} else { } else {
statusString = toThemeImg(img, "", txt) + "</td>" + statusString = toThemeImg(img, "", tooltip) + "</td>" +
"<td class=\"snarkTorrentStatus\"><b>" + txt + "<td class=\"snarkTorrentStatus\"><b>" + txt +
":</b> " + curPeers + thinsp(noThinsp) + ":</b> " + curPeers + thinsp(noThinsp) +
ngettext("1 peer", "{0} peers", knownPeers); ngettext("1 peer", "{0} peers", knownPeers);