Ease of use for contact sets, add multiple non-friends to group quicky

Sat, 24 Mar 2012 05:14:24 -0500

author
LordGregGreg
date
Sat, 24 Mar 2012 05:14:24 -0500
changeset 1692
6404f370792c
parent 1691
feed62e38a1a
child 1693
d13ecd8bc0cf

Ease of use for contact sets, add multiple non-friends to group quicky
Avatar Selecter allows multiple people
if group is selected, auto adds new people to that group.

indra/newview/lggcontactsetsfloater.cpp file | annotate | diff | revisions
indra/newview/skins/default/xui/en-us/floater_avatar_picker.xml file | annotate | diff | revisions
     1.1 --- a/indra/newview/lggcontactsetsfloater.cpp	Mon Mar 19 10:52:06 2012 -0700
     1.2 +++ b/indra/newview/lggcontactsetsfloater.cpp	Sat Mar 24 05:14:24 2012 -0500
     1.3 @@ -217,11 +217,25 @@
     1.4  }
     1.5  void lggContactSetsFloater::onPickAvatar(const std::vector<std::string>& names,
     1.6  								  const std::vector<LLUUID>& ids,
     1.7 -								  void* )
     1.8 +								  void* userData)
     1.9  {
    1.10  	if (names.empty()) return;
    1.11  	if (ids.empty()) return;
    1.12 -	LGGContactSets::getInstance()->addNonFriendToList(ids[0]);
    1.13 +	std::string group("");
    1.14 +	if(userData!=NULL)
    1.15 +	{
    1.16 +		std::string *sp = static_cast<std::string*>(userData);
    1.17 +		group=*sp;
    1.18 +		delete sp;
    1.19 +	}
    1.20 +	for(int i =0;i<ids.size();i++)
    1.21 +	{
    1.22 +		LGGContactSets::getInstance()->addNonFriendToList(ids[i]);
    1.23 +		if(group!="")
    1.24 +		{
    1.25 +			LGGContactSets::getInstance()->addFriendToGroup(ids[i],group);
    1.26 +		}
    1.27 +	}
    1.28  	sInstance->updateGroupsList();
    1.29  	LLFirstUse::usePhoenixFriendsNonFriend();
    1.30  }
    1.31 @@ -878,6 +892,15 @@
    1.32  	top-=heightPer;
    1.33  	top-=heightPer;
    1.34  	remBackGround.setLeftTopAndSize(contextRect.mLeft,top,width,heightPer);
    1.35 +	std::string addTitle("Add New Avatar");
    1.36 +	std::string groupToSend("");
    1.37 +	if(drawRemove)
    1.38 +	{
    1.39 +		addTitle=std::string("Add New Avatar to: "+currentGroup);
    1.40 +		groupToSend=currentGroup;
    1.41 +		gGL.color4fv(LGGContactSets::getInstance()->getGroupColor(currentGroup).mV);
    1.42 +		gl_rect_2d(remBackGround);
    1.43 +	}
    1.44  	if(remBackGround.pointInRect(mouse_x,mouse_y))
    1.45  	{
    1.46  		//draw hover effect
    1.47 @@ -886,13 +909,14 @@
    1.48  		if(justClicked)
    1.49  		{
    1.50  			//add new av
    1.51 -			LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(onPickAvatar, NULL, FALSE, TRUE);
    1.52 +			void *groupSend = static_cast<void*>(new std::string(groupToSend));
    1.53 +			LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(onPickAvatar, groupSend, TRUE, TRUE);
    1.54  			sInstance->addDependentFloater(picker);
    1.55  			
    1.56  		}
    1.57  	}
    1.58  	LLFontGL::getFontSansSerif()->renderUTF8(
    1.59 -		"Add New Avatar"
    1.60 +		addTitle
    1.61  		, 0,
    1.62  		contextRect.mLeft,
    1.63  		top-(heightPer/2)-2,
     2.1 --- a/indra/newview/skins/default/xui/en-us/floater_avatar_picker.xml	Mon Mar 19 10:52:06 2012 -0700
     2.2 +++ b/indra/newview/skins/default/xui/en-us/floater_avatar_picker.xml	Sat Mar 24 05:14:24 2012 -0500
     2.3 @@ -58,7 +58,7 @@
     2.4             font="SansSerif" mouse_opaque="true" name="Refresh" scale_image="TRUE" />
     2.5        <slider bottom_delta="-20" left="10" follows="left|top" width="175" height="15"
     2.6             name="near_me_range" label="Range" control_name="NearMeRange" 
     2.7 -           min_val="5" max_val="40" increment="1" initial_val="20" decimal_digits="0" />
     2.8 +           min_val="5" max_val="4096" increment="1" initial_val="20" decimal_digits="0" />
     2.9        <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
    2.10             bottom_delta="0" left="185" drop_shadow_visible="true" follows="left|top"
    2.11             font="SansSerifSmall" h_pad="0" halign="left" height="15"

mercurial