From aadf40739c45c3396ace5766dd9c60db0c3b1ccc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 30 May 2015 17:45:27 +0300 Subject: Move relation enum into separate file. --- src/gui/models/playertablemodel.cpp | 2 +- src/gui/popups/popupmenu.cpp | 14 +++++++------- src/gui/widgets/tabs/socialfriendstab.h | 3 +-- src/gui/windows/chatwindow.cpp | 4 ++-- src/gui/windows/whoisonline.cpp | 14 +++++++------- 5 files changed, 18 insertions(+), 19 deletions(-) (limited to 'src/gui') diff --git a/src/gui/models/playertablemodel.cpp b/src/gui/models/playertablemodel.cpp index f83a67707..4affed712 100644 --- a/src/gui/models/playertablemodel.cpp +++ b/src/gui/models/playertablemodel.cpp @@ -123,7 +123,7 @@ void PlayerTableModel::updateModelInRow(const int row) const const DropDown *const choicebox = static_cast( getElementAt(row, RELATION_CHOICE_COLUMN)); player_relations.setRelation(getPlayerAt(row), - static_cast( + static_cast( choicebox->getSelected())); } diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 6c348a8e5..37c8e0d78 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -2264,18 +2264,18 @@ void PopupMenu::addPlayerRelation(const std::string &name) { switch (player_relations.getRelation(name)) { - case PlayerRelation::NEUTRAL: + case Relation::NEUTRAL: // TRANSLATORS: popup menu item // TRANSLATORS: add player to friends list mBrowserBox->addRow("/friend 'NAME'", _("Be friend")); addNormalRelations(); break; - case PlayerRelation::FRIEND: + case Relation::FRIEND: addNormalRelations(); break; - case PlayerRelation::BLACKLISTED: + case Relation::BLACKLISTED: // TRANSLATORS: popup menu item // TRANSLATORS: remove player from ignore list mBrowserBox->addRow("/unignore 'NAME'", _("Unignore")); @@ -2293,7 +2293,7 @@ void PopupMenu::addPlayerRelation(const std::string &name) mBrowserBox->addRow("/erase 'NAME'", _("Erase")); break; - case PlayerRelation::DISREGARDED: + case Relation::DISREGARDED: // TRANSLATORS: popup menu item // TRANSLATORS: remove player from ignore list mBrowserBox->addRow("/unignore 'NAME'", _("Unignore")); @@ -2305,7 +2305,7 @@ void PopupMenu::addPlayerRelation(const std::string &name) mBrowserBox->addRow("/erase 'NAME'", _("Erase")); break; - case PlayerRelation::IGNORED: + case Relation::IGNORED: // TRANSLATORS: popup menu item // TRANSLATORS: remove player from ignore list mBrowserBox->addRow("/unignore 'NAME'", _("Unignore")); @@ -2314,7 +2314,7 @@ void PopupMenu::addPlayerRelation(const std::string &name) mBrowserBox->addRow("/erase 'NAME'", _("Erase")); break; - case PlayerRelation::ENEMY2: + case Relation::ENEMY2: // TRANSLATORS: popup menu item // TRANSLATORS: remove player from ignore list mBrowserBox->addRow("/unignore 'NAME'", _("Unignore")); @@ -2332,7 +2332,7 @@ void PopupMenu::addPlayerRelation(const std::string &name) mBrowserBox->addRow("/erase 'NAME'", _("Erase")); break; - case PlayerRelation::ERASED: + case Relation::ERASED: // TRANSLATORS: popup menu item // TRANSLATORS: remove player from ignore list mBrowserBox->addRow("/unignore 'NAME'", _("Unignore")); diff --git a/src/gui/widgets/tabs/socialfriendstab.h b/src/gui/widgets/tabs/socialfriendstab.h index 229591096..e09068d8d 100644 --- a/src/gui/widgets/tabs/socialfriendstab.h +++ b/src/gui/widgets/tabs/socialfriendstab.h @@ -86,8 +86,7 @@ class SocialFriendsTab final : public SocialTab avatars->clear(); const StringVect *const players - = player_relations.getPlayersByRelation( - PlayerRelation::FRIEND); + = player_relations.getPlayersByRelation(Relation::FRIEND); const std::set &players2 = whoIsOnline->getOnlineNicks(); diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index f79f8b45d..747ba498e 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -605,10 +605,10 @@ void ChatWindow::ignoreAllWhispers() if (tab) { if (player_relations.getRelation(tab->getNick()) - != PlayerRelation::IGNORED) + != Relation::IGNORED) { player_relations.setRelation(tab->getNick(), - PlayerRelation::IGNORED); + Relation::IGNORED); } tab->handleCommand("close", ""); } diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index d0b896041..174b242dd 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -282,13 +282,13 @@ void WhoIsOnline::handlerPlayerRelation(const std::string &nick, { switch (player_relations.getRelation(nick)) { - case PlayerRelation::NEUTRAL: + case Relation::NEUTRAL: default: setNeutralColor(player); mNeutral.push_back(player); break; - case PlayerRelation::FRIEND: + case Relation::FRIEND: player->setText("2"); if (mGroupFriends) mFriends.push_back(player); @@ -296,19 +296,19 @@ void WhoIsOnline::handlerPlayerRelation(const std::string &nick, mNeutral.push_back(player); break; - case PlayerRelation::DISREGARDED: - case PlayerRelation::BLACKLISTED: + case Relation::DISREGARDED: + case Relation::BLACKLISTED: player->setText("8"); mDisregard.push_back(player); break; - case PlayerRelation::ENEMY2: + case Relation::ENEMY2: player->setText("1"); mEnemy.push_back(player); break; - case PlayerRelation::IGNORED: - case PlayerRelation::ERASED: + case Relation::IGNORED: + case Relation::ERASED: // Ignore the ignored. break; } -- cgit v1.2.3-60-g2f50