From d420fc89a57f9f6c12126700ff0337091cc64630 Mon Sep 17 00:00:00 2001 From: Matt Lowe Date: Mon, 9 Feb 2015 17:11:13 +0100 Subject: [PATCH 1/2] Spectator viewing options Its now easy to see which games you can chat/see hands in. --- cockatrice/src/gamesmodel.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/gamesmodel.cpp b/cockatrice/src/gamesmodel.cpp index 8f7e324a..da620ec0 100644 --- a/cockatrice/src/gamesmodel.cpp +++ b/cockatrice/src/gamesmodel.cpp @@ -172,8 +172,18 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const case SPECTATORS: switch(role) { case SORT_ROLE: - case Qt::DisplayRole: - return g.spectators_allowed() ? QVariant(g.spectators_count()) : QVariant(tr("not allowed")); + case Qt::DisplayRole: { + 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 hands")); + return result; + } + return QVariant(tr("not allowed")); + } case Qt::TextAlignmentRole: return Qt::AlignLeft; default: From 616f8439aecec2d3f9366994c81ee775b9ccfaa4 Mon Sep 17 00:00:00 2001 From: Matt Lowe Date: Mon, 9 Feb 2015 17:41:38 +0100 Subject: [PATCH 2/2] Changed text to match room creation "see hands" -> "see everything" --- cockatrice/src/gamesmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/src/gamesmodel.cpp b/cockatrice/src/gamesmodel.cpp index da620ec0..49b8886e 100644 --- a/cockatrice/src/gamesmodel.cpp +++ b/cockatrice/src/gamesmodel.cpp @@ -179,7 +179,7 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const if (g.spectators_can_chat()) result.append(", ").append(tr("chat")); if (g.spectators_omniscient()) - result.append(", ").append(tr("see hands")); + result.append(", ").append(tr("see everything")); return result; } return QVariant(tr("not allowed"));