mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-17 05:22:31 -04:00
* Enabled by default to display Friends Avatar on Friendslist
* Changed for RS 0.6 the status icons * beautify the status string which displays after nicknames git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7695 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3ef04a61c9
commit
4cdd83cc89
11 changed files with 39 additions and 12 deletions
|
@ -296,6 +296,7 @@ void FriendList::initializeHeader(bool /*afterLoadSettings*/)
|
|||
header->resizeSection(COLUMN_NAME, 150);
|
||||
header->resizeSection(COLUMN_LAST_CONTACT, 120);
|
||||
}*/
|
||||
header->resizeSection(COLUMN_NAME, 220);
|
||||
header->resizeSection(COLUMN_AVATAR, COLUMN_AVATAR_WIDTH);
|
||||
}
|
||||
|
||||
|
@ -1083,7 +1084,7 @@ void FriendList::insertPeers()
|
|||
gpgItem->setFont(i, font);
|
||||
}
|
||||
|
||||
gpgIcon = QIcon(StatusDefs::imageUser(bestRSState));
|
||||
gpgIcon = QIcon(StatusDefs::imageStatus(bestRSState));
|
||||
|
||||
if (!isStatusColumnHidden) {
|
||||
gpgItem->setText(COLUMN_STATE, StatusDefs::name(bestRSState));
|
||||
|
@ -1096,13 +1097,13 @@ void FriendList::insertPeers()
|
|||
gpgItemText += "\n" + bestCustomStateString;
|
||||
}
|
||||
} else if (isStatusColumnHidden && !mHideState){
|
||||
gpgItemText += " [" + StatusDefs::name(bestRSState) + "]";
|
||||
gpgItemText += " - " + StatusDefs::name(bestRSState);
|
||||
}
|
||||
} else if (gpg_online) {
|
||||
if (!isStatusColumnHidden) {
|
||||
gpgItem->setText(COLUMN_STATE, tr("Available"));
|
||||
} else if (!mHideState && !mBigName) {
|
||||
gpgItemText += " [" + tr("Available") + "]";
|
||||
gpgItemText += " - " + tr("Available") ;
|
||||
}
|
||||
|
||||
bestPeerState = PEER_STATE_AVAILABLE;
|
||||
|
@ -1121,12 +1122,12 @@ void FriendList::insertPeers()
|
|||
if (!isStatusColumnHidden) {
|
||||
gpgItem->setText(COLUMN_STATE, StatusDefs::name(RS_STATUS_OFFLINE));
|
||||
} else if (!mHideState && !mBigName) {
|
||||
gpgItemText += " [" + StatusDefs::name(RS_STATUS_OFFLINE) + "]";
|
||||
gpgItemText += " - " + StatusDefs::name(RS_STATUS_OFFLINE) ;
|
||||
}
|
||||
|
||||
bestPeerState = PEER_STATE_OFFLINE;
|
||||
gpgItem->setHidden(mHideUnconnected);
|
||||
gpgIcon = QIcon(StatusDefs::imageUser(RS_STATUS_OFFLINE));
|
||||
gpgIcon = QIcon(StatusDefs::imageStatus(RS_STATUS_OFFLINE));
|
||||
|
||||
QColor textColor = mTextColorStatus[RS_STATUS_OFFLINE];
|
||||
QFont font = StatusDefs::font(RS_STATUS_OFFLINE);
|
||||
|
@ -1769,6 +1770,7 @@ void FriendList::setShowAvatarColumn(bool show)
|
|||
ui->peerTreeWidget->setColumnHidden(COLUMN_AVATAR, !show);
|
||||
|
||||
updateHeader();
|
||||
initializeHeader(true);
|
||||
insertPeers();
|
||||
}
|
||||
|
||||
|
|
|
@ -82,6 +82,25 @@ const char *StatusDefs::imageUser(unsigned int status)
|
|||
return "";
|
||||
}
|
||||
|
||||
const char *StatusDefs::imageStatus(unsigned int status)
|
||||
{
|
||||
switch (status) {
|
||||
case RS_STATUS_OFFLINE:
|
||||
return ":/images/status/user-offline.png";
|
||||
case RS_STATUS_AWAY:
|
||||
return ":/images/status/user-away.png";
|
||||
case RS_STATUS_BUSY:
|
||||
return ":/images/status/user-busy.png";
|
||||
case RS_STATUS_ONLINE:
|
||||
return ":/images/status/user-online.png";
|
||||
case RS_STATUS_INACTIVE:
|
||||
return ":/images/status/user-away-extended.png";
|
||||
}
|
||||
|
||||
std::cerr << "StatusDefs::imageUser: Unknown status requested " << status;
|
||||
return "";
|
||||
}
|
||||
|
||||
QString StatusDefs::tooltip(unsigned int status)
|
||||
{
|
||||
switch (status) {
|
||||
|
|
|
@ -34,6 +34,7 @@ public:
|
|||
static QString name(unsigned int status);
|
||||
static const char* imageIM(unsigned int status);
|
||||
static const char* imageUser(unsigned int status);
|
||||
static const char* imageStatus(unsigned int status);
|
||||
static QString tooltip(unsigned int status);
|
||||
|
||||
static QFont font(unsigned int status);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue