+
+QString DownloadView::GetStatusString(QTorrentHandle::State const& status) const
+{
+ switch (status) {
+ case QTorrentHandle::QUEUED_FOR_CHECKING :
+ return "Queued";
+ case QTorrentHandle::CHECKING_FILES :
+ return "Checking";
+ case QTorrentHandle::DOWNLOADING_METADATA :
+ return "DL meta";
+ case QTorrentHandle::DOWNLOADING :
+ return "Downloading";
+ case QTorrentHandle::FINISHED :
+ return "Finished";
+ case QTorrentHandle::SEEDING :
+ return "Seeding";
+ case QTorrentHandle::ALLOCATING :
+ return "Allocating";
+ default:
+ return "N/A";
+ }
+}
+
+
+QColor DownloadView::GetStatusColor(QTorrentHandle::State const& status) const
+{
+ QColor green(40,205,40);
+ QColor yellow(255,174,0);
+
+ switch (status) {
+ case QTorrentHandle::QUEUED_FOR_CHECKING :
+ case QTorrentHandle::CHECKING_FILES :
+ case QTorrentHandle::DOWNLOADING_METADATA :
+ case QTorrentHandle::ALLOCATING :
+ return yellow;
+ case QTorrentHandle::DOWNLOADING :
+ case QTorrentHandle::FINISHED :
+ case QTorrentHandle::SEEDING :
+ return green;
+ default:
+ return QColor();
+ }
+
+}
\ No newline at end of file