context menu for a message sender's name in chat; also display the user level icon next to the name; minor consistency and type-safety changes

This commit is contained in:
Max-Wilhelm Bruker 2012-04-08 23:48:02 +02:00
parent f9e0b6fe9e
commit 95cd293b9c
30 changed files with 283 additions and 195 deletions

View file

@ -56,7 +56,7 @@ void UserInfoBox::retranslateUi()
void UserInfoBox::updateInfo(const ServerInfo_User &user)
{
const int userLevel = user.user_level();
const UserLevelFlags userLevel(user.user_level());
QPixmap avatarPixmap;
const std::string bmp = user.avatar_bmp();
@ -70,11 +70,11 @@ void UserInfoBox::updateInfo(const ServerInfo_User &user)
countryLabel2->setPixmap(CountryPixmapGenerator::generatePixmap(15, QString::fromStdString(user.country())));
userLevelLabel2->setPixmap(UserLevelPixmapGenerator::generatePixmap(15, userLevel));
QString userLevelText;
if (userLevel & ServerInfo_User::IsAdmin)
if (userLevel.testFlag(ServerInfo_User::IsAdmin))
userLevelText = tr("Administrator");
else if (userLevel & ServerInfo_User::IsModerator)
else if (userLevel.testFlag(ServerInfo_User::IsModerator))
userLevelText = tr("Moderator");
else if (userLevel & ServerInfo_User::IsRegistered)
else if (userLevel.testFlag(ServerInfo_User::IsRegistered))
userLevelText = tr("Registered user");
else
userLevelText = tr("Unregistered user");