From 47f0e16e34cf22701b7c0670297bb7288a55310d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 15 Aug 2011 01:57:55 +0300 Subject: Add option to hide ip addresses on screenshots. --- src/gui/setup_players.cpp | 3 +++ src/gui/widgets/avatarlistbox.cpp | 46 ++++++++++++++++++++++++++++----------- 2 files changed, 36 insertions(+), 13 deletions(-) (limited to 'src/gui') diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp index d2664adbd..acc6b3d3c 100644 --- a/src/gui/setup_players.cpp +++ b/src/gui/setup_players.cpp @@ -75,6 +75,9 @@ Setup_Players::Setup_Players() new SetupItemCheckBox(_("Show statuses"), "", "showPlayersStatus", this, "showPlayersStatusEvent"); + new SetupItemCheckBox(_("Show ip addresses on screenshots"), "", + "showip", this, "showipEvent"); + setDimension(gcn::Rectangle(0, 0, 550, 350)); } diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 5ac6721a5..0d35ad188 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -242,25 +242,45 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics) } } - if (mShowGender) + if (graphics->getSecure()) { - switch (a->getGender()) + if (mShowGender) { - case GENDER_FEMALE: - text += strprintf(" \u2640 %s", - a->getAdditionString().c_str()); - break; - case GENDER_MALE: - text += strprintf(" \u2642 %s", - a->getAdditionString().c_str()); - break; - default: - break; + switch (a->getGender()) + { + case GENDER_FEMALE: + text += strprintf(" \u2640 "); + break; + case GENDER_MALE: + text += strprintf(" \u2642 "); + break; + default: + break; + } } } else { - text += a->getAdditionString(); + if (mShowGender) + { + switch (a->getGender()) + { + case GENDER_FEMALE: + text += strprintf(" \u2640 %s", + a->getAdditionString().c_str()); + break; + case GENDER_MALE: + text += strprintf(" \u2642 %s", + a->getAdditionString().c_str()); + break; + default: + break; + } + } + else + { + text += a->getAdditionString(); + } } graphics->setColor(Theme::getThemeColor(Theme::TEXT)); -- cgit v1.2.3-60-g2f50