From b5fbebc883826b7830fd2727c29adc7d42661f6b Mon Sep 17 00:00:00 2001 From: Gavin Bises Date: Wed, 28 Jan 2015 11:57:17 -0500 Subject: [PATCH 1/3] 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(); From 1af6486d74958222e9a24182d2faff78fad708da Mon Sep 17 00:00:00 2001 From: Gavin Bises Date: Wed, 28 Jan 2015 19:03:08 -0500 Subject: [PATCH 2/3] Capitalize country code in user info box --- cockatrice/src/userinfobox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/src/userinfobox.cpp b/cockatrice/src/userinfobox.cpp index 4472ada6..aa245b3f 100644 --- a/cockatrice/src/userinfobox.cpp +++ b/cockatrice/src/userinfobox.cpp @@ -66,7 +66,7 @@ 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())); - QString country = QString::fromStdString(user.country()); + QString country = QString::fromStdString(user.country()).toUpper(); countryLabel2.setPixmap(CountryPixmapGenerator::generatePixmap(15, country)); countryLabel3.setText(QString("(%1)").arg(country)); userLevelLabel2.setPixmap(UserLevelPixmapGenerator::generatePixmap(15, userLevel)); From 6f50266931da1ac0485383871482b6f137b12c9e Mon Sep 17 00:00:00 2001 From: Gavin Bises Date: Thu, 29 Jan 2015 20:01:48 -0500 Subject: [PATCH 3/3] Uppercase country code for text display, not flag filename generation --- cockatrice/src/userinfobox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/userinfobox.cpp b/cockatrice/src/userinfobox.cpp index aa245b3f..6c33bbf7 100644 --- a/cockatrice/src/userinfobox.cpp +++ b/cockatrice/src/userinfobox.cpp @@ -66,9 +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())); - QString country = QString::fromStdString(user.country()).toUpper(); + QString country = QString::fromStdString(user.country()); countryLabel2.setPixmap(CountryPixmapGenerator::generatePixmap(15, country)); - countryLabel3.setText(QString("(%1)").arg(country)); + countryLabel3.setText(QString("(%1)").arg(country.toUpper())); userLevelLabel2.setPixmap(UserLevelPixmapGenerator::generatePixmap(15, userLevel)); QString userLevelText; if (userLevel.testFlag(ServerInfo_User::IsAdmin))