Browse Source

Merge pull request #300 from Gelmir/uploaded_column

Main view column changes
adaptive-webui-19844
Christophe Dumez 12 years ago
parent
commit
6f88b072d1
  1. 6
      src/qtlibtorrent/torrentmodel.cpp
  2. 2
      src/qtlibtorrent/torrentmodel.h
  3. 1
      src/transferlistdelegate.h
  4. 1
      src/transferlistwidget.cpp

6
src/qtlibtorrent/torrentmodel.cpp

@ -190,7 +190,9 @@ QVariant TorrentModelItem::data(int column, int role) const @@ -190,7 +190,9 @@ QVariant TorrentModelItem::data(int column, int role) const
case TR_UPLIMIT:
return m_torrent.upload_limit();
case TR_AMOUNT_DOWNLOADED:
return static_cast<qlonglong>(m_torrent.total_wanted_done());
return static_cast<qlonglong>(m_torrent.all_time_download());
case TR_AMOUNT_UPLOADED:
return static_cast<qlonglong>(m_torrent.all_time_upload());
case TR_AMOUNT_LEFT:
return static_cast<qlonglong>(m_torrent.total_wanted() - m_torrent.total_wanted_done());
case TR_TIME_ELAPSED:
@ -261,6 +263,7 @@ QVariant TorrentModel::headerData(int section, Qt::Orientation orientation, @@ -261,6 +263,7 @@ QVariant TorrentModel::headerData(int section, Qt::Orientation orientation,
case TorrentModelItem::TR_DLLIMIT: return tr("Down Limit", "i.e: Download limit");
case TorrentModelItem::TR_UPLIMIT: return tr("Up Limit", "i.e: Upload limit");
case TorrentModelItem::TR_AMOUNT_DOWNLOADED: return tr("Amount downloaded", "Amount of data downloaded (e.g. in MB)");
case TorrentModelItem::TR_AMOUNT_UPLOADED: return tr("Amount uploaded", "Amount of data uploaded (e.g. in MB)");
case TorrentModelItem::TR_AMOUNT_LEFT: return tr("Amount left", "Amount of data left to download (e.g. in MB)");
case TorrentModelItem::TR_TIME_ELAPSED: return tr("Time Active", "Time (duration) the torrent is active (not paused)");
default:
@ -279,6 +282,7 @@ QVariant TorrentModel::headerData(int section, Qt::Orientation orientation, @@ -279,6 +282,7 @@ QVariant TorrentModel::headerData(int section, Qt::Orientation orientation,
case TorrentModelItem::TR_DLLIMIT:
case TorrentModelItem::TR_UPLIMIT:
case TorrentModelItem::TR_AMOUNT_DOWNLOADED:
case TorrentModelItem::TR_AMOUNT_UPLOADED:
case TorrentModelItem::TR_AMOUNT_LEFT:
return Qt::AlignRight;
case TorrentModelItem::TR_PROGRESS:

2
src/qtlibtorrent/torrentmodel.h

@ -49,7 +49,7 @@ Q_OBJECT @@ -49,7 +49,7 @@ Q_OBJECT
public:
enum State {STATE_DOWNLOADING, 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_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_LEFT, TR_TIME_ELAPSED, NB_COLUMNS};
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, NB_COLUMNS};
public:
TorrentModelItem(const QTorrentHandle& h);

1
src/transferlistdelegate.h

@ -62,6 +62,7 @@ public: @@ -62,6 +62,7 @@ public:
painter->save();
switch(index.column()) {
case TorrentModelItem::TR_AMOUNT_DOWNLOADED:
case TorrentModelItem::TR_AMOUNT_UPLOADED:
case TorrentModelItem::TR_AMOUNT_LEFT:
case TorrentModelItem::TR_SIZE:{
QItemDelegate::drawBackground(painter, opt, index);

1
src/transferlistwidget.cpp

@ -120,6 +120,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window, @@ -120,6 +120,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window,
setColumnHidden(TorrentModelItem::TR_DLLIMIT, true);
setColumnHidden(TorrentModelItem::TR_TRACKER, true);
setColumnHidden(TorrentModelItem::TR_AMOUNT_DOWNLOADED, true);
setColumnHidden(TorrentModelItem::TR_AMOUNT_UPLOADED, true);
setColumnHidden(TorrentModelItem::TR_AMOUNT_LEFT, true);
setColumnHidden(TorrentModelItem::TR_TIME_ELAPSED, true);
}

Loading…
Cancel
Save