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

@ -207,17 +207,17 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
clearcompletedAct = new QAction(QIcon(IMAGE_CLEARCOMPLETED), tr( "Clear Completed" ), this ); clearcompletedAct = new QAction(QIcon(IMAGE_CLEARCOMPLETED), tr( "Clear Completed" ), this );
connect( clearcompletedAct , SIGNAL( triggered() ), this, SLOT( clearcompleted() ) ); connect( clearcompletedAct , SIGNAL( triggered() ), this, SLOT( clearcompleted() ) );
rootisnotdecoratedAct = new QAction(QIcon(), tr( "Set Root is not Decorated" ), this ); rootisnotdecoratedAct = new QAction(QIcon(), tr( "Set Root is not Decorated" ), this );
connect( rootisnotdecoratedAct , SIGNAL( triggered() ), this, SLOT( rootisnotdecorated() ) ); connect( rootisnotdecoratedAct , SIGNAL( triggered() ), this, SLOT( rootisnotdecorated() ) );
rootisdecoratedAct = new QAction(QIcon(), tr( "Set Root is Decorated" ), this ); rootisdecoratedAct = new QAction(QIcon(), tr( "Set Root is Decorated" ), this );
connect( rootisdecoratedAct , SIGNAL( triggered() ), this, SLOT( rootdecorated() ) ); connect( rootisdecoratedAct , SIGNAL( triggered() ), this, SLOT( rootdecorated() ) );
QMenu *viewMenu = new QMenu( tr("View"), this ); QMenu *viewMenu = new QMenu( tr("View"), this );
viewMenu->addAction(rootisnotdecoratedAct); viewMenu->addAction(rootisnotdecoratedAct);
viewMenu->addAction(rootisdecoratedAct); viewMenu->addAction(rootisdecoratedAct);
contextMnu.clear(); contextMnu.clear();
if (addPlayOption) if (addPlayOption)
{ {
@ -234,7 +234,7 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
contextMnu.addSeparator(); contextMnu.addSeparator();
contextMnu.addMenu( viewMenu); contextMnu.addMenu( viewMenu);
contextMnu.exec( mevent->globalPos() ); contextMnu.exec( mevent->globalPos() );
} }
void TransfersDialog::playSelectedTransfer() void TransfersDialog::playSelectedTransfer()
@ -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" ) 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") 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 //set this false if you want to expand on double click
dlItem->setEditable(false); dlItem->setEditable(false);
name.insert(0, " ");
QList<QStandardItem *> items; QList<QStandardItem *> items;
QStandardItem *i1 = new QStandardItem(); i1->setData(QVariant((QString)name), Qt::DisplayRole); QStandardItem *i1 = new QStandardItem(); i1->setData(QVariant((QString)name), Qt::DisplayRole);
QStandardItem *i2 = new QStandardItem(); i2->setData(QVariant((qlonglong)fileSize), 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 *i8 = new QStandardItem(); i8->setData(QVariant((qlonglong)remaining), Qt::DisplayRole);
QStandardItem *i9 = new QStandardItem(); i9->setData(QVariant((QString)coreID), 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(i1);
items.append(i2); items.append(i2);
items.append(i3); items.append(i3);