mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 13:04:23 +00:00
Add "Total Size" column to transfer list
This column shows the total size of the related torrent taking into account also the unwanted data. Closes #1233.
This commit is contained in:
parent
b1af99ffba
commit
b63f647c2c
@ -299,6 +299,8 @@ QVariant TorrentModelItem::data(int column, int role) const
|
|||||||
return m_lastStatus.time_since_upload;
|
return m_lastStatus.time_since_upload;
|
||||||
else
|
else
|
||||||
return m_lastStatus.time_since_download;
|
return m_lastStatus.time_since_download;
|
||||||
|
case TR_TOTAL_SIZE:
|
||||||
|
return m_lastStatus.has_metadata ? static_cast<qlonglong>(m_torrent.total_size()) : -1;
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@ -377,6 +379,7 @@ QVariant TorrentModel::headerData(int section, Qt::Orientation orientation,
|
|||||||
case TorrentModelItem::TR_RATIO_LIMIT: return tr("Ratio Limit", "Upload share ratio limit");
|
case TorrentModelItem::TR_RATIO_LIMIT: return tr("Ratio Limit", "Upload share ratio limit");
|
||||||
case TorrentModelItem::TR_SEEN_COMPLETE_DATE: return tr("Last Seen Complete", "Torrent was seen complete on 01/01/2010 08:00");
|
case TorrentModelItem::TR_SEEN_COMPLETE_DATE: return tr("Last Seen Complete", "Torrent was seen complete on 01/01/2010 08:00");
|
||||||
case TorrentModelItem::TR_LAST_ACTIVITY: return tr("Last Activity", "Time passed since a chunk was downloaded/uploaded");
|
case TorrentModelItem::TR_LAST_ACTIVITY: return tr("Last Activity", "Time passed since a chunk was downloaded/uploaded");
|
||||||
|
case TorrentModelItem::TR_TOTAL_SIZE: return tr("Total Size", "i.e. Size including unwanted data");
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ Q_OBJECT
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
enum State {STATE_DOWNLOADING, STATE_DOWNLOADING_META, STATE_ALLOCATING, STATE_STALLED_DL, STATE_STALLED_UP, STATE_SEEDING, STATE_PAUSED_DL, STATE_PAUSED_UP, STATE_QUEUED_DL, STATE_QUEUED_UP, STATE_CHECKING_UP, STATE_CHECKING_DL, STATE_QUEUED_CHECK, STATE_QUEUED_FASTCHECK, STATE_INVALID};
|
enum State {STATE_DOWNLOADING, STATE_DOWNLOADING_META, STATE_ALLOCATING, STATE_STALLED_DL, STATE_STALLED_UP, STATE_SEEDING, STATE_PAUSED_DL, STATE_PAUSED_UP, STATE_QUEUED_DL, STATE_QUEUED_UP, STATE_CHECKING_UP, STATE_CHECKING_DL, STATE_QUEUED_CHECK, STATE_QUEUED_FASTCHECK, STATE_INVALID};
|
||||||
enum Column {TR_NAME, TR_PRIORITY, TR_SIZE, TR_PROGRESS, TR_STATUS, TR_SEEDS, TR_PEERS, TR_DLSPEED, TR_UPSPEED, TR_ETA, TR_RATIO, TR_LABEL, TR_ADD_DATE, TR_SEED_DATE, TR_TRACKER, TR_DLLIMIT, TR_UPLIMIT, TR_AMOUNT_DOWNLOADED, TR_AMOUNT_UPLOADED, TR_AMOUNT_LEFT, TR_TIME_ELAPSED, TR_SAVE_PATH, TR_COMPLETED, TR_RATIO_LIMIT, TR_SEEN_COMPLETE_DATE, TR_LAST_ACTIVITY, NB_COLUMNS};
|
enum Column {TR_NAME, TR_PRIORITY, TR_SIZE, TR_TOTAL_SIZE, TR_PROGRESS, TR_STATUS, TR_SEEDS, TR_PEERS, TR_DLSPEED, TR_UPSPEED, TR_ETA, TR_RATIO, TR_LABEL, TR_ADD_DATE, TR_SEED_DATE, TR_TRACKER, TR_DLLIMIT, TR_UPLIMIT, TR_AMOUNT_DOWNLOADED, TR_AMOUNT_UPLOADED, TR_AMOUNT_LEFT, TR_TIME_ELAPSED, TR_SAVE_PATH, TR_COMPLETED, TR_RATIO_LIMIT, TR_SEEN_COMPLETE_DATE, TR_LAST_ACTIVITY, NB_COLUMNS};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TorrentModelItem(const QTorrentHandle& h);
|
TorrentModelItem(const QTorrentHandle& h);
|
||||||
|
@ -58,7 +58,8 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem
|
|||||||
case TorrentModelItem::TR_AMOUNT_UPLOADED:
|
case TorrentModelItem::TR_AMOUNT_UPLOADED:
|
||||||
case TorrentModelItem::TR_AMOUNT_LEFT:
|
case TorrentModelItem::TR_AMOUNT_LEFT:
|
||||||
case TorrentModelItem::TR_COMPLETED:
|
case TorrentModelItem::TR_COMPLETED:
|
||||||
case TorrentModelItem::TR_SIZE: {
|
case TorrentModelItem::TR_SIZE:
|
||||||
|
case TorrentModelItem::TR_TOTAL_SIZE: {
|
||||||
QItemDelegate::drawBackground(painter, opt, index);
|
QItemDelegate::drawBackground(painter, opt, index);
|
||||||
opt.displayAlignment = Qt::AlignRight;
|
opt.displayAlignment = Qt::AlignRight;
|
||||||
QItemDelegate::drawDisplay(painter, opt, option.rect, misc::friendlyUnit(index.data().toLongLong()));
|
QItemDelegate::drawDisplay(painter, opt, option.rect, misc::friendlyUnit(index.data().toLongLong()));
|
||||||
|
@ -132,6 +132,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window,
|
|||||||
setColumnHidden(TorrentModelItem::TR_RATIO_LIMIT, true);
|
setColumnHidden(TorrentModelItem::TR_RATIO_LIMIT, true);
|
||||||
setColumnHidden(TorrentModelItem::TR_SEEN_COMPLETE_DATE, true);
|
setColumnHidden(TorrentModelItem::TR_SEEN_COMPLETE_DATE, true);
|
||||||
setColumnHidden(TorrentModelItem::TR_LAST_ACTIVITY, true);
|
setColumnHidden(TorrentModelItem::TR_LAST_ACTIVITY, true);
|
||||||
|
setColumnHidden(TorrentModelItem::TR_TOTAL_SIZE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Ensure that at least one column is visible at all times
|
//Ensure that at least one column is visible at all times
|
||||||
|
Loading…
x
Reference in New Issue
Block a user