Browse Source

FEATURE: Added "Time Active/Seeded" column to transfer list

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
bc035b3873
  1. 1
      Changelog
  2. 4
      src/mainwindow.cpp
  3. 4
      src/properties/propertieswidget.ui
  4. 3
      src/qtlibtorrent/torrentmodel.cpp
  5. 2
      src/qtlibtorrent/torrentmodel.h
  6. 9
      src/transferlistdelegate.h
  7. 1
      src/transferlistwidget.cpp

1
Changelog

@ -4,6 +4,7 @@
- FEATURE: Simplify program preferences - FEATURE: Simplify program preferences
- FEATURE: Software update check can now be disabled (Mac OS X / Windows) - FEATURE: Software update check can now be disabled (Mac OS X / Windows)
- FEATURE: Display pieces size in torrent properties - FEATURE: Display pieces size in torrent properties
- FEATURE: Added "Time Active/Seeded" column to transfer list
- COSMETIC: Same deletion confirmation dialog in the GUI and Web UI - COSMETIC: Same deletion confirmation dialog in the GUI and Web UI
- COSMETIC: Simplified the top toolbar - COSMETIC: Simplified the top toolbar
- COSMETIC: Display execution log as a tab instead of a modal window - COSMETIC: Display execution log as a tab instead of a modal window

4
src/mainwindow.cpp

@ -1268,8 +1268,8 @@ void MainWindow::on_actionExecution_Logs_triggered(bool checked)
int index_tab = tabs->addTab(m_executionLog, tr("Execution Log")); int index_tab = tabs->addTab(m_executionLog, tr("Execution Log"));
tabs->setTabIcon(index_tab, misc::getIcon("view-calendar-journal")); tabs->setTabIcon(index_tab, misc::getIcon("view-calendar-journal"));
} else { } else {
Q_ASSERT(m_executionLog); if(m_executionLog)
delete m_executionLog; delete m_executionLog;
} }
Preferences().setExecutionLogEnabled(checked); Preferences().setExecutionLogEnabled(checked);
} }

4
src/properties/propertieswidget.ui

@ -53,7 +53,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-92</y> <y>0</y>
<width>520</width> <width>520</width>
<height>377</height> <height>377</height>
</rect> </rect>
@ -293,7 +293,7 @@
<item row="2" column="2"> <item row="2" column="2">
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="label_7">
<property name="text"> <property name="text">
<string>Time elapsed:</string> <string extracomment="Time (duration) the torrent is active (not paused)">Time active:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>

3
src/qtlibtorrent/torrentmodel.cpp

@ -184,6 +184,8 @@ QVariant TorrentModelItem::data(int column, int role) const
return static_cast<qlonglong>(m_torrent.total_wanted_done()); return static_cast<qlonglong>(m_torrent.total_wanted_done());
case TR_AMOUNT_LEFT: case TR_AMOUNT_LEFT:
return static_cast<qlonglong>(m_torrent.total_wanted() - m_torrent.total_wanted_done()); return static_cast<qlonglong>(m_torrent.total_wanted() - m_torrent.total_wanted_done());
case TR_TIME_ELAPSED:
return (role == Qt::DisplayRole) ? m_torrent.active_time() : m_torrent.seeding_time();
default: default:
return QVariant(); return QVariant();
} }
@ -247,6 +249,7 @@ QVariant TorrentModel::headerData(int section, Qt::Orientation orientation,
case TorrentModelItem::TR_UPLIMIT: return tr("Up Limit", "i.e: Upload 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_DOWNLOADED: return tr("Amount downloaded", "Amount of data downloaded (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_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: default:
return QVariant(); return QVariant();
} }

2
src/qtlibtorrent/torrentmodel.h

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

9
src/transferlistdelegate.h

@ -137,6 +137,15 @@ public:
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::fromUtf8("")); QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::fromUtf8(""));
break; break;
} }
case TorrentModelItem::TR_TIME_ELAPSED: {
QItemDelegate::drawBackground(painter, opt, index);
QString txt = misc::userFriendlyDuration(index.data().toLongLong());
qlonglong seeding_time = index.data(Qt::UserRole).toLongLong();
if(seeding_time > 0)
txt += " ("+tr("Seeded for %1", "e.g. Seeded for 3m10s").arg(misc::userFriendlyDuration(seeding_time))+")";
QItemDelegate::drawDisplay(painter, opt, opt.rect, txt);
break;
}
case TorrentModelItem::TR_ADD_DATE: case TorrentModelItem::TR_ADD_DATE:
case TorrentModelItem::TR_SEED_DATE: case TorrentModelItem::TR_SEED_DATE:
QItemDelegate::drawBackground(painter, opt, index); QItemDelegate::drawBackground(painter, opt, index);

1
src/transferlistwidget.cpp

@ -107,6 +107,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window,
setColumnHidden(TorrentModelItem::TR_TRACKER, true); setColumnHidden(TorrentModelItem::TR_TRACKER, true);
setColumnHidden(TorrentModelItem::TR_AMOUNT_DOWNLOADED, true); setColumnHidden(TorrentModelItem::TR_AMOUNT_DOWNLOADED, true);
setColumnHidden(TorrentModelItem::TR_AMOUNT_LEFT, true); setColumnHidden(TorrentModelItem::TR_AMOUNT_LEFT, true);
setColumnHidden(TorrentModelItem::TR_TIME_ELAPSED, true);
setContextMenuPolicy(Qt::CustomContextMenu); setContextMenuPolicy(Qt::CustomContextMenu);

Loading…
Cancel
Save