searchdialog - mark current downloads green

This commit is contained in:
RetroPooh 2017-03-21 14:57:06 +03:00
parent ca0521cb2d
commit 19bd51dfae
3 changed files with 23 additions and 0 deletions

View file

@ -407,6 +407,13 @@ void SearchDialog::download()
for(std::list<RsPeerId>::const_iterator it(srcIds.begin()); it!=srcIds.end(); ++it) {
std::cout << *it << "-" << std::endl;
}//for(std::list<RsPeerId>::const_iterator
//QColor foreground = QColor(0, 128, 0); // green
QColor foreground = textColorDownloading();
QBrush brush(foreground);
for (int i = 0; i < item->columnCount(); ++i)
{
item->setForeground(i, brush);
}
}//if(!rsFiles -> FileRequest(
}//if (item->text(SR_HASH_COL).isEmpty())
}//for (int i = 0
@ -1189,6 +1196,11 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s
found = true ;
if (!item->data(SR_DATA_COL, SR_ROLE_LOCAL).toBool()) {
FileInfo fi;
if (rsFiles->FileDetails(file.hash, RS_FILE_HINTS_DOWNLOAD, fi))
break;
QColor foreground;
int sources = friendSource + anonymousSource ;
@ -1281,6 +1293,12 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s
setForeground = true;
}
}
if (rsFiles->FileDetails(file.hash, RS_FILE_HINTS_DOWNLOAD, fi))
{
//foreground = QColor(0, 128, 0); // green
foreground = textColorDownloading();
setForeground = true;
}
if (setForeground) {
QBrush brush(foreground);