From b5fbebc883826b7830fd2727c29adc7d42661f6b Mon Sep 17 00:00:00 2001 From: Gavin Bises Date: Wed, 28 Jan 2015 11:57:17 -0500 Subject: [PATCH] Add country code to user info box. People might not know all the flags --- cockatrice/src/userinfobox.cpp | 5 ++++- cockatrice/src/userinfobox.h | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cockatrice/src/userinfobox.cpp b/cockatrice/src/userinfobox.cpp index a733f5bc..4472ada6 100644 --- a/cockatrice/src/userinfobox.cpp +++ b/cockatrice/src/userinfobox.cpp @@ -31,6 +31,7 @@ UserInfoBox::UserInfoBox(AbstractClient *_client, bool _fullInfo, QWidget *paren mainLayout->addWidget(&genderLabel2, 3, 1, 1, 2); mainLayout->addWidget(&countryLabel1, 4, 0, 1, 1); mainLayout->addWidget(&countryLabel2, 4, 1, 1, 2); + mainLayout->addWidget(&countryLabel3, 4, 2, 1, 1); mainLayout->addWidget(&userLevelLabel1, 5, 0, 1, 1); mainLayout->addWidget(&userLevelLabel2, 5, 1, 1, 1); mainLayout->addWidget(&userLevelLabel3, 5, 2, 1, 1); @@ -65,7 +66,9 @@ void UserInfoBox::updateInfo(const ServerInfo_User &user) nameLabel.setText(QString::fromStdString(user.name())); realNameLabel2.setText(QString::fromStdString(user.real_name())); genderLabel2.setPixmap(GenderPixmapGenerator::generatePixmap(15, user.gender())); - countryLabel2.setPixmap(CountryPixmapGenerator::generatePixmap(15, QString::fromStdString(user.country()))); + QString country = QString::fromStdString(user.country()); + countryLabel2.setPixmap(CountryPixmapGenerator::generatePixmap(15, country)); + countryLabel3.setText(QString("(%1)").arg(country)); userLevelLabel2.setPixmap(UserLevelPixmapGenerator::generatePixmap(15, userLevel)); QString userLevelText; if (userLevel.testFlag(ServerInfo_User::IsAdmin)) diff --git a/cockatrice/src/userinfobox.h b/cockatrice/src/userinfobox.h index b64e29af..e144cd4c 100644 --- a/cockatrice/src/userinfobox.h +++ b/cockatrice/src/userinfobox.h @@ -14,8 +14,8 @@ class UserInfoBox : public QWidget { private: AbstractClient *client; bool fullInfo; - QLabel avatarLabel, nameLabel, realNameLabel1, realNameLabel2, genderLabel1, genderLabel2, countryLabel1, - countryLabel2, userLevelLabel1, userLevelLabel2, userLevelLabel3, accountAgeLebel1, accountAgeLabel2; + QLabel avatarLabel, nameLabel, realNameLabel1, realNameLabel2, genderLabel1, genderLabel2, countryLabel1, + countryLabel2, countryLabel3, userLevelLabel1, userLevelLabel2, userLevelLabel3, accountAgeLebel1, accountAgeLabel2; public: UserInfoBox(AbstractClient *_client, bool fullInfo, QWidget *parent = 0, Qt::WindowFlags flags = 0); void retranslateUi();