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.
This commit is contained in:
Lirusaito
2012-08-08 15:51:26 -04:00
parent 5ce8770dc3
commit efe3dd77fa
5 changed files with 80 additions and 7 deletions

View File

@@ -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<LLUUID> 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)
{

View File

@@ -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);

View File

@@ -70,7 +70,6 @@
<ScrollHighlightedColor value="183, 184, 188, 128"/> <!-- Hover color -->
<ScrollbarThumbColor value="100, 100, 100, 255"/>
<ScrollbarTrackColor value="153, 154, 158, 255"/>
<DefaultListText value="255, 255, 255, 255"/> <!-- We are replacing all the hardcoded black text with this color so we can make skins with white text on dark background -->
<!-- MENUS -->
<MenuBarBgColor value="62, 62, 62, 255"/>

View File

@@ -60,7 +60,7 @@
<button
name="im_btn"
label="IM"
tool_tip="Open Instant Message session"
tool_tip="Open Instant Message session (Shift-Enter)"
left="10"
bottom_delta="-22"
width="80"
@@ -267,6 +267,18 @@
font="SansSerifSmall"
follows="bottom|left"
/>
<!-- Lowest row -->
<button
name="estate_ban_btn"
label="Eject And Ban From Estate"
tool_tip="Eject and Ban this avatar from the estate"
left="10"
bottom_delta="-24"
width="260"
height="20"
font="SansSerifSmall"
follows="bottom|left"
/>
</panel>
<panel border="true" bottom_delta="-150" follows="left|top|right|bottom" height="255"

View File

@@ -3545,6 +3545,18 @@ Kick [EVIL_USER] from this estate?
yestext="OK"/>
</notification>
<notification
icon="alert.tga"
label="Confirm Kick and Ban"
name="EstateBanUser"
type="alert">
Kick and Ban [EVIL_USER] from this estate?
<usetemplate
name="okcancelbuttons"
notext="Cancel"
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"
name="EstateChangeCovenant"