Implement peer relevance column. Closes #1630.

This commit is contained in:
sledgehammer999
2014-12-06 19:07:26 +02:00
parent dc04ff511f
commit 35e964f66d
4 changed files with 42 additions and 11 deletions

View File

@@ -40,7 +40,7 @@ class PeerListDelegate: public QItemDelegate {
public:
enum PeerListColumns {COUNTRY, IP, PORT, CONNECTION, FLAGS, CLIENT, PROGRESS, DOWN_SPEED, UP_SPEED,
TOT_DOWN, TOT_UP, IP_HIDDEN, COL_COUNT};
TOT_DOWN, TOT_UP, RELEVANCE, IP_HIDDEN, COL_COUNT};
public:
PeerListDelegate(QObject *parent) : QItemDelegate(parent) {}
@@ -64,7 +64,8 @@ public:
QItemDelegate::drawDisplay(painter, opt, opt.rect, misc::friendlyUnit(speed)+tr("/s", "/second (i.e. per second)"));
break;
}
case PROGRESS:{
case PROGRESS:
case RELEVANCE:{
QItemDelegate::drawBackground(painter, opt, index);
qreal progress = index.data().toDouble();
QItemDelegate::drawDisplay(painter, opt, opt.rect, misc::accurateDoubleToString(progress*100.0, 1)+"%");