Browse Source

Distinguish more torrent states.

adaptive-webui-19844
sledgehammer999 11 years ago
parent
commit
8f955fe110
  1. 12
      src/qtlibtorrent/torrentmodel.cpp
  2. 2
      src/qtlibtorrent/torrentmodel.h
  3. 12
      src/transferlistdelegate.h

12
src/qtlibtorrent/torrentmodel.cpp

@ -69,7 +69,13 @@ TorrentModelItem::State TorrentModelItem::state() const @@ -69,7 +69,13 @@ TorrentModelItem::State TorrentModelItem::state() const
// Other states
switch(m_torrent.state()) {
case torrent_status::allocating:
m_icon = QIcon(":/Icons/skin/stalledDL.png");
m_fgColor = QColor("grey");
return STATE_ALLOCATING;
case torrent_status::downloading_metadata:
m_icon = QIcon(":/Icons/skin/downloading.png");
m_fgColor = QColor("green");
return STATE_DOWNLOADING_META;
case torrent_status::downloading: {
if (m_torrent.download_payload_rate() > 0) {
m_icon = QIcon(":/Icons/skin/downloading.png");
@ -93,7 +99,13 @@ TorrentModelItem::State TorrentModelItem::state() const @@ -93,7 +99,13 @@ TorrentModelItem::State TorrentModelItem::state() const
return STATE_STALLED_UP;
}
case torrent_status::queued_for_checking:
m_icon = QIcon(":/Icons/skin/checking.png");
m_fgColor = QColor("grey");
return STATE_QUEUED_CHECK;
case torrent_status::checking_resume_data:
m_icon = QIcon(":/Icons/skin/checking.png");
m_fgColor = QColor("grey");
return STATE_QUEUED_FASTCHECK;
case torrent_status::checking_files:
m_icon = QIcon(":/Icons/skin/checking.png");
m_fgColor = QColor("grey");

2
src/qtlibtorrent/torrentmodel.h

@ -48,7 +48,7 @@ class TorrentModelItem : public QObject { @@ -48,7 +48,7 @@ class TorrentModelItem : public QObject {
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 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, NB_COLUMNS};
public:

12
src/transferlistdelegate.h

@ -91,6 +91,12 @@ public: @@ -91,6 +91,12 @@ public:
case TorrentModelItem::STATE_DOWNLOADING:
display = tr("Downloading");
break;
case TorrentModelItem::STATE_DOWNLOADING_META:
display = tr("Downloading metadata");
break;
case TorrentModelItem::STATE_ALLOCATING:
display = tr("Allocating", "qBittorrent is allocating the files on disk");
break;
case TorrentModelItem::STATE_PAUSED_DL:
case TorrentModelItem::STATE_PAUSED_UP:
display = tr("Paused");
@ -110,6 +116,12 @@ public: @@ -110,6 +116,12 @@ public:
case TorrentModelItem::STATE_CHECKING_UP:
display = tr("Checking", "Torrent local data is being checked");
break;
case TorrentModelItem::STATE_QUEUED_CHECK:
display = tr("Queued for checking", "i.e. torrent is queued for hash checking");
break;
case TorrentModelItem::STATE_QUEUED_FASTCHECK:
display = tr("Checking resume data");
break;
default:
display = "";
}

Loading…
Cancel
Save