Browse Source

FEATURE: Added a transfer list column to display the current tracker

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
ccf0002c0f
  1. 1
      Changelog
  2. 2
      src/transferlistdelegate.h
  3. 15
      src/transferlistwidget.cpp

1
Changelog

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.5.0
- FEATURE: Added feature to shutdown qbittorrent on torrents completion
- FEATURE: Added a transfer list column to display the current tracker
* Tue Aug 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.4.0
- FEATURE: Added actions to "Move to top/bottom" of priority queue

2
src/transferlistdelegate.h

@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
// Defines for download list list columns
enum TorrentState {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_DLLIMIT, TR_UPLIMIT, TR_HASH};
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_HASH};
class TransferListDelegate: public QItemDelegate {
Q_OBJECT

15
src/transferlistwidget.cpp

@ -63,7 +63,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, GUI *main_window, Bittor @@ -63,7 +63,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, GUI *main_window, Bittor
setItemDelegate(listDelegate);
// Create transfer list model
listModel = new QStandardItemModel(0,17);
listModel = new QStandardItemModel(0,18);
listModel->setHeaderData(TR_NAME, Qt::Horizontal, tr("Name", "i.e: torrent name"));
listModel->setHeaderData(TR_PRIORITY, Qt::Horizontal, "#");
listModel->horizontalHeaderItem(TR_PRIORITY)->setTextAlignment(Qt::AlignRight);
@ -86,6 +86,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, GUI *main_window, Bittor @@ -86,6 +86,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, GUI *main_window, Bittor
listModel->setHeaderData(TR_LABEL, Qt::Horizontal, tr("Label"));
listModel->setHeaderData(TR_ADD_DATE, Qt::Horizontal, tr("Added On", "Torrent was added to transfer list on 01/01/2010 08:00"));
listModel->setHeaderData(TR_SEED_DATE, Qt::Horizontal, tr("Completed On", "Torrent was completed on 01/01/2010 08:00"));
listModel->setHeaderData(TR_TRACKER, Qt::Horizontal, tr("Tracker"));
listModel->setHeaderData(TR_DLLIMIT, Qt::Horizontal, tr("Down Limit", "i.e: Download limit"));
listModel->horizontalHeaderItem(TR_DLLIMIT)->setTextAlignment(Qt::AlignRight);
listModel->setHeaderData(TR_UPLIMIT, Qt::Horizontal, tr("Up Limit", "i.e: Upload limit"));;
@ -358,6 +359,9 @@ int TransferListWidget::updateTorrent(int row) { @@ -358,6 +359,9 @@ int TransferListWidget::updateTorrent(int row) {
peers += 1;
listModel->setData(listModel->index(row, TR_PEERS), QVariant(peers));
}
if(!isColumnHidden(TR_TRACKER)) {
listModel->setData(listModel->index(row, TR_TRACKER), QVariant(h.current_tracker()));
}
// Update torrent size. It changes when files are filtered from torrent properties
// or Web UI
listModel->setData(listModel->index(row, TR_SIZE), QVariant((qlonglong)h.actual_size()));
@ -1005,6 +1009,7 @@ bool TransferListWidget::loadHiddenColumns() { @@ -1005,6 +1009,7 @@ bool TransferListWidget::loadHiddenColumns() {
setColumnHidden(TR_SEED_DATE, true);
setColumnHidden(TR_UPLIMIT, true);
setColumnHidden(TR_DLLIMIT, true);
setColumnHidden(TR_TRACKER, true);
}
return loaded;
}
@ -1465,13 +1470,13 @@ void TransferListWidget::applyStatusFilter(int f) { @@ -1465,13 +1470,13 @@ void TransferListWidget::applyStatusFilter(int f) {
switch(f) {
case FILTER_DOWNLOADING:
statusFilterModel->setFilterRegExp(QRegExp(QString::number(STATE_DOWNLOADING)+"|"+QString::number(STATE_STALLED_DL)+"|"+
QString::number(STATE_PAUSED_DL)+"|"+QString::number(STATE_CHECKING_DL)+"|"+
QString::number(STATE_QUEUED_DL), Qt::CaseSensitive));
QString::number(STATE_PAUSED_DL)+"|"+QString::number(STATE_CHECKING_DL)+"|"+
QString::number(STATE_QUEUED_DL), Qt::CaseSensitive));
break;
case FILTER_COMPLETED:
statusFilterModel->setFilterRegExp(QRegExp(QString::number(STATE_SEEDING)+"|"+QString::number(STATE_STALLED_UP)+"|"+
QString::number(STATE_PAUSED_UP)+"|"+QString::number(STATE_CHECKING_UP)+"|"+
QString::number(STATE_QUEUED_UP), Qt::CaseSensitive));
QString::number(STATE_PAUSED_UP)+"|"+QString::number(STATE_CHECKING_UP)+"|"+
QString::number(STATE_QUEUED_UP), Qt::CaseSensitive));
break;
case FILTER_ACTIVE:
statusFilterModel->setFilterRegExp(QRegExp(QString::number(STATE_DOWNLOADING)+"|"+QString::number(STATE_SEEDING), Qt::CaseSensitive));

Loading…
Cancel
Save