Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
b5fbebc8
Commit
b5fbebc8
authored
Jan 28, 2015
by
Gavin Bises
Browse files
Add country code to user info box.
People might not know all the flags
parent
739ca6a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/userinfobox.cpp
View file @
b5fbebc8
...
...
@@ -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
))
...
...
cockatrice/src/userinfobox.h
View file @
b5fbebc8
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment