- made the source comulmn more explicit by displaying the real name of the source

- used for the source the same colour code (i.e. green when the source is online)



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@711 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2008-08-31 16:50:36 +00:00
parent f7fca4295b
commit 213d24c1d8

View File

@ -25,6 +25,7 @@
#include "rsiface/rsiface.h" #include "rsiface/rsiface.h"
#include "rsiface/rsexpr.h" #include "rsiface/rsexpr.h"
#include "rsiface/rsfiles.h" #include "rsiface/rsfiles.h"
#include "rsiface/rspeers.h"
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
@ -479,7 +480,6 @@ void SearchDialog::resultsToTree(std::string txt, std::list<FileDetail> results)
QTreeWidgetItem *item = new QTreeWidgetItem(); QTreeWidgetItem *item = new QTreeWidgetItem();
item->setText(SR_NAME_COL, QString::fromStdString(it->name)); item->setText(SR_NAME_COL, QString::fromStdString(it->name));
item->setText(SR_HASH_COL, QString::fromStdString(it->hash)); item->setText(SR_HASH_COL, QString::fromStdString(it->hash));
item->setText(SR_ID_COL, QString::fromStdString(it->id));
item->setText(SR_SEARCH_ID_COL, QString::fromStdString(out.str())); item->setText(SR_SEARCH_ID_COL, QString::fromStdString(out.str()));
/* /*
* to facilitate downlaods we need to save the file size too * to facilitate downlaods we need to save the file size too
@ -487,16 +487,23 @@ void SearchDialog::resultsToTree(std::string txt, std::list<FileDetail> results)
QVariant * variant = new QVariant(it->size); QVariant * variant = new QVariant(it->size);
item->setText(SR_SIZE_COL, QString(variant->toString())); item->setText(SR_SIZE_COL, QString(variant->toString()));
// I kept the color code green=online, grey=offline
// Qt::blue is very dark and hardly compatible with the black text on it.
//
if (it->id == "Local") if (it->id == "Local")
{ {
/* colour green? */ item->setText(SR_ID_COL, QString::fromStdString(it->id));
item->setBackground(2, QBrush(Qt::green)); item->setBackground(2, QBrush(Qt::red)); /* colour green? */
} }
else else
{ {
/* colour blue? */ item->setText(SR_ID_COL, QString::fromStdString( rsPeers->getPeerName(it->id)));
item->setBackground(2, QBrush(Qt::blue)); if(rsPeers->isOnline(it->id))
item->setBackground(2, QBrush(Qt::green));
else
item->setBackground(2, QBrush(Qt::lightGray));
} }
ui.searchResultWidget->addTopLevelItem(item); ui.searchResultWidget->addTopLevelItem(item);
} }