From 39905b927d60e204438705728d2c214cb3f9ef81 Mon Sep 17 00:00:00 2001
From: Steven Bennetts <steve@lindenlab.com>
Date: Thu, 2 Jul 2009 00:38:13 +0000
Subject: [PATCH] merge
 https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@873
 https://svn.aws.productengine.com/secondlife/pe/stable@888 ->
 viewer-2.0.0-pe-4

---
 indra/llui/llpanel.cpp                        |   4 +-
 indra/llui/llpanel.h                          |   5 +-
 indra/llui/lluictrl.cpp                       |  18 +
 indra/llui/lluictrl.h                         |  11 +
 indra/newview/llagent.cpp                     |  12 +-
 indra/newview/llavatarlist.cpp                |  10 +-
 indra/newview/llavatarlist.h                  |   3 +-
 indra/newview/llavatarpropertiesprocessor.cpp |   1 +
 indra/newview/llbottomtray.cpp                | 208 +++++++--
 indra/newview/llbottomtray.h                  |  39 +-
 indra/newview/llchatbar.cpp                   |   9 +-
 indra/newview/llchiclet.cpp                   | 248 +++++++---
 indra/newview/llchiclet.h                     |  18 +-
 indra/newview/llgesturemgr.cpp                |   3 +-
 indra/newview/llgrouplist.cpp                 |  20 +-
 indra/newview/llgrouplist.h                   |   2 +-
 indra/newview/llmenucommands.cpp              |   4 +-
 indra/newview/llpanelavatar.cpp               | 139 ++++--
 indra/newview/llpanelavatar.h                 |  15 +-
 indra/newview/llpanellandmarks.cpp            |  27 +-
 indra/newview/llpanellandmarks.h              |   1 +
 indra/newview/llpanelpeople.cpp               | 207 +++++---
 indra/newview/llpanelpeople.h                 |  17 +-
 indra/newview/llpanelpick.cpp                 | 188 +++++---
 indra/newview/llpanelpick.h                   |  28 +-
 indra/newview/llpanelpicks.cpp                | 352 ++++++++------
 indra/newview/llpanelpicks.h                  |  44 +-
 indra/newview/llpanelplaceinfo.cpp            |  54 ++-
 indra/newview/llpanelplaceinfo.h              |  11 +-
 indra/newview/llpanelplaces.cpp               |  11 +-
 indra/newview/llpanelplacestab.cpp            |  21 -
 indra/newview/llpanelplacestab.h              |   6 +-
 indra/newview/llpanelprofileview.cpp          |   6 +-
 indra/newview/llpanelteleporthistory.cpp      |  40 +-
 indra/newview/llpanelteleporthistory.h        |   3 +-
 indra/newview/llsidetray.cpp                  |   4 +-
 indra/newview/lltoolgrab.cpp                  |   1 -
 indra/newview/lltoolpie.cpp                   |   1 +
 indra/newview/llviewergesture.cpp             |   4 +-
 indra/newview/llviewerwindow.cpp              |  47 +-
 .../default/textures/image_edit_icon.tga      | Bin 0 -> 3116 bytes
 .../skins/default/xui/en/accordion_parent.xml |   2 +-
 .../skins/default/xui/en/menu_picks.xml       |  46 ++
 .../default/xui/en/panel_avatar_list_item.xml |   6 +-
 .../skins/default/xui/en/panel_bottomtray.xml |  17 +-
 .../skins/default/xui/en/panel_edit_pick.xml  |  31 +-
 .../default/xui/en/panel_edit_profile.xml     |  20 +-
 .../default/xui/en/panel_landmark_info.xml    | 442 +++++++++---------
 .../skins/default/xui/en/panel_notes.xml      | 281 +++++------
 .../skins/default/xui/en/panel_people.xml     |  34 +-
 .../skins/default/xui/en/panel_pick_info.xml  |  34 +-
 .../default/xui/en/panel_pick_list_item.xml   |  62 +++
 .../skins/default/xui/en/panel_picks.xml      |  72 +--
 .../skins/default/xui/en/panel_places.xml     |   6 +-
 .../skins/default/xui/en/panel_profile.xml    | 249 +++++-----
 .../default/xui/en/panel_profile_view.xml     |  50 +-
 .../skins/default/xui/en/panel_side_tray.xml  |   2 +-
 .../default/xui/en/panel_teleport_history.xml |   2 +-
 .../default/xui/en/widgets/side_tray.xml      |  16 +-
 59 files changed, 2037 insertions(+), 1177 deletions(-)
 create mode 100644 indra/newview/skins/default/textures/image_edit_icon.tga
 create mode 100644 indra/newview/skins/default/xui/en/menu_picks.xml
 create mode 100644 indra/newview/skins/default/xui/en/panel_pick_list_item.xml

diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 0136a41d616..3a76e728683 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -869,12 +869,12 @@ void LLPanel::childSetAction(const std::string& id, boost::function<void(void*)>
 	}
 }
 
-void LLPanel::childSetActionTextbox(const std::string& id, void(*function)(void*), void* value)
+void LLPanel::childSetActionTextbox(const std::string& id, boost::function<void(void*)> function, void* value)
 {
 	LLTextBox* textbox = findChild<LLTextBox>(id);
 	if (textbox)
 	{
-		textbox->setClickedCallback(function, value);
+		textbox->setClickedCallback(boost::bind(function, value));
 	}
 }
 
diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h
index fc40cd77eb0..c38e9df53b9 100644
--- a/indra/llui/llpanel.h
+++ b/indra/llui/llpanel.h
@@ -235,7 +235,10 @@ class LLPanel : public LLUICtrl
 
 	// LLButton
 	void childSetAction(const std::string& id, boost::function<void(void*)> function, void* value = NULL);
-	void childSetActionTextbox(const std::string& id, void(*function)(void*), void* value = NULL);
+
+	// LLTextBox
+	void childSetActionTextbox(const std::string& id, boost::function<void(void*)> function, void* value = NULL);
+
 	void childSetControlName(const std::string& id, const std::string& control_name);
 
 	// Error reporting
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index 7b378fd9c7f..0fbcf24c490 100644
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -48,6 +48,8 @@ LLUICtrl::Params::Params()
 	commit_callback("commit_callback"),
 	validate_callback("validate_callback"),
 	rightclick_callback("rightclick_callback"),
+	mouseenter_callback("mouseenter_callback"),
+	mouseleave_callback("mouseleave_callback"),
 	control_name("control_name")
 {
 	addSynonym(initial_value, "initial_val");
@@ -200,6 +202,11 @@ void LLUICtrl::initFromParams(const Params& p)
 	if(p.rightclick_callback.isProvided())
 		initCommitCallback(p.rightclick_callback, mRightClickSignal);
 
+	if(p.mouseenter_callback.isProvided())
+		initCommitCallback(p.mouseenter_callback, mMouseEnterSignal);
+
+	if(p.mouseleave_callback.isProvided())
+		initCommitCallback(p.mouseleave_callback, mMouseLeaveSignal);
 }
 
 
@@ -264,6 +271,17 @@ void LLUICtrl::initEnableCallback(const EnableCallbackParam& cb, enable_signal_t
 	}
 }
 
+// virtual
+void LLUICtrl::onMouseEnter(S32 x, S32 y, MASK mask)
+{
+	mMouseEnterSignal(this, getValue());
+}
+
+// virtual
+void LLUICtrl::onMouseLeave(S32 x, S32 y, MASK mask)
+{
+	mMouseLeaveSignal(this, getValue());
+}
 
 void LLUICtrl::onCommit()
 {
diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h
index 6dfbd9cf8be..2b9caa2a82f 100644
--- a/indra/llui/lluictrl.h
+++ b/indra/llui/lluictrl.h
@@ -145,6 +145,9 @@ class LLUICtrl
 		Optional<EnableCallbackParam>	validate_callback;
 		
 		Optional<CommitCallbackParam>	rightclick_callback;
+
+		Optional<CommitCallbackParam>	mouseenter_callback;
+		Optional<CommitCallbackParam>	mouseleave_callback;
 		
 		Optional<focus_callback_t>		focus_lost_callback;
 		
@@ -181,6 +184,8 @@ class LLUICtrl
 	/*virtual*/ BOOL	isCtrl() const;
 	/*virtual*/ void	setTentative(BOOL b);
 	/*virtual*/ BOOL	getTentative() const;
+	/*virtual*/ void	onMouseEnter(S32 x, S32 y, MASK mask);
+	/*virtual*/ void	onMouseLeave(S32 x, S32 y, MASK mask);
 
 	// From LLFocusableElement
 	/*virtual*/ void	setFocus( BOOL b );
@@ -246,6 +251,9 @@ class LLUICtrl
 
 	boost::signals2::connection setCommitCallback( const commit_signal_t::slot_type& cb ) { return mCommitSignal.connect(cb); }
 	boost::signals2::connection setValidateCallback( const enable_signal_t::slot_type& cb ) { return mValidateSignal.connect(cb); }
+
+	boost::signals2::connection setMouseEnterCallback( const commit_signal_t::slot_type& cb ) { return mMouseEnterSignal.connect(cb); }
+	boost::signals2::connection setMouseLeaveCallback( const commit_signal_t::slot_type& cb ) { return mMouseLeaveSignal.connect(cb); }
 	
 	// *TODO: Deprecate; for backwards compatability only:
 	boost::signals2::connection setCommitCallback( boost::function<void (LLUICtrl*,void*)> cb, void* data);	
@@ -275,6 +283,9 @@ class LLUICtrl
 	enable_signal_t		mValidateSignal;
 	commit_signal_t		mRightClickSignal;
 
+	commit_signal_t		mMouseEnterSignal;
+	commit_signal_t		mMouseLeaveSignal;
+
     LLViewModelPtr  mViewModel;
 
 	LLControlVariable* mControlVariable;
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index a8094a5850d..8a050539d7f 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -2724,7 +2724,8 @@ void LLAgent::startTyping()
 	{
 		sendAnimationRequest(ANIM_AGENT_TYPE, ANIM_REQUEST_START);
 	}
-	LLBottomTray::getInstance()->sendChatFromViewer("", CHAT_TYPE_START, FALSE);
+	if(gBottomTray)
+		gBottomTray->sendChatFromViewer("", CHAT_TYPE_START, FALSE);
 }
 
 //-----------------------------------------------------------------------------
@@ -2736,7 +2737,8 @@ void LLAgent::stopTyping()
 	{
 		clearRenderState(AGENT_STATE_TYPING);
 		sendAnimationRequest(ANIM_AGENT_TYPE, ANIM_REQUEST_STOP);
-		LLBottomTray::getInstance()->sendChatFromViewer("", CHAT_TYPE_STOP, FALSE);
+		if(gBottomTray)
+			gBottomTray->sendChatFromViewer("", CHAT_TYPE_STOP, FALSE);
 	}
 }
 
@@ -2811,7 +2813,8 @@ void LLAgent::endAnimationUpdateUI()
 		LLNavigationBar::getInstance()->setVisible(TRUE);
 		gStatusBar->setVisibleForMouselook(true);
 
-		LLBottomTray::getInstance()->setVisible(TRUE);
+		if(gBottomTray)
+			gBottomTray->setVisible(TRUE);
 
 		LLSideTray::getInstance()->setVisible(TRUE);
 
@@ -2901,7 +2904,8 @@ void LLAgent::endAnimationUpdateUI()
 		LLNavigationBar::getInstance()->setVisible(FALSE);
 		gStatusBar->setVisibleForMouselook(false);
 
-		LLBottomTray::getInstance()->setVisible(FALSE);
+		if(gBottomTray)
+			gBottomTray->setVisible(FALSE);
 
 		LLSideTray::getInstance()->setVisible(FALSE);
 
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 08f0cf88420..449bcc4f0b9 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -117,7 +117,13 @@ void LLAvatarList::addItem(const LLUUID& id, const std::string& name, BOOL is_bo
 	}
 }
 
-BOOL LLAvatarList::updateList(const std::vector<LLUUID>& all_buddies)
+static bool findInsensitive(std::string haystack, const std::string& needle_upper)
+{
+    LLStringUtil::toUpper(haystack);
+    return haystack.find(needle_upper) != std::string::npos;
+}
+
+BOOL LLAvatarList::update(const std::vector<LLUUID>& all_buddies, const std::string& name_filter)
 {
 	BOOL have_names = TRUE;
 	
@@ -133,6 +139,8 @@ BOOL LLAvatarList::updateList(const std::vector<LLUUID>& all_buddies)
 		std::string name;
 		const LLUUID& buddy_id = *buddy_it;
 		have_names &= gCacheName->getFullName(buddy_id, name);
+		if (name_filter != LLStringUtil::null && !findInsensitive(name, name_filter))
+			continue;
 		addItem(buddy_id, name, LLAvatarTracker::instance().isBuddyOnline(buddy_id));
 	}
 
diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h
index 9bd9ce8e0eb..9dba719feec 100644
--- a/indra/newview/llavatarlist.h
+++ b/indra/newview/llavatarlist.h
@@ -53,7 +53,8 @@ class LLAvatarList : public LLScrollListCtrl
 	LLAvatarList(const Params&);
 	virtual	~LLAvatarList() {}
 
-	BOOL updateList(const std::vector<LLUUID>& all_buddies);
+	BOOL update(const std::vector<LLUUID>& all_buddies,
+		const std::string& name_filter = LLStringUtil::null);
 
 protected:
 	std::vector<LLUUID> getSelectedIDs();
diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp
index e27da5663b0..5a92888cef3 100644
--- a/indra/newview/llavatarpropertiesprocessor.cpp
+++ b/indra/newview/llavatarpropertiesprocessor.cpp
@@ -102,6 +102,7 @@ void LLAvatarPropertiesProcessor::sendDataRequest(const LLUUID& avatar_id, EAvat
 		if (data) {
 			sendPickInfoRequest(avatar_id, *static_cast<const LLUUID*>(data));
 		}
+		break;
 	case APT_NOTES:
 		sendGenericRequest(avatar_id, "avatarnotesrequest");
 		break;
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 616cbb1fdb9..d26da81179c 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -38,53 +38,81 @@
 #include "llkeyboard.h"
 #include "llgesturemgr.h"
 #include "llanimationstates.h"
+#include "llmultigesture.h"
 
 //FIXME: temporary, for send_chat_from_viewer() proto
 #include "llchatbar.h"
 
+//
+// Globals
+//
+//FIXME: made it adjustable
+const F32 AGENT_TYPING_TIMEOUT = 5.f;	// seconds
+
+LLBottomTray* gBottomTray = NULL;
+
 LLBottomTray::LLBottomTray()
-	:mLastSpecialChatChannel(0)
+	: mLastSpecialChatChannel(0)
+	, mGestureLabelTimer()
 {
 	LLUICtrlFactory::getInstance()->buildPanel(this,"panel_bottomtray.xml");
 
 	mChicletPanel = getChild<LLChicletPanel>("chiclet_list",TRUE,FALSE);
+	mIMWell = getChild<LLNotificationChiclet>("im_well",TRUE,FALSE);
+	mSysWell = getChild<LLNotificationChiclet>("sys_well",TRUE,FALSE);
+	mSeparator = getChild<LLViewBorder>("well_separator",TRUE,FALSE);
+	mChatBox = getChild<LLLineEditor>("chat_box",TRUE,FALSE);
+
+	if (mChatBox)
+	{
+		mChatBox->setCommitCallback(boost::bind(&LLBottomTray::onChatBoxCommit, this));
+		mChatBox->setKeystrokeCallback(&onChatBoxKeystroke, this);
+		mChatBox->setFocusLostCallback(&onChatBoxFocusLost, this);
+
+		mChatBox->setIgnoreArrowKeys(TRUE);
+		mChatBox->setCommitOnFocusLost( FALSE );
+		mChatBox->setRevertOnEsc( FALSE );
+		mChatBox->setIgnoreTab(TRUE);
+		mChatBox->setPassDelete(TRUE);
+		mChatBox->setReplaceNewlinesWithSpaces(FALSE);
+		mChatBox->setMaxTextLength(1023);
+		mChatBox->setEnableLineHistory(TRUE);
+
+	}
+
+	mGestureCombo = getChild<LLComboBox>( "Gesture", TRUE, FALSE);
+	if (mGestureCombo)
+	{
+		mGestureCombo->setCommitCallback(boost::bind(&LLBottomTray::onCommitGesture, this, _1));
 
-	LLLineEditor* chat_box = getChatBox();
-	chat_box->setCommitCallback(boost::bind(&LLBottomTray::onChatBoxCommit, this));
-	chat_box->setKeystrokeCallback(&onChatBoxKeystroke, this);
-	chat_box->setFocusLostCallback(&onChatBoxFocusLost, this);
+		// now register us as observer since we have a place to put the results
+		gGestureManager.addObserver(this);
+
+		// refresh list from current active gestures
+		refreshGestures();
+	}
 
 	LLIMMgr::getInstance()->addSessionObserver(this);
 }
 
 LLBottomTray::~LLBottomTray()
 {
+	gGestureManager.removeObserver(this);
 	if (!LLSingleton<LLIMMgr>::destroyed())
 	{
 		LLIMMgr::getInstance()->removeSessionObserver(this);
 	}
 }
 
-LLLineEditor* LLBottomTray::getChatBox()
-{
-	return getChild<LLLineEditor>("chat_box",TRUE,FALSE);
-}
-
 void LLBottomTray::onChatBoxCommit()
 {
-	if (getChatBox()->getText().length() > 0)
+	if (mChatBox && mChatBox->getText().length() > 0)
 	{
 		sendChat(CHAT_TYPE_NORMAL);
-		
-		LLLineEditor* chat_box = getChatBox();
-
-		if (chat_box)
-		{
-			chat_box->setText(LLStringExplicit(""));			
-		}
-
-		gAgent.stopTyping();
+		mChatBox->setText(LLStringExplicit(""));
 	}
+
+	gAgent.stopTyping();
 }
 
 void LLBottomTray::sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate)
@@ -219,6 +247,105 @@ void LLBottomTray::onChatBoxFocusLost(LLFocusableElement* caller, void* userdata
 	gAgent.stopTyping();
 }
 
+void LLBottomTray::refresh()
+{
+	// HACK: Leave the name of the gesture in place for a few seconds.
+	const F32 SHOW_GESTURE_NAME_TIME = 2.f;
+	if (mGestureLabelTimer.getStarted() && mGestureLabelTimer.getElapsedTimeF32() > SHOW_GESTURE_NAME_TIME)
+	{
+		LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL;
+		if (gestures) gestures->selectFirstItem();
+		mGestureLabelTimer.stop();
+	}
+
+	if ((gAgent.getTypingTime() > AGENT_TYPING_TIMEOUT) && (gAgent.getRenderState() & AGENT_STATE_TYPING))
+	{
+		gAgent.stopTyping();
+	}
+}
+
+void LLBottomTray::onCommitGesture(LLUICtrl* ctrl)
+{
+	LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL;
+	if (gestures)
+	{
+		S32 index = gestures->getFirstSelectedIndex();
+		if (index == 0)
+		{
+			return;
+		}
+		const std::string& trigger = gestures->getSelectedValue().asString();
+
+		// pretend the user chatted the trigger string, to invoke
+		// substitution and logging.
+		std::string text(trigger);
+		std::string revised_text;
+		gGestureManager.triggerAndReviseString(text, &revised_text);
+
+		revised_text = utf8str_trim(revised_text);
+		if (!revised_text.empty())
+		{
+			// Don't play nodding animation
+			sendChatFromViewer(revised_text, CHAT_TYPE_NORMAL, FALSE);
+		}
+	}
+	mGestureLabelTimer.start();
+	if (mGestureCombo != NULL)
+	{
+		// free focus back to chat bar
+		mGestureCombo->setFocus(FALSE);
+	}
+}
+
+void LLBottomTray::refreshGestures()
+{
+	if (mGestureCombo)
+	{
+		
+		//store current selection so we can maintain it
+		std::string cur_gesture = mGestureCombo->getValue().asString();
+		mGestureCombo->selectFirstItem();
+		std::string label = mGestureCombo->getValue().asString();;
+		// clear
+		mGestureCombo->clearRows();
+		
+		// collect list of unique gestures
+		std::map <std::string, BOOL> unique;
+		LLGestureManager::item_map_t::iterator it;
+		for (it = gGestureManager.mActive.begin(); it != gGestureManager.mActive.end(); ++it)
+		{
+			LLMultiGesture* gesture = (*it).second;
+			if (gesture)
+			{
+				if (!gesture->mTrigger.empty())
+				{
+					unique[gesture->mTrigger] = TRUE;
+				}
+			}
+		}
+		
+		// add unique gestures
+		std::map <std::string, BOOL>::iterator it2;
+		for (it2 = unique.begin(); it2 != unique.end(); ++it2)
+		{
+			mGestureCombo->addSimpleElement((*it2).first);
+		}
+		
+		mGestureCombo->sortByName();
+		// Insert label after sorting, at top, with separator below it
+		mGestureCombo->addSeparator(ADD_TOP);		
+		mGestureCombo->addSimpleElement(getString("gesture_label"), ADD_TOP);
+		
+		if (!cur_gesture.empty())
+		{ 
+			mGestureCombo->selectByValue(LLSD(cur_gesture));
+		}
+		else
+		{
+			mGestureCombo->selectFirstItem();
+		}
+	}
+}
 
 //virtual
 void LLBottomTray::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
@@ -236,8 +363,6 @@ void LLBottomTray::sessionAdded(const LLUUID& session_id, const std::string& nam
 			LLIMChiclet* chicklet = (LLIMChiclet *)getChicletPanel()->createChiclet(&sid);
 			chicklet->setIMSessionName(name);
 			chicklet->setOtherParticipantId(other_participant_id);
-
-			getChicletPanel()->arrange();
 		}
 	}
 }
@@ -249,21 +374,48 @@ void LLBottomTray::sessionRemoved(const LLUUID& session_id)
 	{
 		LLSD sid(session_id);
 		getChicletPanel()->removeIMChiclet(&sid);
-		getChicletPanel()->arrange();
 	}
 }
 
