Merge pull request #4451 from netjunki/master

add a remaining column to the torrent content model
This commit is contained in:
sledgehammer999
2016-03-05 10:42:14 -06:00
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;

View File

@@ -45,7 +45,8 @@ enum PropColumn
NAME,
PCSIZE,
PROGRESS,
PRIORITY
PRIORITY,
REMAINING
};
class PropListDelegate : public QItemDelegate