add a remaining column to the torrent content model

This commit is contained in:
Ben Lau
2016-01-09 10:10:57 -08:00
parent 6054e05e70
commit cd9cae4121
7 changed files with 30 additions and 3 deletions

View File

@@ -67,6 +67,15 @@ void PropListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
QItemDelegate::drawBackground(painter, opt, index);
QItemDelegate::drawDisplay(painter, opt, option.rect, Utils::Misc::friendlyUnit(index.data().toLongLong()));
break;
case REMAINING:
QItemDelegate::drawBackground(painter, opt, index);
if (index.sibling(index.row(), PRIORITY).data().toInt() == prio::IGNORED) {
QItemDelegate::drawDisplay(painter, opt, option.rect, tr("N/A"));
}
else {
QItemDelegate::drawDisplay(painter, opt, option.rect, Utils::Misc::friendlyUnit(index.data().toLongLong()));
}
break;
case PROGRESS:
if (index.data().toDouble() >= 0) {
QStyleOptionProgressBarV2 newopt;