-void LLBottomTray::sendChat( EChatType type )
+//virtual
+void LLBottomTray::onFocusLost()
+{
+	if (gAgent.cameraMouselook())
+	{
+		setVisible(FALSE);
+	}
+}
+
+//virtual
+void LLBottomTray::onVisibilityChange(BOOL curVisibilityIn)
 {
-	LLLineEditor* chat_box = getChatBox();
+	BOOL visibility = gAgent.cameraMouselook() ? false : true;
+
+	if (mChicletPanel && mChicletPanel->getVisible() == visibility)
+		return;
+
+	if (mChicletPanel)
+		mChicletPanel->setVisible(visibility);
+
+	if (mIMWell)
+		mIMWell->setVisible(visibility);
 
-	if (chat_box)
+	if (mSysWell)
+		mSysWell->setVisible(visibility);
+
+	if (mSeparator)
+		mSeparator->setVisible(visibility);
+}
+
+void LLBottomTray::sendChat( EChatType type )
+{
+	if (mChatBox)
 	{
-		LLWString text = chat_box->getConvertedText();
+		LLWString text = mChatBox->getConvertedText();
 		if (!text.empty())
 		{
 			// store sent line in history, duplicates will get filtered
-			chat_box->updateHistory();
+			mChatBox->updateHistory();
 			// Check if this is destined for another channel
 			S32 channel = 0;
 			stripChannelNumber(text, &channel);
diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h
index 780e1b270de..7d842a0aade 100644
--- a/indra/newview/llbottomtray.h
+++ b/indra/newview/llbottomtray.h
@@ -37,6 +37,7 @@
 #include "llflyoutbutton.h"
 #include "llimview.h"
 #include "llchat.h"
+#include "llgesturemgr.h"
 
 class LLChicletPanel;
 class LLNotificationChiclet;
@@ -44,22 +45,19 @@ class LLNotificationChiclet;
 class LLTalkButton;
 
 class LLBottomTray 
-	: public LLSingleton<LLBottomTray>
-	, public LLPanel
+	: public LLPanel
 	, public LLIMSessionObserver
+	, LLGestureManagerObserver
 {
 public:
 	LLBottomTray();
 
 	~LLBottomTray();
 
-	LLLineEditor* getChatBox();
-
-	LLChicletPanel* getChicletPanel() {return mChicletPanel;};
-
-	LLNotificationChiclet* getIMWell() {return mIMWell;};
-
-	LLNotificationChiclet* getNotificationWell(){return mNotificationWell;};
+	LLLineEditor*		getChatBox()	{return mChatBox;}
+	LLChicletPanel*		getChicletPanel()	{return mChicletPanel;}
+	LLNotificationChiclet*	getIMWell()	{return mIMWell;}
+	LLNotificationChiclet*	getSysWell()	{return mSysWell;}
 
 	void onChatBoxCommit();
 	void sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate);
@@ -67,10 +65,21 @@ class LLBottomTray
 	static void onChatBoxKeystroke(LLLineEditor* caller, void* userdata);
 	static void onChatBoxFocusLost(LLFocusableElement* caller, void* userdata);
 
+	void refresh();
+
+	void onCommitGesture(LLUICtrl* ctrl);
+	void refreshGestures();
+
 	// LLIMSessionObserver observe triggers
 	virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
 	virtual void sessionRemoved(const LLUUID& session_id);
 
+	// LLGestureManagerObserver trigger
+	virtual void changed() { refreshGestures(); }
+
+	virtual void onFocusLost();
+	virtual void onVisibilityChange(BOOL curVisibilityIn);
+
 protected:
 
 	void sendChat( EChatType type );
@@ -79,10 +88,14 @@ class LLBottomTray
 	// Which non-zero channel did we last chat on?
 	S32 mLastSpecialChatChannel;
 
-	LLChicletPanel* mChicletPanel;
-	LLNotificationChiclet* mIMWell;
-	LLNotificationChiclet* mNotificationWell;
-	LLTalkButton* mTalkBtn;
+	LLLineEditor*		mChatBox;
+	LLChicletPanel* 	mChicletPanel;
+	LLNotificationChiclet* 	mIMWell;
+	LLNotificationChiclet* 	mSysWell;
+	LLViewBorder*		mSeparator;
+	LLTalkButton* 		mTalkBtn;
+	LLComboBox* 		mGestureCombo;
+	LLFrameTimer 		mGestureLabelTimer;
 };
 
 extern LLBottomTray* gBottomTray;
diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp
index 5e971576940..b94229704fd 100644
--- a/indra/newview/llchatbar.cpp
+++ b/indra/newview/llchatbar.cpp
@@ -415,9 +415,10 @@ void LLChatBar::sendChat( EChatType type )
 void LLChatBar::startChat(const char* line)
 {
 	//TODO* remove DUMMY chat
-	if(LLBottomTray::getInstance()->getChatBox())
+	if(gBottomTray && gBottomTray->getChatBox())
 	{
-		LLBottomTray::getInstance()->getChatBox()->setFocus(TRUE);
+		gBottomTray->setVisible(TRUE);
+		gBottomTray->getChatBox()->setFocus(TRUE);
 	}
 
 	// *TODO Vadim: Why was this code commented out?
@@ -441,9 +442,9 @@ void LLChatBar::startChat(const char* line)
 void LLChatBar::stopChat()
 {
 	//TODO* remove DUMMY chat
-	if(LLBottomTray::getInstance()->getChatBox())
+	if(gBottomTray && gBottomTray->getChatBox())
 	{
-		LLBottomTray::getInstance()->getChatBox()->setFocus(FALSE);
+		gBottomTray->getChatBox()->setFocus(FALSE);
 	}
 
 	// *TODO Vadim: Why was this code commented out?
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index d8e844d2917..811ce392285 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -264,7 +264,7 @@ void LLIMChiclet::setShowSpeaker(bool show)
 void LLIMChiclet::draw()
 {
 	LLUICtrl::draw();
-	gl_rect_2d(1, getRect().getHeight(), getRect().getWidth(), 1, LLColor4(0.0f,0.0f,0.0f,1.f), FALSE);
+	gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 1, LLColor4(0.0f,0.0f,0.0f,1.f), FALSE);
 }
 
 S32 LLIMChiclet::calcCounterWidth()
@@ -281,27 +281,27 @@ S32 LLIMChiclet::calcCounterWidth()
 
 LLChicletPanel::LLChicletPanel(const Params&p)
 : LLPanel(p)
+, mScrollArea(NULL)
 , mLeftScroll(NULL)
 , mRightScroll(NULL)
-, mFirstToShow(0)
 {
 	LLButton::Params params;
 
 	params.name("scroll_left");
 	params.label(LLStringUtil::null);
 	params.tab_stop(false);
-	params.image_selected(LLUI::getUIImage("scroll_left.tga"));
-	params.image_unselected(LLUI::getUIImage("scroll_left.tga"));
-	params.image_hover_selected(LLUI::getUIImage("scroll_left.tga"));
+	params.image_selected(LLUI::getUIImage("bottom_tray_scroll_left.tga"));
+	params.image_unselected(LLUI::getUIImage("bottom_tray_scroll_left.tga"));
+	params.image_hover_selected(LLUI::getUIImage("bottom_tray_scroll_left.tga"));
 	mLeftScroll = LLUICtrlFactory::create<LLButton>(params);
 	addChild(mLeftScroll);
 	mLeftScroll->setClickedCallback(boost::bind(&LLChicletPanel::onLeftScrollClick,this));
 	mLeftScroll->setEnabled(false);
 
 	params.name("scroll_right");
-	params.image_selected(LLUI::getUIImage("scroll_right.tga"));
-	params.image_unselected(LLUI::getUIImage("scroll_right.tga"));
-	params.image_hover_selected(LLUI::getUIImage("scroll_right.tga"));
+	params.image_selected(LLUI::getUIImage("bottom_tray_scroll_right.tga"));
+	params.image_unselected(LLUI::getUIImage("bottom_tray_scroll_right.tga"));
+	params.image_hover_selected(LLUI::getUIImage("bottom_tray_scroll_right.tga"));
 	mRightScroll = LLUICtrlFactory::create<LLButton>(params);
 	addChild(mRightScroll);
 	mRightScroll->setClickedCallback(boost::bind(&LLChicletPanel::onRightScrollClick,this));
@@ -317,19 +317,6 @@ LLChicletPanel::~LLChicletPanel()
 
 }
 
-LLChicletPanel* LLChicletPanel::create()
-{
-	LLChicletPanel* panel = new LLChicletPanel(LLChicletPanel::Params());
-	return panel;
-}
-
-BOOL LLChicletPanel::postBuild()
-{
-	LLPanel::postBuild();
-
-	return TRUE;
-}
-
 LLChiclet* LLChicletPanel::createChiclet(LLSD* imSessionId, S32 pos)
 {
 	LLChiclet* chiclet = LLIMChiclet::create(imSessionId);
@@ -352,10 +339,20 @@ bool LLChicletPanel::addChiclet(LLChiclet* chiclet, S32 pos)
 {
 	if(mScrollArea->addChild(chiclet))
 	{
+		// if first chiclet is scrolled left, the created one should be scrolled left too
+		if(0 == pos && canScrollLeft())
+		{
+			LLRect first_chiclet_rect = getChiclet(0)->getRect();
+			chiclet->setRect(first_chiclet_rect);
+		}
+
 		mChicletList.insert(mChicletList.begin() + pos, chiclet);
 
 		chiclet->setLeftButtonClickCallback(boost::bind(&LLChicletPanel::onChicletClick, this, _1, _2));
 
+		arrange();
+		showScrollButtonsIfNeeded();
+
 		return true;
 	}
 
@@ -378,6 +375,7 @@ LLChiclet* LLChicletPanel::findIMChiclet(LLSD* imSessionId)
 	chiclet_list_t::const_iterator it = mChicletList.begin();
 	for( ; mChicletList.end() != it; ++it)
 	{
+		// Only IM Chiclets have session id, skip non IM Chiclets
 		LLIMChiclet* chiclet = dynamic_cast<LLIMChiclet*>(*it);
 		if(!chiclet)
 		{
@@ -394,21 +392,35 @@ LLChiclet* LLChicletPanel::findIMChiclet(LLSD* imSessionId)
 
 LLChiclet* LLChicletPanel::getChiclet(S32 pos)
 {
-	return mChicletList.at(pos);
+	return mChicletList[pos];
 }
 
 void LLChicletPanel::removeChiclet(chiclet_list_t::iterator it)
 {
+	// if possible, after deletion shift chiclets right
+	if(canScrollLeft() && !canScrollRight())
+	{
+		LLChiclet* chiclet = *it;
+		LLRect first_chiclet_rect = getChiclet(0)->getRect();
+		S32 deleted_chiclet_width = chiclet->getRect().getWidth();
+		deleted_chiclet_width += CHICLET_PADDING;
+		
+		first_chiclet_rect.mLeft += deleted_chiclet_width;
+		first_chiclet_rect.mRight += deleted_chiclet_width;
+
+		getChiclet(0)->setRect(first_chiclet_rect);
+	}
+
 	mScrollArea->removeChild(*it);
-	delete *it;
 	mChicletList.erase(it);
-	mLeftScroll->setEnabled(canScrollLeft());
-	mRightScroll->setEnabled(canScrollRight());
+	
+	arrange();
+	showScrollButtonsIfNeeded();
 }
 
 void LLChicletPanel::removeChiclet(S32 pos)
 {
-	if(0 > pos || getChicletCount() >= pos)
+	if(0 > pos || getChicletCount() <= pos)
 	{
 		return;
 	}
@@ -434,6 +446,7 @@ void LLChicletPanel::removeIMChiclet(LLSD* imSessionId)
 	chiclet_list_t::iterator it = mChicletList.begin();
 	for( ; mChicletList.end() != it; ++it)
 	{
+		// Only IM Chiclets have session id, skip non IM Chiclets
 		LLIMChiclet* chiclet = dynamic_cast<LLIMChiclet*>(*it);
 		if(!chiclet)
 		{
@@ -453,8 +466,8 @@ void LLChicletPanel::removeAll()
 	mScrollArea->deleteAllChildren();
 
 	mChicletList.erase(mChicletList.begin(), mChicletList.end());
-	mLeftScroll->setEnabled(false);
-	mRightScroll->setEnabled(false);
+
+	showScrollButtonsIfNeeded();
 }
 
 void LLChicletPanel::reshape(S32 width, S32 height, BOOL called_from_parent )
@@ -463,41 +476,92 @@ void LLChicletPanel::reshape(S32 width, S32 height, BOOL called_from_parent )
 
 	mLeftScroll->setRect(LLRect(0,CHICLET_HEIGHT,SCROLL_BUTTON_WIDTH,
 		CHICLET_HEIGHT - SCROLL_BUTTON_HEIGHT));
-	mRightScroll->setRect(LLRect(getRect().getWidth()-SCROLL_BUTTON_WIDTH,CHICLET_HEIGHT,
-		getRect().getWidth(),CHICLET_HEIGHT - SCROLL_BUTTON_HEIGHT));
+	mRightScroll->setRect(LLRect(width-SCROLL_BUTTON_WIDTH,CHICLET_HEIGHT,
+		width,CHICLET_HEIGHT - SCROLL_BUTTON_HEIGHT));
+
+	S32 old_scroll_width = mScrollArea->getRect().getWidth();
 
 	mScrollArea->setRect(LLRect(SCROLL_BUTTON_WIDTH + 5,CHICLET_HEIGHT + 1,
-		getRect().getWidth() - SCROLL_BUTTON_WIDTH - 5, 0));
+		width - SCROLL_BUTTON_WIDTH - 5, 0));
 
+	S32 current_scroll_width = mScrollArea->getRect().getWidth();
+	reshapeScrollArea(current_scroll_width - old_scroll_width);
 
-	arrange();
+	showScrollButtonsIfNeeded();
+}
+
+void LLChicletPanel::reshapeScrollArea(S32 delta_width)
+{
+	if(mChicletList.empty())
+		return;
+
+	S32 last_chiclet_right = (*mChicletList.rbegin())->getRect().mRight;
+	S32 scroll_width = mScrollArea->getRect().getWidth();
+
+	// Align all chiclets to last chiclet
+	// if there is a gap between last chiclet and scroll area right side
+	// or last chiclet is at visible area right side
+	if( last_chiclet_right < scroll_width 
+		|| last_chiclet_right == scroll_width - delta_width)
+	{
+		LLRect first_chiclet_rect = getChiclet(0)->getRect();
+		// if we can right shift all chiclets
+		if(first_chiclet_rect.mLeft < 0)
+		{
+			first_chiclet_rect.mLeft += delta_width;
+			first_chiclet_rect.mRight += delta_width;
+
+			getChiclet(0)->setRect(first_chiclet_rect);
+
+			arrange();
+		}
+	}
 }
 
 void LLChicletPanel::arrange()
 {
-	S32 left = 0;
-	S32 size = getChicletCount();
+	if(mChicletList.empty())
+		return;
 
-	for( int n = mFirstToShow; n < size; ++n)
+	LLRect first_chiclet_rect = getChiclet(0)->getRect();
+	// don't allow gap between first chiclet and scroll area left side
+	if(first_chiclet_rect.mLeft > 0)
+	{
+		first_chiclet_rect.mRight = first_chiclet_rect.getWidth();
+		first_chiclet_rect.mLeft = 0;
+	}
+
+	S32 left = first_chiclet_rect.mLeft;
+
+	S32 size = getChicletCount();
+	for( int n = 0; n < size; ++n)
 	{
 		LLChiclet* chiclet = getChiclet(n);
 		S32 chiclet_width = chiclet->getRequiredRect().getWidth();
 		LLRect rc(left, CHICLET_HEIGHT, left + chiclet_width, 0);
 
 		chiclet->setRect(rc);
-		chiclet->reshape(rc.getWidth(),rc.getHeight());
 
 		left += chiclet_width + CHICLET_PADDING;
 	}
+}
+
+void LLChicletPanel::showScrollButtonsIfNeeded()
+{
+	bool can_scroll_left = canScrollLeft();
+	bool can_scroll_right = canScrollRight();
 
-	mLeftScroll->setEnabled(canScrollLeft());
-	mRightScroll->setEnabled(canScrollRight());
+	mLeftScroll->setEnabled(can_scroll_left);
+	mRightScroll->setEnabled(can_scroll_right);
+
+	bool show_scroll_buttons = can_scroll_left || can_scroll_right;
+
+	mLeftScroll->setVisible(show_scroll_buttons);
+	mRightScroll->setVisible(show_scroll_buttons);
 }
 
 void LLChicletPanel::draw()
 {
-	//gl_rect_2d(0,getRect().getHeight(),getRect().getWidth(),0,LLColor4(0.f,1.f,1.f,1.f),TRUE);
-
 	child_list_const_iter_t it = getChildList()->begin();
 	for( ; getChildList()->end() != it; ++it)
 	{
@@ -516,36 +580,60 @@ void LLChicletPanel::draw()
 
 bool LLChicletPanel::canScrollRight()
 {
-	S32 width = 0;
-	LLRect visible_rect = mScrollArea->getRect();
+	if(mChicletList.empty())
+		return false;
+
+	S32 scroll_width = mScrollArea->getRect().getWidth();
+	S32 last_chiclet_right = (*mChicletList.rbegin())->getRect().mRight;
+
+	if(last_chiclet_right > scroll_width)
+		return true;
 
-	chiclet_list_t::const_iterator it = mChicletList.begin() + mFirstToShow;
-	for(;mChicletList.end() != it; ++it)
-	{
-		LLChiclet* chiclet = *it;
-		width += chiclet->getRect().getWidth() + CHICLET_PADDING;
-		if(width > visible_rect.getWidth())
-			return true;
-	}
 	return false;
 }
 
 bool LLChicletPanel::canScrollLeft()
 {
-	return mFirstToShow > 0;
+	if(mChicletList.empty())
+		return false;
+
+	return getChiclet(0)->getRect().mLeft < 0;
 }
 
 void LLChicletPanel::scroll(ScrollDirection direction)
 {
-	S32 elem = 0;
-	if(SCROLL_LEFT == direction)
-		elem = mFirstToShow;
-	else if(SCROLL_RIGHT)
-		elem = mFirstToShow - 1;
+	S32 first_visible_chiclet = getFirstVisibleChiclet();
+	if(-1 == first_visible_chiclet)
+		return;
 
-	S32 offset = mChicletList[elem]->getRect().getWidth() + 
-		CHICLET_PADDING;
-	offset *= direction;
+	S32 offset = 0;
+
+	if(SCROLL_LEFT == direction)
+	{
+		if(0 == first_visible_chiclet)
+		{
+			// shift chiclets in case first chiclet is partially visible
+			offset = llabs(getChiclet(first_visible_chiclet)->getRect().mLeft);
+		}
+		else
+		{
+			offset = getChiclet(first_visible_chiclet - 1)->getRect().getWidth() + CHICLET_PADDING;
+		}
+	}
+	else if(SCROLL_RIGHT == direction)
+	{
+		S32 last_chiclet_right = (*mChicletList.rbegin())->getRect().mRight;
+		S32 scroll_rect_width = mScrollArea->getRect().getWidth();
+
+		offset = getChiclet(first_visible_chiclet)->getRect().getWidth() + CHICLET_PADDING;
+		offset *= direction;
+		// if after scrolling, the last chiclet will not be aligned to 
+		// scroll area right side - align it.
+		if( last_chiclet_right + offset < scroll_rect_width )
+		{
+			offset = scroll_rect_width - last_chiclet_right;
+		}
+	}
 
 	chiclet_list_t::const_iterator it = mChicletList.begin();
 	for(;mChicletList.end() != it; ++it)
@@ -555,14 +643,33 @@ void LLChicletPanel::scroll(ScrollDirection direction)
 	}
 }
 
+S32 LLChicletPanel::getFirstVisibleChiclet()
+{
+	if(mChicletList.empty())
+		return -1;
+
+	for(int n = 0; n < getChicletCount(); ++n)
+	{
+		LLRect rc = getChiclet(n)->getRect();
+		if(n > 0)
+			rc.mLeft -= CHICLET_PADDING;
+		// bottom left of scroll area is first visible point
+		if(rc.pointInRect(0,0))
+		{
+			return n;
+		}
+	}
+
+	return -1;
+}
+
 void LLChicletPanel::scrollLeft()
 {
 	if(canScrollLeft())
 	{
-		--mFirstToShow;
 		scroll(SCROLL_LEFT);
-		mLeftScroll->setEnabled(canScrollLeft());
-		mRightScroll->setEnabled(canScrollRight());
+		
+		showScrollButtonsIfNeeded();
 	}
 }
 
@@ -570,10 +677,9 @@ void LLChicletPanel::scrollRight()
 {
 	if(canScrollRight())
 	{
-		++mFirstToShow;
 		scroll(SCROLL_RIGHT);
-		mLeftScroll->setEnabled(canScrollLeft());
-		mRightScroll->setEnabled(canScrollRight());
+		
+		showScrollButtonsIfNeeded();
 	}
 }
 
@@ -606,6 +712,10 @@ BOOL LLChicletPanel::handleScrollWheel(S32 x, S32 y, S32 clicks)
 	return TRUE;
 }
 
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
 LLTalkButton::LLTalkButton(const LLUICtrl::Params& p)
 : LLUICtrl(p)
 {
@@ -639,8 +749,8 @@ LLTalkButton::LLTalkButton(const LLUICtrl::Params& p)
 	show_params.tab_stop(false);
 	show_params.is_toggle(true);
 	show_params.picture_style(true);
-	show_params.image_selected(LLUI::getUIImage("show_btn_selected.tga"));
-	show_params.image_unselected(LLUI::getUIImage("show_btn.tga"));
+	show_params.image_selected(LLUI::getUIImage("talk_btn_right_selected.tga"));
+	show_params.image_unselected(LLUI::getUIImage("talk_btn_right.tga"));
 	mShowBtn = LLUICtrlFactory::create<LLButton>(show_params);
 	addChild(mShowBtn);
 
@@ -704,8 +814,8 @@ void LLTalkButton::onClick_ShowBtn()
 	mPrivateCallPanel = new LLVoiceControlPanel;
 	getRootView()->addChild(mPrivateCallPanel);
 
-	y = LLBottomTray::getInstance()->getRect().getHeight()
-		+ mPrivateCallPanel->getRect().getHeight();
+ 	if(gBottomTray)
+ 		y = gBottomTray->getRect().getHeight() + mPrivateCallPanel->getRect().getHeight();
 
 	LLRect rect;
 	rect.setLeftTopAndSize(x, y, mPrivateCallPanel->getRect().getWidth(), mPrivateCallPanel->getRect().getHeight());
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index 11c3356c461..65be9e183a4 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -180,7 +180,7 @@ class LLChicletPanel : public LLPanel
 		Params(){};
 	};
 
-	static LLChicletPanel* create();
+	~LLChicletPanel();
 
 	LLChiclet* createChiclet(LLSD* imSessionId = NULL, S32 pos = 0);
 
@@ -200,10 +200,6 @@ class LLChicletPanel : public LLPanel
 
 	void removeAll();
 
-	void arrange();
-
-	~LLChicletPanel();
-
 	void scrollLeft();
 
 	void scrollRight();
@@ -224,18 +220,22 @@ class LLChicletPanel : public LLPanel
 
 	void draw();
 
-	BOOL postBuild();
-
 protected:
 	LLChicletPanel(const Params&p);
 	friend class LLUICtrlFactory;
 
-	bool needsScrolling();
+	void arrange();
 
 	bool canScrollRight();
 
 	bool canScrollLeft();
 
+	void showScrollButtonsIfNeeded();
+
+	S32 getFirstVisibleChiclet();
+
+	void reshapeScrollArea(S32 delta_width);
+
 	enum ScrollDirection
 	{
 		SCROLL_LEFT = 1,
@@ -255,8 +255,6 @@ class LLChicletPanel : public LLPanel
 	chiclet_list_t mChicletList;
 	LLButton* mLeftScroll;
 	LLButton* mRightScroll;
-	S32 mFirstToShow;
-	S32 mLastToShow;
 	LLPanel* mScrollArea;
 };
 
diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp
index 0f2951d9df3..66ed680984b 100644
--- a/indra/newview/llgesturemgr.cpp
+++ b/indra/newview/llgesturemgr.cpp
@@ -872,7 +872,8 @@ void LLGestureManager::runStep(LLMultiGesture* gesture, LLGestureStep* step)
 
 			const BOOL animate = FALSE;
 
-			LLBottomTray::getInstance()->sendChatFromViewer(chat_text, CHAT_TYPE_NORMAL, animate);
+			if(gBottomTray)
+				gBottomTray->sendChatFromViewer(chat_text, CHAT_TYPE_NORMAL, animate);
 
 			gesture->mCurrentStep++;
 			break;
diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp
index 5d0bcab07a5..6473c85775d 100644
--- a/indra/newview/llgrouplist.cpp
+++ b/indra/newview/llgrouplist.cpp
@@ -34,6 +34,9 @@
 
 #include "llgrouplist.h"
 
+// libs
+#include "lltrans.h"
+
 // newview
 #include "llagent.h"
 
@@ -44,7 +47,13 @@ LLGroupList::LLGroupList(const Params& p)
 {
 }
 
-BOOL LLGroupList::updateList()
+static bool findInsensitive(std::string haystack, const std::string& needle_upper)
+{
+    LLStringUtil::toUpper(haystack);
+    return haystack.find(needle_upper) != std::string::npos;
+}
+
+BOOL LLGroupList::update(const std::string& name_filter)
 {
 	LLCtrlListInterface *group_list		= getListInterface();
 	const LLUUID& 		highlight_id	= gAgent.getGroupID();
@@ -58,12 +67,17 @@ BOOL LLGroupList::updateList()
 		// *TODO: check powers mask?
 		id = gAgent.mGroups.get(i).mID;
 		const LLGroupData& group_data = gAgent.mGroups.get(i);
+		if (name_filter != LLStringUtil::null && !findInsensitive(group_data.mName, name_filter))
+			continue;
 		addItem(id, group_data.mName, highlight_id == id, ADD_BOTTOM);
 	}
 
 	// add "none" to list at top
-	//name = LLTrans::getString("GroupsNone")
-	addItem(LLUUID::null, std::string("none"), highlight_id.isNull(), ADD_TOP); // *TODO: localize
+	{
+		std::string loc_none = LLTrans::getString("GroupsNone");
+		if (name_filter == LLStringUtil::null || findInsensitive(loc_none, name_filter))
+			addItem(LLUUID::null, loc_none, highlight_id.isNull(), ADD_TOP);
+	}
 
 	group_list->selectByValue(highlight_id);
 	return TRUE;
diff --git a/indra/newview/llgrouplist.h b/indra/newview/llgrouplist.h
index ce26977fdb6..a246650822f 100644
--- a/indra/newview/llgrouplist.h
+++ b/indra/newview/llgrouplist.h
@@ -47,7 +47,7 @@ class LLGroupList: public LLAvatarList
 	};
 
 	LLGroupList(const Params&);
-	BOOL updateList();
+	BOOL update(const std::string& name_filter = LLStringUtil::null);
 };
 
 #endif // LL_LLGROUPLIST_H
diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp
index 80bc2ad8615..f0bfbef5658 100644
--- a/indra/newview/llmenucommands.cpp
+++ b/indra/newview/llmenucommands.cpp
@@ -84,8 +84,8 @@ void handle_mouselook(void*)
 void handle_chat(void*)
 {
 	// give focus to chatbar if it's open but not focused
-	if (gSavedSettings.getBOOL("ChatVisible") && gFocusMgr.childHasKeyboardFocus(
-		LLBottomTray::getInstance()->getChatBox()))
+	if (gBottomTray && gSavedSettings.getBOOL("ChatVisible") && 
+		gFocusMgr.childHasKeyboardFocus(gBottomTray->getChatBox()))
 	{
 		LLChatBar::stopChat();
 	}
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index d7929cc5c22..ee592ac22c0 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -45,6 +45,7 @@
 #include "lltooldraganddrop.h"
 #include "llviewermenu.h"		// *FIX: for is_agent_friend()
 #include "llscrollcontainer.h"
+#include "llweb.h"
 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // Class LLDropTarget
@@ -168,6 +169,7 @@ void LLPanelProfileTab::setProfileType()
 void LLPanelProfileTab::onActivate(const LLUUID& id)
 {
 	setAvatarId(id);
+	scrollToTop();
 	updateData();
 }
 
@@ -199,6 +201,15 @@ void LLPanelProfileTab::onTeleport()
 	}
 }
 
+void LLPanelProfileTab::scrollToTop()
+{
+	LLScrollContainer* scrollContainer = getChild<LLScrollContainer>("profile_scroll", FALSE, FALSE);
+	if (NULL != scrollContainer)
+	{
+		scrollContainer->goToTop();
+	}
+}
+
 //////////////////////////////////////////////////////////////////////////
 //-----------------------------------------------------------------------------
 // LLPanelAvatarProfile()
@@ -260,20 +271,26 @@ void LLPanelAvatarProfile::processProperties(void* data, EAvatarProcessorType ty
 			if (!isEditMode())
 			{
 				setCaptionText(avatar_data);
-			}
-			childSetValue("show_in_search_checkbox", (BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH));
-
-			if (avatar_data->partner_id.notNull())
-			{
-				std::string first, last;
-				BOOL found = gCacheName->getName(avatar_data->partner_id, first, last);
-				if (found)
+				if (avatar_data->partner_id.notNull())
+				{
+					std::string first, last;
+					BOOL found = gCacheName->getName(avatar_data->partner_id, first, last);
+					if (found)
+					{
+						childSetTextArg("partner_text", "[FIRST]", first);
+						childSetTextArg("partner_text", "[LAST]", last);
+					}
+				}
+				else
 				{
-					childSetTextArg("partner_text", "[FIRST]", first);
-					childSetTextArg("partner_text", "[LAST]", last);
+					childSetTextArg("partner_text", "[FIRST]", getString("no_partner_text"));
 				}
 			}
-			//http://secondlife.com/partner
+			else
+			{
+				childSetValue("show_in_search_checkbox", (BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH));
+			}
+
 
 			bool online = avatar_data->flags & AVATAR_ONLINE;
 			if(is_agent_friend(avatar_data->avatar_id))
@@ -306,6 +323,12 @@ void LLPanelAvatarProfile::processProperties(void* data, EAvatarProcessorType ty
 			}
 			mStatusCombobox->setValue(status);
 		}
+		if (isOwnProfile())
+		{
+			std::string full_name;
+			gCacheName->getFullName(mAvatarId, full_name);
+			childSetValue("user_name", full_name);
+		}
 	}
 	else if(APT_GROUPS == type)
 	{
@@ -438,6 +461,14 @@ void LLPanelAvatarProfile::onShareButtonClick()
 		mStatusMessage->setCommitCallback(boost::bind(&LLPanelAvatarProfile::onStatusMessageChanged, this));
 	}
 
+	if (!isEditMode())
+	{
+		childSetActionTextbox("homepage_edit", boost::bind(&LLPanelAvatarProfile::onHomepageTextboxClicked, this));
+		childSetActionTextbox("payment_update_link", boost::bind(&LLPanelAvatarProfile::onUpdateAccountTextboxClicked, this));
+		childSetActionTextbox("my_account_link", boost::bind(&LLPanelAvatarProfile::onMyAccountTextboxClicked, this));
+		childSetActionTextbox("partner_edit_link", boost::bind(&LLPanelAvatarProfile::onPartnerEditTextboxClicked, this));
+	}
+
 	childSetCommitCallback("add_friend",(boost::bind(&LLPanelAvatarProfile::onAddFriendButtonClick,this)),NULL);
 	childSetCommitCallback("im",(boost::bind(&LLPanelAvatarProfile::onIMButtonClick,this)),NULL);
 	childSetCommitCallback("call",(boost::bind(&LLPanelAvatarProfile::onCallButtonClick,this)),NULL);
@@ -460,22 +491,13 @@ void LLPanelAvatarProfile::onShareButtonClick()
 
 	return TRUE;
 }
+
 void LLPanelAvatarProfile::onOpen(const LLSD& key)
 {
-	setAvatarId(key);
-	scrollToTop();
+	onActivate(key);
 	updateChildrenList();
-	updateData();
 }
 
-void LLPanelAvatarProfile::scrollToTop()
-{
-	LLScrollContainer* scrollContainer = getChild<LLScrollContainer>("profile_scroll", FALSE, FALSE);
-	if (NULL != scrollContainer)
-	{
-		scrollContainer->goToTop();
-	}
-}
 
 void LLPanelAvatarProfile::updateChildrenList()
 {
@@ -486,29 +508,35 @@ void LLPanelAvatarProfile::updateChildrenList()
 	switch (mProfileType)
 	{
 	case PT_OWN:
-		childSetVisible("status_panel",FALSE);
-		childSetVisible("profile_buttons_panel",FALSE);
-		childSetVisible("title_groups_text",FALSE);
-		childSetVisible("sl_groups",FALSE);
+		childSetVisible("user_name", true);
+		childSetVisible("status_panel", false);
+		childSetVisible("profile_buttons_panel", false);
+		childSetVisible("title_groups_text", false);
+		childSetVisible("sl_groups", false);
 		mUpdated = true;
-		childSetVisible("status_me_panel",TRUE);
-		childSetVisible("profile_me_buttons_panel",TRUE);
+		childSetVisible("status_me_panel", true);
+		childSetVisible("profile_me_buttons_panel", true);
 
 		break;
 	case PT_OTHER:
-		childSetVisible("status_me_panel",FALSE);
-		childSetVisible("profile_me_buttons_panel",FALSE);
+		childSetVisible("user_name", false);
+		childSetVisible("status_me_panel", false);
+		childSetVisible("profile_me_buttons_panel", false);
 
-		childSetVisible("status_panel",TRUE);
-		childSetVisible("profile_buttons_panel",TRUE);
-		childSetVisible("title_groups_text",TRUE);
-		childSetVisible("sl_groups",TRUE);
+		childSetVisible("status_panel", true);
+		childSetVisible("profile_buttons_panel", true);
+		childSetVisible("title_groups_text", true);
+		childSetVisible("sl_groups", true);
 
 		// account actions
-		childSetVisible("account_actions_panel", FALSE);
-		childSetVisible("partner_edit_link", FALSE);
+		childSetVisible("account_actions_panel", false);
+		childSetVisible("partner_edit_link", false);
 
-		mUpdated = true;
+		//hide for friends
+		childSetEnabled("add_friend", !is_agent_friend(getAvatarId()));
+
+		//need to update profile view on every activate
+		mUpdated = false;
 		break;
 	case PT_UNKNOWN: break;//do nothing 
 	default:
@@ -546,6 +574,31 @@ void LLPanelAvatarProfile::onStatusMessageChanged()
 	updateData();
 }
 
+//static
+void LLPanelAvatarProfile::onUrlTextboxClicked(std::string url)
+{
+	LLWeb::loadURL(url);
+}
+
+void LLPanelAvatarProfile::onHomepageTextboxClicked()
+{
+	onUrlTextboxClicked(childGetValue("homepage_edit").asString());
+}
+
+void LLPanelAvatarProfile::onUpdateAccountTextboxClicked()
+{
+	onUrlTextboxClicked(getString("payment_update_link_url"));
+}
+
+void LLPanelAvatarProfile::onMyAccountTextboxClicked()
+{
+	onUrlTextboxClicked(getString("my_account_link_url"));
+}
+
+void LLPanelAvatarProfile::onPartnerEditTextboxClicked()
+{
+	onUrlTextboxClicked(getString("partner_edit_link_url"));
+}
 
 //-----------------------------------------------------------------------------
 // LLPanelAvatarNotes()
@@ -664,3 +717,15 @@ void LLPanelAvatarNotes::processProperties(void* data, EAvatarProcessorType type
 		}
 	}
 }
