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
e02f9e7d
Commit
e02f9e7d
authored
Feb 09, 2015
by
Zach
Browse files
Merge pull request #715 from ZeldaZach/dialog_spec_view
Game list informs better of what spectators can do
parents
b7cb16da
f0338118
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/dlg_creategame.cpp
View file @
e02f9e7d
...
...
@@ -72,12 +72,12 @@ void DlgCreateGame::sharedCtor()
QGroupBox
*
joinRestrictionsGroupBox
=
new
QGroupBox
(
tr
(
"Joining restrictions"
));
joinRestrictionsGroupBox
->
setLayout
(
joinRestrictionsLayout
);
spectatorsAllowedCheckBox
=
new
QCheckBox
(
tr
(
"&Spectators
allowed
"
));
spectatorsAllowedCheckBox
=
new
QCheckBox
(
tr
(
"&Spectators
can watch
"
));
spectatorsAllowedCheckBox
->
setChecked
(
true
);
connect
(
spectatorsAllowedCheckBox
,
SIGNAL
(
stateChanged
(
int
)),
this
,
SLOT
(
spectatorsAllowedChanged
(
int
)));
spectatorsNeedPasswordCheckBox
=
new
QCheckBox
(
tr
(
"Spectators &need a password to
join
"
));
spectatorsNeedPasswordCheckBox
=
new
QCheckBox
(
tr
(
"Spectators &need a password to
watch
"
));
spectatorsCanTalkCheckBox
=
new
QCheckBox
(
tr
(
"Spectators can &chat"
));
spectatorsSeeEverythingCheckBox
=
new
QCheckBox
(
tr
(
"Spectators see &
everything
"
));
spectatorsSeeEverythingCheckBox
=
new
QCheckBox
(
tr
(
"Spectators
can
see &
hands
"
));
QVBoxLayout
*
spectatorsLayout
=
new
QVBoxLayout
;
spectatorsLayout
->
addWidget
(
spectatorsAllowedCheckBox
);
spectatorsLayout
->
addWidget
(
spectatorsNeedPasswordCheckBox
);
...
...
cockatrice/src/gamesmodel.cpp
View file @
e02f9e7d
...
...
@@ -176,10 +176,20 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const
if
(
g
.
spectators_allowed
())
{
QString
result
;
result
.
append
(
QString
::
number
(
g
.
spectators_count
()));
if
(
g
.
spectators_can_chat
())
result
.
append
(
", "
).
append
(
tr
(
"chat"
));
if
(
g
.
spectators_omniscient
())
result
.
append
(
", "
).
append
(
tr
(
"see everything"
));
if
(
g
.
spectators_can_chat
()
&&
g
.
spectators_omniscient
())
{
result
.
append
(
" ("
).
append
(
tr
(
"can chat"
)).
append
(
" & "
).
append
(
tr
(
"see hands"
)).
append
(
")"
);
}
else
if
(
g
.
spectators_can_chat
())
{
result
.
append
(
" ("
).
append
(
tr
(
"can chat"
)).
append
(
")"
);
}
else
if
(
g
.
spectators_omniscient
())
{
result
.
append
(
" ("
).
append
(
tr
(
"can see hands"
)).
append
(
")"
);
}
return
result
;
}
return
QVariant
(
tr
(
"not allowed"
));
...
...
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