Friends menu now how global visibility toggle

master
Arrehn 2010-12-15 14:27:02 -05:00
parent 835dc44c3d
commit 2f0d43ea17
7 changed files with 97 additions and 5 deletions

View File

@ -23,3 +23,4 @@ MapTeleportAbove255m LGPL
NonBusyAutoresponse LGPL
V1_Clienttags LGPL
AlwaysShowFriendPerms LGPL
GlobalFriendVisToggle LGPL

View File

@ -1,6 +1,17 @@
<?xml version="1.0" ?>
<llsd>
<map>
<key>GlobalOnlineStatusToggle</key>
<map>
<key>Comment</key>
<string>Saves the state of global online status permission for friends</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>RenderVolumeSAThreshold</key>
<map>
<key>Comment</key>

View File

@ -33,6 +33,17 @@
<key>Value</key>
<string>The Resident you messaged is in &apos;unavailable mode&apos; which means they have requested not to be disturbed. Your message will still be shown in their IM panel for later viewing.</string>
</map>
<key>GlobalOnlineStatusToggle</key>
<map>
<key>Comment</key>
<string>Saves the state of global online status permission for friends</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>InstantMessageLogPath</key>
<map>
<key>Comment</key>

View File

@ -160,7 +160,7 @@ void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask)
mHovered = true;
LLPanel::onMouseEnter(x, y, mask);
showPermissions(mShowPermissions);
showPermissions(true);
updateChildren();
}
@ -186,7 +186,8 @@ void LLAvatarListItem::changed(U32 mask)
if ((mask & LLFriendObserver::POWERS) || (mask & LLFriendObserver::PERMS))
{
//showPermissions(mShowPermissions && mHovered); AO- Keep icons around persistently.
showPermissions(mShowPermissions);
llinfos << "Permissions changed, updating Children." << llendl;
showPermissions(true);
updateChildren();
}
}
@ -643,15 +644,23 @@ bool LLAvatarListItem::showPermissions(bool visible)
if (!relation->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS))
mIconPermissionOnline->setColor(LLUIColorTable::instance().getColor("Transparent"));
else
mIconPermissionOnline->setColor(LLUIColorTable::instance().getColor("White"));
if (!relation->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION))
mIconPermissionMap->setColor(LLUIColorTable::instance().getColor("Transparent"));
else
mIconPermissionMap->setColor(LLUIColorTable::instance().getColor("White"));
if (!relation->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS))
mIconPermissionEditMine->setColor(LLUIColorTable::instance().getColor("Transparent"));
else
mIconPermissionEditMine->setColor(LLUIColorTable::instance().getColor("White"));
if (!relation->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS))
mIconPermissionEditTheirs->setColor(LLUIColorTable::instance().getColor("Transparent"));
else
mIconPermissionEditTheirs->setColor(LLUIColorTable::instance().getColor("White"));
}
else

View File

@ -39,6 +39,7 @@
#include "llpanelpeople.h"
// newview
#include "llavatarpropertiesprocessor.h"
#include "llaccordionctrl.h"
#include "llaccordionctrltab.h"
#include "llagent.h"
@ -568,6 +569,7 @@ BOOL LLPanelPeople::postBuild()
LLPanel* friends_panel = getChild<LLPanel>(FRIENDS_TAB_NAME);
friends_panel->childSetAction("add_btn", boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked, this));
friends_panel->childSetAction("del_btn", boost::bind(&LLPanelPeople::onDeleteFriendButtonClicked, this));
friends_panel->childSetAction("GlobalOnlineStatusToggle", boost::bind(&LLPanelPeople::onGlobalVisToggleButtonClicked, this));
mOnlineFriendList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1));
mAllFriendList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1));
@ -1119,6 +1121,47 @@ void LLPanelPeople::onAddFriendWizButtonClicked()
}
}
void LLPanelPeople::onGlobalVisToggleButtonClicked()
// Iterate through friends lists, toggling status permission on or off
{
llinfos << "TOGGLE GLOBAL FRIEND VIS" << llendl;
bool vis = getChild<LLUICtrl>("GlobalOnlineStatusToggle")->getValue().asBoolean();
gSavedSettings.setBOOL("GlobalOnlineStatusToggle", vis);
const LLAvatarTracker& av_tracker = LLAvatarTracker::instance();
LLAvatarTracker::buddy_map_t all_buddies;
av_tracker.copyBuddyList(all_buddies);
LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin();
for (; buddy_it != all_buddies.end(); ++buddy_it)
{
LLUUID buddy_id = buddy_it->first;
const LLRelationship* relation = LLAvatarTracker::instance().getBuddyInfo(buddy_id);
if (relation == NULL)
{
// Lets have a warning log message instead of having a crash. EXT-4947.
llwarns << "Trying to modify rights for non-friend avatar. Skipped." << llendl;
return;
}
S32 cur_rights = relation->getRightsGrantedTo();
S32 new_rights = 0;
if (vis)
new_rights = LLRelationship::GRANT_ONLINE_STATUS + (cur_rights & LLRelationship::GRANT_MAP_LOCATION) + (cur_rights & LLRelationship::GRANT_MODIFY_OBJECTS);
else
new_rights = (cur_rights & LLRelationship::GRANT_MAP_LOCATION) + (cur_rights & LLRelationship::GRANT_MODIFY_OBJECTS);
llinfos << "TOGGLING " << buddy_id << " " << vis << llendl;
LLAvatarPropertiesProcessor::getInstance()->sendFriendRights(buddy_id,new_rights);
}
mAllFriendList->showPermissions(true);
mOnlineFriendList->showPermissions(true);
updateFriendList();
//LLAvatarListItem::changed(LLFriendObserver::POWERS);
}
void LLPanelPeople::onDeleteFriendButtonClicked()
{
uuid_vec_t selected_uuids;

View File

@ -95,6 +95,7 @@ private:
void onViewProfileButtonClicked();
void onAddFriendButtonClicked();
void onAddFriendWizButtonClicked();
void onGlobalVisToggleButtonClicked();
void onDeleteFriendButtonClicked();
void onGroupInfoButtonClicked();
void onChatButtonClicked();

View File

@ -267,7 +267,7 @@ Looking for people to hang out with? Use the search box to find topics or conten
height="25"
layout="topleft"
name="add_btn_panel"
width="32">
width="64">
<button
follows="bottom|left"
height="25"
@ -281,6 +281,22 @@ Looking for people to hang out with? Use the search box to find topics or conten
tool_tip="Offer friendship to a Resident"
top="0"
width="31" />
<button
follows="bottom|left"
height="25"
image_hover_unselected="Toolbar_Middle_Over"
image_overlay="Permission_Visible_Online"
image_pressed="PushButton_Press"
image_pressed_selected="PushButton_Selected_Press"
image_selected="PushButton_Selected_Press"
control_name="GlobalOnlineStatusToggle"
is_toggle="true"
layout="topleft"
left_pad="1"
name="GlobalOnlineStatusToggle"
tool_tip="Toggle Global Visibility"
width="31" />
</layout_panel>
<layout_panel
auto_resize="true"
@ -353,7 +369,7 @@ Looking for people to hang out with? Use the search box to find topics or conten
left_pad="1"
name="dummy_icon"
width="209"
/>
/>
<button
follows="bottom|left"
height="25"