+
+void LLPanelAvatarNotes::onActivate(const LLUUID& id)
+{
+	LLPanelProfileTab::onActivate(id);
+	updateChildrenList();
+}
+
+void LLPanelAvatarNotes::updateChildrenList()
+{
+	//hide for friends
+	childSetEnabled("add_friend", !is_agent_friend(getAvatarId()));
+}
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index f72eb1990d7..8bfa386d550 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -109,6 +109,9 @@ class LLPanelProfileTab
 	virtual ~LLPanelProfileTab();
 	void setProfileType();
 
+private:
+	void scrollToTop();
+
 protected:
 	e_profile_type mProfileType;
 	LLUUID mAvatarId;
@@ -133,7 +136,7 @@ class LLPanelAvatarProfile
 	virtual void clearControls();
 
 	/*virtual*/ BOOL postBuild(void);
-	void onOpen(const LLSD& key);
+	/*virtual*/ void onOpen(const LLSD& key);
 
 	void onAddFriendButtonClick();
 
@@ -152,8 +155,12 @@ class LLPanelAvatarProfile
 	void onStatusChanged();
 	void onStatusMessageChanged();
 	void setCaptionText(const LLAvatarData* avatar_data);
-	void scrollToTop();
 
+	static void onUrlTextboxClicked(std::string url);
+	void onHomepageTextboxClicked();
+	void onUpdateAccountTextboxClicked();
+	void onMyAccountTextboxClicked();
+	void onPartnerEditTextboxClicked();
 
 protected:
 	bool mEditMode;
@@ -175,6 +182,8 @@ class LLPanelAvatarNotes
 
 	static void* create(void* data);
 
+	void onActivate(const LLUUID& id);
+
 	BOOL postBuild(void);
 
 	void onCommitRights();
@@ -188,6 +197,8 @@ class LLPanelAvatarNotes
 	void updateData();
 
 protected:
+
+	void updateChildrenList();
 };
 
 
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 24b4082630f..8c7e3e960a6 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -157,8 +157,6 @@ void LLLandmarksPanel::onTeleport()
 	{
 		listenerp->openItem();
 	}
-
-	togglePanelPlacesButtons(TRUE);
 }
 
 /*
@@ -195,6 +193,25 @@ void LLLandmarksPanel::onCopySLURL()
 }
 */
 
+// virtual
+void LLLandmarksPanel::updateVerbs()
+{
+	BOOL enabled = FALSE;
+
+	LLFolderViewItem* current_item = mInventoryPanel->getRootFolder()->getCurSelectedItem();
+	if (current_item)
+	{
+		LLFolderViewEventListener* listenerp = current_item->getListener();
+		if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK)
+		{
+			enabled = TRUE;
+		}
+	}
+
+	mTeleportBtn->setEnabled(enabled);
+	mShowOnMapBtn->setEnabled(enabled);
+}
+
 void LLLandmarksPanel::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action)
 {
 	LLFolderViewItem* current_item = mInventoryPanel->getRootFolder()->getCurSelectedItem();
@@ -224,16 +241,14 @@ void LLLandmarksPanel::onSelectionChange(const std::deque<LLFolderViewItem*> &it
 
 		if (!mActionBtn->getVisible())
 			mActionBtn->setVisible(TRUE);
-
-		togglePanelPlacesButtons(TRUE);
 	}
 	else
 	{
 		if (mActionBtn->getVisible())
 			mActionBtn->setVisible(FALSE);
-
-		togglePanelPlacesButtons(FALSE);
 	}
+
+	updateVerbs();
 }
 
 void LLLandmarksPanel::onSelectorButtonClicked()
diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h
index 0f400a722ee..76333e4d85d 100644
--- a/indra/newview/llpanellandmarks.h
+++ b/indra/newview/llpanellandmarks.h
@@ -48,6 +48,7 @@ class LLLandmarksPanel : public LLPanelPlacesTab
 	/*virtual*/ void onShowOnMap();
 	/*virtual*/ void onTeleport();
 	///*virtual*/ void onCopySLURL();
+	/*virtual*/ void updateVerbs();
 
 	void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action);
 	void onSelectorButtonClicked();
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 1d7a2748cc8..3f9f44bbf59 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -62,10 +62,18 @@ using namespace LLOldEvents;
 #define NEARBY_LIST_UPDATE_INTERVAL 1
 #define RECENT_LIST_UPDATE_DELAY	1
 
+static const std::string NEARBY_TAB_NAME	= "nearby_panel";
+static const std::string FRIENDS_TAB_NAME	= "friends_panel";
+static const std::string GROUP_TAB_NAME		= "groups_panel";
+static const std::string RECENT_TAB_NAME	= "recent_panel";
+
 static LLRegisterPanelClassWrapper<LLPanelPeople> t_people("panel_people");
 
 //=============================================================================
 
+/**
+ * Updates given list either on regular basis or on external events (up to implementation). 
+ */
 class LLPanelPeople::Updater
 {
 public:
@@ -74,15 +82,31 @@ class LLPanelPeople::Updater
 	: mCallback(cb)
 	{
 	}
+
 	virtual ~Updater()
 	{
 	}
+
+	/**
+	 * Force the list updates.
+	 * 
+	 * This may start repeated updates until all names are complete.
+	 */
+	virtual void forceUpdate() {}
+
+	/**
+	 * Activate/deactivate updater.
+	 *
+	 * This may start/stop regular updates.
+	 */
 	virtual void setActive(bool) {}
+
 protected:
 	bool updateList(U32 mask = 0)
 	{
 		return mCallback(mask);
 	}
+
 	callback_t		mCallback;
 };
 
@@ -99,10 +123,13 @@ class LLAvatarListUpdater : public LLPanelPeople::Updater, public LLEventTimer
 
 /**
  * Updates the friends list.
+ * 
+ * Updates the list on external events which trigger the changed() method. 
  */
 class LLFriendListUpdater : public LLAvatarListUpdater, public LLFriendObserver
 {
 	LOG_CLASS(LLFriendListUpdater);
+
 public: 
 	LLFriendListUpdater(callback_t cb)
 	:	LLAvatarListUpdater(cb, FRIEND_LIST_UPDATE_TIMEOUT)
@@ -111,20 +138,20 @@ class LLFriendListUpdater : public LLAvatarListUpdater, public LLFriendObserver
 		// For notification when SIP online status changes.
 		LLVoiceClient::getInstance()->addObserver(this);
 	}
+
 	~LLFriendListUpdater()
 	{
 		LLVoiceClient::getInstance()->removeObserver(this);
 		LLAvatarTracker::instance().removeObserver(this);
 	}
-	/*virtual*/ void setActive(bool val)
-	{
-		if (!val)
-			return;
 
+	/*virtual*/ void forceUpdate()
+	{
 		// Perform updates until all names are loaded.
 		if (!updateList(LLFriendObserver::ADD))
 			changed(LLFriendObserver::ADD);
 	}
+
 	/*virtual*/ void changed(U32 mask)
 	{
 		// events can arrive quickly in bulk - we need not process EVERY one of them -
@@ -134,6 +161,7 @@ class LLFriendListUpdater : public LLAvatarListUpdater, public LLFriendObserver
 		// save-up all the mask-bits which have come-in
 		mMask |= mask;
 	}
+
 	/*virtual*/ BOOL tick()
 	{
 		if (updateList(mMask))
@@ -145,33 +173,33 @@ class LLFriendListUpdater : public LLAvatarListUpdater, public LLFriendObserver
 
 		return FALSE;
 	}
+
 private:
 	U32 mMask;
 };
 
 /**
  * Periodically updates the nearby people list while the Nearby tab is active.
+ * 
+ * The period is defined by NEARBY_LIST_UPDATE_INTERVAL constant.
  */
 class LLNearbyListUpdater : public LLAvatarListUpdater
 {
 	LOG_CLASS(LLNearbyListUpdater);
+
 public:
 	LLNearbyListUpdater(callback_t cb)
 	:	LLAvatarListUpdater(cb, NEARBY_LIST_UPDATE_INTERVAL)
 	{
 		setActive(false);
 	}
-	/*virtual*/ BOOL tick()
-	{
-		updateList();
-		return FALSE;
-	}
+
 	/*virtual*/ void setActive(bool val)
 	{
 		if (val)
 		{
 			// update immediately and start regular updates
-			tick();
+			updateList();
 			mEventTimer.start(); 
 		}
 		else
@@ -180,6 +208,17 @@ class LLNearbyListUpdater : public LLAvatarListUpdater
 			mEventTimer.stop();
 		}
 	}
+
+	/*virtual*/ void forceUpdate()
+	{
+		updateList();
+	}
+
+	/*virtual*/ BOOL tick()
+	{
+		updateList();
+		return FALSE;
+	}
 private:
 };
 
