added status icon in the name field of download peers

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1280 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
alexandrut 2009-05-27 22:21:09 +00:00
parent 7b4c7384b5
commit 8cdb8e077f

View File

@ -336,7 +336,7 @@ int TransfersDialog::addItem(QString symbol, QString name, QString coreID, qlong
}
else if (ext == "iso" || ext == "nrg" || ext == "mdf" || ext == "img" || ext == "dmg" || ext == "bin" )
{
DLListModel->setData(DLListModel->index(row,NAME), QIcon(QString::fromUtf8(":/imagees/FileTypeCDImage.png")), Qt::DecorationRole);
DLListModel->setData(DLListModel->index(row,NAME), QIcon(QString::fromUtf8(":/images/FileTypeCDImage.png")), Qt::DecorationRole);
}
else if (ext == "txt" || ext == "cpp" || ext == "c" || ext == "h")
{
@ -367,6 +367,8 @@ bool TransfersDialog::addPeerToItem(int row, QString symbol, QString name, QStri
//set this false if you want to expand on double click
dlItem->setEditable(false);
name.insert(0, " ");
QList<QStandardItem *> items;
QStandardItem *i1 = new QStandardItem(); i1->setData(QVariant((QString)name), Qt::DisplayRole);
QStandardItem *i2 = new QStandardItem(); i2->setData(QVariant((qlonglong)fileSize), Qt::DisplayRole);
@ -378,6 +380,20 @@ bool TransfersDialog::addPeerToItem(int row, QString symbol, QString name, QStri
QStandardItem *i8 = new QStandardItem(); i8->setData(QVariant((qlonglong)remaining), Qt::DisplayRole);
QStandardItem *i9 = new QStandardItem(); i9->setData(QVariant((QString)coreID), Qt::DisplayRole);
/* set status icon in the name field */
if (status == "Downloading") {
i1->setData(QIcon(QString::fromUtf8(":/images/Client0.png")), Qt::DecorationRole);
} else if (status == "Failed") {
i1->setData(QIcon(QString::fromUtf8(":/images/Client1.png")), Qt::DecorationRole);
} else if (status == "Okay") {
i1->setData(QIcon(QString::fromUtf8(":/images/Client2.png")), Qt::DecorationRole);
} else if (status == "Waiting") {
i1->setData(QIcon(QString::fromUtf8(":/images/Client3.png")), Qt::DecorationRole);
} else if (status == "Unknown") {
i1->setData(QIcon(QString::fromUtf8(":/images/Client4.png")), Qt::DecorationRole);
} else if (status == "Complete") {
}
items.append(i1);
items.append(i2);
items.append(i3);