Distinguish more torrent states.

This commit is contained in:
sledgehammer999 2013-10-22 21:34:27 +03:00
parent 0f9ece76f8
commit c7dc6d0edf
3 changed files with 25 additions and 1 deletions

View file

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

View file

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

View file

@ -91,6 +91,12 @@ public:
case TorrentModelItem::STATE_DOWNLOADING: case TorrentModelItem::STATE_DOWNLOADING:
display = tr("Downloading"); display = tr("Downloading");
break; 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_DL:
case TorrentModelItem::STATE_PAUSED_UP: case TorrentModelItem::STATE_PAUSED_UP:
display = tr("Paused"); display = tr("Paused");
@ -110,6 +116,12 @@ public:
case TorrentModelItem::STATE_CHECKING_UP: case TorrentModelItem::STATE_CHECKING_UP:
display = tr("Checking", "Torrent local data is being checked"); display = tr("Checking", "Torrent local data is being checked");
break; 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: default:
display = ""; display = "";
} }