@@ -189,13 +228,20 @@ class LLNearbyListUpdater : public LLAvatarListUpdater
 class LLRecentListUpdater : public LLAvatarListUpdater
 {
 	LOG_CLASS(LLRecentListUpdater);
+
 public:
 	LLRecentListUpdater(callback_t cb)
 	:	LLAvatarListUpdater(cb, RECENT_LIST_UPDATE_DELAY)
 	{
 		LLRecentPeople::instance().setChangedCallback(boost::bind(&LLRecentListUpdater::onRecentPeopleChanged, this));
 	}
+
 private:
+	/*virtual*/ void forceUpdate()
+	{
+		onRecentPeopleChanged();
+	}
+	
 	/*virtual*/ BOOL tick()
 	{
 		// Update the list until we get all the names. 
@@ -207,6 +253,7 @@ class LLRecentListUpdater : public LLAvatarListUpdater
 
 		return FALSE;
 	}
+
 	void onRecentPeopleChanged()
 	{
 		if (!updateList())
@@ -223,16 +270,24 @@ class LLRecentListUpdater : public LLAvatarListUpdater
 class LLGroupListUpdater : public LLPanelPeople::Updater, public LLSimpleListener
 {
 	LOG_CLASS(LLGroupListUpdater);
+
 public:
 	LLGroupListUpdater(callback_t cb)
 	:	LLPanelPeople::Updater(cb)
 	{
 		gAgent.addListener(this, "new group");
 	}
+
 	~LLGroupListUpdater()
 	{
 		gAgent.removeListener(this);
 	}
+
+	/*virtual*/ void forceUpdate()
+	{
+		updateList();
+	}
+
 	/*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
 	{
 		// Why is "new group" sufficient?
@@ -277,22 +332,23 @@ LLPanelPeople::~LLPanelPeople()
 BOOL LLPanelPeople::postBuild()
 {
 	mSearchEditor = getChild<LLSearchEditor>("filter_input");
+	mSearchEditor->setSearchCallback(boost::bind(&LLPanelPeople::onSearchEdit, this, _1));
 
 	mTabContainer = getChild<LLTabContainer>("tabs");
 	mTabContainer->setCommitCallback(boost::bind(&LLPanelPeople::onTabSelected, this, _2));
-	mTabContainer->selectTabByName("friends_panel"); // must go after setting commit callback
+	mTabContainer->selectTabByName(FRIENDS_TAB_NAME); // must go after setting commit callback
 
-	mFriendList = getChild<LLPanel>("friends_panel")->getChild<LLAvatarList>("avatar_list");
-	mNearbyList = getChild<LLPanel>("nearby_panel")->getChild<LLAvatarList>("avatar_list");
-	mRecentList = getChild<LLPanel>("recent_panel")->getChild<LLAvatarList>("avatar_list");
+	mFriendList = getChild<LLPanel>(FRIENDS_TAB_NAME)->getChild<LLAvatarList>("avatar_list");
+	mNearbyList = getChild<LLPanel>(NEARBY_TAB_NAME)->getChild<LLAvatarList>("avatar_list");
+	mRecentList = getChild<LLPanel>(RECENT_TAB_NAME)->getChild<LLAvatarList>("avatar_list");
 	mGroupList = getChild<LLGroupList>("group_list");
 
-	LLPanel* groups_panel = getChild<LLPanel>("groups_panel");
+	LLPanel* groups_panel = getChild<LLPanel>(GROUP_TAB_NAME);
 	groups_panel->childSetAction("activate_btn", boost::bind(&LLPanelPeople::onActivateButtonClicked,	this));
 	groups_panel->childSetAction("plus_btn",	boost::bind(&LLPanelPeople::onGroupPlusButtonClicked,	this));
 	groups_panel->childSetAction("minus_btn",	boost::bind(&LLPanelPeople::onGroupMinusButtonClicked,	this));
 
-	LLPanel* friends_panel = getChild<LLPanel>("friends_panel");
+	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));
 
@@ -326,82 +382,84 @@ BOOL LLPanelPeople::postBuild()
 	mGroupMinusMenuHandle = minus_menu->getHandle();
 
 	// Perform initial update.
-	mFriendListUpdater->setActive(true);
+	mFriendListUpdater->forceUpdate();
 	updateGroupList();
 	updateRecentList();
 
 	return TRUE;
 }
 
-bool LLPanelPeople::refreshFriendNames(U32 changed_mask)
+bool LLPanelPeople::updateFriendList(U32 changed_mask)
 {
-	// get all buddies we know about
-	LLAvatarTracker::buddy_map_t all_buddies;
-	LLAvatarTracker::instance().copyBuddyList(all_buddies);
-	
-	bool have_names = true;
-
+	// Refresh names.
 	if (changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE))
 	{
+		// get all buddies we know about
+		LLAvatarTracker::buddy_map_t all_buddies;
+		LLAvatarTracker::instance().copyBuddyList(all_buddies);
+
 		// *TODO: it's suboptimal to rebuild the whole list on online status change.
 
 		// convert the buddy map to vector
-		std::vector<LLUUID> avatar_ids;
+		mFriendVec.clear();
 		LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin();
 		for (; buddy_it != all_buddies.end(); ++buddy_it)
-			avatar_ids.push_back(buddy_it->first);
+			mFriendVec.push_back(buddy_it->first);
 
-		// do refresh the friend list
-		if (avatar_ids.size() > 0)
-			have_names = mFriendList->updateList(avatar_ids);
-		else	
-			mFriendList->setCommentText(getString("no_friends"));
+		return filterFriendList();
 	}
 
-	return have_names;
+	return true;
 }
 
-bool LLPanelPeople::updateFriendList(U32 changed_mask)
+bool LLPanelPeople::updateNearbyList()
 {
-	// Refresh names. 
-	if (changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE))
-	{
-		return refreshFriendNames(changed_mask);
-	}
-	
+	LLWorld::getInstance()->getAvatars(&mNearbyVec, NULL, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange"));
+	filterNearbyList();
+
 	return true;
 }
 
-bool LLPanelPeople::updateNearbyList()
+bool LLPanelPeople::updateRecentList()
 {
-	std::vector<LLUUID> avatar_ids;
+	LLRecentPeople::instance().get(mRecentVec);
+	filterRecentList();
 
-	LLWorld::getInstance()->getAvatars(&avatar_ids, NULL, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange"));
+	return true;
+}
 
-	mNearbyList->updateList(avatar_ids);
+bool LLPanelPeople::updateGroupList()
+{
+	return mGroupList->update(mFilterSubString);
+}
 
-	if (avatar_ids.size() == 0)
-		mNearbyList->setCommentText(getString("no_one_near"));
+bool LLPanelPeople::filterFriendList()
+{
+	if (mFriendVec.size() > 0)
+		return mFriendList->update(mFriendVec, mFilterSubString);
 
+	mFriendList->setCommentText(getString("no_friends"));
 	return true;
 }
 
-bool LLPanelPeople::updateRecentList()
+bool LLPanelPeople::filterNearbyList()
 {
-	std::vector<LLUUID> avatar_ids;
+	bool have_names = mNearbyList->update(mNearbyVec, mFilterSubString);
 
-	LLRecentPeople::instance().get(avatar_ids);
-	
-	if (avatar_ids.size() > 0)
-		return mRecentList->updateList(avatar_ids);
+	if (mNearbyVec.size() == 0)
+		mNearbyList->setCommentText(getString("no_one_near"));
 
-	mRecentList->setCommentText(getString("no_people"));
-	return true;
+	return have_names;
 }
 
-bool LLPanelPeople::updateGroupList()
+bool LLPanelPeople::filterRecentList()
 {
-	return mGroupList->updateList();
+	if (mRecentVec.size() > 0)
+		return mRecentList->update(mRecentVec, mFilterSubString);
+
+	mRecentList->setCommentText(getString("no_people"));
+
+	return true;
 }
 
 void LLPanelPeople::buttonSetVisible(std::string btn_name, BOOL visible)
@@ -433,10 +491,10 @@ void LLPanelPeople::buttonSetAction(const std::string& btn_name, const commit_si
 void LLPanelPeople::updateButtons()
 {
 	std::string cur_tab		= mTabContainer->getCurrentPanel()->getName();
-	bool nearby_tab_active	= (cur_tab == "nearby_panel");
-	bool friends_tab_active = (cur_tab == "friends_panel");
-	bool group_tab_active	= (cur_tab == "groups_panel");
-	bool recent_tab_active	= (cur_tab == "recent_panel");
+	bool nearby_tab_active	= (cur_tab == NEARBY_TAB_NAME);
+	bool friends_tab_active = (cur_tab == FRIENDS_TAB_NAME);
+	bool group_tab_active	= (cur_tab == GROUP_TAB_NAME);
+	bool recent_tab_active	= (cur_tab == RECENT_TAB_NAME);
 	LLUUID selected_id;
 
 	buttonSetVisible("group_info_btn",		group_tab_active);
@@ -489,11 +547,11 @@ LLAvatarList* LLPanelPeople::getActiveAvatarList() const
 {
 	std::string cur_tab = mTabContainer->getCurrentPanel()->getName();
 
-	if (cur_tab == "friends_panel")
+	if (cur_tab == FRIENDS_TAB_NAME)
 		return mFriendList;
-	if (cur_tab == "nearby_panel")
+	if (cur_tab == NEARBY_TAB_NAME)
 		return mNearbyList;
-	if (cur_tab == "recent_panel")
+	if (cur_tab == RECENT_TAB_NAME)
 		return mRecentList;
 
 	return NULL;
@@ -535,14 +593,19 @@ void LLPanelPeople::onVisibilityChange(BOOL new_visibility)
 	}
 	else
 	{
-		// Make the tab-container re-select current tab
-		// for onTabSelected() callback to get called.
-		// (currently this is needed to reactivate nearby list updates
-		// when we get visible)
-		mTabContainer->selectTab(mTabContainer->getCurrentPanelIndex());
+		reSelectedCurrentTab();
 	}
 }
 
+// Make the tab-container re-select current tab
+// for onTabSelected() callback to get called.
+// (currently this is needed to reactivate nearby list updates
+// when we get visible)
+void LLPanelPeople::reSelectedCurrentTab()
+{
+	mTabContainer->selectTab(mTabContainer->getCurrentPanelIndex());
+}
+
 void LLPanelPeople::onSearchEdit(const std::string& search_string)
 {
 	if (mFilterSubString == search_string)
@@ -553,12 +616,18 @@ void LLPanelPeople::onSearchEdit(const std::string& search_string)
 	LLStringUtil::toUpper(mFilterSubString);
 	LLStringUtil::trimHead(mFilterSubString);
 	mSearchEditor->setText(mFilterSubString);
+
+	// Apply new filter to all tabs.
+	filterNearbyList();
+	filterFriendList();
+	filterRecentList();
+	updateGroupList();
 }
 
 void LLPanelPeople::onTabSelected(const LLSD& param)
 {
 	std::string tab_name = getChild<LLPanel>(param.asString())->getName();
-	mNearbyListUpdater->setActive(tab_name == "nearby_panel");
+	mNearbyListUpdater->setActive(tab_name == NEARBY_TAB_NAME);
 	updateButtons();
 }
 
@@ -725,5 +794,5 @@ void LLPanelPeople::onMoreButtonClicked()
 
 void	LLPanelPeople::onOpen(const LLSD& key)
 {
-	mTabContainer->selectTab(key.asInteger());
+	reSelectedCurrentTab();
 }
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 4d535f287cd..4855096750e 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -61,8 +61,10 @@ class LLPanelPeople : public LLPanel
 	bool					updateNearbyList();
 	bool					updateRecentList();
 	bool					updateGroupList();
+	bool					filterFriendList();
+	bool					filterNearbyList();
+	bool					filterRecentList();
 	void					updateButtons();
-	bool					refreshFriendNames(U32 changed_mask);
 	LLAvatarList*			getActiveAvatarList() const;
 	LLUUID					getCurrentItemID() const;
 	void					buttonSetVisible(std::string btn_name, BOOL visible);
@@ -72,6 +74,8 @@ class LLPanelPeople : public LLPanel
 
 	/*virtual*/ void		onVisibilityChange(BOOL new_visibility);
 
+	void					reSelectedCurrentTab();
+
 	// UI callbacks
 	void					onSearchEdit(const std::string& search_string);
 	void					onTabSelected(const LLSD& param);
@@ -117,6 +121,17 @@ class LLPanelPeople : public LLPanel
 	Updater*				mGroupListUpdater;
 
 	std::string				mFilterSubString;
+
+	// The vectors below contain up-to date avatar lists
+	// for the corresponding tabs.
+	// When the user enters a filter, it gets applied
+	// to all the vectors and the result is shown in the tabs.
+	// We don't need to have such a vector for the groups tab
+	// since re-fetching the groups list is always fast.
+	typedef std::vector<LLUUID> uuid_vector_t;
+	uuid_vector_t			mNearbyVec;
+	uuid_vector_t			mFriendVec;
+	uuid_vector_t			mRecentVec;
 };
 
 #endif //LL_LLPANELPEOPLE_H
diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp
index 65be4718efa..cb47759a49d 100644
--- a/indra/newview/llpanelpick.cpp
+++ b/indra/newview/llpanelpick.cpp
@@ -42,9 +42,11 @@
 #include "llviewerparcelmgr.h"
 #include "lltexturectrl.h"
 #include "lluiconstants.h"
+#include "llworldmap.h"
+#include "llfloaterworldmap.h"
+#include "llfloaterreg.h"
 #include "llavatarpropertiesprocessor.h"
 #include "llpanelpick.h"
-#include "llpanelmeprofile.h"
 
 
 #define XML_PANEL_EDIT_PICK "panel_edit_pick.xml"
@@ -55,6 +57,12 @@
 #define XML_SNAPSHOT	"pick_snapshot"
 #define XML_LOCATION	"pick_location"
 
+#define XML_BTN_SAVE "save_changes_btn"
+
+#define SAVE_BTN_LABEL "[WHAT]"
+#define LABEL_PICK = "Pick"
+#define LABEL_CHANGES = "Changes"
+
 
 LLPanelPick::LLPanelPick(BOOL edit_mode/* = FALSE */)
 :	LLPanel(), LLAvatarPropertiesObserver(),
@@ -78,15 +86,22 @@ LLPanelPick::LLPanelPick(BOOL edit_mode/* = FALSE */)
 
 LLPanelPick::~LLPanelPick()
 {
-	if (!mCreatorId.isNull()) 	LLAvatarPropertiesProcessor::instance().removeObserver(mCreatorId, this);
+	if (mCreatorId.notNull()) 	LLAvatarPropertiesProcessor::instance().removeObserver(mCreatorId, this);
 }
 
 void LLPanelPick::reset()
 {
+	setEditMode(FALSE);
+	
 	mPickId.setNull();
 	mCreatorId.setNull();
 	mParcelId.setNull();
 	
+	setName("");
+	setDesc("");
+	setLocation("");
+	mSnapshotCtrl->setImageAssetID(LLUUID::null);
+
 	mDataReceived = FALSE;
 
 	mPosGlobal.clearVec();
@@ -100,14 +115,22 @@ BOOL LLPanelPick::postBuild()
 	{
 		childSetAction("cancel_btn", onClickCancel, this);
 		childSetAction("set_to_curr_location_btn", onClickSet, this);
-		childSetAction("save_changes_btn", onClickSave, this);
+		childSetAction(XML_BTN_SAVE, onClickSave, this);
+
+		mSnapshotCtrl->setMouseEnterCallback(boost::bind(&LLPanelPick::childSetVisible, this, "edit_icon", true));
+		mSnapshotCtrl->setMouseLeaveCallback(boost::bind(&LLPanelPick::childSetVisible, this, "edit_icon", false));
 	}
 	else
 	{
 		childSetAction("edit_btn", onClickEdit, this);
 		childSetAction("teleport_btn", onClickTeleport, this);
 		childSetAction("show_on_map_btn", onClickMap, this);
-		childSetAction("back_btn", onClickBack, this);
+
+		if (mExitFunction && mExitData)
+		{
+			childSetAction("back_btn", mExitFunction, mExitData);
+		}
+
 		//*TODO set on menu
 	}
 
@@ -119,21 +142,15 @@ void LLPanelPick::init(LLUUID creator_id, LLUUID pick_id)
 	mCreatorId = creator_id;
 	mPickId = pick_id;
 
-	// on Pick Info panel (for non-Agent picks) edit_btn should be invisible
-	if (!mEditMode)
-	{
-		if (mCreatorId != gAgentID)
-		{
-			childSetEnabled("edit_btn", FALSE);
-			childSetVisible("edit_btn", FALSE);
-		}
-		else 
-		{
-			childSetEnabled("edit_btn", TRUE);
-			childSetVisible("edit_btn", TRUE);
-		}
-	}
+	//*TODO consider removing this, already called by setEditMode()
+	updateButtons();
+
+	requestData();
+}
 
+void LLPanelPick::requestData()
+{
+	mDataReceived = FALSE;
 	LLAvatarPropertiesProcessor::instance().addObserver(mCreatorId, this);
 	LLAvatarPropertiesProcessor::instance().sendDataRequest(mCreatorId, APT_PICK_INFO, &mPickId);
 }
@@ -170,6 +187,8 @@ void LLPanelPick::createNewPick()
 	}
 
 	sendUpdate();
+
+	childSetLabelArg(XML_BTN_SAVE, SAVE_BTN_LABEL, std::string("Pick"));
 }
 
 /*virtual*/ void LLPanelPick::processProperties(void* data, EAvatarProcessorType type)
@@ -183,7 +202,7 @@ void LLPanelPick::createNewPick()
 
 	init(pick_data);
 	mDataReceived = TRUE;
-	LLAvatarPropertiesProcessor::instance().removeObserver(gAgentID, this);
+	LLAvatarPropertiesProcessor::instance().removeObserver(mCreatorId, this);
 }
 
 
@@ -192,44 +211,36 @@ void LLPanelPick::setEditMode( BOOL edit_mode )
 	if (mEditMode == edit_mode) return;
 	mEditMode = edit_mode;
 
-	if (edit_mode)
-	{
-		// preserve data before killing controls
-		std::string name = getName();
-		std::string desc = getDesc();
-		std::string location = getLocation();
-		LLUUID snapshot_id = mSnapshotCtrl->getImageAssetID();
-		LLRect old_rect = getRect();
+	// preserve data before killing controls
+	std::string name = getName();
+	std::string desc = getDesc();
+	std::string location = getLocation();
+	LLUUID snapshot_id = mSnapshotCtrl->getImageAssetID();
+	LLRect old_rect = getRect();
 
-		deleteAllChildren();
+	deleteAllChildren();
 
+	if (edit_mode)
+	{
 		LLUICtrlFactory::getInstance()->buildPanel(this, XML_PANEL_EDIT_PICK);
-
-		//*NOTE this code is from LLPanelMeProfile.togglePanel()... doubt this is a right way to do things
-		reshape(old_rect.getWidth(), old_rect.getHeight());
-		old_rect.setLeftTopAndSize(0, old_rect.getHeight(), old_rect.getWidth(), old_rect.getHeight());
-		setRect(old_rect);
-
-		// time to restore data
-		setName(name);
-		setDesc(desc);
-		setLocation(location);
-		mSnapshotCtrl->setImageAssetID(snapshot_id);
 	}
 	else
 	{
-		// returning to VIEW mode - need to perform cleanup 
-		// this is the case when that panel is reused between viewing/editing different picks
-		deleteAllChildren();
-		reset();
 		LLUICtrlFactory::getInstance()->buildPanel(this, XML_PANEL_PICK_INFO);
 	}
-}
 
-//*HACK need to be redone - control panel toggling from parent (Me Panel/Avatar Profile Panel)
-void LLPanelPick::setPanelMeProfile(LLPanelMeProfile* meProfilePanel)
-{
-	mMeProfilePanel = meProfilePanel;
+	//*NOTE this code is from LLPanelMeProfile.togglePanel()... doubt this is a right way to do things
+	reshape(old_rect.getWidth(), old_rect.getHeight());
+	old_rect.setLeftTopAndSize(0, old_rect.getHeight(), old_rect.getWidth(), old_rect.getHeight());
+	setRect(old_rect);
+
+	// time to restore data
+	setName(name);
+	setDesc(desc);
+	setLocation(location);
+	mSnapshotCtrl->setImageAssetID(snapshot_id);
+
+	updateButtons();
 }
 
 void LLPanelPick::setName(std::string name)
@@ -299,6 +310,9 @@ void LLPanelPick::sendUpdate()
 	pick_data.sort_order = 0;
 	pick_data.enabled = TRUE;
 
+	mDataReceived = FALSE;
+	LLAvatarPropertiesProcessor::instance().addObserver(gAgentID, this);
+
 	LLAvatarPropertiesProcessor::instance().sendDataUpdate(&pick_data, APT_PICK_INFO);
 }
 
@@ -321,28 +335,20 @@ void LLPanelPick::onClickEdit(void* data)
 //static
 void LLPanelPick::onClickTeleport(void* data)
 {
-	//LLPanelPick* self = (LLPanelPick*)data;
-	//*TODO implement
+	LLPanelPick* self = (LLPanelPick*)data;
+	if (!self) return;
+	teleport(self->mPosGlobal);
 }
 
 //static
 void LLPanelPick::onClickMap(void* data)
-{
-	//LLPanelPick* self = (LLPanelPick*)data;
-	//*TODO implement
-}
-
-//*HACK need to move panel toggling to parent panels
-//static
-void LLPanelPick::onClickBack(void* data)
 {
 	LLPanelPick* self = (LLPanelPick*)data;
 	if (!self) return;
-	self->mMeProfilePanel->togglePanel(self);
+	showOnMap(self->mPosGlobal);
 }
 
 
-
 //-----------------------------------------
 // "EDIT PICK" (EDIT MODE) BUTTON HANDLERS
 //-----------------------------------------
@@ -353,17 +359,20 @@ void LLPanelPick::onClickCancel(void* data)
 	LLPanelPick* self = (LLPanelPick*) data;
 	if (!self) return;
 	if (!self->mEditMode) return;
-	self->mMeProfilePanel->togglePanel(self);
+	
+	LLUUID pick_id = self->mPickId;
+	LLUUID creator_id = self->mCreatorId;
+	self->reset();
+	self->init(creator_id, pick_id);
 }
 
 // static
 void LLPanelPick::onClickSet(void* data)
 {
-	//TODO check whether pick data was received before
-
 	LLPanelPick* self = (LLPanelPick*) data;
 	if (!self) return;
 	if (!self->mEditMode) return;
+	if (!self->mDataReceived) return;
 
 	// Save location for later.
 	self->mPosGlobal = gAgent.getPositionGlobal();
@@ -386,7 +395,56 @@ void LLPanelPick::onClickSave(void* data)
 	if (!self->mEditMode) return;
 	if (!self->mDataReceived) return;
 
-	//*TODO check if data was received before 
 	self->sendUpdate();
-	self->mMeProfilePanel->togglePanel(self);
+	self->setEditMode(FALSE);
+}
+
+void LLPanelPick::updateButtons()
+{
+
+	// on Pick Info panel (for non-Agent picks) edit_btn should be invisible
+	if (mEditMode)
+	{
+		childSetLabelArg(XML_BTN_SAVE, SAVE_BTN_LABEL, std::string("Changes"));
+	}
+	else 
+	{
+		if (mCreatorId != gAgentID)
+		{
+			childSetEnabled("edit_btn", FALSE);
+			childSetVisible("edit_btn", FALSE);
+		}
+		else 
+		{
+			childSetEnabled("edit_btn", TRUE);
+			childSetVisible("edit_btn", TRUE);
+		}
+	}
+}
+
+void LLPanelPick::setExitCallback( boost::function<void(void*)> function, void* data )
+{
+	mExitFunction = function;
+	mExitData = data;
+	if (!mEditMode)
+	{
+		childSetAction("back_btn", function, data);
+	}
+}
+
+//static
+void LLPanelPick::teleport(const LLVector3d& position)
+{
+	if (!position.isExactlyZero())
+	{
+		gAgent.teleportViaLocation(position);
+		LLFloaterWorldMap::getInstance()->trackLocation(position);
+	}
+}
+
+//static
+void LLPanelPick::showOnMap(const LLVector3d& position)
+{
+	LLFloaterWorldMap::getInstance()->trackLocation(position);
+	LLFloaterReg::showInstance("world_map", "center");
 }
diff --git a/indra/newview/llpanelpick.h b/indra/newview/llpanelpick.h
index 8ada1a39fb5..36bced38494 100644
--- a/indra/newview/llpanelpick.h
+++ b/indra/newview/llpanelpick.h
@@ -41,7 +41,6 @@
 
 class LLTextureCtrl;
 class LLMessageSystem;
-class LLPanelMeProfile;
 class LLAvatarPropertiesObserver;
 
 class LLPanelPick : public LLPanel, public LLAvatarPropertiesObserver
@@ -51,6 +50,7 @@ class LLPanelPick : public LLPanel, public LLAvatarPropertiesObserver
 	LLPanelPick(BOOL edit_mode = FALSE);
 	/*virtual*/ ~LLPanelPick();
 
+	// switches the panel to the VIEW mode and resets controls
 	void reset();
 
 	/*virtual*/ BOOL postBuild();
@@ -59,14 +59,26 @@ class LLPanelPick : public LLPanel, public LLAvatarPropertiesObserver
 	// initial position, etc.
 	void createNewPick();
 
+	//initializes the panel with data of the pick with id = pick_id 
+	//owned by the avatar with id = creator_id
 	void init(LLUUID creator_id, LLUUID pick_id);
 
 	/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
 
+	// switches the panel to either View or Edit mode
 	void setEditMode(BOOL edit_mode);
 
-	//TODO redo panel toggling
-	void setPanelMeProfile(LLPanelMeProfile* meProfilePanel);
+	// because this panel works in two modes (edit/view) we are  
+	// free from managing two panel for editing and viewing picks and so
+	// are free from controlling switching between them in the parent panel (e.g. Me Profile)
+	// but that causes such a complication that we cannot set a callback for a "Back" button
+	// from the parent panel only once, so we have to preserve that callback
+	// in the pick panel and set it for the back button everytime postBuild() is called.
+	void setExitCallback(boost::function<void(void*)> function, void* value);
+
+	static void teleport(const LLVector3d& position);
+	static void showOnMap(const LLVector3d& position);
+
 
 protected:
 
@@ -79,15 +91,18 @@ class LLPanelPick : public LLPanel, public LLAvatarPropertiesObserver
 	std::string getLocation();
 
 	void sendUpdate();
+	void requestData();
+
 	void init(LLPickData *pick_data);
 
+	void updateButtons();
+
 	//-----------------------------------------
 	// "PICK INFO" (VIEW MODE) BUTTON HANDLERS
 	//-----------------------------------------
 	static void onClickEdit(void* data);
 	static void onClickTeleport(void* data);
 	static void onClickMap(void* data);
-	static void onClickBack(void* data);
 
 	//-----------------------------------------
 	// "EDIT PICK" (EDIT MODE) BUTTON HANDLERS
@@ -99,7 +114,6 @@ class LLPanelPick : public LLPanel, public LLAvatarPropertiesObserver
 protected:
 	BOOL mEditMode;
 	LLTextureCtrl*	mSnapshotCtrl;
-	BOOL mDataRequested;
 	BOOL mDataReceived;
 
 	LLUUID mPickId;
@@ -108,8 +122,8 @@ class LLPanelPick : public LLPanel, public LLAvatarPropertiesObserver
 	LLUUID mParcelId;
 	std::string mSimName;
 
-	//TODO redo panel toggling
-	LLPanelMeProfile* mMeProfilePanel;
+	boost::function<void(void*)> mExitFunction;
+	void* mExitData;
 };
 
 #endif // LL_LLPANELPICK_H
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
index 1a3aa8a33a9..c32af244232 100644
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -36,37 +36,39 @@
 #include "llavatarconstants.h"
 #include "lltexturectrl.h"
 #include "llviewergenericmessage.h"	// send_generic_message
-#include "llworldmap.h"
-#include "llfloaterworldmap.h"
-#include "llpanelmeprofile.h"
-#include "llfloaterreg.h"
+#include "llmenugl.h"
+#include "llviewermenu.h"
+
 #include "llpanelpicks.h"
 #include "llavatarpropertiesprocessor.h"
+#include "llpanelavatar.h"
 #include "llpanelpick.h"
 
-#define XML_BTN_NEW "new_btn"
-#define XML_BTN_DELETE "trash_btn"
-#define XML_BTN_INFO "info_btn"
+static const std::string XML_BTN_NEW = "new_btn";
+static const std::string XML_BTN_DELETE = "trash_btn";
+static const std::string XML_BTN_INFO = "info_btn";
+static const std::string XML_BTN_TELEPORT = "teleport_btn";
+static const std::string XML_BTN_SHOW_ON_MAP = "show_on_map_btn";
+
+static const std::string XML_PICKS_LIST = "back_panel";
+
+#define PICK_ITEMS_BETWEEN 5
 
 
 //-----------------------------------------------------------------------------
 // LLPanelPicks
 //-----------------------------------------------------------------------------
 LLPanelPicks::LLPanelPicks(const LLUUID& avatar_id /* = LLUUID::null */)
-:LLPanelProfileTab(avatar_id), mMeProfilePanel(NULL)
+:	LLPanelProfileTab(avatar_id),
+	mPopupMenu(NULL),
+	mSelectedPickItem(NULL)
 {
 	updateData();
 }
 
