diff options
| author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-04-02 19:34:44 -0700 | 
|---|---|---|
| committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-04-02 19:34:44 -0700 | 
| commit | ae4dcb2d1cade521f4cb116e3b7aa79475c38cc6 (patch) | |
| tree | 17bf709185cc2e1b052a5e54cb5f5324443cdd8b /indra | |
| parent | 207db356c21246ca9eb1b255b71623b0a5a4d470 (diff) | |
created LLSocialList and LLSocialListItem and linked them up to the facebook tab.
Diffstat (limited to 'indra')
| -rwxr-xr-x | indra/newview/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | indra/newview/llpanelpeople.cpp | 5 | ||||
| -rw-r--r-- | indra/newview/llpanelpeople.h | 3 | ||||
| -rw-r--r-- | indra/newview/llsociallist.cpp | 130 | ||||
| -rw-r--r-- | indra/newview/llsociallist.h | 98 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_people.xml | 2 | 
6 files changed, 236 insertions, 4 deletions
| diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index dff2c04fbc..b303ff3d18 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -483,6 +483,7 @@ set(viewer_SOURCE_FILES      llsidetraypanelcontainer.cpp      llsky.cpp      llslurl.cpp +    llsociallist.cpp      llspatialpartition.cpp      llspeakers.cpp      llspeakingindicatormanager.cpp @@ -1050,6 +1051,7 @@ set(viewer_HEADER_FILES      llsidetraypanelcontainer.h      llsky.h      llslurl.h +    llsociallist.h      llspatialpartition.h      llspeakers.h      llspeakingindicatormanager.h diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 4b4dd27bf2..cbc5eba65f 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -63,6 +63,7 @@  #include "llviewermenu.h"			// for gMenuHolder  #include "llvoiceclient.h"  #include "llworld.h" +#include "llsociallist.h"  #include "llspeakers.h"  #include "llfloaterwebcontent.h" @@ -648,7 +649,7 @@ BOOL LLPanelPeople::postBuild()  	mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);  	LLPanel * social_tab = getChild<LLPanel>(FBCTEST_TAB_NAME); -	mFacebookFriends = social_tab->getChild<LLAvatarListSocial>("facebook_friends"); +	mFacebookFriends = social_tab->getChild<LLSocialList>("facebook_friends");  	setSortOrder(mRecentList,		(ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"),	false);  	setSortOrder(mAllFriendList,	(ESortOrder)gSavedSettings.getU32("FriendsSortOrder"),		false); @@ -1670,7 +1671,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)  		std::string name = (*i)["name"].asString();  		LLUUID agent_id = (*i).has("agent_id") ? (*i)["agent_id"].asUUID() : LLUUID(NULL); -		mFacebookFriends->addSocialItem(agent_id, name, false); +		mFacebookFriends->addNewItem(agent_id, name, false);  	}  } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 914899ca6d..d61eb80f57 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -38,6 +38,7 @@ class LLAvatarListSocial;  class LLAvatarName;  class LLFilterEditor;  class LLGroupList; +class LLSocialList;  class LLMenuButton;  class LLTabContainer; @@ -158,7 +159,7 @@ private:  	LLAvatarList*			mNearbyList;  	LLAvatarList*			mRecentList;  	LLGroupList*			mGroupList; -	LLAvatarListSocial*		mFacebookFriends; +	LLSocialList*			mFacebookFriends;  	LLNetMap*				mMiniMap;  	LLHandle<LLView>		mGroupPlusMenuHandle; diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp new file mode 100644 index 0000000000..3d1d256149 --- /dev/null +++ b/indra/newview/llsociallist.cpp @@ -0,0 +1,130 @@ +sDestroyImmediate +/**  +* @file llsociallist.cpp +* @brief Implementation of llsociallist +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA +* $/LicenseInfo$ +*/ + + +#include "llviewerprecompiledheaders.h" + +#include "llsociallist.h" + +#include "llavatariconctrl.h" +#include "lloutputmonitorctrl.h" +#include "lltextutil.h" +     +static LLDefaultChildRegistry::Register<LLSocialList> r("social_list"); + +LLSocialList::LLSocialList(const Params&p) : LLFlatListViewEx(p) +{ + +} + +LLSocialList::~LLSocialList() +{ + +} + +void LLSocialList::draw() +{ +	LLFlatListView::draw(); +} + +void LLSocialList::refresh() +{ + +} + +void LLSocialList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) +{ +	LLSocialListItem * item = new LLSocialListItem(); +	item->setName(name, mNameFilter); +	addItem(item, id, pos); +} + +LLSocialListItem::LLSocialListItem() +{ +	buildFromFile("panel_avatar_list_item.xml"); +} + +LLSocialListItem::~LLSocialListItem() +{ + +} + +BOOL LLSocialListItem::postBuild() +{ +	mIcon = getChild<LLAvatarIconCtrl>("avatar_icon"); +	mLabelTextBox = getChild<LLTextBox>("avatar_name"); + +	mLastInteractionTime = getChild<LLTextBox>("last_interaction"); +	mIconPermissionOnline = getChild<LLIconCtrl>("permission_online_icon"); +	mIconPermissionMap = getChild<LLIconCtrl>("permission_map_icon"); +	mIconPermissionEditMine = getChild<LLIconCtrl>("permission_edit_mine_icon"); +	mIconPermissionEditTheirs = getChild<LLIconCtrl>("permission_edit_theirs_icon"); +	mSpeakingIndicator = getChild<LLOutputMonitorCtrl>("speaking_indicator"); +	mInfoBtn = getChild<LLButton>("info_btn"); +	mProfileBtn = getChild<LLButton>("profile_btn"); + +	mLastInteractionTime->setVisible(false); +	mIconPermissionOnline->setVisible(false); +	mIconPermissionMap->setVisible(false); +	mIconPermissionEditMine->setVisible(false); +	mIconPermissionEditTheirs->setVisible(false); +	mSpeakingIndicator->setVisible(false); +	mInfoBtn->setVisible(false); +	mProfileBtn->setVisible(false); + +	return TRUE; +} + +void LLSocialListItem::setName(const std::string& name, const std::string& highlight) +{ +	mLabel = name; +	LLTextUtil::textboxSetHighlightedVal(mLabelTextBox, mLabelTextBoxStyle, name, highlight); +} + +void LLSocialListItem::setValue(const LLSD& value) +{ +	getChildView("selected_icon")->setVisible( value["selected"]); +} + +void LLSocialListItem::onMouseEnter(S32 x, S32 y, MASK mask) +{ +	getChildView("hovered_icon")->setVisible( true); +	mInfoBtn->setVisible(true); +	mProfileBtn->setVisible(true); + +	LLPanel::onMouseEnter(x, y, mask); +} + +void LLSocialListItem::onMouseLeave(S32 x, S32 y, MASK mask) +{ +	getChildView("hovered_icon")->setVisible( false); +	mInfoBtn->setVisible(false); +	mProfileBtn->setVisible(false); + +	LLPanel::onMouseLeave(x, y, mask); +} diff --git a/indra/newview/llsociallist.h b/indra/newview/llsociallist.h new file mode 100644 index 0000000000..884d6ebd7e --- /dev/null +++ b/indra/newview/llsociallist.h @@ -0,0 +1,98 @@ +/**  +* @file   llsociallist.h +* @brief  Header file for llsociallist +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLSOCIALLIST_H +#define LL_LLSOCIALLIST_H + +#include "llflatlistview.h" +#include "llstyle.h" + + +/** + * Generic list of avatars. + *  + * Updates itself when it's dirty, using optional name filter. + * To initiate update, modify the UUID list and call setDirty(). + *  + * @see getIDs() + * @see setDirty() + * @see setNameFilter() + */ + +class LLAvatarIconCtrl; +class LLIconCtrl; +class LLOutputMonitorCtrl; + +class LLSocialList : public LLFlatListViewEx +{ +public: + +	struct Params : public LLInitParam::Block<Params, LLFlatListViewEx::Params> +	{ +	}; + +	LLSocialList(const Params&p); +	virtual	~LLSocialList(); + +	virtual void draw(); +	void refresh(); +	void addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM); + + + +	std::string mNameFilter; +}; + +class LLSocialListItem : public LLPanel +{ +	public: +	LLSocialListItem(); +	~LLSocialListItem(); + +	BOOL postBuild(); +	void setName(const std::string& name, const std::string& highlight = LLStringUtil::null); +	void setValue(const LLSD& value); +	void onMouseEnter(S32 x, S32 y, MASK mask); +	void onMouseLeave(S32 x, S32 y, MASK mask); + +	LLTextBox * mLabelTextBox; +	std::string mLabel; +	LLStyle::Params mLabelTextBoxStyle; + + +	LLAvatarIconCtrl * mIcon; +	LLTextBox * mLastInteractionTime; +	LLIconCtrl * mIconPermissionOnline; +	LLIconCtrl * mIconPermissionMap; +	LLIconCtrl * mIconPermissionEditMine; +	LLIconCtrl * mIconPermissionEditTheirs; +	LLOutputMonitorCtrl * mSpeakingIndicator; +	LLButton * mInfoBtn; +	LLButton * mProfileBtn; +};	 + + +#endif // LL_LLSOCIALLIST_H diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index f3334fd767..81946ff7f9 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -602,7 +602,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M               min_height="150"               name="tab_facebook"               title="Facebook Friends"> -              <avatar_list_social +              <social_list                 allow_select="true"                 follows="all"                 height="172" | 
