diff --git a/cockatrice/src/gameselector.cpp b/cockatrice/src/gameselector.cpp index 4ec06863..743d5263 100644 --- a/cockatrice/src/gameselector.cpp +++ b/cockatrice/src/gameselector.cpp @@ -29,10 +29,10 @@ GameSelector::GameSelector(AbstractClient *_client, TabSupervisor *_tabSuperviso gameListView->header()->hideSection(1); gameListView->header()->setResizeMode(1, QHeaderView::ResizeToContents); - showUnjoinableGamesCheckBox = new QCheckBox; + showUnavailableGamesCheckBox = new QCheckBox; QVBoxLayout *filterLayout = new QVBoxLayout; - filterLayout->addWidget(showUnjoinableGamesCheckBox); + filterLayout->addWidget(showUnavailableGamesCheckBox); if (room) createButton = new QPushButton; @@ -63,15 +63,15 @@ GameSelector::GameSelector(AbstractClient *_client, TabSupervisor *_tabSuperviso setMinimumWidth((qreal) (gameListView->columnWidth(0) * gameListModel->columnCount()) / 1.5); setMinimumHeight(200); - connect(showUnjoinableGamesCheckBox, SIGNAL(stateChanged(int)), this, SLOT(showUnjoinableGamesChanged(int))); + connect(showUnavailableGamesCheckBox, SIGNAL(stateChanged(int)), this, SLOT(showUnavailableGamesChanged(int))); connect(createButton, SIGNAL(clicked()), this, SLOT(actCreate())); connect(joinButton, SIGNAL(clicked()), this, SLOT(actJoin())); connect(spectateButton, SIGNAL(clicked()), this, SLOT(actJoin())); } -void GameSelector::showUnjoinableGamesChanged(int state) +void GameSelector::showUnavailableGamesChanged(int state) { - gameListProxyModel->setUnjoinableGamesVisible(state); + gameListProxyModel->setUnavailableGamesVisible(state); } void GameSelector::actCreate() @@ -130,7 +130,7 @@ void GameSelector::actJoin() void GameSelector::retranslateUi() { setTitle(tr("Games")); - showUnjoinableGamesCheckBox->setText(tr("Show u&njoinable games")); + showUnavailableGamesCheckBox->setText(tr("Show u&navailable games")); if (createButton) createButton->setText(tr("C&reate")); joinButton->setText(tr("&Join")); diff --git a/cockatrice/src/gameselector.h b/cockatrice/src/gameselector.h index 38acda2d..13ec71a5 100644 --- a/cockatrice/src/gameselector.h +++ b/cockatrice/src/gameselector.h @@ -18,7 +18,7 @@ class TabRoom; class GameSelector : public QGroupBox { Q_OBJECT private slots: - void showUnjoinableGamesChanged(int state); + void showUnavailableGamesChanged(int state); void actCreate(); void actJoin(); void checkResponse(ResponseCode response); @@ -33,7 +33,7 @@ private: GamesModel *gameListModel; GamesProxyModel *gameListProxyModel; QPushButton *createButton, *joinButton, *spectateButton; - QCheckBox *showUnjoinableGamesCheckBox; + QCheckBox *showUnavailableGamesCheckBox; public: GameSelector(AbstractClient *_client, TabSupervisor *_tabSupervisor, TabRoom *_room, const QMap &_rooms, const QMap &_gameTypes, QWidget *parent = 0); void retranslateUi(); diff --git a/cockatrice/src/gamesmodel.cpp b/cockatrice/src/gamesmodel.cpp index 5f5f05da..5b9dd77e 100644 --- a/cockatrice/src/gamesmodel.cpp +++ b/cockatrice/src/gamesmodel.cpp @@ -107,14 +107,14 @@ void GamesModel::updateGameList(ServerInfo_Game *_game) } GamesProxyModel::GamesProxyModel(QObject *parent, ServerInfo_User *_ownUser) - : QSortFilterProxyModel(parent), ownUser(_ownUser), unjoinableGamesVisible(false) + : QSortFilterProxyModel(parent), ownUser(_ownUser), unavailableGamesVisible(false) { setDynamicSortFilter(true); } -void GamesProxyModel::setUnjoinableGamesVisible(bool _unjoinableGamesVisible) +void GamesProxyModel::setUnavailableGamesVisible(bool _unavailableGamesVisible) { - unjoinableGamesVisible = _unjoinableGamesVisible; + unavailableGamesVisible = _unavailableGamesVisible; invalidateFilter(); } @@ -125,7 +125,7 @@ bool GamesProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &/*sourc return false; ServerInfo_Game *game = model->getGame(sourceRow); - if (!unjoinableGamesVisible) { + if (!unavailableGamesVisible) { if (game->getPlayerCount() == game->getMaxPlayers()) return false; if (game->getStarted()) diff --git a/cockatrice/src/gamesmodel.h b/cockatrice/src/gamesmodel.h index bafd15b4..3832157c 100644 --- a/cockatrice/src/gamesmodel.h +++ b/cockatrice/src/gamesmodel.h @@ -31,10 +31,10 @@ class GamesProxyModel : public QSortFilterProxyModel { Q_OBJECT private: ServerInfo_User *ownUser; - bool unjoinableGamesVisible; + bool unavailableGamesVisible; public: GamesProxyModel(QObject *parent = 0, ServerInfo_User *_ownUser = 0); - void setUnjoinableGamesVisible(bool _unjoinableGamesVisible); + void setUnavailableGamesVisible(bool _unavailableGamesVisible); protected: bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; };