-LLPanelPicks::LLPanelPicks(const Params& params)
-:LLPanelProfileTab(params), mMeProfilePanel(NULL)
-{
-
-}
-
 LLPanelPicks::~LLPanelPicks()
 {
-	if(!getAvatarId().isNull())
+	if(getAvatarId().notNull())
 	{
 		LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this);
 	}
@@ -99,8 +101,13 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type)
 			gCacheName->getName(getAvatarId(),name,second_name);
 			childSetTextArg("pick_title", "[NAME]",name);
 
-			LLView* picks_list = getChild<LLView>("back_panel",TRUE,FALSE);
+			LLView* picks_list = getPicksList();
 			if(!picks_list) return;
+			
+			// to restore selection of the same item later
+			LLUUID pick_id_selected(LLUUID::null);
+			if (mSelectedPickItem) pick_id_selected = mSelectedPickItem->getPickId();
+
 			clear();
 
 			//*TODO move it somewhere else?
@@ -108,13 +115,9 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type)
 			childSetEnabled(XML_BTN_NEW, false);
 			childSetEnabled(XML_BTN_DELETE, false);
 			childSetEnabled(XML_BTN_INFO, false);
+			childSetEnabled(XML_BTN_TELEPORT,!avatar_picks->picks_list.empty());
+			childSetEnabled(XML_BTN_SHOW_ON_MAP,!avatar_picks->picks_list.empty());
 						
-			S32 height = avatar_picks->picks_list.size() * 85;
-			LLRect rc = picks_list->getRect();
-			rc.setLeftTopAndSize(rc.mLeft,rc.mTop,rc.getWidth(),height);
-			picks_list->setRect(rc);
-			picks_list->reshape(rc.getWidth(),rc.getHeight());
-
 			LLAvatarPicks::picks_list_t::const_iterator it = avatar_picks->picks_list.begin();
 			for(; avatar_picks->picks_list.end() != it; ++it)
 			{
@@ -124,30 +127,22 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type)
 				LLPickItem* picture = LLPickItem::create();
 				picks_list->addChild(picture);
 
-				picture->setPictureName(pick_name);
-				picture->setPictureId(pick_id);
+				picture->setPickName(pick_name);
+				picture->setPickId(pick_id);
 				picture->setCreatorId(getAvatarId());
 
-				S32 last_bottom = picks_list->getRect().getHeight();
-				if(mPickItemList.size() > 0)
-				{
-					last_bottom = mPickItemList[mPickItemList.size()-1]->getRect().mBottom;
-					last_bottom -= 5;
-				}
-				LLRect rc = picture->getRect();
-				rc.mBottom = last_bottom - rc.getHeight();
-				rc.mTop = last_bottom;
-				picture->reshape(rc.getWidth(),rc.getHeight());
-				picture->setRect(rc);
-
-				
 				LLAvatarPropertiesProcessor::instance().addObserver(mAvatarId, picture);
 				picture->update();
 				mPickItemList.push_back(picture);
+				if (pick_id_selected != LLUUID::null && 
+					pick_id == pick_id_selected) setSelectedPickItem(picture);
 			}
+
+			reshapePicksList();
 			LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this);
 
 			updateButtons();
+			if (!mSelectedPickItem && mPickItemList.size()) setSelectedPickItem(mPickItemList.back());
 			picks_list->setEnabled(TRUE);
 
 		}
@@ -156,7 +151,7 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type)
 
 void LLPanelPicks::clear()
 {
-	LLView* scroll = getChild<LLView>("back_panel",TRUE,FALSE);
+	LLView* scroll = getPicksList();
 	if(scroll)
 	{
 		picture_list_t::const_iterator it = mPickItemList.begin();
@@ -167,16 +162,85 @@ void LLPanelPicks::clear()
 		}
 	}
 	mPickItemList.clear();
+	mSelectedPickItem = NULL;
+}
+
+
+LLPickItem* LLPanelPicks::getSelectedPickItem()
+{
+	return mSelectedPickItem;
+}
+
+
+void LLPanelPicks::removePickItem( LLPickItem* pick_item )
+{
+	LLView* scroll = getPicksList();
+	scroll->removeChild(pick_item);
+	mPickItemList.remove(pick_item);
+	if (mPickItemList.size() == 0)
+	{
+		mSelectedPickItem = NULL;
+	}
+	else 
+	{
+		setSelectedPickItem(mPickItemList.back());
+	}
+
+	reshapePicksList();
+}
+
+void LLPanelPicks::reshapePicksList()
+{
+	if (!mPickItemList.size()) return;
+	LLView* pickList = getPicksList();
+
+	S32 last_bottom = pickList->getRect().getHeight();
+	child_list_const_iter_t child_it, child_first_it = pickList->getChildList()->begin();
+	for ( child_it = child_first_it; child_it != pickList->getChildList()->end(); ++child_it)
+	{
+		LLView* const childp = *child_it;
+		if(child_it != child_first_it)
+		{
+			last_bottom -= childp->getRect().getHeight();
+			last_bottom -= PICK_ITEMS_BETWEEN;
+		}
+		reshapePickItem(childp, last_bottom);
+	}
+
+	S32 height = pickList->getChildCount() * ((*child_first_it)->getRect().getHeight() + PICK_ITEMS_BETWEEN);
+	LLRect rc = pickList->getRect();
+	rc.setLeftTopAndSize(rc.mLeft, rc.mTop, rc.getWidth(), height);
+	pickList->reshape(rc.getWidth(), rc.getHeight());
+	pickList->setRect(rc);
+}
+
+void LLPanelPicks::reshapePickItem(LLView* const pick_item, const S32 last_bottom)
+{
+	LLRect rc = pick_item->getRect();
+	rc.mBottom = last_bottom - rc.getHeight();
+	rc.mTop = last_bottom;
+	pick_item->reshape(rc.getWidth(), rc.getHeight());
+	pick_item->setRect(rc);
+}
+
+LLView* LLPanelPicks::getPicksList() const
+{
+	return getChild<LLView>(XML_PICKS_LIST, TRUE, FALSE);
 }
 
 BOOL LLPanelPicks::postBuild(void)
 {
-	childSetAction(XML_BTN_INFO, onClickInfo, this);
-	childSetAction(XML_BTN_NEW, onClickNew, this);
 	childSetAction(XML_BTN_DELETE, onClickDelete, this);
 
 	childSetAction("teleport_btn", onClickTeleport, this);
 	childSetAction("show_on_map_btn", onClickMap, this);
+
+	mCommitCallbackRegistrar.add("Pick.Teleport", boost::bind(onClickTeleport, this));
+	mCommitCallbackRegistrar.add("Pick.Map", boost::bind(onClickMap, this));
+	mCommitCallbackRegistrar.add("Pick.Delete", boost::bind(onClickDelete, this));
+
+	mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_picks.xml", gMenuHolder);
+
 	return TRUE;
 }
 
@@ -188,6 +252,14 @@ void LLPanelPicks::onActivate(const LLUUID& id)
 	childSetEnabled("edit_panel", self);
 	childSetVisible("edit_panel", self);
 
+	// Disable buttons when viewing profile for first time
+	if(getAvatarId() != id)
+	{
+		childSetEnabled(XML_BTN_INFO,FALSE);
+		childSetEnabled(XML_BTN_TELEPORT,FALSE);
+		childSetEnabled(XML_BTN_SHOW_ON_MAP,FALSE);
+	}
+
 	// and see a special title - set as invisible by default in xml file
 	if (self)
 	{
@@ -198,141 +270,74 @@ void LLPanelPicks::onActivate(const LLUUID& id)
 	LLPanelProfileTab::onActivate(id);
 }
 
-
-//static
-void LLPanelPicks::onClickInfo(void *data)
-{
-	LLPanelPicks* self = (LLPanelPicks*) data;
-	if (self)
-	{
-		LLPanelPick* panel_pick_info = new LLPanelPick();
-		
-		//*TODO redo, use the selected pick from List View, but not the first (last) one
-		LLView* scroll = self->getChild<LLView>("back_panel", TRUE, FALSE);
-		LLPickItem* pick = static_cast<LLPickItem*>(scroll->getFirstChild());
-		if (!pick) return;
-
-		panel_pick_info->init(pick->getCreatorId(), pick->getPickId());
-
-		//*HACK redo toggling of panels (should work on both "profiles")
-		if (self->mMeProfilePanel)
-		{
-			panel_pick_info->setPanelMeProfile(self->mMeProfilePanel);
-			//self->mMeProfilePanel->addChildInBack(panel_pick_info);
-			self->mMeProfilePanel->togglePanel(panel_pick_info);
-		}
-	}
-}
-
-//static
-void LLPanelPicks::onClickNew(void *data)
-{
-	LLPanelPicks* self = (LLPanelPicks*) data;
-	if(self && self->mMeProfilePanel)
-	{
-		if (self->mPickItemList.size() >= MAX_AVATAR_PICKS)
-		{
-			//*TODO show warning message
-			return;
-		}
-				
-		//in edit mode
-		LLPanelPick* panel_edit_pick = new LLPanelPick(TRUE);
-		panel_edit_pick->createNewPick();
-
-		//*HACK redo toggling of panels
-		panel_edit_pick->setPanelMeProfile(self->mMeProfilePanel);
-		self->mMeProfilePanel->togglePanel(panel_edit_pick);
-	}
-}
-
 //static
 void LLPanelPicks::onClickDelete(void *data)
 {
 	LLPanelPicks* self = (LLPanelPicks*) data;
-	if(self && self->mMeProfilePanel)
-	{
-	//*TODO redo, use the selected pick from List View, but not the first (last) one
-	LLView* scroll = self->getChild<LLView>("back_panel", TRUE, FALSE);
-	LLPickItem* first_pick = static_cast<LLPickItem*>(scroll->getFirstChild());
-	if (!first_pick) return;
+	if (!self) return;
+
+	LLPickItem* pick_item = self->getSelectedPickItem();
+	if (!pick_item) return;
 
 	LLSD args; 
-	args["PICK"] = first_pick->getPickName(); 
+	args["PICK"] = pick_item->getPickName(); 
 	LLNotifications::instance().add("DeleteAvatarPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackDelete, self, _1, _2)); 
-	}
 }
 
 bool LLPanelPicks::callbackDelete(const LLSD& notification, const LLSD& response) 
 {
 	S32 option = LLNotification::getSelectedOption(notification, response);
 
-	//*TODO redo, use the selected pick from List View, but not the first (last) one
-	LLView* scroll = getChild<LLView>("back_panel",TRUE,FALSE);
-	LLPickItem* first_pick = static_cast<LLPickItem*>(scroll->getFirstChild());
-	if (!first_pick) return false;
+	LLPickItem* pick_item = getSelectedPickItem();
 
 	if (0 == option)
 	{
-		LLAvatarPropertiesProcessor::instance().sendPickDelete(first_pick->getPickId());
-
-		scroll->removeChild(first_pick);
-		mPickItemList.pop_back();
-		first_pick = NULL;
+		LLAvatarPropertiesProcessor::instance().sendPickDelete(pick_item->getPickId());
+		removePickItem(pick_item);
 	}
 	updateButtons();
 	return false;
 }
 
-void LLPanelPicks::setPanelMeProfile(LLPanelMeProfile* meProfilePanel)
-{
-	mMeProfilePanel = meProfilePanel;
-}
-
-//static
-void LLPanelPicks::teleport(const LLVector3d& position)
-{
-	if (!position.isExactlyZero())
-	{
-		gAgent.teleportViaLocation(position);
-		LLFloaterWorldMap::getInstance()->trackLocation(position);
-	}
-}
-
 //static
 void LLPanelPicks::onClickTeleport(void* data)
 {
 	LLPanelPicks* self = (LLPanelPicks*)data;
-
-	if (!self->mPickItemList.size()) return;
-
-	//*TODO use the selected Pick instead of the last one in the list of Picks
-	LLPickItem* last_pick = self->mPickItemList.back();
-	if (!last_pick) return;
-
-	teleport(last_pick->getPosGlobal());
+	LLPickItem* pick_item = self->getSelectedPickItem();
+	if (!pick_item) return;
+	LLPanelPick::teleport(pick_item->getPosGlobal());
 }
 
 //static
 void LLPanelPicks::onClickMap(void* data)
 {
 	LLPanelPicks* self = (LLPanelPicks*)data;
-	
-	if (!self->mPickItemList.size()) return;
-	
-	//*TODO use the selected Pick instead of the last one in the list of Picks
-	LLPickItem* last_pick = self->mPickItemList.back();
-	if (!last_pick) return;
+	LLPickItem* pick_item = self->getSelectedPickItem();
+	if (!pick_item) return;
+	LLPanelPick::showOnMap(pick_item->getPosGlobal());
+}
 
-	showOnMap(last_pick->getPosGlobal());
 
+BOOL LLPanelPicks::handleRightMouseDown(S32 x, S32 y, MASK mask)
+{
+	if (isMouseInPick(x, y))
+	{
+		if (mPopupMenu)
+		{
+			mPopupMenu->buildDrawLabels();
+			mPopupMenu->updateParent(LLMenuGL::sMenuContainer);
+			((LLContextMenu*)mPopupMenu)->show(x, y, FALSE);
+			LLMenuGL::showPopup(this, mPopupMenu, x, y);
+		}
+		return TRUE;
+	}
+	return LLPanel::handleRightMouseDown(x, y, mask);
 }
 
-//static
-void LLPanelPicks::showOnMap(const LLVector3d& position)
+BOOL LLPanelPicks::handleMouseDown( S32 x, S32 y, MASK mask )
 {
-	LLFloaterWorldMap::getInstance()->trackLocation(position);
-	LLFloaterReg::showInstance("world_map", "center");
+	if (isMouseInPick(x, y)) return TRUE;
+	return LLPanel::handleMouseDown(x, y, mask);
 }
 
 void LLPanelPicks::updateButtons()
@@ -344,7 +349,49 @@ void LLPanelPicks::updateButtons()
 	{
 		childSetEnabled(XML_BTN_NEW, picks_num < MAX_AVATAR_PICKS);
 		childSetEnabled(XML_BTN_DELETE, picks_num > 0);
+
+		//*TODO move somewhere this calls
+		// we'd better set them up earlier when a panel was being constructed
+		mPopupMenu->setItemVisible("pick_delete", TRUE);
+		mPopupMenu->setItemVisible("pick_edit", TRUE);
+		mPopupMenu->setItemVisible("pick_separator", TRUE);
 	}
+
+	//*TODO update buttons like Show on Map, Teleport etc.
+
+}
+
+void LLPanelPicks::setSelectedPickItem( LLPickItem* item )
+{
+	if (!item) return;
+	if (mSelectedPickItem == item) return;
+	if (mSelectedPickItem && mSelectedPickItem->isBackgroundVisible())
+	{
+		mSelectedPickItem->setBackgroundVisible(FALSE);
+	}
+	item->setBackgroundVisible(TRUE);
+	mSelectedPickItem = item;
+}
+
+BOOL LLPanelPicks::isMouseInPick( S32 x, S32 y )
+{
+	LLView* scroll = getChild<LLView>("profile_scroll");
+	if (!scroll->parentPointInView(x, y)) return FALSE;
+
+	S32 x_l = x;
+	S32 y_l = y;
+	
+	picture_list_t::const_iterator it = mPickItemList.begin();
+	for(; mPickItemList.end() != it; ++it)
+	{
+		localPointToOtherView(x, y, &x_l, &y_l, (*it));
+		if ((*it)->pointInView(x_l, y_l))
+		{
+			setSelectedPickItem(*it);
+			return TRUE;
+		}
+	}	
+	return FALSE;
 }
 
 
@@ -353,18 +400,18 @@ void LLPanelPicks::updateButtons()
 //-----------------------------------------------------------------------------
 LLPickItem::LLPickItem()
 : LLPanel()
-, mPicID(LLUUID::null)
+, mPickID(LLUUID::null)
 , mCreatorID(LLUUID::null)
 , mParcelID(LLUUID::null)
 , mSnapshotID(LLUUID::null)
 , mNeedData(true)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this,"panel_pic_list_item.xml");
+	LLUICtrlFactory::getInstance()->buildPanel(this,"panel_pick_list_item.xml");
 }
 
 LLPickItem::~LLPickItem()
 {
-	if (!mCreatorID.isNull())
+	if (mCreatorID.notNull())
 	{
 		LLAvatarPropertiesProcessor::instance().removeObserver(mCreatorID, this);
 	}
@@ -378,7 +425,7 @@ LLPickItem* LLPickItem::create()
 
 void LLPickItem::init(LLPickData* pick_data)
 {
-	setPictureDescription(pick_data->desc);
+	setPickDesc(pick_data->desc);
 	setSnapshotId(pick_data->snapshot_id);
 	mPosGlobal = pick_data->pos_global;
 	mLocation = pick_data->location_text;
@@ -390,12 +437,7 @@ void LLPickItem::init(LLPickData* pick_data)
 	}
 }
 
-void LLPickItem::setPicture()
-{
-
-}
-
-void LLPickItem::setPictureName(const std::string& name)
+void LLPickItem::setPickName(const std::string& name)
 {
 	mPickName = name;
 	childSetValue("picture_name",name);
@@ -417,19 +459,19 @@ const LLUUID& LLPickItem::getSnapshotId()
 	return mSnapshotID;
 }
 
-void LLPickItem::setPictureDescription(const std::string& descr)
+void LLPickItem::setPickDesc(const std::string& descr)
 {
 	childSetValue("picture_descr",descr);
 }
 
-void LLPickItem::setPictureId(const LLUUID& id)
+void LLPickItem::setPickId(const LLUUID& id)
 {
-	mPicID = id;
+	mPickID = id;
 }
 
 const LLUUID& LLPickItem::getPickId()
 {
-	return mPicID;
+	return mPickID;
 }
 
 const LLVector3d& LLPickItem::getPosGlobal()
@@ -450,7 +492,7 @@ const std::string LLPickItem::getDescription()
 void LLPickItem::update()
 {
 	mNeedData = true;
-	LLAvatarPropertiesProcessor::instance().sendDataRequest(mCreatorID, APT_PICK_INFO, &mPicID);
+	LLAvatarPropertiesProcessor::instance().sendDataRequest(mCreatorID, APT_PICK_INFO, &mPickID);
 	mNeedData = false;
 }
 
@@ -461,7 +503,7 @@ void LLPickItem::processProperties(void *data, EAvatarProcessorType type)
 
 	LLPickData* pick_data = static_cast<LLPickData *>(data);
 	if (!pick_data) return;
-	if (mPicID != pick_data->pick_id) return;
+	if (mPickID != pick_data->pick_id) return;
 
 	init(pick_data);
 	LLAvatarPropertiesProcessor::instance().removeObserver(pick_data->agent_id, this);
diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h
index bb1ee067807..5ec9809f0b2 100644
--- a/indra/newview/llpanelpicks.h
+++ b/indra/newview/llpanelpicks.h
@@ -37,13 +37,14 @@
 #include "v3dmath.h"
 #include "lluuid.h"
 #include "llavatarpropertiesprocessor.h"
+#include "llpanelavatar.h"
 
 class LLMessageSystem;
 class LLVector3d;
 class LLPanelProfileTab;
-class LLPanelMeProfile;
 class LLPanelPick;
 class LLAgent;
+class LLMenuGL;
 class LLPickItem;
 
 
