From efe3dd77fa3b2c36c98f41a818c69718ef5aa27e Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Wed, 8 Aug 2012 15:51:26 -0400 Subject: [PATCH] Address Issue 91: Estate ban button added to radar Shift-Enter in radar now starts an IM with people selected. Also, it seems Dark used black for texts and should... so... let's reverse that change. --- indra/newview/llfloateravatarlist.cpp | 58 +++++++++++++++++-- indra/newview/llfloateravatarlist.h | 2 + indra/newview/skins/dark/colors.xml | 1 - .../skins/default/xui/en-us/floater_radar.xml | 14 ++++- .../skins/default/xui/en-us/notifications.xml | 12 ++++ 5 files changed, 80 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 801633eaf..c038db2a0 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -319,11 +319,6 @@ BOOL LLFloaterAvatarList::postBuild() mTracking = FALSE; mUpdate = TRUE; - // Hide them until some other way is found - // Users may not expect to find a Ban feature on the Eject button - // Perhaps turn it into a FlyOutButton? - childSetVisible("estate_ban_btn", false); - // Set callbacks childSetAction("profile_btn", onClickProfile, this); childSetAction("im_btn", onClickIM, this); @@ -344,6 +339,7 @@ BOOL LLFloaterAvatarList::postBuild() childSetAction("ar_btn", onClickAR, this); childSetAction("teleport_btn", onClickTeleport, this); childSetAction("estate_eject_btn", onClickEjectFromEstate, this); + childSetAction("estate_ban_btn", onClickBanFromEstate, this); childSetAction("send_keys_btn", onClickSendKeys, this); @@ -1111,6 +1107,36 @@ BOOL LLFloaterAvatarList::handleKeyHere(KEY key, MASK mask) return TRUE; } } + + if (( KEY_RETURN == key ) && (MASK_SHIFT == mask)) + { + LLDynamicArray ids = self->mAvatarList->getSelectedIDs(); + if (ids.size() > 0) + { + if (ids.size() == 1) + { + // Single avatar + LLUUID agent_id = ids[0]; + + // [Ansariel: Display name support] + LLAvatarName avatar_name; + if (LLAvatarNameCache::get(agent_id, &avatar_name)) + { + gIMMgr->setFloaterOpen(TRUE); + gIMMgr->addSession(LLCacheName::cleanFullName(avatar_name.getLegacyName()),IM_NOTHING_SPECIAL,agent_id); + } + // [Ansariel: Display name support] + } + else + { + // Group IM + LLUUID session_id; + session_id.generate(); + gIMMgr->setFloaterOpen(TRUE); + gIMMgr->addSession("Avatars Conference", IM_SESSION_CONFERENCE_START, ids[0], ids); + } + } + } return LLPanel::handleKeyHere(key, mask); } @@ -1499,6 +1525,7 @@ static void cmd_eject(const LLUUID& avatar, const std::string& name) { sen static void cmd_ban(const LLUUID& avatar, const std::string& name) { send_eject(avatar, true); } static void cmd_profile(const LLUUID& avatar, const std::string& name) { LLFloaterAvatarInfo::showFromDirectory(avatar); } static void cmd_estate_eject(const LLUUID& avatar, const std::string& name){ send_estate_message("teleporthomeuser", avatar); } +static void cmd_estate_ban(const LLUUID &avatar, const std::string &name) { LLPanelEstateInfo::sendEstateAccessDelta(ESTATE_ACCESS_BANNED_AGENT_ADD | ESTATE_ACCESS_ALLOWED_AGENT_REMOVE | ESTATE_ACCESS_NO_REPLY, avatar); } void LLFloaterAvatarList::doCommand(void (*func)(const LLUUID& avatar, const std::string& name)) { @@ -1594,6 +1621,18 @@ void LLFloaterAvatarList::callbackEjectFromEstate(const LLSD& notification, cons } } +//static +void LLFloaterAvatarList::callbackBanFromEstate(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + + if (option == 0) + { + getInstance()->doCommand(cmd_estate_eject); //Eject first, just in case. + getInstance()->doCommand(cmd_estate_ban); + } +} + //static void LLFloaterAvatarList::callbackIdle(void* userdata) { @@ -1663,6 +1702,15 @@ void LLFloaterAvatarList::onClickEjectFromEstate(void* userdata) LLNotificationsUtil::add("EstateKickUser", args, payload, callbackEjectFromEstate); } +//static +void LLFloaterAvatarList::onClickBanFromEstate(void* userdata) +{ + LLSD args; + LLSD payload; + args["EVIL_USER"] = ((LLFloaterAvatarList*)userdata)->getSelectedNames(); + LLNotificationsUtil::add("EstateBanUser", args, payload, callbackBanFromEstate); +} + //static void LLFloaterAvatarList::onClickAR(void* userdata) { diff --git a/indra/newview/llfloateravatarlist.h b/indra/newview/llfloateravatarlist.h index 6051a8b88..46bdd1a0f 100644 --- a/indra/newview/llfloateravatarlist.h +++ b/indra/newview/llfloateravatarlist.h @@ -282,11 +282,13 @@ private: static void onClickAR(void *userdata); static void onClickTeleport(void *userdata); static void onClickEjectFromEstate(void *userdata); + static void onClickBanFromEstate(void *userdata); static void callbackFreeze(const LLSD& notification, const LLSD& response); static void callbackEject(const LLSD& notification, const LLSD& response); static void callbackAR(void *userdata); static void callbackEjectFromEstate(const LLSD& notification, const LLSD& response); + static void callbackBanFromEstate(const LLSD& notification, const LLSD& response); static void onSelectName(LLUICtrl*, void *userdata); diff --git a/indra/newview/skins/dark/colors.xml b/indra/newview/skins/dark/colors.xml index 2766ba09b..032351a88 100644 --- a/indra/newview/skins/dark/colors.xml +++ b/indra/newview/skins/dark/colors.xml @@ -70,7 +70,6 @@ - diff --git a/indra/newview/skins/default/xui/en-us/floater_radar.xml b/indra/newview/skins/default/xui/en-us/floater_radar.xml index 75fe1898f..b3b32412e 100644 --- a/indra/newview/skins/default/xui/en-us/floater_radar.xml +++ b/indra/newview/skins/default/xui/en-us/floater_radar.xml @@ -60,7 +60,7 @@