grey user icon when online is 0 on statusbar

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1158 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2009-05-02 22:45:31 +00:00
parent 69914204db
commit 1c5db15325
3 changed files with 26 additions and 15 deletions

View File

@ -320,6 +320,7 @@
<file>images/user/identityavaiblecyan24.png</file>
<file>images/user/agt_forum24.png</file>
<file>images/user/identity32.png</file>
<file>images/user/identitygray16.png</file>
<file>images/user/add_user16.png</file>
<file>images/user/personal64.png</file>
<file>images/user/kuser24.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 B

View File

@ -43,7 +43,7 @@ PeerStatus::PeerStatus(QWidget *parent)
hbox->setSpacing(6);
iconLabel = new QLabel( this );
iconLabel->setPixmap(QPixmap::QPixmap(":/images/user/identity16.png"));
iconLabel->setPixmap(QPixmap::QPixmap(":/images/user/identitygray16.png"));
// iconLabel doesn't change over time, so we didn't need a minimum size
hbox->addWidget(iconLabel);
@ -61,26 +61,36 @@ PeerStatus::~PeerStatus()
void PeerStatus::getPeerStatus()
{
/* set users/friends/network */
/* set users/friends/network */
std::list<std::string> ids;
rsPeers->getOnlineList(ids);
int online = ids.size();
std::list<std::string> ids;
rsPeers->getOnlineList(ids);
int online = ids.size();
ids.clear();
rsPeers->getFriendList(ids);
int friends = ids.size();
ids.clear();
rsPeers->getFriendList(ids);
int friends = ids.size();
ids.clear();
rsPeers->getOthersList(ids);
int others = 1 + ids.size();
ids.clear();
rsPeers->getOthersList(ids);
int others = 1 + ids.size();
std::ostringstream out2;
out2 << "<span style=\"color:#008000\"><strong>Online: </strong></span>" << online << " | <span style=\"color:#0000FF\"><strong>Friends: </strong></span>" << friends << " | <strong>Network: </strong>" << others << " ";
std::ostringstream out2;
out2 << "<span style=\"color:#008000\"><strong>Online: </strong></span>" << online << " | <span style=\"color:#0000FF\"><strong>Friends: </strong></span>" << friends << " | <strong>Network: </strong>" << others << " ";
if (statusPeers)
statusPeers -> setText(QString::fromStdString(out2.str()));
if (statusPeers)
statusPeers -> setText(QString::fromStdString(out2.str()));
if (online > 0)
{
iconLabel->setPixmap(QPixmap::QPixmap(":/images/user/identity16.png"));
}
else
{
iconLabel->setPixmap(QPixmap::QPixmap(":/images/user/identitygray16.png"));
}
}