@@ -52,15 +53,10 @@ class LLPanelPicks
 {
 public:
 	LLPanelPicks(const LLUUID& avatar_id = LLUUID::null);
-	LLPanelPicks(const Params& params );
 	~LLPanelPicks();
 
 	static void* create(void* data);
 
-	static void teleport(const LLVector3d& position);
-
-	static void showOnMap(const LLVector3d& position);
-	
 	/*virtual*/ BOOL postBuild(void);
 
 	/*virtual*/ void onActivate(const LLUUID& id);
@@ -69,28 +65,38 @@ class LLPanelPicks
 
 	void updateData();
 
-	void setPanelMeProfile(LLPanelMeProfile*);
-
 	void clear();
 
-	//*TODO implement
-	//LLPickItem& getSelectedPick();
+	// returns the selected pick item
+	LLPickItem* getSelectedPickItem();
+
+	// removes the specified pick item
+	void removePickItem(LLPickItem* pick_item);
+
+	/*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
+	/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
 
 private:
-	static void onClickInfo(void* data);
-	static void onClickNew(void* data);
 	static void onClickDelete(void* data);
 	static void onClickTeleport(void* data);
 	static void onClickMap(void* data);
 
 	bool callbackDelete(const LLSD& notification, const LLSD& response);
 
+	void reshapePicksList();
+	void reshapePickItem(LLView* const pick_item, const S32 last_bottom);
+	LLView* getPicksList() const;
 	void updateButtons();
 
-	typedef std::vector<LLPickItem*> picture_list_t;
+	void setSelectedPickItem(LLPickItem* item);
+
+	BOOL isMouseInPick(S32 x, S32 y);
+
+	typedef std::list<LLPickItem*> picture_list_t;
 	picture_list_t mPickItemList;
-	LLPanelMeProfile* mMeProfilePanel;
 
+	LLMenuGL* mPopupMenu;
+	LLPickItem* mSelectedPickItem;
 };
 
 class LLPickItem : public LLPanel, public LLAvatarPropertiesObserver
@@ -103,13 +109,11 @@ class LLPickItem : public LLPanel, public LLAvatarPropertiesObserver
 
 	void init(LLPickData* pick_data);
 
-	void setPictureName(const std::string& name);
-
-	void setPictureDescription(const std::string& descr);
+	void setPickName(const std::string& name);
 
-	void setPicture();
+	void setPickDesc(const std::string& descr);
 
-	void setPictureId(const LLUUID& id);
+	void setPickId(const LLUUID& id);
 
 	void setCreatorId(const LLUUID& id) {mCreatorID = id;};
 
@@ -139,7 +143,7 @@ class LLPickItem : public LLPanel, public LLAvatarPropertiesObserver
 
 protected:
 
-	LLUUID mPicID;
+	LLUUID mPickID;
 	LLUUID mCreatorID;
 	LLUUID mParcelID;
 	LLUUID mSnapshotID;
diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp
index 3ed93e55988..d40e10478a4 100644
--- a/indra/newview/llpanelplaceinfo.cpp
+++ b/indra/newview/llpanelplaceinfo.cpp
@@ -34,33 +34,36 @@
 
 #include "llpanelplaceinfo.h"
 
-// *TODO: reorder includes to match the coding standard
+#include "roles_constants.h"
+#include "llsdutil.h"
+#include "llsecondlifeurls.h"
+
 #include "llinventory.h"
-#include "llviewercontrol.h"
+
 #include "llqueryflags.h"
-#include "llui.h"
-#include "llsecondlifeurls.h"
+
+#include "llbutton.h"
 #include "llfloater.h"
 #include "llfloaterreg.h"
+#include "lllineeditor.h"
+#include "llscrollcontainer.h"
+#include "lltextbox.h"
+#include "lltrans.h"
+#include "llui.h"
+#include "lluictrlfactory.h"
 
 #include "llagent.h"
-#include "llviewerwindow.h"
-#include "llviewerinventory.h"
-#include "llbutton.h"
 #include "llfloaterworldmap.h"
-#include "lllineeditor.h"
 #include "llinventorymodel.h"
-#include "lluiconstants.h"
-#include "roles_constants.h"
-#include "lltextbox.h"
-#include "llviewertexteditor.h"
 #include "lltexturectrl.h"
-#include "lltrans.h"
-#include "llworldmap.h"
+#include "lluiconstants.h"
+#include "llviewercontrol.h"
+#include "llviewerinventory.h"
 #include "llviewerregion.h"
-#include "lluictrlfactory.h"
+#include "llviewertexteditor.h"
+#include "llviewerwindow.h"
 #include "llweb.h"
-#include "llsdutil.h"
+#include "llworldmap.h"
 
 static LLRegisterPanelClassWrapper<LLPanelPlaceInfo> t_places("panel_landmark_info");
 
@@ -69,7 +72,8 @@ LLPanelPlaceInfo::LLPanelPlaceInfo()
 	mParcelID(),
 	mRequestedID(),
 	mPosRegion(),
-	mLandmarkID()
+	mLandmarkID(),
+	mMinHeight(0)
 {}
 
 LLPanelPlaceInfo::~LLPanelPlaceInfo()
@@ -104,6 +108,12 @@ BOOL LLPanelPlaceInfo::postBuild()
 	mNotesEditor->setCommitCallback(boost::bind(&LLPanelPlaceInfo::onCommitTitleOrNote, this, NOTE));
 	mNotesEditor->setCommitOnFocusLost(true);
 
+	LLScrollContainer* scroll_container = getChild<LLScrollContainer>("scroll_container");
+	scroll_container->setBorderVisible(FALSE);
+	mMinHeight = scroll_container->getScrolledViewRect().getHeight();
+
+	mScrollingPanel = getChild<LLPanel>("scrolling_panel");
+
 	mInfoPanel = getChild<LLPanel>("info_panel");
 
 	return TRUE;
@@ -380,3 +390,13 @@ void LLPanelPlaceInfo::onCommitTitleOrNote(LANDMARK_INFO_TYPE type)
 		gInventory.notifyObservers();
 	}
 }
+
+void LLPanelPlaceInfo::reshape(S32 width, S32 height, BOOL called_from_parent)
+{
+	if (mMinHeight > 0)
+	{
+		mScrollingPanel->reshape(mScrollingPanel->getRect().getWidth(), mMinHeight);
+	}
+
+	LLView::reshape(width, height, called_from_parent);
+}
diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h
index f88e29bc915..cec9e7b80c0 100644
--- a/indra/newview/llpanelplaceinfo.h
+++ b/indra/newview/llpanelplaceinfo.h
@@ -1,5 +1,5 @@
 /** 
- * @file llpanelplace.h
+ * @file llpanelplaceinfo.h
  * @brief Displays place information in Side Tray.
  *
  * $LicenseInfo:firstyear=2009&license=viewergpl$
@@ -43,11 +43,11 @@
 #include "llremoteparcelrequest.h"
 
 class LLButton;
-class LLTextBox;
+class LLInventoryItem;
 class LLLineEditor;
+class LLTextBox;
 class LLTextEditor;
 class LLTextureCtrl;
-class LLInventoryItem;
 
 class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver
 {
@@ -77,6 +77,7 @@ class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver
 							 const std::string& last);
 
 	/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
+	/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
 
 private:
 	enum LANDMARK_INFO_TYPE
@@ -102,8 +103,10 @@ class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver
 	LLTextBox*			mCreated;
 	LLLineEditor*		mTitleEditor;
 	LLTextEditor*		mNotesEditor;
-	LLTextBox*			mLocationEditor;	
+	LLTextBox*			mLocationEditor;
+	LLPanel*            mScrollingPanel;
 	LLPanel*			mInfoPanel;
+	S32					mMinHeight;
 };
 
 #endif // LL_LLPANELPLACEINFO_H
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp
index d18cac9f420..42b09a45c3e 100644
--- a/indra/newview/llpanelplaces.cpp
+++ b/indra/newview/llpanelplaces.cpp
@@ -108,13 +108,14 @@ void LLPanelPlaces::onOpen(const LLSD& key)
 		return;
 
 	togglePlaceInfoPanel(TRUE);
-	
+
 	mPlaceInfoType = key["type"].asInteger();
 
 	if (mPlaceInfoType == AGENT)
 	{
 		// We don't need to teleport to the current location so disable the button
 		getChild<LLButton>("teleport_btn")->setEnabled(FALSE);
+		getChild<LLButton>("map_btn")->setEnabled(TRUE);
 
 		mPlaceInfo->displayParcelInfo(gAgent.getPositionAgent(),
 									  gAgent.getRegion()->getRegionID(),
@@ -178,15 +179,11 @@ void LLPanelPlaces::onSearchEdit(const std::string& search_string)
 
 void LLPanelPlaces::onTabSelected()
 {
-	if (!mActivePanel)
-		return;
-
 	mActivePanel = dynamic_cast<LLPanelPlacesTab*>(mTabContainer->getCurrentPanel());
-
 	if (mActivePanel)
 	{
 		mActivePanel->onSearchEdit(mFilterSubString);
-		mActivePanel->onTabSelected();
+		mActivePanel->updateVerbs();
 	}
 }
 
@@ -249,7 +246,7 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible)
 
 		LLRect rect = getRect();
 		LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom);
-		mPlaceInfo->reshape(new_rect.getWidth(),new_rect.getHeight());
+		mPlaceInfo->reshape(new_rect.getWidth(),new_rect.getHeight());	
 	}
 }
 
diff --git a/indra/newview/llpanelplacestab.cpp b/indra/newview/llpanelplacestab.cpp
index 2b38aa08907..dc9119d2e32 100644
--- a/indra/newview/llpanelplacestab.cpp
+++ b/indra/newview/llpanelplacestab.cpp
@@ -75,24 +75,3 @@ void LLPanelPlacesTab::onRegionResponse(const LLVector3d& landmark_global_pos,
 
 	LLNotifications::instance().add("CopySLURL", args);
 }
-
-void LLPanelPlacesTab::onTabSelected()
-{
-	togglePanelPlacesButtons(TRUE);
-}
-
-void LLPanelPlacesTab::togglePanelPlacesButtons(BOOL enabled)
-{
-	if (enabled)
-	{
-		//mShareBtn->setEnabled(TRUE);
-		mTeleportBtn->setEnabled(TRUE);
-		mShowOnMapBtn->setEnabled(TRUE);
-	}
-	else
-	{
-		//mShareBtn->setEnabled(FALSE);
-		mTeleportBtn->setEnabled(FALSE);
-		mShowOnMapBtn->setEnabled(FALSE);
-	}
-}
diff --git a/indra/newview/llpanelplacestab.h b/indra/newview/llpanelplacestab.h
index 5d6b7d1090c..c098302d1af 100644
--- a/indra/newview/llpanelplacestab.h
+++ b/indra/newview/llpanelplacestab.h
@@ -43,6 +43,7 @@ class LLPanelPlacesTab : public LLPanel
 	virtual ~LLPanelPlacesTab() {}
 
 	virtual void onSearchEdit(const std::string& string) = 0;
+	virtual void updateVerbs() = 0;		// Updates buttons at the bottom of Places panel
 	//virtual void onShare() = 0;
 	virtual void onShowOnMap() = 0;
 	virtual void onTeleport() = 0;
@@ -54,12 +55,7 @@ class LLPanelPlacesTab : public LLPanel
 										const std::string& url,
 										const LLUUID& snapshot_id,
 										bool teleport);
-	void onTabSelected();
-
 protected:
-	void togglePanelPlacesButtons(BOOL enabled);
-
-private:
 	//LLButton*				mShareBtn;
 	LLButton*				mTeleportBtn;
 	LLButton*				mShowOnMapBtn;
diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp
index 0d25272f88a..495911c2e33 100644
--- a/indra/newview/llpanelprofileview.cpp
+++ b/indra/newview/llpanelprofileview.cpp
@@ -70,10 +70,8 @@ void LLPanelProfileView::onOpen(const LLSD& key)
 
 	mProfileId = id;
 	mTabs[PANEL_PROFILE]->onOpen(mProfileId);
-	mTabs[PANEL_PICKS]->setAvatarId(mProfileId);
-	mTabs[PANEL_PICKS]->updateData();
-	mTabs[PANEL_NOTES]->setAvatarId(mProfileId);
-	mTabs[PANEL_NOTES]->updateData();
+	mTabs[PANEL_PICKS]->onActivate(mProfileId);
+	mTabs[PANEL_NOTES]->onActivate(mProfileId);
 
 	std::string full_name;
 	gCacheName->getFullName(key,full_name);
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index eb35834dc0f..c271ca34b9c 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -92,8 +92,15 @@ void LLTeleportHistoryPanel::onShowOnMap()
 
 	S32 index = itemp->getColumn(LIST_INDEX)->getValue().asInteger();
 
-	// teleport to existing item in history, so we don't add it again
-	mTeleportHistory->goToItem(index);
+	const LLTeleportHistory::slurl_list_t& hist_items = mTeleportHistory->getItems();
+
+	LLVector3d global_pos = hist_items[index].mGlobalPos;
+	
+	if (!global_pos.isExactlyZero())
+	{
+		LLFloaterWorldMap::getInstance()->trackLocation(global_pos);
+		LLFloaterReg::showInstance("world_map", "center");
+	}
 }
 
 // virtual
@@ -104,7 +111,8 @@ void LLTeleportHistoryPanel::onTeleport()
 		return;
 
 	S32 index = itemp->getColumn(LIST_INDEX)->getValue().asInteger();
-	
+
+	// teleport to existing item in history, so we don't add it again
 	mTeleportHistory->goToItem(index);
 }
 
@@ -132,6 +140,23 @@ void LLTeleportHistoryPanel::onCopySLURL()
 }
 */
 
+// virtual
+void LLTeleportHistoryPanel::updateVerbs()
+{
+	S32 index = 0;
+	S32 cur_item = 0;
+
+	LLScrollListItem* itemp = mHistoryItems->getFirstSelected();
+	if (itemp)
+	{
+		index = itemp->getColumn(LIST_INDEX)->getValue().asInteger();
+		cur_item = mTeleportHistory->getCurrentItemIndex();
+	}
+
+	mTeleportBtn->setEnabled(index != cur_item);
+	mShowOnMapBtn->setEnabled(itemp != NULL);
+}
+
 void LLTeleportHistoryPanel::showTeleportHistory()
 {
 	const LLTeleportHistory::slurl_list_t& hist_items = mTeleportHistory->getItems();
@@ -181,17 +206,12 @@ void LLTeleportHistoryPanel::showTeleportHistory()
 		}
 	}
 
-	togglePanelPlacesButtons(mHistoryItems->getFirstSelected() != NULL);
+	updateVerbs();
 }
 
 void LLTeleportHistoryPanel::handleItemSelect(const LLSD& data)
 {
-	LLScrollListItem* itemp = mHistoryItems->getFirstSelected();
-
-	if (!itemp)
-		return;
-
-	togglePanelPlacesButtons(TRUE);
+	updateVerbs();
 }
 
 //static
diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h
index 6f41c97eec9..553385b37e7 100644
--- a/indra/newview/llpanelteleporthistory.h
+++ b/indra/newview/llpanelteleporthistory.h
@@ -50,7 +50,8 @@ class LLTeleportHistoryPanel : public LLPanelPlacesTab
 	/*virtual*/ void onShowOnMap();
 	/*virtual*/ void onTeleport();
 	///*virtual*/ void onCopySLURL();
-
+	/*virtual*/ void updateVerbs();
+	
 	void showTeleportHistory();
 	void handleItemSelect(const LLSD& data);
 
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp
index e7008abe605..daee3ecfa60 100644
--- a/indra/newview/llsidetray.cpp
+++ b/indra/newview/llsidetray.cpp
@@ -704,6 +704,7 @@ void LLSideTray::createHomeTab()
 		panel_params.padding_right(10);
 		panel_params.padding_top(5);
 		panel_params.padding_bottom(5);
+		panel_params.name(sidebar_tab->getTabTitle());
 
 		LLCollapsibleCtrl* ctrl = LLUICtrlFactory::create<LLCollapsibleCtrl>(panel_params);
 
@@ -732,7 +733,8 @@ void	LLSideTray::setPanelRect	()
 		panel_width+=mMaxBarWidth;
 
 	S32 panel_height = parent_rect.getHeight()-fake_top_offset;
-	panel_height -= LLBottomTray::getInstance()->getRect().getHeight();
+	if(gBottomTray)
+		panel_height -= gBottomTray->getRect().getHeight();
 
 	LLRect panel_rect;
 	panel_rect.setLeftTopAndSize( parent_rect.mRight-panel_width, parent_rect.mTop-fake_top_offset, panel_width, panel_height);
diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp
index 409549a66b9..88e79fd4f43 100644
--- a/indra/newview/lltoolgrab.cpp
+++ b/indra/newview/lltoolgrab.cpp
@@ -46,7 +46,6 @@
 
 // newview headers
 #include "llagent.h"
-//#include "llfloateravatarinfo.h"
 #include "lldrawable.h"
 #include "llfloatertools.h"
 #include "llhudeffect.h"
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index a6dcebc3b56..a89e79c8b80 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -48,6 +48,7 @@
 #include "llhoverview.h"
 #include "llhudeffecttrail.h"
 #include "llhudmanager.h"
+#include "llmediamanager.h"
 #include "llmenugl.h"
 #include "llmutelist.h"
 #include "llselectmgr.h"
diff --git a/indra/newview/llviewergesture.cpp b/indra/newview/llviewergesture.cpp
index 2fb56fbcb82..bbd34835ca6 100644
--- a/indra/newview/llviewergesture.cpp
+++ b/indra/newview/llviewergesture.cpp
@@ -133,11 +133,11 @@ void LLViewerGesture::doTrigger( BOOL send_chat )
 		}
 	}
 
-	if ( send_chat && !mOutputString.empty())
+	if (gBottomTray && send_chat && !mOutputString.empty())
 	{
 		// Don't play nodding animation, since that might not blend
 		// with the gesture animation.
-		LLBottomTray::getInstance()->sendChatFromViewer(mOutputString, CHAT_TYPE_NORMAL, FALSE);
+		gBottomTray->sendChatFromViewer(mOutputString, CHAT_TYPE_NORMAL, FALSE);
 	}
 }
 
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 5c9f8af2169..2689fff5332 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1552,20 +1552,13 @@ void LLViewerWindow::initWorldUI()
 	gIMMgr = LLIMMgr::getInstance();
 
 	// new bottom panel
-	LLRect rc = LLBottomTray::getInstance()->getRect();
+	gBottomTray = new LLBottomTray();
+	LLRect rc = gBottomTray->getRect();
 	rc.mLeft = 0;
 	rc.mRight = mRootView->getRect().getWidth();
-	mRootView->addChild(LLBottomTray::getInstance());
-	LLBottomTray::getInstance()->reshape(rc.getWidth(),rc.getHeight(),FALSE);
-	LLBottomTray::getInstance()->setRect(rc);
-
-	// Updating of bottom boundary of gConsole to avoid overlapping
-	if (gConsole)
-	{
-		LLRect cr = gConsole->getRect();
-		cr.mBottom += LLBottomTray::getInstance()->getRect().getHeight();
-		gConsole->setRect(cr);
-	}
+	mRootView->addChild(gBottomTray);
+	gBottomTray->reshape(rc.getWidth(),rc.getHeight(),FALSE);
+	gBottomTray->setRect(rc);
 
 	// View for hover information
 	LLHoverView::Params hvp;
@@ -1597,9 +1590,9 @@ void LLViewerWindow::initWorldUI()
 	LLRect floater_view_rect = gFloaterView->getRect();
 	LLRect notify_view_rect = gNotifyBoxView->getRect();
 	floater_view_rect.mTop -= NAVIGATION_BAR_HEIGHT;
-	floater_view_rect.mBottom += LLBottomTray::getInstance()->getRect().getHeight();
+	floater_view_rect.mBottom += gBottomTray->getRect().getHeight();
 	notify_view_rect.mTop -= NAVIGATION_BAR_HEIGHT;
-	notify_view_rect.mBottom += LLBottomTray::getInstance()->getRect().getHeight();
+	notify_view_rect.mBottom += gBottomTray->getRect().getHeight();
 	gFloaterView->setRect(floater_view_rect);
 	gNotifyBoxView->setRect(notify_view_rect);
 
@@ -1858,8 +1851,11 @@ void LLViewerWindow::reshape(S32 width, S32 height)
 // Hide normal UI when a logon fails
 void LLViewerWindow::setNormalControlsVisible( BOOL visible )
 {
-	LLBottomTray::getInstance()->setVisible(visible);
-	LLBottomTray::getInstance()->setEnabled(visible);
+	if(gBottomTray)
+	{
+		gBottomTray->setVisible(visible);
+		gBottomTray->setEnabled(visible);
+	}
 
 	if ( gMenuBarView )
 	{
@@ -2775,6 +2771,14 @@ void LLViewerWindow::updateLayout()
 		}
 		gMenuBarView->setItemVisible("BuildTools", gFloaterTools->getVisible());
 	}
+
+	// Always update console
+	if(gConsole)
+	{
+		LLRect console_rect = getChatConsoleRect();
+		gConsole->reshape(console_rect.getWidth(), console_rect.getHeight());
+		gConsole->setRect(console_rect);
+	}
 }
 
 void LLViewerWindow::updateMouseDelta()
@@ -4850,13 +4854,12 @@ void LLViewerWindow::calcDisplayScale()
 	}
 }
 
-S32 TOOL_BAR_HEIGHT = 20; // *TODO:Skinning Fix
-
 S32 LLViewerWindow::getChatConsoleBottomPad()
 {
 	S32 offset = 0;
-	if( gToolBar && gToolBar->getVisible() )
-		offset += TOOL_BAR_HEIGHT;
+
+	if(gBottomTray)
+		offset += gBottomTray->getRect().getHeight();
 
 	return offset;
 }
@@ -4875,7 +4878,9 @@ LLRect LLViewerWindow::getChatConsoleRect()
 
 	console_rect.mLeft   += CONSOLE_PADDING_LEFT; 
 
-	if (gSavedSettings.getBOOL("ChatFullWidth"))
+	static const BOOL CHAT_FULL_WIDTH = gSavedSettings.getBOOL("ChatFullWidth");
+
+	if (CHAT_FULL_WIDTH)
 	{
 		console_rect.mRight -= CONSOLE_PADDING_RIGHT;
 	}
diff --git a/indra/newview/skins/default/textures/image_edit_icon.tga b/indra/newview/skins/default/textures/image_edit_icon.tga
new file mode 100644
index 0000000000000000000000000000000000000000..8666f0bbe6286ce5c9ef5c0a0397128debc71ee8
GIT binary patch
literal 3116
zcmcJSS4(4I5QfA40`bCzXe`-9!HR<3*f48hlZ7p2aY4a$r``!s6bmYr4Hm4iB(e9l
zQDdx#D5wbjqJ4D8*<iL9iF0xM^5vZ8oq1=zB&t+zRIX5~)T$uW_t%g8R}0Bq@OHc1
z=Q;}CzPGpUaP02x?(FRBv3?9?@nT(t|I=<iJw0_goqc_M7K>$idU|PTX?b~hV`GE5
zM95RlbLUAW3Lo<D@bKZ`;mOHKS65eEU0rKyYfn!PoAdMYtE;P<o10r(TU3XfC{iqZ
zC3q=2?h*=LHpj=ux#!~IVr6Bev$M0Qsj0cSxwp4>XlTf6Hrs5rg@pyQ*4Nk3+TPwq
z?x!ncjr60=t^nQn4u^xy!NI|Ug9E%eIy#!1oNR1tq>zq|4r&<~7#JBDnVOoKo14Qu
z5yC(vL=;_7p)_|saG0nA;gR$6^P8KS+1XioflK}U{U(!%EALKBOi&BHNslO&P~=2~
zvOqoIiv;RpV`J2Nd3lKhY48ZnAVftN1)nt%6vF=E;-Vt7wzfuYG)wIA<Rd|sNe2JP
z>gww1_VyMDlA&;%2S`yfGc#O0`8>is1QOi;M?Mma6Xjz&cVgQ0^);IWLL|l}2{65q
zwk%jb*yLsu5`W`^qRTkI{7^m>iBa%*i(0T3(;$czSX2<jA9f@#>L2`vbockIRx9&^
z4@}hE-5sYx_Qf$&C<hK?fwLyimBoMgBGJ;)LT91f-`}5|ogE(^vyTKJg}72)7c6{<
z=kP&cRC{|nJ;f90xKzRQ(CNfU@k)X7QsS9>kzk@mM@JbO+KpXo()!ZU(wLYSMumVW
z3mHyIdp;i;=ZoV^ba!_%U^Km^rbew+=j7yMW@f^q@0=Y8)`VAlBp4F-4Gj%En3|dz
z78Vu}5s{RXl$e+p6%~bqG)1o5?=2sz+uGVnN=iuE&(AMEKfkcBP@~br#l<oI3Kp`2
zw|t(WeBja1(Sd=1V9U$PQ&Lj$^73p}tBd;kueW?Wr=et?kdTm`o*onwghXs?Eaqsn
zTE3fpqaRmZ@tKF(+FGUserRZDa&j`}v&Ns|;$ph2*XwN-i@StZeC*|86T?X!Y;bUJ
zWMrhjzduGXKUGy#81>CyV7e3uulVv5A4e4x6}VAURAe+7Gcq#J3J3_u&CRW>tVGdZ
zFi?ejTfKmf3dah#Oe5cGI-L$ak)555L|R%Jb~PG}-1#!TQobxW(exUlLPA2ava-s`
z%Az$Iz3zjr_;C0Ez=$$VG$lMd{O#L!4fXXt<cow(ujfR^$H)ILnb;wG;*X%1t_icb
sy1JUC^C>5rKI9AV$yNBTdUgFb@a5B2ZBfDJf{*&RZ|@5}XyaAC0D<ye$N&HU

literal 0
HcmV?d00001

diff --git a/indra/newview/skins/default/xui/en/accordion_parent.xml b/indra/newview/skins/default/xui/en/accordion_parent.xml
index 632752b1c43..914a6eddb9a 100644
--- a/indra/newview/skins/default/xui/en/accordion_parent.xml
+++ b/indra/newview/skins/default/xui/en/accordion_parent.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
   <panel  border_thickness="2" name="splitter_parent"
-    can_resize="true" background_visible="true"
+    background_visible="true"
        label="splitter_parent"
        title=""
     >
diff --git a/indra/newview/skins/default/xui/en/menu_picks.xml b/indra/newview/skins/default/xui/en/menu_picks.xml
new file mode 100644
index 00000000000..146d7d06fe3
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_picks.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<context_menu
+ layout="topleft"
+ name="Picks">
+    <menu_item_call
+     label="Info"
+     layout="topleft"
+     name="pick_info">
+        <menu_item_call.on_click
+         function="Pick.Info" />
+    </menu_item_call>
+    <menu_item_call
+     label="Edit"
+     layout="topleft"
+     name="pick_edit"
+     visible="false">
+        <menu_item_call.on_click
+         function="Pick.Edit" />
+    </menu_item_call>
+    <menu_item_call
+     label="Teleport"
+     layout="topleft"
+     name="pick_teleport">
+        <menu_item_call.on_click
+         function="Pick.Teleport" />
+    </menu_item_call>
+    <menu_item_call
+     label="Show on Map"
+     layout="topleft"
+     name="pick_map">
+        <menu_item_call.on_click
+         function="Pick.Map" />
+    </menu_item_call>
+    <menu_item_separator
+     layout="topleft"
+     name="pick_separator"
+     visible="false" />
+    <menu_item_call
+     label="Delete"
+     layout="topleft"
+     name="pick_delete"
+     visible="false">
+        <menu_item_call.on_click
+         function="Pick.Delete" />
+    </menu_item_call>
+</context_menu>
diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml
index bf3f70f54bd..3de3365539c 100644
--- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml
@@ -47,9 +47,9 @@
   <button
     bottom="5" left="260" width="20" height="20" follows="right"
     name="info_btn" label=""
-    image_unselected="info_btn.tga" image_disabled="info_btn.tga"
-    image_selected="info_btn_active.tga" image_hover_selected="info_btn_active.tga"
-    image_disabled_selected="info_btn.tga" font="SansSerifBigBold"
+    image_unselected="avatar_info_btn.tga" image_disabled="avatar_info_btn.tga"
+    image_selected="avatar_info_btn_active.tga" image_hover_selected="avatar_info_btn_active.tga"
+    image_disabled_selected="avatar_info_btn.tga" font="SansSerifBigBold"
   />
   
   <button
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
index 303487f21ba..1e222db7b59 100644
--- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml
+++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?> 
 <panel follows="left|bottom|right" name="bottom_tray" bg_opaque_color="0.25 0.25 0.25 1.0"
 		bg_alpha_color="0.25 0.25 0.25 1.0" background_visible="true" auto_resize="true"
-		left="0" bottom="0" width="1000" height="28" border_visible="false" has_border="false">
+		left="0" bottom="0" width="1000" height="28" border_visible="false">
+	<panel.string name="gesture_label">
+        	Gestures
+	</panel.string>		
 	<layout_stack name="toolbar_stack" follows="left|right|bottom|top" 
 		bottom="0" left="0" width="1000" height="25" orientation="horizontal" border_size="0" auto_resize="false">
 	
@@ -12,12 +15,16 @@
 			bevel_style="in" border_style="line" border_thickness="1"/>
 	  </panel>
 		<icon image_name="spacer24.tga" left="0" width="5" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/>
-		<view_border bevel_style="in" bottom="0" height="28" min_height="28" width="1" follows="left|right" left="270" mouse_opaque="false" auto_resize="false"/>
+		<view_border bevel_style="in" bottom="0" height="28" width="1" follows="left|right" left="270" mouse_opaque="false" auto_resize="false"/>
 		<icon image_name="spacer24.tga" left="0" width="5" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/>
 	  <panel follows="left|right" auto_resize="false" width="100" height="28" min_height="28">
 		<chiclet_talk name="talk" left="0" bottom="6" width="100" height="20" follows="left|right" auto_resize="false"/>	
 	  </panel>
-		<icon name="DUMMY" image_name="spacer24.tga" left="0" width="150" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/>
+		<icon name="DUMMY" image_name="spacer24.tga" left="0" width="5" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/>
+	  <panel follows="left|right" auto_resize="true" width="90" height="28" min_height="28">
+		<combo_box follows="left|right" height="20" label="Gestures" left="0" bottom="6" name="Gesture" top_delta="0" width="90" />
+	  </panel>
+	  	<icon name="DUMMY" image_name="spacer24.tga" left="0" width="5" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/>
 	  <panel follows="left|right" auto_resize="true" width="250" height="28" min_height="28">
 		<chiclet_panel name="chiclet_list"  follows="left|right" 
 			width="250" height="25" left="0" bottom="2"/>
@@ -29,12 +36,12 @@
 			image_unselected="im_notifications.tga" image_selected="im_notifications.tga"/>
 	  </panel>
 		<icon image_name="spacer24.tga" left="0" width="10" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/>
-		<view_border bevel_style="in" bottom="0" height="30" width="1" follows="left|right" left="270" mouse_opaque="false" auto_resize="false"/>
+		<view_border name="well_separator" bevel_style="in" bottom="0" height="30" width="1" follows="left|right" left="270" mouse_opaque="false" auto_resize="false"/>
 		<icon image_name="spacer24.tga" left="0" width="10" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/>
 	  <panel follows="left|right" auto_resize="false" width="48" height="28" min_height="28">
 		<chiclet_notification name="sys_well" follows="left|right" auto_resize="false"
 			left="0" bottom="5" width="48" height="25" 
-			image_unselected="sys_notifications.tga" image_selected="sys_notifications.tga"/>
+			image_unselected="bottom_tray_sys_notifications.tga" image_selected="bottom_tray_sys_notifications.tga"/>
 	  </panel>
 		<icon image_name="spacer24.tga" left="0" width="5" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/>
 	</layout_stack>	
diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml
index 967cf2f539d..acbbde37c99 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_pick.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_pick.xml
@@ -9,7 +9,7 @@
  left="0"
  name="panel_edit_pick"
  top="0"
- width="355">
+ width="345">
     <text
      type="string"
      length="1"
@@ -33,14 +33,33 @@
      left="10"
      right="-10"
      top="30">
-        <texture_picker
+        <panel
          follows="left|top|right"
          height="150"
          layout="topleft"
          left="10"
-         name="pick_snapshot"
          right="-10"
-         top="10" />
+         top="10">
+            <panel
+             follows="left|top|right"
+             height="150"
+             layout="topleft" >
+                <texture_picker
+                 follows="left|top|right"
+                 height="150"
+                 layout="topleft"
+                 name="pick_snapshot" />
+            </panel>
+            <icon
+             height="16"
+             image_name="image_edit_icon.tga"
+             layout="topleft"
+             name="edit_icon"
+             right="-25"
+             top="30"
+             visible="false"
+             width="16" />
+        </panel>
         <text
          type="string"
          length="1"
@@ -124,11 +143,11 @@
      left="5"
      name="bottom_panel"
      top="605"
-     width="345">
+	   right="-10">
         <button
          follows="bottom|left"
          height="20"
-         label="Save Changes"
+         label="Save [WHAT]"
          layout="topleft"
          name="save_changes_btn"
          right="-120"
diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml
index e787d03ecaa..5f51e8d22c0 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml
@@ -119,6 +119,24 @@
                top_pad="5"
                width="105" />
           </panel>
+          <icon
+           height="16"
+           image_name="image_edit_icon.tga"
+           layout="topleft"
+           left="75"
+           name="2nd_life_edit_icon"
+           tool_tip="Click to select an image" 
+           top="35"
+           width="16" />
+          <icon
+           height="16"
+           image_name="image_edit_icon.tga"
+           layout="topleft"
+           left="200"
+           name="1st_life_edit_icon"
+           tool_tip="Click to select an image" 
+           top="35"
+           width="16" />
       </panel>
       <text
        type="string"
@@ -189,8 +207,6 @@
           Homepage:
       </text>
       <line_editor
-       type="string"
-       length="1"
        follows="left|top|right"
        font="SansSerif"
        font.style="UNDERLINE"
diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml
index e252788c69c..7cdda126b9d 100644
--- a/indra/newview/skins/default/xui/en/panel_landmark_info.xml
+++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml
@@ -37,222 +37,238 @@
      name="acquired_date">
         [wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local]
     </panel.string>
-    <button
-     follows="top|left"
-     height="20"
-     image_overlay="navbar_back.tga"
-     image_selected="navbar_bg_button.tga"
-     image_unselected="navbar_bg_button.tga"
-     layout="topleft"
-     left="10"
-     name="back_btn"
-     picture_style="true"
-     top="20"
-     width="20" />
-    <text
-     type="string"
-     length="1"
-     follows="left|top|right"
-     font="SansSerifHugeBold"
-     height="20"
-     layout="topleft"
-     left="50"
-     name="panel_title"
-     text_color="white"
-     top="20"
-     width="150">
-        Landmark
-    </text>
-    <texture_picker
-     follows="top|left"
-     height="128"
-     layout="topleft"
-     left="10"
-     name="logo"
-     top="60"
-     width="128" />
-    <text
-     follows="left|top|right"
-     font="SansSerifHugeBold"
-     height="20"
-     layout="topleft"
-     left="10"
-     name="region_name"
-     text_color="white"
-     top="180"
-     width="340" />
-    <text
-     follows="left|top|right"
-     font="SansSerifBold"
-     height="20"
-     layout="topleft"
-     left="10"
-     name="parcel_name"
-     text_color="white"
-     top="205"
-     width="340" />
-    <panel
-     follows="left|top|right|bottom"
-     height="335"
+    <scroll_container
+     follows="all"
+     height="560"
      layout="topleft"
      left="0"
-     name="info_panel"
-     top="225"
+     top="0"
      width="355">
-        <text_editor
-         bg_focus_color="0.3 0.3 0.3 1"
-         bg_readonly_color="0.3 0.3 0.3 1"
-         follows="left|top|right"
-         font="SansSerif"
-         height="90"
-         hide_border="true"
-         hide_scrollbar="true"
+        <panel
+         height="560"
          layout="topleft"
-         left="10"
-         max_length="1000"
-         name="description"
-         read_only="true"
-         text_color="white"
+         left="0"
+         name="scrolling_panel"
          top="0"
-         width="340" />
-        <icon
-         follows="top|left"
-         height="30"
-         image_name=""
-         layout="topleft"
-         left="10"
-         mouse_opaque="true"
-         name="maturity"
-         top="95"
-         width="30" />
-        <text
-         type="string"
-         length="1"
-         follows="left|top"
-         font="SansSerif"
-         height="15"
-         layout="topleft"
-         left="10"
-         name="owner_lable"
-         text_color="white"
-         top="130"
-         width="50"
-         word_wrap="true">
-            Owner:
-        </text>
-        <text
-         follows="left|top|right"
-         font="SansSerif"
-         height="15"
-         layout="topleft"
-         left="80"
-         name="owner"
-         text_color="white"
-         top="130"
-         width="260"
-         word_wrap="true" />
-        <text
-         type="string"
-         length="1"
-         follows="left|top"
-         font="SansSerif"
-         height="15"
-         layout="topleft"
-         left="10"
-         name="creator_lable"
-         text_color="white"
-         top="150"
-         width="50"
-         word_wrap="true">
-            Creator:
-        </text>
-        <text
-         follows="left|top|right"
-         font="SansSerif"
-         height="15"
-         layout="topleft"
-         left="80"
-         name="creator"
-         text_color="white"
-         top="150"
-         width="260"
-         word_wrap="true" />
-        <text
-         type="string"
-         length="1"
-         follows="left|top"
-         font="SansSerif"
-         height="15"
-         layout="topleft"
-         left="10"
-         name="created_lable"
-         text_color="white"
-         top="170"
-         width="50"
-         word_wrap="true">
-            Created:
-        </text>
-        <text
-         follows="left|top|right"
-         font="SansSerif"
-         height="15"
-         layout="topleft"
-         left="80"
-         name="created"
-         text_color="white"
-         top="170"
-         width="260"
-         word_wrap="true" />
-        <text
-         type="string"
-         length="1"
-         follows="left|top"
-         font="SansSerif"
-         height="15"
-         layout="topleft"
-         left="10"
-         name="title_lable"
-         text_color="white"
-         top="190"
-         width="50"
-         word_wrap="true">
-            Title:
-        </text>
-        <line_editor
-         follows="left|top|right"
-         font="SansSerif"
-         height="22"
-         layout="topleft"
-         left="10"
-         max_length="255"
-         name="title_editor"
-         top="210"
-         width="330" />
-        <text
-         type="string"
-         length="1"
-         follows="left|top"
-         font="SansSerif"
-         height="15"
-         layout="topleft"
-         left="10"
-         name="notes_lable"
-         text_color="white"
-         top="240"
-         width="90"
-         word_wrap="true">
-            My Notes:
-        </text>
-        <text_editor
-         follows="left|top|bottom|right"
-         font="SansSerif"
-         height="70"
-         hide_scrollbar="true"
-         layout="topleft"
-         left="10"
-         max_length="1000"
-         name="notes_editor"
-         top="260"
-         width="330" />
-    </panel>
+         width="310">
+            <button
+             follows="top|left"
+             height="20"
+             image_overlay="navbar_back.tga"
+             image_selected="navbar_bg_button.tga"
+             image_unselected="navbar_bg_button.tga"
+             layout="topleft"
+             left="10"
+             name="back_btn"
+             picture_style="true"
+             top="20"
+             width="20" />
+            <text
+             type="string"
+             length="1"
+             follows="left|top|right"
+             font="SansSerifHugeBold"
+             height="20"
+             layout="topleft"
+             left="50"
+             name="panel_title"
+             text_color="white"
+             top="20"
+             width="150">
+                Landmark
+            </text>
+            <texture_picker
+             follows="top|left"
+             height="128"
+             layout="topleft"
+             left="10"
+             name="logo"
+             top="60"
+             width="128" />
+            <text
+             follows="left|top|right"
+             font="SansSerifHugeBold"
+             height="20"
+             layout="topleft"
+             left="10"
+             name="region_name"
+             text_color="white"
+             top="180"
+             width="310" />
+            <text
+             follows="left|top|right"
+             font="SansSerifBold"
+             height="20"
+             layout="topleft"
+             left="10"
+             name="parcel_name"
+             text_color="white"
+             top="205"
+             width="310" />
+            <panel
+             follows="left|top|right|bottom"
+             height="335"
+             layout="topleft"
+             left="10"
+             name="info_panel"
+             top="225"
+             width="310">
+                <text_editor
+                 bg_focus_color="0.3 0.3 0.3 1"
+                 bg_readonly_color="0.3 0.3 0.3 1"
+                 follows="left|top|right"
+                 font="SansSerif"
+                 height="90"
+                 hide_border="true"
+                 hide_scrollbar="true"
+                 layout="topleft"
+                 left="0"
+                 max_length="1000"
+                 name="description"
+                 read_only="true"
+                 text_color="white"
+                 top="0"
+                 width="310" />
+                <icon
+                 follows="top|left"
+                 height="30"
+                 image_name=""
+                 layout="topleft"
+                 left="0"
+                 mouse_opaque="true"
+                 name="maturity"
+                 top="95"
+                 width="30" />
+                <text
+                 type="string"
+                 length="1"
+                 follows="left|top"
+                 font="SansSerif"
+                 height="15"
+                 layout="topleft"
+                 left="0"
+                 name="owner_lable"
+                 text_color="white"
+                 top="130"
+                 width="50"
+                 word_wrap="true">
+                    Owner:
+                </text>
+                <text
+                 follows="left|top|right"
+                 font="SansSerif"
+                 height="15"
+                 layout="topleft"
+                 left="70"
+                 name="owner"
+                 text_color="white"
+                 top="130"
+                 width="240"
+                 word_wrap="true" />
+                <text
+                 type="string"
+                 length="1"
+                 follows="left|top"
+                 font="SansSerif"
+                 height="15"
+                 layout="topleft"
+                 left="0"
+                 name="creator_lable"
+                 text_color="white"
+                 top="150"
+                 width="50"
+                 word_wrap="true">
+                    Creator:
+                </text>
+                <text
+                 follows="left|top|right"
+                 font="SansSerif"
+                 height="15"
+                 layout="topleft"
+                 left="70"
+                 name="creator"
+                 text_color="white"
+                 top="150"
+                 width="240"
+                 word_wrap="true" />
+                <text
+                 type="string"
+                 length="1"
+                 follows="left|top"
+                 font="SansSerif"
+                 height="15"
+                 layout="topleft"
+                 left="0"
+                 name="created_lable"
+                 text_color="white"
+                 top="170"
+                 width="50"
+                 word_wrap="true">
+                    Created:
+                </text>
+                <text
+                 follows="left|top|right"
+                 font="SansSerif"
+                 height="15"
+                 layout="topleft"
+                 left="70"
+                 name="created"
+                 text_color="white"
+                 top="170"
+                 width="240"
+                 word_wrap="true" />
+                <text
+                 type="string"
+                 length="1"
+                 follows="left|top"
+                 font="SansSerif"
+                 height="15"
+                 layout="topleft"
+                 left="0"
+                 name="title_lable"
+                 text_color="white"
+                 top="190"
+                 width="50"
+                 word_wrap="true">
+                    Title:
+                </text>
+                <line_editor
+                 follows="left|top|right"
+                 font="SansSerif"
+                 height="22"
+                 layout="topleft"
+                 left="0"
+                 max_length="255"
+                 name="title_editor"
+                 top="210"
+                 width="310" />
+                <text
+                 type="string"
+                 length="1"
+                 follows="left|top"
+                 font="SansSerif"
+                 height="15"
+                 layout="topleft"
+                 left="0"
+                 name="notes_lable"
+                 text_color="white"
+                 top="240"
+                 width="90"
+                 word_wrap="true">
+                    My Notes:
+                </text>
+                <text_editor
+                 follows="left|top|bottom|right"
+                 font="SansSerif"
+                 height="70"
+                 hide_scrollbar="true"
+                 layout="topleft"
+                 left="0"
+                 max_length="1000"
+                 name="notes_editor"
+                 top="260"
+                 width="310" />
+            </panel>
+        </panel>
+    </scroll_container>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_notes.xml b/indra/newview/skins/default/xui/en/panel_notes.xml
index 767432a522c..27e2f87fb4e 100644
--- a/indra/newview/skins/default/xui/en/panel_notes.xml
+++ b/indra/newview/skins/default/xui/en/panel_notes.xml
@@ -1,155 +1,162 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
  follows="top|left|right|bottom"
- background_visible="true"
  bevel_style="in"
- bg_alpha_color="0.5 0.5 0.5 1"
- height="705"
+ height="625"
  label="Notes and Privacy"
  layout="topleft"
  left="10"
  name="panel_notes"
  top="10"
  width="355">
- <scroll_container
-      left="1" width="354" height="690" follows="left|top|right|bottom"
-	  layout="topleft"
-      reserve_scroll_corner="false">
-	  <panel
-	  layout="topleft"
-	  width="320"
-	  height="690"
-	  left="0"
-	  top="0">
-    <text
-     type="string"
-     length="1"
-     follows="left|top"
-     font="SansSerifHugeBold"
-     height="35"
+    <scroll_container
+     left="8" 
+     width="340" 
+     height="570" 
+     follows="left|top|right|bottom"
      layout="topleft"
-     left="10"
-     name="pick_title"
-     text_color="white"
-     top="10"
-     width="250"
-     word_wrap="true">
-        Private Notes
-    </text>
-    <text
-     type="string"
-     length="1"
-     follows="left|top"
-     font="SansSerif"
-     font.style="ITALIC"
-     height="15"
-     layout="topleft"
-     left="10"
-     name="status_message"
-     text_color="0.1 0.1 0.1 1"
-     top="50"
-     width="300">
-        Your notes about this user:
-    </text>
-    <text_editor
-     bg_focus_color="white"
-     bg_writeable_color="0.6 0.6 0.6 1"
-     follows="left|right"
-     font="SansSerif"
-     height="300"
-     hide_scrollbar="true"
-     layout="topleft"
-     left="10"
-     max_length="1000"
-     name="notes_edit"
-     text_color="black"
-     top="70"
-     width="280"
-     word_wrap="true" />
-    <text
-     type="string"
-     length="1"
-     follows="left|top"
-     font="SansSerifHugeBold"
-     height="35"
-     layout="topleft"
-     left="10"
-     name="pick_title"
-     text_color="white"
-     top="410"
-     width="250"
-     word_wrap="true">
-        Private Settings
-    </text>
-    <text
-     type="string"
-     length="1"
-     follows="left|top"
-     font="SansSerif"
-     font.style="ITALIC"
-     height="15"
-     layout="topleft"
-     left="10"
-     name="status_message"
-     text_color="0.1 0.1 0.1 1"
-     top="435"
-     width="300">
-        This user can:
-    </text>
-    <check_box
-     enabled="false"
-     follows="left|top"
-     font="SansSerifBig"
-     height="20"
-     label="See my online status"
-     layout="topleft"
-     left="10"
-     name="status_check"
-     text_disabled_color="0.1 0.1 0.1 1"
-     text_enabled_color="white"
-     top="455"
-     width="300" />
-    <check_box
-     enabled="false"
-     follows="left|top"
-     font="SansSerifBig"
-     height="20"
-     label="See me on the map"
-     layout="topleft"
-     left="10"
-     name="map_check"
-     text_disabled_color="0.1 0.1 0.1 1"
-     text_enabled_color="white"
-     top="480"
-     width="300" />
-    <check_box
-     enabled="false"
-     follows="left|top"
-     font="SansSerifBig"
-     height="20"
-     label="Edit, delite or take my objects"
-     layout="topleft"
-     left="10"
-     name="objects_check"
-     text_disabled_color="0.1 0.1 0.1 1"
-     text_enabled_color="white"
-     top="505"
-     width="300" />
+     name="profile_scroll"
+     opaque="true"
+     color="0.5 0.5 0.5 1.0"
+     reserve_scroll_corner="false">
+        <panel
+         layout="topleft"
+         width="310"
+         height="530"
+         left="0"
+         follows="left|right"
+         top="0">
+            <text
+             type="string"
+             length="1"
+             follows="left|top"
+             font="SansSerifHugeBold"
+             height="20"
+             layout="topleft"
+             left="10"
+             name="pick_title"
+             text_color="white"
+             top="10"
+             width="250"
+             word_wrap="true">
+                Private Notes
+            </text>
+            <text
+             type="string"
+             length="1"
+             follows="left|top"
+             font="SansSerif"
+             font.style="ITALIC"
+             height="15"
+             layout="topleft"
+             left="10"
+             name="status_message"
+             text_color="0.1 0.1 0.1 1"
+             top_pad="10"
+             width="300">
+                Your notes about this user:
+            </text>
+            <text_editor
+             bg_focus_color="white"
+             bg_writeable_color="0.6 0.6 0.6 1"
+             follows="left|right"
+             font="SansSerif"
+             height="300"
+             hide_scrollbar="true"
+             layout="topleft"
+             left="10"
+             max_length="1000"
+             name="notes_edit"
+             text_color="black"
+             top_pad="10"
+             width="290"
+             word_wrap="true" />
+            <text
+             type="string"
+             length="1"
+             follows="left|top"
+             font="SansSerifHugeBold"
+             height="20"
+             layout="topleft"
+             left="10"
+             name="pick_title"
+             text_color="white"
+             top_pad="10"
+             width="250"
+             word_wrap="true">
+                Private Settings
+            </text>
+            <text
+             type="string"
+             length="1"
+             follows="left|top"
+             font="SansSerif"
+             font.style="ITALIC"
+             height="15"
+             layout="topleft"
+             left="10"
+             name="status_message"
+             text_color="0.1 0.1 0.1 1"
+             top_pad="10"
+             width="300">
+                This user can:
+            </text>
+            <check_box
+             enabled="false"
+             follows="left|top"
+             font="SansSerifBig"
+             height="20"
+             label="See my online status"
+             layout="topleft"
+             left="10"
+             name="status_check"
+             text_disabled_color="0.1 0.1 0.1 1"
+             text_enabled_color="white"
+             top_pad="10"
+             width="300" />
+            <check_box
+             enabled="false"
+             follows="left|top"
+             font="SansSerifBig"
+             height="20"
+             label="See me on the map"
+             layout="topleft"
+             left="10"
+             name="map_check"
+             text_disabled_color="0.1 0.1 0.1 1"
+             text_enabled_color="white"
+             top_pad="10"
+             width="300" />
+            <check_box
+             enabled="false"
+             follows="left|top"
+             font="SansSerifBig"
+             height="20"
+             label="Edit, delite or take my objects"
+             layout="topleft"
+             left="10"
+             name="objects_check"
+             text_disabled_color="0.1 0.1 0.1 1"
+             text_enabled_color="white"
+             top_pad="10"
+             width="300" />
+        </panel>
+    </scroll_container>
     <panel
 	 layout="topleft"
      follows="bottom"
      height="30"
-     left="0"
+     left="8"
      name="notes_buttons_panel"
-     bottom="690"
-     width="350">
-      <button
+     bottom="625"
+     width="345">
+        <button
          follows="bottom|left"
          font="SansSerifSmallBold"
          height="25"
          label="Add Friend"
          layout="topleft"
-         left="5"
+         left="0"
          mouse_opaque="false"
          name="add_friend"
          top="0"
@@ -162,7 +169,7 @@
          layout="topleft"
          left_pad="5"
          name="im"
-         top_delta="0"
+         top="0"
          width="40" />
         <button
          follows="bottom|left"
@@ -172,7 +179,7 @@
          layout="topleft"
          left_pad="5"
          name="call"
-         top_delta="0"
+         top="0"
          width="50"
          enabled="false"/>
         <button
@@ -183,7 +190,7 @@
          layout="topleft"
          left_pad="5"
          name="teleport"
-         top_delta="0"
+         top="0"
          width="65" />
         <button
          follows="bottom|left"
@@ -191,12 +198,10 @@
          height="25"
          label="Share"
          layout="topleft"
-         left_pad="15"
+         left_pad="5"
          name="share"
-         top_delta="0"
+         top="0"
          width="50"
          enabled="false"/>
     </panel>
-</panel>
-	</scroll_container>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index f53e06494f6..ae385731f96 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -82,9 +82,9 @@
           top="9" left="10" width="16" height="16"
           follows="bottom|left"
           font="SansSerifBigBold"
-          image_hover_selected="add_btn.tga"
-          image_selected="add_btn.tga"
-          image_unselected="add_btn.tga" picture_style="true"
+          image_hover_selected="plus.tga"
+          image_selected="plus.tga"
+          image_unselected="plus.tga" picture_style="true"
         />
         <button
           name="del_btn"
@@ -92,9 +92,9 @@
           top_delta="0" left_pad="24" width="16" height="16"
           follows="bottom|left"
           font="SansSerifBigBold"
-          image_hover_selected="del_btn.tga"
-          image_selected="del_btn.tga"
-          image_unselected="del_btn.tga"
+          image_hover_selected="minus.tga"
+          image_selected="minus.tga"
+          image_unselected="minus.tga"
           picture_style="true"
         />
         <button
@@ -137,9 +137,9 @@
           top="9" left="10" width="16" height="16"
           follows="bottom|left"
           font="SansSerifBigBold"
-          image_hover_selected="add_btn.tga"
-          image_selected="add_btn.tga"
-          image_unselected="add_btn.tga"
+          image_hover_selected="plus.tga"
+          image_selected="plus.tga"
+          image_unselected="plus.tga"
           picture_style="true"
         />
         <button
@@ -148,9 +148,9 @@
           top_delta="0" left_pad="24" width="16" height="16"
           follows="bottom|left"
           font="SansSerifBigBold"
-          image_hover_selected="del_btn.tga"
-          image_selected="del_btn.tga"
-          image_unselected="del_btn.tga"
+          image_hover_selected="minus.tga"
+          image_selected="minus.tga"
+          image_unselected="minus.tga"
           picture_style="true"
         />
         <button
@@ -159,9 +159,9 @@
           top_delta="0" left_pad="24" width="16" height="16"
           follows="bottom|left"
           font="SansSerifBigBold"
-          image_hover_selected="activate_btn.tga"
-          image_selected="activate_btn.tga"
-          image_unselected="activate_btn.tga"
+          image_hover_selected="group_activate_btn.tga"
+          image_selected="group_activate_btn.tga"
+          image_unselected="group_activate_btn.tga"
           picture_style="true"
         />
         <button
@@ -434,8 +434,8 @@
 	class="panel_profile_view" 
 	filename="panel_profile_view.xml"
 	top="0"
-	left="5"
-	width="345"
+	left="0"
+	width="355"
 	height="465"
 	follows="left|right|top|bottom"
 	visible="false"
diff --git a/indra/newview/skins/default/xui/en/panel_pick_info.xml b/indra/newview/skins/default/xui/en/panel_pick_info.xml
index fa04ba7f150..9fc1627cb91 100644
--- a/indra/newview/skins/default/xui/en/panel_pick_info.xml
+++ b/indra/newview/skins/default/xui/en/panel_pick_info.xml
@@ -3,7 +3,7 @@
  background_visible="true"
  bevel_style="in"
  bg_alpha_color="0.2 0.2 0.2 1"
- height="640"
+ height="660"
  layout="topleft"
  left="0"
  name="panel_pick_info"
@@ -39,7 +39,7 @@
      background_visible="true"
      bg_alpha_color="0.5 0.5 0.5 1"
      follows="left|right|top|bottom"
-     height="570"
+     height="580"
      layout="topleft"
      left="10"
      right="-10"
@@ -133,52 +133,50 @@
      follows="left|right|bottom"
      height="30"
      layout="topleft"
-     left="10"
+     left="8"
      name="buttons"
      right="-10"
-     top_pad="2">
+     bottom="660">
         <button
          follows="bottom|left"
          font="SansSerifSmallBold"
          height="25"
          label="Edit"
          layout="topleft"
-         left="10"
+         left="0"
          name="edit_btn"
-         top="3"
+         top="0"
          width="50" />
         <button
-         enabled="false"
-		 follows="bottom|left"
+         follows="bottom|left"
          font="SansSerifSmallBold"
          height="25"
          label="Teleport"
          layout="topleft"
-         left="65"
+         left_pad="5"
          name="teleport_btn"
-         top="3"
+         top="0"
          width="70" />
         <button
-         enabled="false"
-		 follows="bottom|left"
+         follows="bottom|left"
          font="SansSerifSmallBold"
          height="25"
          label="Show on Map"
          layout="topleft"
-         left="140"
+         left_pad="5"
          name="show_on_map_btn"
-         top="3"
+         top="0"
          width="90" />
         <button
-		 enabled="false"
-		 follows="bottom|right"
+         enabled="false"
+         follows="bottom|left"
          font="SansSerifSmallBold"
          height="25"
          label="Verb"
          layout="topleft"
-         left="270"
+         right="-5"
          name="verb_btn"
-         top="3"
+         top="0"
          width="50" />
     </panel>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml
new file mode 100644
index 00000000000..a4599bdf1ef
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ bg_alpha_color="0.4 0.4 0.4 1"
+ bg_opaque_color="0.4 0.4 0.4 1"
+ border="true"
+ follows="top|left|right"
+ height="80"
+ layout="topleft"
+ left="0"
+ name="picture_item"
+ top="80"
+ width="310">
+    <texture_picker
+     allow_no_texture="true"
+     default_image_name="None"
+     enabled="false"
+     follows="left|top"
+     height="80"
+     layout="topleft"
+     left="5"
+     mouse_opaque="false"
+     name="picture"
+     tab_stop="false"
+     top="7"
+     width="90" />
+    <text
+     follows="right"
+     font="SansSerifBold"
+     height="20"
+     layout="topleft"
+     left="100"
+     name="picture_name"
+     text_color="black"
+     top="5"
+     width="170" />
+    <text
+     follows="right"
+     font="SansSerif"
+     height="40"
+     layout="topleft"
+     left="100"
+     name="picture_descr"
+     text_color="white"
+     top="25"
+     width="170"
+     word_wrap="true" />
+    <button
+     follows="right"
+     height="20"
+     image_disabled="navbar_bg_button.tga"
+     image_disabled_selected="navbar_bg_button.tga"
+     image_overlay="navbar_forward.tga"
+     image_selected="navbar_bg_button.tga"
+     image_unselected="navbar_bg_button.tga"
+     layout="topleft"
+     name="inspector"
+     picture_style="true"
+     right="-5"
+     tab_stop="false"
+     top="28"
+     width="20" />
+</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_picks.xml b/indra/newview/skins/default/xui/en/panel_picks.xml
index 95055f43dc4..ed851452fe4 100644
--- a/indra/newview/skins/default/xui/en/panel_picks.xml
+++ b/indra/newview/skins/default/xui/en/panel_picks.xml
@@ -1,9 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
- background_visible="true"
  bevel_style="in"
- bg_alpha_color="0.5 0.5 0.5 1"
- height="690"
+ follows="left|top|right|bottom"
+ height="625"
  label="Picks"
  layout="topleft"
  left="0"
@@ -15,7 +14,7 @@
      length="1"
      follows="top|left|right"
      font="SansSerifHugeBold"
-     height="55"
+     height="50"
      layout="topleft"
      left="10"
      name="pick_title"
@@ -44,22 +43,23 @@
     </text>
     <scroll_container
      follows="left|top|right|bottom"
-     height="550"
+     height="495"
      layout="topleft"
-     left="5"
-     reserve_scroll_corner="true"
-     width="345">
+     left="8"
+     name="profile_scroll"
+     opaque="true"
+     color="0.5 0.5 0.5 1.0"
+     reserve_scroll_corner="false"
+     top_pad="0"
+     width="340">
         <panel
-         background_visible="true"
          bevel_style="in"
-         bg_alpha_color="0.6 0.6 0.6 1"
-         follows="left|top|right|bottom"
-         height="600"
+         height="40"
          layout="topleft"
          left="0"
          name="back_panel"
          top="0"
-         width="325" />
+         width="310" />
     </scroll_container>
     <panel
      background_visible="true"
@@ -70,10 +70,11 @@
      height="25"
      label="bottom_panel"
      layout="topleft"
-     left="5"
+     left="8"
      name="edit_panel"
      visible="false"
-     width="345">
+     top_pad="0"
+     width="340">
         <button
          enabled="false"
          follows="bottom|left"
@@ -92,27 +93,27 @@
          follows="bottom|left"
          font="SansSerifBigBold"
          height="16"
-         image_disabled="add_btn.tga"
-         image_disabled_selected="add_btn.tga"
-         image_hover_selected="add_btn.tga"
-         image_selected="add_btn.tga"
-         image_unselected="add_btn.tga"
+         image_disabled="plus.tga"
+         image_disabled_selected="plus.tga"
+         image_hover_selected="plus.tga"
+         image_selected="plus.tga"
+         image_unselected="plus.tga"
          layout="topleft"
          left="35"
          name="new_btn"
          picture_style="true"
-		 tool_tip="Create New Pick at Current Location"
+         tool_tip="Create New Pick at Current Location"
          top="5"
          width="16" />
         <button
          follows="bottom|right"
          font="SansSerifBigBold"
          height="16"
-         image_disabled="del_btn.tga"
-         image_disabled_selected="del_btn.tga"
-         image_hover_selected="del_btn.tga"
-         image_selected="del_btn.tga"
-         image_unselected="del_btn.tga"
+         image_disabled="minus.tga"
+         image_disabled_selected="minus.tga"
+         image_hover_selected="minus.tga"
+         image_selected="minus.tga"
+         image_unselected="minus.tga"
          layout="topleft"
          name="trash_btn"
          picture_style="true"
@@ -121,12 +122,12 @@
          width="16" />
     </panel>
     <panel
-     follows="left|right"
-     height="25"
+     follows="bottom|left"
+     height="30"
      layout="topleft"
-     left="0"
+     left="8"
      name="buttons_cucks"
-     top_pad="10"
+     bottom="625"
      width="345">
         <button
          follows="bottom|left"
@@ -134,8 +135,9 @@
          height="25"
          label="Info"
          layout="topleft"
-         left="10"
+         left="0"
          name="info_btn"
+         enabled="false"
          top="0"
          width="50" />
         <button
@@ -144,8 +146,9 @@
          height="25"
          label="Teleport"
          layout="topleft"
-         left="65"
+         left_pad="5"
          name="teleport_btn"
+         enabled="false"
          top="0"
          width="70" />
         <button
@@ -154,8 +157,9 @@
          height="25"
          label="Show on Map"
          layout="topleft"
-         left="140"
+         left_pad="5"
          name="show_on_map_btn"
+         enabled="false"
          top="0"
          width="90" />
         <button
@@ -165,7 +169,7 @@
          height="25"
          label="Verb"
          layout="topleft"
-         left="270"
+         left="280"
          name="verb_btn"
          top="0"
          width="50" />
diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml
index 66bb38b45e8..272a7f43285 100644
--- a/indra/newview/skins/default/xui/en/panel_places.xml
+++ b/indra/newview/skins/default/xui/en/panel_places.xml
@@ -45,7 +45,7 @@
      follows="bottom|left"
      font="SansSerifSmallBold"
      height="25"
-     label="TELEPORT"
+     label="Teleport"
      layout="topleft"
      left_delta="10"
      name="teleport_btn"
@@ -55,7 +55,7 @@
      follows="bottom|left"
      font="SansSerifSmallBold"
      height="25"
-     label="SHOW ON MAP"
+     label="Show on Map"
      layout="topleft"
      left_pad="5"
      name="map_btn"
@@ -66,7 +66,7 @@
      follows="bottom|left"
      font="SansSerifSmallBold"
      height="25"
-     label="SHARE"
+     label="Share"
      layout="topleft"
      left_pad="5"
      name="share_btn"
diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml
index a4363d58586..f99d629aeda 100644
--- a/indra/newview/skins/default/xui/en/panel_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_profile.xml
@@ -1,10 +1,8 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
- background_visible="true"
  bevel_style="in"
- bg_alpha_color="0.5 0.5 0.5 1"
  follows="left|top|right|bottom"
- height="705"
+ height="625"
  label="Profile"
  layout="topleft"
  left="10"
@@ -52,19 +50,52 @@
      name="NotAgeVerified">
         Not Age-verified
     </panel.string>
+    <panel.string
+     name="payment_update_link_url">
+        http://www.secondlife.com/account/billing.php?lang=en
+    </panel.string>
+    <panel.string
+     name="my_account_link_url">
+        http://secondlife.com/account
+    </panel.string>
+    <panel.string
+     name="partner_edit_link_url">
+        http://www.secondlife.com/account/partners.php?lang=en
+    </panel.string>
+    <panel.string
+     name="no_partner_text">
+        None
+    </panel.string>
     <scroll_container
+     color="0.5 0.5 0.5 1.0"
      follows="left|top|right|bottom"
-     height="690"
+     height="570"
      layout="topleft"
-     left="1"
-	 name="profile_scroll"
-     width="354">
+     left="8"
+     name="profile_scroll"
+     opaque="true"
+     reserve_scroll_corner="false"
+     width="340">
         <panel
-         height="710"
+         height="680"
          layout="topleft"
          left="0"
          top="0"
-         width="320">
+         width="310">
+            <text 
+             type="string"
+             follows="top|left|right"
+             font="SansSerifHugeBold" 
+             height="20" 
+             layout="topleft" 
+             left="9" 
+             name="user_name" 
+             text_color="white" 
+             top="0" 
+             mouse_opaque="true" 
+             width="320">
+              (Loading...)
+            </text> 
             <panel
              follows="left|top"
              height="120"
@@ -146,8 +177,8 @@
              layout="topleft"
              left="0"
              name="status_panel"
-             top="135"
-             width="300">
+             top="155"
+             width="320">
                 <text
                  follows="left|top"
                  font="SansSerifBold"
@@ -160,7 +191,6 @@
                  width="100" />
                 <text
                  type="string"
-                 length="1"
                  follows="left|top"
                  font="SansSerifBold"
                  font.style="ITALIC"
@@ -179,7 +209,7 @@
              layout="topleft"
              left="0"
              name="status_me_panel"
-             top="135"
+             top="155"
              width="300">
                 <text
                  type="string"
@@ -223,7 +253,6 @@
                     What&apos;re you up to?
                 </text>
                 <line_editor
-                 type="string"
                  border_style="line"
                  border_thickness="1"
                  follows="left|top|right"
@@ -336,6 +365,7 @@
              follows="left|top|right"
              font="SansSerif"
              font.style="UNDERLINE"
+             font_shadow="hard" 
              height="15"
              layout="topleft"
              left="9"
@@ -402,16 +432,17 @@
              layout="topleft"
              left="9"
              name="account_actions_panel"
-             width="335">
+             width="300">
                 <text
                  type="string"
                  follows="left|top"
                  font="SansSerif"
                  font.style="UNDERLINE"
+                 font_shadow="hard" 
                  height="15"
                  layout="topleft"
                  left="0"
-                 name="my_account_link"
+                 name="payment_update_link"
                  text_color="0.2 0.2 1 1"
                  top="0"
                  width="65">
@@ -422,6 +453,7 @@
                  follows="left|top"
                  font="SansSerif"
                  font.style="UNDERLINE"
+                 font_shadow="hard" 
                  height="15"
                  layout="topleft"
                  left="70"
@@ -450,7 +482,7 @@
              layout="topleft"
              left="9"
              name="partner_data_panel"
-             width="335">
+             width="300">
                 <text
                  type="string"
                  follows="left|top|right"
@@ -470,10 +502,11 @@
                  follows="top|right"
                  font="SansSerif"
                  font.style="UNDERLINE"
+                 font_shadow="hard" 
                  halign="right"
                  height="15"
                  layout="topleft"
-                 left="270"
+                 left="250"
                  name="partner_edit_link"
                  text_color="0.2 0.2 1 1"
                  top="0"
@@ -481,94 +514,98 @@
                     Edit
                 </text>
             </panel>
-            <panel
-             follows="left|top"
-             height="30"
-             layout="topleft"
-             name="profile_buttons_panel"
-             width="350">
-                <button
-                 follows="bottom|left"
-                 font="SansSerifSmallBold"
-                 height="25"
-                 label="Add Friend"
-                 layout="topleft"
-                 left="5"
-                 mouse_opaque="false"
-                 name="add_friend"
-                 top="0"
-                 width="75" />
-                <button
-                 follows="bottom|left"
-                 font="SansSerifSmallBold"
-                 height="25"
-                 label="IM"
-                 layout="topleft"
-                 left_pad="5"
-                 name="im"
-                 top_delta="0"
-                 width="40" />
-                <button
-                 enabled="false"
-                 follows="bottom|left"
-                 font="SansSerifSmallBold"
-                 height="25"
-                 label="Call"
-                 layout="topleft"
-                 left_pad="5"
-                 name="call"
-                 top_delta="0"
-                 width="50" />
-                <button
-                 follows="bottom|left"
-                 font="SansSerifSmallBold"
-                 height="25"
-                 label="Teleport"
-                 layout="topleft"
-                 left_pad="5"
-                 name="teleport"
-                 top_delta="0"
-                 width="65" />
-                <button
-                 enabled="false"
-                 follows="bottom|left"
-                 font="SansSerifSmallBold"
-                 height="25"
-                 label="Share"
-                 layout="topleft"
-                 left_pad="15"
-                 name="share"
-                 top_delta="0"
-                 width="50" />
-            </panel>
-            <panel
-             follows="left|top"
-             height="30"
-             layout="topleft"
-             name="profile_me_buttons_panel"
-			 visible="false"
-             width="350">
-                <button
-                 follows="bottom|left"
-                 font="SansSerifSmallBold"
-                 height="25"
-                 label="Edit Profile"
-                 layout="topleft"
-                 left="0"
-                 name="edit_profile_btn"
-                 top="0"
-                 width="105" />
-                <button
-                 follows="bottom|left"
-                 font="SansSerifSmallBold"
-                 height="25"
-                 label="Edit Appearance"
-                 layout="topleft"
-                 left_pad="15"
-                 name="edit_appearance_btn"
-                 top_delta="0"
-                 width="130" />
-            </panel>
         </panel>
     </scroll_container>
+    <panel
+     bottom="625"
+     follows="bottom|left"
+     height="30"
+     layout="topleft"
+     left="8"
+     name="profile_buttons_panel"
+     width="345">
+        <button
+         follows="bottom|left"
+         font="SansSerifSmallBold"
+         height="25"
+         label="Add Friend"
+         layout="topleft"
+         left="0"
+         mouse_opaque="false"
+         name="add_friend"
+         top="0"
+         width="75" />
+        <button
+         follows="bottom|left"
+         font="SansSerifSmallBold"
+         height="25"
+         label="IM"
+         layout="topleft"
+         left_pad="5"
+         name="im"
+         top="0"
+         width="40" />
+        <button
+         enabled="false"
+         follows="bottom|left"
+         font="SansSerifSmallBold"
+         height="25"
+         label="Call"
+         layout="topleft"
+         left_pad="5"
+         name="call"
+         top="0"
+         width="50" />
+        <button
+         follows="bottom|left"
+         font="SansSerifSmallBold"
+         height="25"
+         label="Teleport"
+         layout="topleft"
+         left_pad="5"
+         name="teleport"
+         top="0"
+         width="65" />
+        <button
+         enabled="false"
+         follows="bottom|left"
+         font="SansSerifSmallBold"
+         height="25"
+         label="Share"
+         layout="topleft"
+         left_pad="5"
+         name="share"
+         top="0"
+         width="50" />
+    </panel>
+    <panel
+     bottom="625"
+     follows="bottom|left"
+     height="30"
+     layout="topleft"
+     left="8"
+     name="profile_me_buttons_panel"
+     visible="false"
+     width="345">
+        <button
+         follows="bottom|left"
+         font="SansSerifSmallBold"
+         height="25"
+         label="Edit Profile"
+         layout="topleft"
+         left="0"
+         name="edit_profile_btn"
+         top="0"
+         width="105" />
+        <button
+         follows="bottom|left"
+         font="SansSerifSmallBold"
+         height="25"
+         label="Edit Appearance"
+         layout="topleft"
+         left_pad="5"
+         name="edit_appearance_btn"
+         top="0"
+         width="130" />
+    </panel>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_profile_view.xml b/indra/newview/skins/default/xui/en/panel_profile_view.xml
index fa919776a71..428d071db2f 100644
--- a/indra/newview/skins/default/xui/en/panel_profile_view.xml
+++ b/indra/newview/skins/default/xui/en/panel_profile_view.xml
@@ -10,32 +10,32 @@
  name="panel_target_profile"
  top="0"
  width="355">
-	<button 
-		layout="topleft" 
-		name="back" 
-		left="0" 
-		top="5" 
-		width="20" 
-		height="20" 
-		label=""
-		follows="top|left"
-		image_selected="navbar_bg_button.tga"
-		image_unselected="navbar_bg_button.tga"
-		image_overlay="navbar_back.tga"/>
-	<text 
-		layout="topleft" 
-		top="0" 
-		left="30" 
-		width="150" 
-		height="20" 
-		font="SansSerifHugeBold" 
-		text_color="white" 
-		follows="top|left"
-		mouse_opaque="true" 
-		name="user_name">(Loading...)</text> 
+    <button 
+     layout="topleft" 
+     name="back" 
+     left="5" 
+     top="5" 
+     width="20" 
+     height="20" 
+     label=""
+     follows="top|left"
+     image_selected="navbar_bg_button.tga"
+     image_unselected="navbar_bg_button.tga"
+     image_overlay="navbar_back.tga"/>
+    <text 
+     layout="topleft" 
+     top="0" 
+     left_pad="15" 
+     width="320" 
+     height="20" 
+     font="SansSerifHugeBold" 
+     text_color="white" 
+     follows="top|left|right"
+     mouse_opaque="true" 
+     name="user_name">(Loading...)</text> 
     <tab_container
      follows="left|top|right|bottom"
-     height="600"
+     height="625"
      layout="topleft"
      left="0"
      name="profile_tabs"
@@ -54,7 +54,7 @@
          label="Picks"
          layout="topleft"
          name="panel_picks"/>
-		 <panel
+        <panel
          class="panel_notes"
          filename="panel_notes.xml"
          label="Notes"
diff --git a/indra/newview/skins/default/xui/en/panel_side_tray.xml b/indra/newview/skins/default/xui/en/panel_side_tray.xml
index 220191ddaa3..ce8cb97f56f 100644
--- a/indra/newview/skins/default/xui/en/panel_side_tray.xml
+++ b/indra/newview/skins/default/xui/en/panel_side_tray.xml
@@ -52,7 +52,7 @@
       title="Places" 
       collapsable="true" 
       min_width="355" 
-      min_height="570" 
+      min_height="200" 
       header_visible="false"
     >
       <panel 
diff --git a/indra/newview/skins/default/xui/en/panel_teleport_history.xml b/indra/newview/skins/default/xui/en/panel_teleport_history.xml
index b7ce812dc83..330bc362d2e 100644
--- a/indra/newview/skins/default/xui/en/panel_teleport_history.xml
+++ b/indra/newview/skins/default/xui/en/panel_teleport_history.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel name="Teleport History" bottom="0" height="326" left="0" width="380"
      border="true" follows="left|top|right|bottom">
-	<scroll_list bottom="0" can_resize="true" column_padding="0" draw_heading="true"
+	<scroll_list bottom="0" column_padding="0" draw_heading="true"
 	     draw_stripes="false" follows="left|top|bottom|right" left="0"
 	     multi_select="false" name="history_items" search_column="1"
 	     sort_column="1" height="326" width="380" >
diff --git a/indra/newview/skins/default/xui/en/widgets/side_tray.xml b/indra/newview/skins/default/xui/en/widgets/side_tray.xml
index e3b70ba6e2e..55ec18f2922 100644
--- a/indra/newview/skins/default/xui/en/widgets/side_tray.xml
+++ b/indra/newview/skins/default/xui/en/widgets/side_tray.xml
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<side_tray tab_btn_image="sidebar_tab_left.tga"
-        tab_btn_image_selected="sidebar_tab_left_selected.tga"
-		tab_btn_width = "32"
-		tab_btn_height = "32"
-		tab_btn_margin = "0"
-        >
-</side_tray>
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<side_tray tab_btn_image="sidebar_tab_left.tga"
+        tab_btn_image_selected="sidebar_tab_left_selected.tga"
+		tab_btn_width = "32"
+		tab_btn_height = "32"
+		tab_btn_margin = "0"
+        >
+</side_tray>
-- 
GitLab