From c649cf883480071c9b93909c4ea4ee5ec98155b2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 6 Jun 2014 14:49:47 +0300 Subject: Remove some duplicate code. --- src/gui/popups/popupmenu.cpp | 51 ++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 30 deletions(-) (limited to 'src/gui/popups/popupmenu.cpp') diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 00cae3ee3..5d0f32f19 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -2521,6 +2521,25 @@ void PopupMenu::showPopup(int x, int y) requestMoveToTop(); } +void PopupMenu::addNormalRelations() +{ + // TRANSLATORS: popup menu item + // TRANSLATORS: add player to disregarded list + mBrowserBox->addRow("disregard", _("Disregard")); + // TRANSLATORS: popup menu item + // TRANSLATORS: add player to ignore list + mBrowserBox->addRow("ignore", _("Ignore")); + // TRANSLATORS: popup menu item + // TRANSLATORS: add player to black list + mBrowserBox->addRow("blacklist", _("Black list")); + // TRANSLATORS: popup menu item + // TRANSLATORS: add player to enemy list + mBrowserBox->addRow("enemy", _("Set as enemy")); + // TRANSLATORS: popup menu item + // TRANSLATORS: add player to erased list + mBrowserBox->addRow("erase", _("Erase")); +} + void PopupMenu::addPlayerRelation(const std::string &name) { switch (player_relations.getRelation(name)) @@ -2529,39 +2548,11 @@ void PopupMenu::addPlayerRelation(const std::string &name) // TRANSLATORS: popup menu item // TRANSLATORS: add player to friends list mBrowserBox->addRow("friend", _("Be friend")); - // TRANSLATORS: popup menu item - // TRANSLATORS: add player to disregarded list - mBrowserBox->addRow("disregard", _("Disregard")); - // TRANSLATORS: popup menu item - // TRANSLATORS: add player to ignore list - mBrowserBox->addRow("ignore", _("Ignore")); - // TRANSLATORS: popup menu item - // TRANSLATORS: add player to black list - mBrowserBox->addRow("blacklist", _("Black list")); - // TRANSLATORS: popup menu item - // TRANSLATORS: add player to enemy list - mBrowserBox->addRow("enemy", _("Set as enemy")); - // TRANSLATORS: popup menu item - // TRANSLATORS: add player to erased list - mBrowserBox->addRow("erase", _("Erase")); + addNormalRelations(); break; case PlayerRelation::FRIEND: - // TRANSLATORS: popup menu item - // TRANSLATORS: add player to disregarded list - mBrowserBox->addRow("disregard", _("Disregard")); - // TRANSLATORS: popup menu item - // TRANSLATORS: add player to ignore list - mBrowserBox->addRow("ignore", _("Ignore")); - // TRANSLATORS: popup menu item - // TRANSLATORS: add player to black list - mBrowserBox->addRow("blacklist", _("Black list")); - // TRANSLATORS: popup menu item - // TRANSLATORS: add player to enemy list - mBrowserBox->addRow("enemy", _("Set as enemy")); - // TRANSLATORS: popup menu item - // TRANSLATORS: add player to erased list - mBrowserBox->addRow("erase", _("Erase")); + addNormalRelations(); break; case PlayerRelation::BLACKLISTED: -- cgit v1.2.3-70-g09d2