diff --git a/retroshare-gui/src/gui/FriendsDialog.cpp b/retroshare-gui/src/gui/FriendsDialog.cpp index b33d009b4..e8d083ae6 100644 --- a/retroshare-gui/src/gui/FriendsDialog.cpp +++ b/retroshare-gui/src/gui/FriendsDialog.cpp @@ -201,7 +201,7 @@ FriendsDialog::FriendsDialog(QWidget *parent) RsAutoUpdatePage::lockAllEvents(); ui.friendList->setShowStatusColumn(false); ui.friendList->setShowLastContactColumn(false); - ui.friendList->setShowAvatarColumn(false); + ui.friendList->setShowAvatarColumn(true); ui.friendList->setShowIPColumn(false); ui.friendList->setRootIsDecorated(true); ui.friendList->setShowGroups(true); diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 3c1be1fbe..47e4b86de 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -1320,19 +1320,19 @@ void MainWindow::initializeStatusObject(QObject *pObject, bool bConnect) /* initialize menu */ QActionGroup *pGroup = new QActionGroup(pMenu); - QAction *pAction = new QAction(QIcon(StatusDefs::imageIM(RS_STATUS_ONLINE)), StatusDefs::name(RS_STATUS_ONLINE), pMenu); + QAction *pAction = new QAction(QIcon(StatusDefs::imageStatus(RS_STATUS_ONLINE)), StatusDefs::name(RS_STATUS_ONLINE), pMenu); pAction->setData(RS_STATUS_ONLINE); pAction->setCheckable(true); pMenu->addAction(pAction); pGroup->addAction(pAction); - pAction = new QAction(QIcon(StatusDefs::imageIM(RS_STATUS_BUSY)), StatusDefs::name(RS_STATUS_BUSY), pMenu); + pAction = new QAction(QIcon(StatusDefs::imageStatus(RS_STATUS_BUSY)), StatusDefs::name(RS_STATUS_BUSY), pMenu); pAction->setData(RS_STATUS_BUSY); pAction->setCheckable(true); pMenu->addAction(pAction); pGroup->addAction(pAction); - pAction = new QAction(QIcon(StatusDefs::imageIM(RS_STATUS_AWAY)), StatusDefs::name(RS_STATUS_AWAY), pMenu); + pAction = new QAction(QIcon(StatusDefs::imageStatus(RS_STATUS_AWAY)), StatusDefs::name(RS_STATUS_AWAY), pMenu); pAction->setData(RS_STATUS_AWAY); pAction->setCheckable(true); pMenu->addAction(pAction); @@ -1345,9 +1345,9 @@ void MainWindow::initializeStatusObject(QObject *pObject, bool bConnect) /* initialize combobox */ QComboBox *pComboBox = dynamic_cast(pObject); if (pComboBox) { - pComboBox->addItem(QIcon(StatusDefs::imageIM(RS_STATUS_ONLINE)), StatusDefs::name(RS_STATUS_ONLINE), RS_STATUS_ONLINE); - pComboBox->addItem(QIcon(StatusDefs::imageIM(RS_STATUS_BUSY)), StatusDefs::name(RS_STATUS_BUSY), RS_STATUS_BUSY); - pComboBox->addItem(QIcon(StatusDefs::imageIM(RS_STATUS_AWAY)), StatusDefs::name(RS_STATUS_AWAY), RS_STATUS_AWAY); + pComboBox->addItem(QIcon(StatusDefs::imageStatus(RS_STATUS_ONLINE)), StatusDefs::name(RS_STATUS_ONLINE), RS_STATUS_ONLINE); + pComboBox->addItem(QIcon(StatusDefs::imageStatus(RS_STATUS_BUSY)), StatusDefs::name(RS_STATUS_BUSY), RS_STATUS_BUSY); + pComboBox->addItem(QIcon(StatusDefs::imageStatus(RS_STATUS_AWAY)), StatusDefs::name(RS_STATUS_AWAY), RS_STATUS_AWAY); if (bConnect) { connect(pComboBox, SIGNAL(activated(int)), this, SLOT(statusChangedComboBox(int))); diff --git a/retroshare-gui/src/gui/common/FriendList.cpp b/retroshare-gui/src/gui/common/FriendList.cpp index 31fd888cb..2299b8967 100644 --- a/retroshare-gui/src/gui/common/FriendList.cpp +++ b/retroshare-gui/src/gui/common/FriendList.cpp @@ -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(); } diff --git a/retroshare-gui/src/gui/common/StatusDefs.cpp b/retroshare-gui/src/gui/common/StatusDefs.cpp index 6945605c5..954d1413d 100644 --- a/retroshare-gui/src/gui/common/StatusDefs.cpp +++ b/retroshare-gui/src/gui/common/StatusDefs.cpp @@ -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) { diff --git a/retroshare-gui/src/gui/common/StatusDefs.h b/retroshare-gui/src/gui/common/StatusDefs.h index d96abb57d..f21298428 100644 --- a/retroshare-gui/src/gui/common/StatusDefs.h +++ b/retroshare-gui/src/gui/common/StatusDefs.h @@ -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); diff --git a/retroshare-gui/src/gui/images.qrc b/retroshare-gui/src/gui/images.qrc index 4e2cdf64c..c95676b82 100644 --- a/retroshare-gui/src/gui/images.qrc +++ b/retroshare-gui/src/gui/images.qrc @@ -680,6 +680,11 @@ images/tags/dev-translator.png images/tags/dev-patcher.png images/tags/developer.png + images/status/user-online.png + images/status/user-offline.png + images/status/user-busy.png + images/status/user-away-extended.png + images/status/user-away.png images/circles/circles_32.png images/circles/circles_64.png images/newsfeed/news-feed-32.png diff --git a/retroshare-gui/src/gui/images/status/user-away-extended.png b/retroshare-gui/src/gui/images/status/user-away-extended.png new file mode 100644 index 000000000..e348a3060 Binary files /dev/null and b/retroshare-gui/src/gui/images/status/user-away-extended.png differ diff --git a/retroshare-gui/src/gui/images/status/user-away.png b/retroshare-gui/src/gui/images/status/user-away.png new file mode 100644 index 000000000..041e75868 Binary files /dev/null and b/retroshare-gui/src/gui/images/status/user-away.png differ diff --git a/retroshare-gui/src/gui/images/status/user-busy.png b/retroshare-gui/src/gui/images/status/user-busy.png new file mode 100644 index 000000000..85453b4e4 Binary files /dev/null and b/retroshare-gui/src/gui/images/status/user-busy.png differ diff --git a/retroshare-gui/src/gui/images/status/user-offline.png b/retroshare-gui/src/gui/images/status/user-offline.png new file mode 100644 index 000000000..d896ddf92 Binary files /dev/null and b/retroshare-gui/src/gui/images/status/user-offline.png differ diff --git a/retroshare-gui/src/gui/images/status/user-online.png b/retroshare-gui/src/gui/images/status/user-online.png new file mode 100644 index 000000000..829ab55af Binary files /dev/null and b/retroshare-gui/src/gui/images/status/user-online.png differ