Commit 43d34bb8 authored by Zach H's avatar Zach H
Browse files

spectator preferences

parent b7cb16da
...@@ -72,12 +72,12 @@ void DlgCreateGame::sharedCtor() ...@@ -72,12 +72,12 @@ void DlgCreateGame::sharedCtor()
QGroupBox *joinRestrictionsGroupBox = new QGroupBox(tr("Joining restrictions")); QGroupBox *joinRestrictionsGroupBox = new QGroupBox(tr("Joining restrictions"));
joinRestrictionsGroupBox->setLayout(joinRestrictionsLayout); joinRestrictionsGroupBox->setLayout(joinRestrictionsLayout);
spectatorsAllowedCheckBox = new QCheckBox(tr("&Spectators allowed")); spectatorsAllowedCheckBox = new QCheckBox(tr("&Spectators can watch"));
spectatorsAllowedCheckBox->setChecked(true); spectatorsAllowedCheckBox->setChecked(true);
connect(spectatorsAllowedCheckBox, SIGNAL(stateChanged(int)), this, SLOT(spectatorsAllowedChanged(int))); 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")); 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; QVBoxLayout *spectatorsLayout = new QVBoxLayout;
spectatorsLayout->addWidget(spectatorsAllowedCheckBox); spectatorsLayout->addWidget(spectatorsAllowedCheckBox);
spectatorsLayout->addWidget(spectatorsNeedPasswordCheckBox); spectatorsLayout->addWidget(spectatorsNeedPasswordCheckBox);
......
...@@ -176,10 +176,20 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const ...@@ -176,10 +176,20 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const
if (g.spectators_allowed()) { if (g.spectators_allowed()) {
QString result; QString result;
result.append(QString::number(g.spectators_count())); result.append(QString::number(g.spectators_count()));
if (g.spectators_can_chat())
result.append(", ").append(tr("chat")); if (g.spectators_can_chat() && g.spectators_omniscient())
if (g.spectators_omniscient()) {
result.append(", ").append(tr("see everything")); result.append(" (").append(tr("can chat")).append(" & ").append((tr("can 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 result;
} }
return QVariant(tr("not allowed")); return QVariant(tr("not allowed"));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment