mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Show a readable Date, no Timestamp in Network Tab.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@734 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
5b2e6b2d62
commit
21cf471f6c
@ -294,7 +294,22 @@ void NetworkDialog::insertConnect()
|
|||||||
/* (3) Last Connect */
|
/* (3) Last Connect */
|
||||||
{
|
{
|
||||||
std::ostringstream out;
|
std::ostringstream out;
|
||||||
out << detail.lastConnect;
|
// Show anouncement if a friend never was connected.
|
||||||
|
if (detail.lastConnect==0 ) {
|
||||||
|
if(detail.state & RS_PEER_STATE_FRIEND) {
|
||||||
|
out << "Friend never seen";
|
||||||
|
} else {
|
||||||
|
out << "0"; // Is zero
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Dont Show a timestamp in RS calculate the day
|
||||||
|
time_t seconds;
|
||||||
|
seconds=detail.lastConnect;
|
||||||
|
struct tm *tmnow= localtime(&seconds);
|
||||||
|
out << setfill ("0");
|
||||||
|
out << tmnow->tm_hour << ":" << tmnow->tm_min << ":" << tmnow->tm_sec << " ";
|
||||||
|
out << tmnow->tm_mday << "." << tmnow->tm_mon + 1 << "." << tmnow->tm_year + 1900;
|
||||||
|
}
|
||||||
item -> setText(3, QString::fromStdString(out.str()));
|
item -> setText(3, QString::fromStdString(out.str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,55 +343,44 @@ void NetworkDialog::insertConnect()
|
|||||||
|
|
||||||
/* change background */
|
/* change background */
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
// I dont know why the setBackground and Icon functions called 10 times,
|
||||||
|
// but this loop dont needed to be implemented in every single switch.
|
||||||
|
for(i = 1; i <10; i++)
|
||||||
|
{
|
||||||
if (detail.state & RS_PEER_STATE_FRIEND)
|
if (detail.state & RS_PEER_STATE_FRIEND)
|
||||||
{
|
{
|
||||||
if (detail.lastConnect < 10000) /* 3 hours? */
|
if (detail.lastConnect < 10000) /* 3 hours? */
|
||||||
{
|
{
|
||||||
/* bright green */
|
/* bright green */
|
||||||
for(i = 1; i <10; i++)
|
|
||||||
{
|
|
||||||
item -> setBackground(i,QBrush(Qt::darkGreen));
|
item -> setBackground(i,QBrush(Qt::darkGreen));
|
||||||
item -> setIcon(0,(QIcon(IMAGE_AUTHED)));
|
item -> setIcon(0,(QIcon(IMAGE_AUTHED)));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
for(i = 1; i < 10; i++)
|
|
||||||
{
|
{
|
||||||
item -> setBackground(i,QBrush(Qt::darkGreen));
|
item -> setBackground(i,QBrush(Qt::darkGreen));
|
||||||
item -> setIcon(0,(QIcon(IMAGE_AUTHED)));
|
item -> setIcon(0,(QIcon(IMAGE_AUTHED)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (detail.trustLvl > RS_TRUST_LVL_MARGINAL)
|
if (detail.trustLvl > RS_TRUST_LVL_MARGINAL)
|
||||||
{
|
|
||||||
for(i = 1; i < 10; i++)
|
|
||||||
{
|
{
|
||||||
item -> setBackground(i,QBrush(Qt::cyan));
|
item -> setBackground(i,QBrush(Qt::cyan));
|
||||||
item -> setIcon(0,(QIcon(IMAGE_DENIED)));
|
item -> setIcon(0,(QIcon(IMAGE_DENIED)));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (detail.lastConnect < 10000) /* 3 hours? */
|
else if (detail.lastConnect < 10000) /* 3 hours? */
|
||||||
{
|
|
||||||
for(i = 1; i < 10; i++)
|
|
||||||
{
|
{
|
||||||
item -> setBackground(i,QBrush(Qt::yellow));
|
item -> setBackground(i,QBrush(Qt::yellow));
|
||||||
item -> setIcon(0,(QIcon(IMAGE_DENIED)));
|
item -> setIcon(0,(QIcon(IMAGE_DENIED)));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
for(i = 1; i < 10; i++)
|
|
||||||
{
|
{
|
||||||
item -> setBackground(i,QBrush(Qt::gray));
|
item -> setBackground(i,QBrush(Qt::gray));
|
||||||
item -> setIcon(0,(QIcon(IMAGE_DENIED)));
|
item -> setIcon(0,(QIcon(IMAGE_DENIED)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* add to the list */
|
/* add to the list */
|
||||||
items.append(item);
|
items.append(item);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user