summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-30 17:45:27 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-30 17:45:27 +0300
commitaadf40739c45c3396ace5766dd9c60db0c3b1ccc (patch)
treea6d2ca5fb86849ae18586b728bfcd9e716f5635f /src/gui
parent2a33b736dc93251bf7a72364c5f818142362a3ce (diff)
downloadmanaplus-aadf40739c45c3396ace5766dd9c60db0c3b1ccc.tar.gz
manaplus-aadf40739c45c3396ace5766dd9c60db0c3b1ccc.tar.bz2
manaplus-aadf40739c45c3396ace5766dd9c60db0c3b1ccc.tar.xz
manaplus-aadf40739c45c3396ace5766dd9c60db0c3b1ccc.zip
Move relation enum into separate file.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/models/playertablemodel.cpp2
-rw-r--r--src/gui/popups/popupmenu.cpp14
-rw-r--r--src/gui/widgets/tabs/socialfriendstab.h3
-rw-r--r--src/gui/windows/chatwindow.cpp4
-rw-r--r--src/gui/windows/whoisonline.cpp14
5 files changed, 18 insertions, 19 deletions
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<DropDown *>(
getElementAt(row, RELATION_CHOICE_COLUMN));
player_relations.setRelation(getPlayerAt(row),
- static_cast<PlayerRelation::Relation>(
+ static_cast<RelationT>(
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<std::string> &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;
}