From bab6e11eef151345c7a8cfb1459fd53006fbd522 Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Tue, 3 Aug 2010 16:43:23 -0700
Subject: New Mac build of llqtwebkit, to fix a problem with named link targets
 and onClickLinkHref events.

Built from the following:

revision aacdf69cbf5aa12d77c179296e31ef643ed1ef4a in http://qt.gitorious.org/+lindenqt/qt/lindenqt (currently head of the 'lindenqt' branch)
revision 08e0bc3253b7 in http://bitbucket.org/lindenlab/llqtwebkit/ (currently head of the default branch)
---
 install.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/install.xml b/install.xml
index 3795fc3757..766f272c70 100644
--- a/install.xml
+++ b/install.xml
@@ -981,9 +981,9 @@ anguage Infrstructure (CLI) international standard</string>
           <key>darwin</key>
           <map>
             <key>md5sum</key>
-            <string>becffca6bd8dcb239de284ea2a8b485b</string>
+            <string>e207ddad01ae1cbe0caae7cb80824e8b</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-4.6+cookies-darwin-20100617.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-4.6-darwin-20100803.tar.bz2</uri>
           </map>
           <key>linux</key>
           <map>
-- 
cgit v1.2.3


From 5062351a0a2a95c3cbca27297b57afddc23d7a4f Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Wed, 4 Aug 2010 19:01:18 -0700
Subject: deprecated ADD_SORTED due to n^2 behavior, set the sort order on the
 scroll list instead

---
 indra/llcommon/stdenums.h                          |  4 ++--
 indra/llui/llscrolllistctrl.cpp                    | 23 +++++-----------------
 indra/newview/llfloatergroups.cpp                  |  7 ++++---
 indra/newview/llfloaterland.cpp                    |  4 ++--
 indra/newview/llfloaterlandholdings.cpp            |  9 ++++-----
 indra/newview/llfloatermediabrowser.cpp            |  3 ++-
 indra/newview/llfloaterpreference.cpp              |  6 ++----
 indra/newview/llfloaterscriptlimits.cpp            |  2 +-
 indra/newview/llpanelgroupgeneral.cpp              |  2 +-
 indra/newview/llpanelgrouplandmoney.cpp            |  2 +-
 indra/newview/llpanelgrouproles.cpp                |  2 +-
 indra/newview/llpanellogin.cpp                     |  3 ++-
 indra/newview/llpanelprimmediacontrols.cpp         |  2 +-
 .../default/xui/en/panel_group_land_money.xml      |  2 ++
 .../default/xui/en/panel_preferences_alerts.xml    |  4 ++++
 .../xui/en/panel_script_limits_region_memory.xml   |  2 ++
 16 files changed, 36 insertions(+), 41 deletions(-)

diff --git a/indra/llcommon/stdenums.h b/indra/llcommon/stdenums.h
index 1a5678dde1..e0565204d4 100644
--- a/indra/llcommon/stdenums.h
+++ b/indra/llcommon/stdenums.h
@@ -119,8 +119,8 @@ enum EObjectPropertiesExtraID
 enum EAddPosition
 {
 	ADD_TOP,
-	ADD_SORTED,
-	ADD_BOTTOM
+	ADD_BOTTOM,
+	ADD_DEFAULT
 };
 
 enum LLGroupChange
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index d4d161f2c9..9ab2cfef4b 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -541,23 +541,7 @@ BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos, BOOL r
 			setNeedsSort();
 			break;
 	
-		case ADD_SORTED:
-			{
-				// sort by column 0, in ascending order
-				std::vector<sort_column_t> single_sort_column;
-				single_sort_column.push_back(std::make_pair(0, TRUE));
-
-				mItemList.push_back(item);
-				std::stable_sort(
-					mItemList.begin(), 
-					mItemList.end(), 
-					SortScrollListItem(single_sort_column,mSortCallback));
-				
-				// ADD_SORTED just sorts by first column...
-				// this might not match user sort criteria, so flag list as being in unsorted state
-				setNeedsSort();
-				break;
-			}	
+		case ADD_DEFAULT:
 		case ADD_BOTTOM:
 			mItemList.push_back(item);
 			setNeedsSort();
@@ -2762,9 +2746,10 @@ LLScrollListColumn* LLScrollListCtrl::getColumn(const std::string& name)
 	return NULL;
 }
 
-
+LLFastTimer::DeclareTimer FTM_ADD_SCROLLLIST_ELEMENT("Add Scroll List Item");
 LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& element, EAddPosition pos, void* userdata)
 {
+	LLFastTimer _(FTM_ADD_SCROLLLIST_ELEMENT);
 	LLScrollListItem::Params item_params;
 	LLParamSDParser::instance().readSD(element, item_params);
 	item_params.userdata = userdata;
@@ -2773,12 +2758,14 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& element, EAddPosition
 
 LLScrollListItem* LLScrollListCtrl::addRow(const LLScrollListItem::Params& item_p, EAddPosition pos)
 {
+	LLFastTimer _(FTM_ADD_SCROLLLIST_ELEMENT);
 	LLScrollListItem *new_item = new LLScrollListItem(item_p);
 	return addRow(new_item, item_p, pos);
 }
 
 LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLScrollListItem::Params& item_p, EAddPosition pos)
 {
+	LLFastTimer _(FTM_ADD_SCROLLLIST_ELEMENT);
 	if (!item_p.validateBlock() || !new_item) return NULL;
 	new_item->setNumColumns(mColumns.size());
 
diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp
index 0bd8215e5c..8558345efa 100644
--- a/indra/newview/llfloatergroups.cpp
+++ b/indra/newview/llfloatergroups.cpp
@@ -347,11 +347,10 @@ void LLPanelGroups::onGroupList(LLUICtrl* ctrl, void* userdata)
 	if(self) self->enableButtons();
 }
 
-void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 powers_mask)
+void init_group_list(LLScrollListCtrl* group_list, const LLUUID& highlight_id, U64 powers_mask)
 {
 	S32 count = gAgent.mGroups.count();
 	LLUUID id;
-	LLCtrlListInterface *group_list = ctrl->getListInterface();
 	if (!group_list) return;
 
 	group_list->operateOnAll(LLCtrlListInterface::OP_DELETE);
@@ -375,10 +374,12 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 pow
 			element["columns"][0]["font"]["name"] = "SANSSERIF";
 			element["columns"][0]["font"]["style"] = style;
 
-			group_list->addElement(element, ADD_SORTED);
+			group_list->addElement(element);
 		}
 	}
 
+	group_list->sortOnce(0, TRUE);
+
 	// add "none" to list at top
 	{
 		std::string style = "NORMAL";
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 625b443abc..19e28720ae 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -2440,7 +2440,7 @@ void LLPanelLandAccess::refresh()
 					suffix.append(" " + parent_floater->getString("Remaining") + ")");
 				}
 				if (mListAccess)
-					mListAccess->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix);
+					mListAccess->addNameItem(entry.mID, ADD_DEFAULT, TRUE, suffix);
 			}
 		}
 		
@@ -2481,7 +2481,7 @@ void LLPanelLandAccess::refresh()
 					}
 					suffix.append(" " + parent_floater->getString("Remaining") + ")");
 				}
-				mListBanned->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix);
+				mListBanned->addNameItem(entry.mID, ADD_DEFAULT, TRUE, suffix);
 			}
 		}
 		
diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp
index 3c8ee6eb9e..12d27b8790 100644
--- a/indra/newview/llfloaterlandholdings.cpp
+++ b/indra/newview/llfloaterlandholdings.cpp
@@ -75,10 +75,9 @@ BOOL LLFloaterLandHoldings::postBuild()
 	childSetAction("Show on Map", onClickMap, this);
 
 	// Grant list
-	getChild<LLScrollListCtrl>("grant list")->setDoubleClickCallback(onGrantList, this);
-
-	LLCtrlListInterface *list = childGetListInterface("grant list");
-	if (!list) return TRUE;
+	LLScrollListCtrl* grant_list = getChild<LLScrollListCtrl>("grant list");
+	grant_list->sortByColumnIndex(0, TRUE);
+	grant_list->setDoubleClickCallback(onGrantList, this);
 
 	S32 count = gAgent.mGroups.count();
 	for(S32 i = 0; i < count; ++i)
@@ -97,7 +96,7 @@ BOOL LLFloaterLandHoldings::postBuild()
 		element["columns"][1]["value"] = areastr;
 		element["columns"][1]["font"] = "SANSSERIF";
 
-		list->addElement(element, ADD_SORTED);
+		grant_list->addElement(element);
 	}
 	
 	center();
diff --git a/indra/newview/llfloatermediabrowser.cpp b/indra/newview/llfloatermediabrowser.cpp
index 5405de2f9a..d01488b6b1 100644
--- a/indra/newview/llfloatermediabrowser.cpp
+++ b/indra/newview/llfloatermediabrowser.cpp
@@ -105,6 +105,7 @@ BOOL LLFloaterMediaBrowser::postBuild()
 
 	mAddressCombo = getChild<LLComboBox>("address");
 	mAddressCombo->setCommitCallback(onEnterAddress, this);
+	mAddressCombo->sortByName();
 
 	childSetAction("back", onClickBack, this);
 	childSetAction("forward", onClickForward, this);
@@ -185,7 +186,7 @@ void LLFloaterMediaBrowser::setCurrentURL(const std::string& url)
 	if (mCurrentURL != "about:blank")
 	{
 		mAddressCombo->remove(mCurrentURL);
-		mAddressCombo->add(mCurrentURL, ADD_SORTED);
+		mAddressCombo->add(mCurrentURL);
 		mAddressCombo->selectByValue(mCurrentURL);
 
 		// Serialize url history
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 7791c037d3..a4b45e04f2 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -826,13 +826,11 @@ void LLFloaterPreference::buildPopupLists()
 				row["columns"][1]["font"] = "SANSSERIF_SMALL";
 				row["columns"][1]["width"] = 360;
 			}
-			item = disabled_popups.addElement(row,
-											  ADD_SORTED);
+			item = disabled_popups.addElement(row);
 		}
 		else
 		{
-			item = enabled_popups.addElement(row,
-											 ADD_SORTED);
+			item = enabled_popups.addElement(row);
 		}
 		
 		if (item)
diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp
index e0f646349e..e827e19f82 100644
--- a/indra/newview/llfloaterscriptlimits.cpp
+++ b/indra/newview/llfloaterscriptlimits.cpp
@@ -741,7 +741,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
 			}
 			element["columns"][5]["font"] = "SANSSERIF";
 
-			list->addElement(element, ADD_SORTED);
+			list->addElement(element);
 			
 			element["owner_id"] = owner_id;
 			element["local_id"] = local_id;
diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp
index 2302772803..155e000bb8 100644
--- a/indra/newview/llpanelgroupgeneral.cpp
+++ b/indra/newview/llpanelgroupgeneral.cpp
@@ -746,7 +746,7 @@ void LLPanelGroupGeneral::updateMembers()
 		sSDTime += sd_timer.getElapsedTimeF32();
 
 		element_timer.reset();
-		LLScrollListItem* member_row = mListVisibleMembers->addElement(row);//, ADD_SORTED);
+		LLScrollListItem* member_row = mListVisibleMembers->addElement(row);
 		
 		if ( member->isOwner() )
 		{
diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp
index 1404cfcea2..16d5f8140d 100644
--- a/indra/newview/llpanelgrouplandmoney.cpp
+++ b/indra/newview/llpanelgrouplandmoney.cpp
@@ -528,7 +528,7 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
 			row["columns"][4]["column"] = "hidden";
 			row["columns"][4]["value"] = hidden;
 			
-			mGroupParcelsp->addElement(row, ADD_SORTED);
+			mGroupParcelsp->addElement(row);
 		}
 	}
 }
diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp
index 7a28d10baf..efc797cfe9 100644
--- a/indra/newview/llpanelgrouproles.cpp
+++ b/indra/newview/llpanelgrouproles.cpp
@@ -1631,7 +1631,7 @@ void LLPanelGroupMembersSubTab::updateMembers()
 			row["columns"][2]["value"] = mMemberProgress->second->getOnlineStatus();
 			row["columns"][2]["font"] = "SANSSERIF_SMALL";
 
-			LLScrollListItem* member = mMembersList->addElement(row);//, ADD_SORTED);
+			LLScrollListItem* member = mMembersList->addElement(row);
 
 			LLUUID id = member->getUUID();
 			mHasMatch = TRUE;
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 4b23e63f12..58ed01896a 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -1110,9 +1110,10 @@ void LLPanelLogin::updateServerCombo()
 	{
 		if (!grid_choice->first.empty())
 		{
-			server_choice_combo->add(grid_choice->second, grid_choice->first, ADD_SORTED);
+			server_choice_combo->add(grid_choice->second, grid_choice->first);
 		}
 	}
+	server_choice_combo->sortByName();
 	
 	server_choice_combo->addSeparator(ADD_TOP);
 	
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index 0648d99685..81e805974f 100644
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -1171,7 +1171,7 @@ void LLPanelPrimMediaControls::setCurrentURL()
 //	if (media_address_combo && mCurrentURL != "about:blank")
 //	{
 //		media_address_combo->remove(mCurrentURL);
-//		media_address_combo->add(mCurrentURL, ADD_SORTED);
+//		media_address_combo->add(mCurrentURL);
 //		media_address_combo->selectByValue(mCurrentURL);
 //	}
 #else   // USE_COMBO_BOX_FOR_MEDIA_URL
diff --git a/indra/newview/skins/default/xui/en/panel_group_land_money.xml b/indra/newview/skins/default/xui/en/panel_group_land_money.xml
index 76f7484c68..1e1d2d18ca 100644
--- a/indra/newview/skins/default/xui/en/panel_group_land_money.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_land_money.xml
@@ -60,6 +60,8 @@
      left="0"
      right="-1"
      top="0"
+     sort_column="0"
+     sort_ascending="true"
      name="group_parcel_list"
      width="313">
         <scroll_list.columns
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml b/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml
index 516457dd93..559df5bec9 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml
@@ -57,6 +57,8 @@
      left="10"
      multi_select="true"
      name="enabled_popups"
+     sort_column="0"
+     sort_ascending="true" 
      width="495" />
 	 <button
 	 enabled_control="FirstSelectedDisabledPopups"
@@ -103,6 +105,8 @@
      height="140"
      layout="topleft"
      left="10"
+     sort_column="0"
+     sort_ascending="true"
      multi_select="true"
      name="disabled_popups"
      width="495" />
diff --git a/indra/newview/skins/default/xui/en/panel_script_limits_region_memory.xml b/indra/newview/skins/default/xui/en/panel_script_limits_region_memory.xml
index 9dff00fa0b..c5e8bf5803 100644
--- a/indra/newview/skins/default/xui/en/panel_script_limits_region_memory.xml
+++ b/indra/newview/skins/default/xui/en/panel_script_limits_region_memory.xml
@@ -79,6 +79,8 @@
      layout="topleft"
      left_delta="0"
      multi_select="true"
+     sort_column="0"
+     sort_ascending="true"
      name="scripts_list"
      top_delta="16"
      width="460">
-- 
cgit v1.2.3


From 932f248553328c2c8d4a2fde9f7c5859c1965024 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Wed, 4 Aug 2010 19:01:28 -0700
Subject: optimized font lookups

---
 indra/llrender/llfontgl.cpp | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index d6c062fc5e..849318ccee 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -983,37 +983,43 @@ LLFontGL::VAlign LLFontGL::vAlignFromName(const std::string& name)
 //static
 LLFontGL* LLFontGL::getFontMonospace()
 {
-	return getFont(LLFontDescriptor("Monospace","Monospace",0));
+	static LLFontGL* fontp = getFont(LLFontDescriptor("Monospace","Monospace",0));
+	return fontp;
 }
 
 //static
 LLFontGL* LLFontGL::getFontSansSerifSmall()
 {
-	return getFont(LLFontDescriptor("SansSerif","Small",0));
+	static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Small",0));
+	return fontp;
 }
 
 //static
 LLFontGL* LLFontGL::getFontSansSerif()
 {
-	return getFont(LLFontDescriptor("SansSerif","Medium",0));
+	static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Medium",0));
+	return fontp;
 }
 
 //static
 LLFontGL* LLFontGL::getFontSansSerifBig()
 {
-	return getFont(LLFontDescriptor("SansSerif","Large",0));
+	static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Large",0));
+	return fontp;
 }
 
 //static 
 LLFontGL* LLFontGL::getFontSansSerifHuge()
 {
-	return getFont(LLFontDescriptor("SansSerif","Huge",0));
+	static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Large",0));
+	return fontp;
 }
 
 //static 
 LLFontGL* LLFontGL::getFontSansSerifBold()
 {
-	return getFont(LLFontDescriptor("SansSerif","Medium",BOLD));
+	static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Medium",BOLD));
+	return fontp;
 }
 
 //static
-- 
cgit v1.2.3


From b3bf2d79330c3238aae8e916f6d483fbcac4b0c2 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Wed, 4 Aug 2010 19:01:44 -0700
Subject: optimized LLUIString construction

---
 indra/llui/lluistring.cpp | 19 ++++++++++++++-----
 indra/llui/lluistring.h   |  9 +++++----
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp
index ac9e71665f..385292e792 100644
--- a/indra/llui/lluistring.cpp
+++ b/indra/llui/lluistring.cpp
@@ -40,7 +40,7 @@ LLFastTimer::DeclareTimer FTM_UI_STRING("UI String");
 
 LLUIString::LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args)
 :	mOrig(instring),
-	mArgs(args)
+	mArgs(new LLStringUtil::format_map_t(args))
 {
 	dirty();
 }
@@ -54,7 +54,7 @@ void LLUIString::assign(const std::string& s)
 void LLUIString::setArgList(const LLStringUtil::format_map_t& args)
 
 {
-	mArgs = args;
+	getArgs() = args;
 	dirty();
 }
 
@@ -74,7 +74,7 @@ void LLUIString::setArgs(const LLSD& sd)
 
 void LLUIString::setArg(const std::string& key, const std::string& replacement)
 {
-	mArgs[key] = replacement;
+	getArgs()[key] = replacement;
 	dirty();
 }
 
@@ -135,14 +135,14 @@ void LLUIString::updateResult() const
 	mResult = mOrig;
 	
 	// get the defailt args + local args
-	if (mArgs.empty())
+	if (!mArgs || mArgs->empty())
 	{
 		LLStringUtil::format(mResult, LLTrans::getDefaultArgs());
 	}
 	else
 	{
 		LLStringUtil::format_map_t combined_args = LLTrans::getDefaultArgs();
-		combined_args.insert(mArgs.begin(), mArgs.end());
+		combined_args.insert(mArgs->begin(), mArgs->end());
 		LLStringUtil::format(mResult, combined_args);
 	}
 }
@@ -153,3 +153,12 @@ void LLUIString::updateWResult() const
 
 	mWResult = utf8str_to_wstring(getUpdatedResult());
 }
+
+LLStringUtil::format_map_t& LLUIString::getArgs()
+{
+	if (!mArgs)
+	{
+		mArgs = new LLStringUtil::format_map_t;
+	}
+	return *mArgs;
+}
\ No newline at end of file
diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h
index 32cfc0d9cd..3f91856e26 100644
--- a/indra/llui/lluistring.h
+++ b/indra/llui/lluistring.h
@@ -64,9 +64,9 @@ class LLUIString
 public:
 	// These methods all perform appropriate argument substitution
 	// and modify mOrig where appropriate
-        LLUIString() : mNeedsResult(false), mNeedsWResult(false) {}
+        LLUIString() : mArgs(NULL), mNeedsResult(false), mNeedsWResult(false) {}
 	LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args);
-	LLUIString(const std::string& instring) { assign(instring); }
+	LLUIString(const std::string& instring) : mArgs(NULL) { assign(instring); }
 
 	void assign(const std::string& instring);
 	LLUIString& operator=(const std::string& s) { assign(s); return *this; }
@@ -86,7 +86,7 @@ public:
 	S32 length() const { return getUpdatedWResult().size(); }
 
 	void clear();
-	void clearArgs() { mArgs.clear(); }
+	void clearArgs() { if (mArgs) mArgs->clear(); }
 	
 	// These utility functions are included for text editing.
 	// They do not affect mOrig and do not perform argument substitution
@@ -105,11 +105,12 @@ private:
 	// do actual work of updating strings (non-inlined)
 	void updateResult() const;
 	void updateWResult() const;
+	LLStringUtil::format_map_t& getArgs();
 	
 	std::string mOrig;
 	mutable std::string mResult;
 	mutable LLWString mWResult; // for displaying
-	LLStringUtil::format_map_t mArgs;
+	LLStringUtil::format_map_t* mArgs;
 
 	// controls lazy evaluation
 	mutable bool	mNeedsResult;
-- 
cgit v1.2.3


From f92a411c023e2178814c27216b4d4c36fcb5d784 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Wed, 4 Aug 2010 19:01:55 -0700
Subject: updated comment on boost lib

---
 install.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/install.xml b/install.xml
index 3795fc3757..f7562e16e2 100644
--- a/install.xml
+++ b/install.xml
@@ -185,7 +185,7 @@
         <key>copyright</key>
         <string>various</string>
         <key>description</key>
-        <string>A set of portable C++ libraries which provide a wide set of functionality. Used primarily for tokenization. </string>
+        <string>A set of portable C++ libraries which provide a wide set of functionality. </string>
         <key>license</key>
         <string>boost</string>
         <key>packages</key>
-- 
cgit v1.2.3


From b2028085fdfddfd5a7ac0f52d9f34b84457b3b98 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Wed, 4 Aug 2010 19:02:30 -0700
Subject: first pass at faster XUI parsing (no recursion support yet) also made
 LLSD->param block parsing faster

---
 indra/llui/llsdparam.cpp       | 116 +++++++---
 indra/llui/llsdparam.h         |  12 +-
 indra/llui/lluictrlfactory.cpp |   7 +-
 indra/llxuixml/llinitparam.h   |  13 +-
 indra/llxuixml/llxuiparser.cpp | 511 ++++++++++++++++++++++++++++++++++++-----
 indra/llxuixml/llxuiparser.h   |  86 +++++--
 6 files changed, 636 insertions(+), 109 deletions(-)

diff --git a/indra/llui/llsdparam.cpp b/indra/llui/llsdparam.cpp
index 4bb45a3065..7d37127584 100644
--- a/indra/llui/llsdparam.cpp
+++ b/indra/llui/llsdparam.cpp
@@ -43,33 +43,16 @@ LLParamSDParser::LLParamSDParser()
 {
 	using boost::bind;
 
-	registerParserFuncs<S32>(bind(&LLParamSDParser::readTypedValue<S32>, this, _1, &LLSD::asInteger),
-							bind(&LLParamSDParser::writeTypedValue<S32>, this, _1, _2));
-	registerParserFuncs<U32>(bind(&LLParamSDParser::readTypedValue<U32>, this, _1, &LLSD::asInteger),
-							bind(&LLParamSDParser::writeU32Param, this, _1, _2));
-	registerParserFuncs<F32>(bind(&LLParamSDParser::readTypedValue<F32>, this, _1, &LLSD::asReal),
-							bind(&LLParamSDParser::writeTypedValue<F32>, this, _1, _2));
-	registerParserFuncs<F64>(bind(&LLParamSDParser::readTypedValue<F64>, this, _1, &LLSD::asReal),
-							bind(&LLParamSDParser::writeTypedValue<F64>, this, _1, _2));
-	registerParserFuncs<bool>(bind(&LLParamSDParser::readTypedValue<F32>, this, _1, &LLSD::asBoolean),
-							bind(&LLParamSDParser::writeTypedValue<F32>, this, _1, _2));
-	registerParserFuncs<std::string>(bind(&LLParamSDParser::readTypedValue<std::string>, this, _1, &LLSD::asString),
-							bind(&LLParamSDParser::writeTypedValue<std::string>, this, _1, _2));
-	registerParserFuncs<LLUUID>(bind(&LLParamSDParser::readTypedValue<LLUUID>, this, _1, &LLSD::asUUID),
-							bind(&LLParamSDParser::writeTypedValue<LLUUID>, this, _1, _2));
-	registerParserFuncs<LLDate>(bind(&LLParamSDParser::readTypedValue<LLDate>, this, _1, &LLSD::asDate),
-							bind(&LLParamSDParser::writeTypedValue<LLDate>, this, _1, _2));
-	registerParserFuncs<LLURI>(bind(&LLParamSDParser::readTypedValue<LLURI>, this, _1, &LLSD::asURI),
-							bind(&LLParamSDParser::writeTypedValue<LLURI>, this, _1, _2));
-	registerParserFuncs<LLSD>(bind(&LLParamSDParser::readSDParam, this, _1),
-							bind(&LLParamSDParser::writeTypedValue<LLSD>, this, _1, _2));
-}
-
-bool LLParamSDParser::readSDParam(void* value_ptr)
-{
-	if (!mCurReadSD) return false;
-	*((LLSD*)value_ptr) = *mCurReadSD;
-	return true;
+	registerParserFuncs<S32>(readS32, bind(&LLParamSDParser::writeTypedValue<S32>, this, _1, _2));
+	registerParserFuncs<U32>(readU32, bind(&LLParamSDParser::writeU32Param, this, _1, _2));
+	registerParserFuncs<F32>(readF32, bind(&LLParamSDParser::writeTypedValue<F32>, this, _1, _2));
+	registerParserFuncs<F64>(readF64, bind(&LLParamSDParser::writeTypedValue<F64>, this, _1, _2));
+	registerParserFuncs<bool>(readBool, bind(&LLParamSDParser::writeTypedValue<F32>, this, _1, _2));
+	registerParserFuncs<std::string>(readString, bind(&LLParamSDParser::writeTypedValue<std::string>, this, _1, _2));
+	registerParserFuncs<LLUUID>(readUUID, bind(&LLParamSDParser::writeTypedValue<LLUUID>, this, _1, _2));
+	registerParserFuncs<LLDate>(readDate, bind(&LLParamSDParser::writeTypedValue<LLDate>, this, _1, _2));
+	registerParserFuncs<LLURI>(readURI, bind(&LLParamSDParser::writeTypedValue<LLURI>, this, _1, _2));
+	registerParserFuncs<LLSD>(readSD, bind(&LLParamSDParser::writeTypedValue<LLSD>, this, _1, _2));
 }
 
 // special case handling of U32 due to ambiguous LLSD::assign overload
@@ -148,3 +131,82 @@ LLSD* LLParamSDParser::getSDWriteNode(const parser_t::name_stack_t& name_stack)
 	return mWriteSD;
 }
 
+bool LLParamSDParser::readS32(Parser& parser, void* val_ptr)
+{
+	LLParamSDParser& self = static_cast<LLParamSDParser&>(parser);
+
+    *((S32*)val_ptr) = self.mCurReadSD->asInteger();
+    return true;
+}
+
+bool LLParamSDParser::readU32(Parser& parser, void* val_ptr)
+{
+	LLParamSDParser& self = static_cast<LLParamSDParser&>(parser);
+
+    *((U32*)val_ptr) = self.mCurReadSD->asInteger();
+    return true;
+}
+
+bool LLParamSDParser::readF32(Parser& parser, void* val_ptr)
+{
+	LLParamSDParser& self = static_cast<LLParamSDParser&>(parser);
+
+    *((F32*)val_ptr) = self.mCurReadSD->asReal();
+    return true;
+}
+
+bool LLParamSDParser::readF64(Parser& parser, void* val_ptr)
+{
+	LLParamSDParser& self = static_cast<LLParamSDParser&>(parser);
+
+    *((F64*)val_ptr) = self.mCurReadSD->asReal();
+    return true;
+}
+
+bool LLParamSDParser::readBool(Parser& parser, void* val_ptr)
+{
+	LLParamSDParser& self = static_cast<LLParamSDParser&>(parser);
+
+    *((bool*)val_ptr) = self.mCurReadSD->asBoolean();
+    return true;
+}
+
+bool LLParamSDParser::readString(Parser& parser, void* val_ptr)
+{
+	LLParamSDParser& self = static_cast<LLParamSDParser&>(parser);
+
+	*((std::string*)val_ptr) = self.mCurReadSD->asString();
+    return true;
+}
+
+bool LLParamSDParser::readUUID(Parser& parser, void* val_ptr)
+{
+	LLParamSDParser& self = static_cast<LLParamSDParser&>(parser);
+
+	*((LLUUID*)val_ptr) = self.mCurReadSD->asUUID();
+    return true;
+}
+
+bool LLParamSDParser::readDate(Parser& parser, void* val_ptr)
+{
+	LLParamSDParser& self = static_cast<LLParamSDParser&>(parser);
+
+	*((LLDate*)val_ptr) = self.mCurReadSD->asDate();
+    return true;
+}
+
+bool LLParamSDParser::readURI(Parser& parser, void* val_ptr)
+{
+	LLParamSDParser& self = static_cast<LLParamSDParser&>(parser);
+
+	*((LLURI*)val_ptr) = self.mCurReadSD->asURI();
+    return true;
+}
+
+bool LLParamSDParser::readSD(Parser& parser, void* val_ptr)
+{
+	LLParamSDParser& self = static_cast<LLParamSDParser&>(parser);
+
+	*((LLSD*)val_ptr) = *self.mCurReadSD;
+    return true;
+}
diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h
index 12f28f876f..71b0a45630 100644
--- a/indra/llui/llsdparam.h
+++ b/indra/llui/llsdparam.h
@@ -79,9 +79,19 @@ private:
 
 	LLSD* getSDWriteNode(const parser_t::name_stack_t& name_stack);
 
-	bool readSDParam(void* value_ptr);
 	bool writeU32Param(const void* value_ptr, const parser_t::name_stack_t& name_stack);
 
+	static bool readS32(Parser& parser, void* val_ptr);
+	static bool readU32(Parser& parser, void* val_ptr);
+	static bool readF32(Parser& parser, void* val_ptr);
+	static bool readF64(Parser& parser, void* val_ptr);
+	static bool readBool(Parser& parser, void* val_ptr);
+	static bool readString(Parser& parser, void* val_ptr);
+	static bool readUUID(Parser& parser, void* val_ptr);
+	static bool readDate(Parser& parser, void* val_ptr);
+	static bool readURI(Parser& parser, void* val_ptr);
+	static bool readSD(Parser& parser, void* val_ptr);
+
 	Parser::name_stack_t	mNameStack;
 	const LLSD*				mCurReadSD;
 	LLSD*					mWriteSD;
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index a46d961709..6ad104c1f4 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -99,10 +99,11 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa
 	std::string filename = std::string("widgets") + gDirUtilp->getDirDelimiter() + widget_tag + ".xml";
 	LLXMLNodePtr root_node;
 
-	if (LLUICtrlFactory::getLayeredXMLNode(filename, root_node))
+	std::string full_filename = gDirUtilp->findSkinnedFilename(LLUI::getXUIPaths().front(), filename);
+	if (!full_filename.empty())
 	{
-		LLUICtrlFactory::instance().pushFileName(filename);
-		LLXUIParser::instance().readXUI(root_node, block, filename);
+		LLUICtrlFactory::instance().pushFileName(full_filename);
+		LLFastXUIParser::instance().readXUI(full_filename, block);
 		LLUICtrlFactory::instance().popFileName();
 	}
 }
diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index b645c4be7c..1cc7d06b73 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -40,6 +40,7 @@ f * @file llinitparam.h
 #include <boost/function.hpp>
 #include <boost/bind.hpp>
 #include <boost/type_traits/is_convertible.hpp>
+#include <boost/unordered_map.hpp>
 #include "llregistry.h"
 #include "llmemory.h"
 
@@ -202,13 +203,13 @@ namespace LLInitParam
 		typedef std::pair<name_stack_t::const_iterator, name_stack_t::const_iterator>	name_stack_range_t;
 		typedef std::vector<std::string>							possible_values_t;
 
-		typedef boost::function<bool (void*)>															parser_read_func_t;
+		typedef bool (*parser_read_func_t)(Parser& parser, void* output);
 		typedef boost::function<bool (const void*, const name_stack_t&)>								parser_write_func_t;
 		typedef boost::function<void (const name_stack_t&, S32, S32, const possible_values_t*)>	parser_inspect_func_t;
 
-		typedef std::map<const std::type_info*, parser_read_func_t, CompareTypeID>		parser_read_func_map_t;
-		typedef std::map<const std::type_info*, parser_write_func_t, CompareTypeID>		parser_write_func_map_t;
-		typedef std::map<const std::type_info*, parser_inspect_func_t, CompareTypeID>	parser_inspect_func_map_t;
+		typedef boost::unordered_map<const void*, parser_read_func_t>		parser_read_func_map_t;
+		typedef boost::unordered_map<const void*, parser_write_func_t>		parser_write_func_map_t;
+		typedef boost::unordered_map<const void*, parser_inspect_func_t>	parser_inspect_func_map_t;
 
 		Parser()
 		:	mParseSilently(false),
@@ -221,7 +222,7 @@ namespace LLInitParam
 		    parser_read_func_map_t::iterator found_it = mParserReadFuncs.find(&typeid(T));
 		    if (found_it != mParserReadFuncs.end())
 		    {
-			    return found_it->second((void*)&param);
+			    return found_it->second(*this, (void*)&param);
 		    }
 		    return false;
 	    }
@@ -386,7 +387,7 @@ namespace LLInitParam
 		void aggregateBlockData(BlockDescriptor& src_block_data);
 
 	public:
-		typedef std::map<const std::string, ParamDescriptor*> param_map_t; // references param descriptors stored in mAllParams
+		typedef boost::unordered_map<const std::string, ParamDescriptor*> param_map_t; // references param descriptors stored in mAllParams
 		typedef std::vector<ParamDescriptor*> param_list_t; 
 
 		typedef std::list<ParamDescriptor> all_params_list_t;// references param descriptors stored in mAllParams
diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index dbc20a5a1e..00128c978a 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -35,11 +35,16 @@
 #include "llxuiparser.h"
 
 #include "llxmlnode.h"
+#include "expat/expat.h"
 #include <fstream>
 #include <boost/tokenizer.hpp>
+//#include <boost/spirit/include/qi.hpp>
+#include <boost/spirit/include/classic_core.hpp>
 
 #include "lluicolor.h"
 
+using namespace BOOST_SPIRIT_CLASSIC_NS;
+
 const S32 MAX_STRING_ATTRIBUTE_SIZE = 40;
 
 //
@@ -370,34 +375,20 @@ LLXUIParser::LLXUIParser()
 :	mLastWriteGeneration(-1),
 	mCurReadDepth(0)
 {
-	registerParserFuncs<bool>(boost::bind(&LLXUIParser::readBoolValue, this, _1),
-								boost::bind(&LLXUIParser::writeBoolValue, this, _1, _2));
-	registerParserFuncs<std::string>(boost::bind(&LLXUIParser::readStringValue, this, _1),
-								boost::bind(&LLXUIParser::writeStringValue, this, _1, _2));
-	registerParserFuncs<U8>(boost::bind(&LLXUIParser::readU8Value, this, _1),
-								boost::bind(&LLXUIParser::writeU8Value, this, _1, _2));
-	registerParserFuncs<S8>(boost::bind(&LLXUIParser::readS8Value, this, _1),
-								boost::bind(&LLXUIParser::writeS8Value, this, _1, _2));
-	registerParserFuncs<U16>(boost::bind(&LLXUIParser::readU16Value, this, _1),
-								boost::bind(&LLXUIParser::writeU16Value, this, _1, _2));
-	registerParserFuncs<S16>(boost::bind(&LLXUIParser::readS16Value, this, _1),
-								boost::bind(&LLXUIParser::writeS16Value, this, _1, _2));
-	registerParserFuncs<U32>(boost::bind(&LLXUIParser::readU32Value, this, _1),
-								boost::bind(&LLXUIParser::writeU32Value, this, _1, _2));
-	registerParserFuncs<S32>(boost::bind(&LLXUIParser::readS32Value, this, _1),
-								boost::bind(&LLXUIParser::writeS32Value, this, _1, _2));
-	registerParserFuncs<F32>(boost::bind(&LLXUIParser::readF32Value, this, _1),
-								boost::bind(&LLXUIParser::writeF32Value, this, _1, _2));
-	registerParserFuncs<F64>(boost::bind(&LLXUIParser::readF64Value, this, _1),
-								boost::bind(&LLXUIParser::writeF64Value, this, _1, _2));
-	registerParserFuncs<LLColor4>(boost::bind(&LLXUIParser::readColor4Value, this, _1),
-								boost::bind(&LLXUIParser::writeColor4Value, this, _1, _2));
-	registerParserFuncs<LLUIColor>(boost::bind(&LLXUIParser::readUIColorValue, this, _1),
-								boost::bind(&LLXUIParser::writeUIColorValue, this, _1, _2));
-	registerParserFuncs<LLUUID>(boost::bind(&LLXUIParser::readUUIDValue, this, _1),
-								boost::bind(&LLXUIParser::writeUUIDValue, this, _1, _2));
-	registerParserFuncs<LLSD>(boost::bind(&LLXUIParser::readSDValue, this, _1),
-								boost::bind(&LLXUIParser::writeSDValue, this, _1, _2));
+	registerParserFuncs<bool>(readBoolValue, boost::bind(&LLXUIParser::writeBoolValue, this, _1, _2));
+	registerParserFuncs<std::string>(readStringValue, boost::bind(&LLXUIParser::writeStringValue, this, _1, _2));
+	registerParserFuncs<U8>(readU8Value, boost::bind(&LLXUIParser::writeU8Value, this, _1, _2));
+	registerParserFuncs<S8>(readS8Value, boost::bind(&LLXUIParser::writeS8Value, this, _1, _2));
+	registerParserFuncs<U16>(readU16Value, boost::bind(&LLXUIParser::writeU16Value, this, _1, _2));
+	registerParserFuncs<S16>(readS16Value, boost::bind(&LLXUIParser::writeS16Value, this, _1, _2));
+	registerParserFuncs<U32>(readU32Value, boost::bind(&LLXUIParser::writeU32Value, this, _1, _2));
+	registerParserFuncs<S32>(readS32Value, boost::bind(&LLXUIParser::writeS32Value, this, _1, _2));
+	registerParserFuncs<F32>(readF32Value, boost::bind(&LLXUIParser::writeF32Value, this, _1, _2));
+	registerParserFuncs<F64>(readF64Value, boost::bind(&LLXUIParser::writeF64Value, this, _1, _2));
+	registerParserFuncs<LLColor4>(readColor4Value, boost::bind(&LLXUIParser::writeColor4Value, this, _1, _2));
+	registerParserFuncs<LLUIColor>(readUIColorValue, boost::bind(&LLXUIParser::writeUIColorValue, this, _1, _2));
+	registerParserFuncs<LLUUID>(readUUIDValue, boost::bind(&LLXUIParser::writeUUIDValue, this, _1, _2));
+	registerParserFuncs<LLSD>(readSDValue, boost::bind(&LLXUIParser::writeSDValue, this, _1, _2));
 }
 
 static LLFastTimer::DeclareTimer FTM_PARSE_XUI("XUI Parsing");
@@ -621,10 +612,11 @@ LLXMLNodePtr LLXUIParser::getNode(const name_stack_t& stack)
 }
 
 
-bool LLXUIParser::readBoolValue(void* val_ptr)
+bool LLXUIParser::readBoolValue(Parser& parser, void* val_ptr)
 {
 	S32 value;
-	bool success = mCurReadNode->getBoolValue(1, &value);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	bool success = self.mCurReadNode->getBoolValue(1, &value);
 	*((bool*)val_ptr) = (value != FALSE);
 	return success;
 }
@@ -640,9 +632,10 @@ bool LLXUIParser::writeBoolValue(const void* val_ptr, const name_stack_t& stack)
 	return false;
 }
 
-bool LLXUIParser::readStringValue(void* val_ptr)
+bool LLXUIParser::readStringValue(Parser& parser, void* val_ptr)
 {
-	*((std::string*)val_ptr) = mCurReadNode->getSanitizedValue();
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	*((std::string*)val_ptr) = self.mCurReadNode->getSanitizedValue();
 	return true;
 }
 
@@ -677,9 +670,10 @@ bool LLXUIParser::writeStringValue(const void* val_ptr, const name_stack_t& stac
 	return false;
 }
 
-bool LLXUIParser::readU8Value(void* val_ptr)
+bool LLXUIParser::readU8Value(Parser& parser, void* val_ptr)
 {
-	return mCurReadNode->getByteValue(1, (U8*)val_ptr);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	return self.mCurReadNode->getByteValue(1, (U8*)val_ptr);
 }
 
 bool LLXUIParser::writeU8Value(const void* val_ptr, const name_stack_t& stack)
@@ -693,10 +687,11 @@ bool LLXUIParser::writeU8Value(const void* val_ptr, const name_stack_t& stack)
 	return false;
 }
 
-bool LLXUIParser::readS8Value(void* val_ptr)
+bool LLXUIParser::readS8Value(Parser& parser, void* val_ptr)
 {
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
 	S32 value;
-	if(mCurReadNode->getIntValue(1, &value))
+	if(self.mCurReadNode->getIntValue(1, &value))
 	{
 		*((S8*)val_ptr) = value;
 		return true;
@@ -715,10 +710,11 @@ bool LLXUIParser::writeS8Value(const void* val_ptr, const name_stack_t& stack)
 	return false;
 }
 
-bool LLXUIParser::readU16Value(void* val_ptr)
+bool LLXUIParser::readU16Value(Parser& parser, void* val_ptr)
 {
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
 	U32 value;
-	if(mCurReadNode->getUnsignedValue(1, &value))
+	if(self.mCurReadNode->getUnsignedValue(1, &value))
 	{
 		*((U16*)val_ptr) = value;
 		return true;
@@ -737,10 +733,11 @@ bool LLXUIParser::writeU16Value(const void* val_ptr, const name_stack_t& stack)
 	return false;
 }
 
-bool LLXUIParser::readS16Value(void* val_ptr)
+bool LLXUIParser::readS16Value(Parser& parser, void* val_ptr)
 {
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
 	S32 value;
-	if(mCurReadNode->getIntValue(1, &value))
+	if(self.mCurReadNode->getIntValue(1, &value))
 	{
 		*((S16*)val_ptr) = value;
 		return true;
@@ -759,9 +756,10 @@ bool LLXUIParser::writeS16Value(const void* val_ptr, const name_stack_t& stack)
 	return false;
 }
 
-bool LLXUIParser::readU32Value(void* val_ptr)
+bool LLXUIParser::readU32Value(Parser& parser, void* val_ptr)
 {
-	return mCurReadNode->getUnsignedValue(1, (U32*)val_ptr);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	return self.mCurReadNode->getUnsignedValue(1, (U32*)val_ptr);
 }
 
 bool LLXUIParser::writeU32Value(const void* val_ptr, const name_stack_t& stack)
@@ -775,9 +773,10 @@ bool LLXUIParser::writeU32Value(const void* val_ptr, const name_stack_t& stack)
 	return false;
 }
 
-bool LLXUIParser::readS32Value(void* val_ptr)
+bool LLXUIParser::readS32Value(Parser& parser, void* val_ptr)
 {
-	return mCurReadNode->getIntValue(1, (S32*)val_ptr);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	return self.mCurReadNode->getIntValue(1, (S32*)val_ptr);
 }
 
 bool LLXUIParser::writeS32Value(const void* val_ptr, const name_stack_t& stack)
@@ -791,9 +790,10 @@ bool LLXUIParser::writeS32Value(const void* val_ptr, const name_stack_t& stack)
 	return false;
 }
 
-bool LLXUIParser::readF32Value(void* val_ptr)
+bool LLXUIParser::readF32Value(Parser& parser, void* val_ptr)
 {
-	return mCurReadNode->getFloatValue(1, (F32*)val_ptr);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	return self.mCurReadNode->getFloatValue(1, (F32*)val_ptr);
 }
 
 bool LLXUIParser::writeF32Value(const void* val_ptr, const name_stack_t& stack)
@@ -807,9 +807,10 @@ bool LLXUIParser::writeF32Value(const void* val_ptr, const name_stack_t& stack)
 	return false;
 }
 
-bool LLXUIParser::readF64Value(void* val_ptr)
+bool LLXUIParser::readF64Value(Parser& parser, void* val_ptr)
 {
-	return mCurReadNode->getDoubleValue(1, (F64*)val_ptr);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	return self.mCurReadNode->getDoubleValue(1, (F64*)val_ptr);
 }
 
 bool LLXUIParser::writeF64Value(const void* val_ptr, const name_stack_t& stack)
@@ -823,10 +824,11 @@ bool LLXUIParser::writeF64Value(const void* val_ptr, const name_stack_t& stack)
 	return false;
 }
 
-bool LLXUIParser::readColor4Value(void* val_ptr)
+bool LLXUIParser::readColor4Value(Parser& parser, void* val_ptr)
 {
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
 	LLColor4* colorp = (LLColor4*)val_ptr;
-	if(mCurReadNode->getFloatValue(4, colorp->mV) >= 3)
+	if(self.mCurReadNode->getFloatValue(4, colorp->mV) >= 3)
 	{
 		return true;
 	}
@@ -846,11 +848,12 @@ bool LLXUIParser::writeColor4Value(const void* val_ptr, const name_stack_t& stac
 	return false;
 }
 
-bool LLXUIParser::readUIColorValue(void* val_ptr)
+bool LLXUIParser::readUIColorValue(Parser& parser, void* val_ptr)
 {
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
 	LLUIColor* param = (LLUIColor*)val_ptr;
 	LLColor4 color;
-	bool success =  mCurReadNode->getFloatValue(4, color.mV) >= 3;
+	bool success =  self.mCurReadNode->getFloatValue(4, color.mV) >= 3;
 	if (success)
 	{
 		param->set(color);
@@ -874,11 +877,12 @@ bool LLXUIParser::writeUIColorValue(const void* val_ptr, const name_stack_t& sta
 	return false;
 }
 
-bool LLXUIParser::readUUIDValue(void* val_ptr)
+bool LLXUIParser::readUUIDValue(Parser& parser, void* val_ptr)
 {
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
 	LLUUID temp_id;
 	// LLUUID::set is destructive, so use temporary value
-	if (temp_id.set(mCurReadNode->getSanitizedValue()))
+	if (temp_id.set(self.mCurReadNode->getSanitizedValue()))
 	{
 		*(LLUUID*)(val_ptr) = temp_id;
 		return true;
@@ -897,9 +901,10 @@ bool LLXUIParser::writeUUIDValue(const void* val_ptr, const name_stack_t& stack)
 	return false;
 }
 
-bool LLXUIParser::readSDValue(void* val_ptr)
+bool LLXUIParser::readSDValue(Parser& parser, void* val_ptr)
 {
-	*((LLSD*)val_ptr) = LLSD(mCurReadNode->getSanitizedValue());
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	*((LLSD*)val_ptr) = LLSD(self.mCurReadNode->getSanitizedValue());
 	return true;
 }
 
@@ -968,3 +973,397 @@ void LLXUIParser::parserError(const std::string& message)
 	Parser::parserError(message);
 #endif
 }
+
+
+//
+// LLFastXUIParser
+//
+
+struct ScopedFile
+{
+	ScopedFile( const std::string& filename, const char* accessmode )
+	{
+		mFile = LLFile::fopen(filename, accessmode);
+	}
+
+	~ScopedFile()
+	{
+		fclose(mFile);
+		mFile = NULL;
+	}
+
+	S32 getRemainingBytes()
+	{
+		if (!isOpen()) return 0;
+
+		S32 cur_pos = ftell(mFile);
+		fseek(mFile, 0L, SEEK_END);
+		S32 file_size = ftell(mFile);
+		fseek(mFile, cur_pos, SEEK_SET);
+		return file_size - cur_pos;
+	}
+
+	bool isOpen() { return mFile != NULL; }
+
+	LLFILE* mFile;
+};
+
+LLFastXUIParser::LLFastXUIParser()
+:	mLastWriteGeneration(-1),
+	mCurReadDepth(0)
+{
+	registerParserFuncs<bool>(readBoolValue, NULL);
+	registerParserFuncs<std::string>(readStringValue, NULL);
+	registerParserFuncs<U8>(readU8Value, NULL);
+	registerParserFuncs<S8>(readS8Value, NULL);
+	registerParserFuncs<U16>(readU16Value, NULL);
+	registerParserFuncs<S16>(readS16Value, NULL);
+	registerParserFuncs<U32>(readU32Value, NULL);
+	registerParserFuncs<S32>(readS32Value, NULL);
+	registerParserFuncs<F32>(readF32Value, NULL);
+	registerParserFuncs<F64>(readF64Value, NULL);
+	registerParserFuncs<LLColor4>(readColor4Value, NULL);
+	registerParserFuncs<LLUIColor>(readUIColorValue, NULL);
+	registerParserFuncs<LLUUID>(readUUIDValue, NULL);
+	registerParserFuncs<LLSD>(readSDValue, NULL);
+}
+
+LLFastXUIParser::~LLFastXUIParser()
+{
+}
+
+
+bool LLFastXUIParser::readXUI(const std::string& filename, LLInitParam::BaseBlock& block, bool silent)
+{
+	LLFastTimer timer(FTM_PARSE_XUI);
+
+	mParser = XML_ParserCreate(NULL);
+	XML_SetUserData(mParser, this);
+	XML_SetElementHandler(					mParser,	startElementHandler, endElementHandler);
+	XML_SetCharacterDataHandler(			mParser,	characterDataHandler);
+
+	mBlock = &block;
+	mNameStack.clear();
+	mCurFileName = filename;
+	mCurReadDepth = 0;
+	setParseSilently(silent);
+
+	ScopedFile file(filename, "rb");
+	if( !file.isOpen() )
+	{
+		LL_WARNS("ReadXUI") << "Unable to open file " << filename << LL_ENDL;
+		return false;
+	}
+
+	S32 bytes_read = 0;
+	
+	S32 buffer_size = file.getRemainingBytes();
+	void* buffer = XML_GetBuffer(mParser, buffer_size);
+	if( !buffer ) 
+	{
+		LL_WARNS("ReadXUI") << "Unable to allocate XML buffer while reading file " << filename << LL_ENDL;
+		XML_ParserFree( mParser );
+		return false;
+	}
+
+	bytes_read = (S32)fread(buffer, 1, buffer_size, file.mFile);
+	if( bytes_read <= 0 )
+	{
+		LL_WARNS("ReadXUI") << "Error while reading file  " << filename << LL_ENDL;
+		XML_ParserFree( mParser );
+		return false;
+	}
+	
+	if( !XML_ParseBuffer(mParser, bytes_read, TRUE ) )
+	{
+		LL_WARNS("ReadXUI") << "Error while parsing file  " << filename << LL_ENDL;
+		XML_ParserFree( mParser );
+		return false;
+	}
+
+	XML_ParserFree( mParser );
+	return true;
+}
+
+void LLFastXUIParser::startElementHandler(void *userData, const char *name, const char **atts)
+{
+	LLFastXUIParser* self = reinterpret_cast<LLFastXUIParser*>(userData);
+	self->startElement(name, atts);
+}
+
+void LLFastXUIParser::endElementHandler(void *userData, const char *name)
+{
+	LLFastXUIParser* self = reinterpret_cast<LLFastXUIParser*>(userData);
+	self->endElement(name);
+}
+
+void LLFastXUIParser::characterDataHandler(void *userData, const char *s, int len)
+{
+	LLFastXUIParser* self = reinterpret_cast<LLFastXUIParser*>(userData);
+	self->characterData(s, len);
+}
+
+void LLFastXUIParser::startElement(const char *name, const char **atts)
+{
+	typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
+	boost::char_separator<char> sep(".");
+
+	mCurReadDepth++;
+	S32 num_tokens_pushed = 0;
+	std::string child_name(name);
+
+	if (mCurReadDepth > 1)
+	{
+		// for non "dotted" child nodes	check to see if child node maps to another widget type
+		// and if not, treat as a child element of the current node
+		// e.g. <button><rect left="10"/></button> will interpret <rect> as "button.rect"
+		// since there is no widget named "rect"
+		if (child_name.find(".") == std::string::npos) 
+		{
+			mNameStack.push_back(std::make_pair(child_name, newParseGeneration()));
+			num_tokens_pushed++;
+		}
+		else
+		{
+			// parse out "dotted" name into individual tokens
+			tokenizer name_tokens(child_name, sep);
+
+			tokenizer::iterator name_token_it = name_tokens.begin();
+			if(name_token_it == name_tokens.end()) 
+			{
+				return;
+			}
+
+			// check for proper nesting
+			if(!mScope.empty() && *name_token_it != mScope.back())
+			{
+				return;
+			}
+
+			// now ignore first token
+			++name_token_it; 
+
+			// copy remaining tokens on to our running token list
+			for(tokenizer::iterator token_to_push = name_token_it; token_to_push != name_tokens.end(); ++token_to_push)
+			{
+				mNameStack.push_back(std::make_pair(*token_to_push, newParseGeneration()));
+				num_tokens_pushed++;
+			}
+			mScope.push_back(mNameStack.back().first);
+		}
+	}
+	else
+	{
+		mScope.push_back(name);
+	}
+
+	mTokenSizeStack.push_back(num_tokens_pushed);
+	readAttributes(atts);
+}
+
+bool LLFastXUIParser::readAttributes(const char **atts)
+{
+	typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
+	boost::char_separator<char> sep(".");
+
+	bool any_parsed = false;
+	for(S32 i = 0; atts[i] && atts[i+1]; i += 2 )
+	{
+		std::string attribute_name(atts[i]);
+		mCurAttributeValueBegin = atts[i+1];
+		
+		S32 num_tokens_pushed = 0;
+		tokenizer name_tokens(attribute_name, sep);
+		// copy remaining tokens on to our running token list
+		for(tokenizer::iterator token_to_push = name_tokens.begin(); token_to_push != name_tokens.end(); ++token_to_push)
+		{
+			mNameStack.push_back(std::make_pair(*token_to_push, newParseGeneration()));
+			num_tokens_pushed++;
+		}
+
+		// child nodes are not necessarily valid attributes, so don't complain once we've recursed
+		bool silent = mCurReadDepth > 1;
+		any_parsed |= mBlock->submitValue(mNameStack, *this, silent);
+		
+		while(num_tokens_pushed-- > 0)
+		{
+			mNameStack.pop_back();
+		}
+	}
+	return any_parsed;
+}
+
+
+void LLFastXUIParser::endElement(const char *name)
+{
+	mCurReadDepth--;
+	S32 num_tokens_to_pop = mTokenSizeStack.back();
+	mTokenSizeStack.pop_back();
+	while(num_tokens_to_pop-- > 0)
+	{
+		mNameStack.pop_back();
+	}
+	mScope.pop_back();
+}
+
+void LLFastXUIParser::characterData(const char *s, int len)
+{
+}
+
+
+/*virtual*/ std::string LLFastXUIParser::getCurrentElementName()
+{
+	std::string full_name;
+	for (name_stack_t::iterator it = mNameStack.begin();	
+		it != mNameStack.end();
+		++it)
+	{
+		full_name += it->first + "."; // build up dotted names: "button.param.nestedparam."
+	}
+
+	return full_name;
+}
+
+const S32 LINE_NUMBER_HERE = 0;
+
+void LLFastXUIParser::parserWarning(const std::string& message)
+{
+#ifdef LL_WINDOWS
+	// use Visual Studo friendly formatting of output message for easy access to originating xml
+	llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()).c_str());
+	utf16str += '\n';
+	OutputDebugString(utf16str.c_str());
+#else
+	Parser::parserWarning(message);
+#endif
+}
+
+void LLFastXUIParser::parserError(const std::string& message)
+{
+#ifdef LL_WINDOWS
+	llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()).c_str());
+	utf16str += '\n';
+	OutputDebugString(utf16str.c_str());
+#else
+	Parser::parserError(message);
+#endif
+}
+
+bool LLFastXUIParser::readBoolValue(Parser& parser, void* val_ptr)
+{
+	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	if (!strcmp(self.mCurAttributeValueBegin, "true")) 
+	{
+		*((bool*)val_ptr) = true;
+		return true;
+	}
+	else if (!strcmp(self.mCurAttributeValueBegin, "false"))
+	{
+		*((bool*)val_ptr) = false;
+		return true;
+	}
+
+	return false;
+}
+
+bool LLFastXUIParser::readStringValue(Parser& parser, void* val_ptr)
+{
+	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	*((std::string*)val_ptr) = self.mCurAttributeValueBegin;
+	return true;
+}
+
+bool LLFastXUIParser::readU8Value(Parser& parser, void* val_ptr)
+{
+	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	return parse(self.mCurAttributeValueBegin, uint_p[assign_a(*(U8*)val_ptr)]).full;
+}
+
+bool LLFastXUIParser::readS8Value(Parser& parser, void* val_ptr)
+{
+	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	return parse(self.mCurAttributeValueBegin, int_p[assign_a(*(S8*)val_ptr)]).full;
+}
+
+bool LLFastXUIParser::readU16Value(Parser& parser, void* val_ptr)
+{
+	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	return parse(self.mCurAttributeValueBegin, uint_p[assign_a(*(U16*)val_ptr)]).full;
+}
+
+bool LLFastXUIParser::readS16Value(Parser& parser, void* val_ptr)
+{
+	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	return parse(self.mCurAttributeValueBegin, int_p[assign_a(*(S16*)val_ptr)]).full;
+}
+
+bool LLFastXUIParser::readU32Value(Parser& parser, void* val_ptr)
+{
+	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	return parse(self.mCurAttributeValueBegin, uint_p[assign_a(*(U32*)val_ptr)]).full;
+}
+
+bool LLFastXUIParser::readS32Value(Parser& parser, void* val_ptr)
+{
+	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	return parse(self.mCurAttributeValueBegin, int_p[assign_a(*(S32*)val_ptr)]).full;
+}
+
+bool LLFastXUIParser::readF32Value(Parser& parser, void* val_ptr)
+{
+	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	return parse(self.mCurAttributeValueBegin, real_p[assign_a(*(F32*)val_ptr)]).full;
+}
+
+bool LLFastXUIParser::readF64Value(Parser& parser, void* val_ptr)
+{
+	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	return parse(self.mCurAttributeValueBegin, real_p[assign_a(*(F64*)val_ptr)]).full;
+}
+	
+bool LLFastXUIParser::readColor4Value(Parser& parser, void* val_ptr)
+{
+	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLColor4 value;
+
+	if (parse(self.mCurAttributeValueBegin, real_p[assign_a(value.mV[0])] >> real_p[assign_a(value.mV[1])] >> real_p[assign_a(value.mV[2])] >> real_p[assign_a(value.mV[3])], space_p).full)
+	{
+		*(LLColor4*)(val_ptr) = value;
+		return true;
+	}
+	return false;
+}
+
+bool LLFastXUIParser::readUIColorValue(Parser& parser, void* val_ptr)
+{
+	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLColor4 value;
+	LLUIColor* colorp = (LLUIColor*)val_ptr;
+
+	if (parse(self.mCurAttributeValueBegin, real_p[assign_a(value.mV[0])] >> real_p[assign_a(value.mV[1])] >> real_p[assign_a(value.mV[2])] >> real_p[assign_a(value.mV[3])], space_p).full)
+	{
+		colorp->set(value);
+		return true;
+	}
+	return false;
+}
+
+bool LLFastXUIParser::readUUIDValue(Parser& parser, void* val_ptr)
+{
+	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLUUID temp_id;
+	// LLUUID::set is destructive, so use temporary value
+	if (temp_id.set(self.mCurAttributeValueBegin))
+	{
+		*(LLUUID*)(val_ptr) = temp_id;
+		return true;
+	}
+	return false;
+}
+
+bool LLFastXUIParser::readSDValue(Parser& parser, void* val_ptr)
+{
+	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	*((LLSD*)val_ptr) = LLSD(self.mCurAttributeValueBegin);
+	return true;
+}
\ No newline at end of file
diff --git a/indra/llxuixml/llxuiparser.h b/indra/llxuixml/llxuiparser.h
index 884f4f7578..4deb083e1c 100644
--- a/indra/llxuixml/llxuiparser.h
+++ b/indra/llxuixml/llxuiparser.h
@@ -120,26 +120,24 @@ public:
 	void writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock& block, const LLInitParam::BaseBlock* diff_block = NULL);
 
 private:
-	typedef std::list<std::pair<std::string, bool> >	token_list_t;
-
 	bool readXUIImpl(LLXMLNodePtr node, const std::string& scope, LLInitParam::BaseBlock& block);
 	bool readAttributes(LLXMLNodePtr nodep, LLInitParam::BaseBlock& block);
 
 	//reader helper functions
-	bool readBoolValue(void* val_ptr);
-	bool readStringValue(void* val_ptr);
-	bool readU8Value(void* val_ptr);
-	bool readS8Value(void* val_ptr);
-	bool readU16Value(void* val_ptr);
-	bool readS16Value(void* val_ptr);
-	bool readU32Value(void* val_ptr);
-	bool readS32Value(void* val_ptr);
-	bool readF32Value(void* val_ptr);
-	bool readF64Value(void* val_ptr);
-	bool readColor4Value(void* val_ptr);
-	bool readUIColorValue(void* val_ptr);
-	bool readUUIDValue(void* val_ptr);
-	bool readSDValue(void* val_ptr);
+	static bool readBoolValue(Parser& parser, void* val_ptr);
+	static bool readStringValue(Parser& parser, void* val_ptr);
+	static bool readU8Value(Parser& parser, void* val_ptr);
+	static bool readS8Value(Parser& parser, void* val_ptr);
+	static bool readU16Value(Parser& parser, void* val_ptr);
+	static bool readS16Value(Parser& parser, void* val_ptr);
+	static bool readU32Value(Parser& parser, void* val_ptr);
+	static bool readS32Value(Parser& parser, void* val_ptr);
+	static bool readF32Value(Parser& parser, void* val_ptr);
+	static bool readF64Value(Parser& parser, void* val_ptr);
+	static bool readColor4Value(Parser& parser, void* val_ptr);
+	static bool readUIColorValue(Parser& parser, void* val_ptr);
+	static bool readUUIDValue(Parser& parser, void* val_ptr);
+	static bool readSDValue(Parser& parser, void* val_ptr);
 
 	//writer helper functions
 	bool writeBoolValue(const void* val_ptr, const name_stack_t&);
@@ -173,5 +171,61 @@ private:
 	std::string						mCurFileName;
 };
 
+class LLFastXUIParser : public LLInitParam::Parser, public LLSingleton<LLFastXUIParser>
+{
+LOG_CLASS(LLFastXUIParser);
+
+protected:
+	LLFastXUIParser();
+	virtual ~LLFastXUIParser();
+	friend class LLSingleton<LLFastXUIParser>;
+public:
+	typedef LLInitParam::Parser::name_stack_t name_stack_t;
+
+	/*virtual*/ std::string getCurrentElementName();
+	/*virtual*/ void parserWarning(const std::string& message);
+	/*virtual*/ void parserError(const std::string& message);
+
+	bool readXUI(const std::string& filename, LLInitParam::BaseBlock& block, bool silent=false);
+
+private:
+	//reader helper functions
+	static bool readBoolValue(Parser&, void* val_ptr);
+	static bool readStringValue(Parser&, void* val_ptr);
+	static bool readU8Value(Parser&, void* val_ptr);
+	static bool readS8Value(Parser&, void* val_ptr);
+	static bool readU16Value(Parser&, void* val_ptr);
+	static bool readS16Value(Parser&, void* val_ptr);
+	static bool readU32Value(Parser&, void* val_ptr);
+	static bool readS32Value(Parser&, void* val_ptr);
+	static bool readF32Value(Parser&, void* val_ptr);
+	static bool readF64Value(Parser&, void* val_ptr);
+	static bool readColor4Value(Parser&, void* val_ptr);
+	static bool readUIColorValue(Parser&, void* val_ptr);
+	static bool readUUIDValue(Parser&, void* val_ptr);
+	static bool readSDValue(Parser&, void* val_ptr);
+
+private:
+	static void startElementHandler(void *userData, const char *name, const char **atts);
+	static void endElementHandler(void *userData, const char *name);
+	static void characterDataHandler(void *userData, const char *s, int len);
+
+	void startElement(const char *name, const char **atts);
+	void endElement(const char *name);
+	void characterData(const char *s, int len);
+	bool readAttributes(const char **atts);
+
+	LLInitParam::BaseBlock*			mBlock;
+	Parser::name_stack_t			mNameStack;
+	struct XML_ParserStruct*		mParser;
+	S32								mLastWriteGeneration;
+	LLXMLNodePtr					mLastWrittenChild;
+	S32								mCurReadDepth;
+	std::string						mCurFileName;
+	const char*						mCurAttributeValueBegin;
+	std::vector<S32>				mTokenSizeStack;
+	std::vector<std::string>		mScope;
+};
+
 
 #endif //LLXUIPARSER_H
-- 
cgit v1.2.3


From d042dd9598a91e7bdfa39ce580f935bb744f8970 Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Thu, 5 Aug 2010 11:01:59 -0700
Subject: Yet another new Mac build of llqtwebkit.

Built from the following:

revision aacdf69cbf5aa12d77c179296e31ef643ed1ef4a in http://qt.gitorious.org/+lindenqt/qt/lindenqt (currently head of the 'lindenqt' branch)
revision bac00603b761 in http://bitbucket.org/lindenlab/llqtwebkit/ (currently head of the default branch)
---
 install.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/install.xml b/install.xml
index 766f272c70..2ecc165f0a 100644
--- a/install.xml
+++ b/install.xml
@@ -981,9 +981,9 @@ anguage Infrstructure (CLI) international standard</string>
           <key>darwin</key>
           <map>
             <key>md5sum</key>
-            <string>e207ddad01ae1cbe0caae7cb80824e8b</string>
+            <string>093c977ef0ef2396cc235b3620329a87</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-4.6-darwin-20100803.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-4.6-darwin-20100805.tar.bz2</uri>
           </map>
           <key>linux</key>
           <map>
-- 
cgit v1.2.3


From d4668787addf870fca0dc1cbf03c756584838261 Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Thu, 5 Aug 2010 11:16:13 -0700
Subject: Allow targeted links in the embedded browser to open multiple media
 browser windows.

Added an optional "target" parameter" to LLWeb::loadURL and loadInternal.

Made LLViewerMediaImpl::handleMediaEvent pass the target attribute of clicked links through.

Set floater_media_browser.xml to allow multiple instances.

Added LLFloaterMediaBrowser::create() and made LLFloaterMediaBrowser assume the incoming tag is the window's target, not the URL.

Reviewed by Richard at http://codereview.lindenlab.com/2641050
---
 indra/newview/llfloatermediabrowser.cpp            | 30 +++++++++++++++++-----
 indra/newview/llfloatermediabrowser.h              |  3 ++-
 indra/newview/llviewermedia.cpp                    | 17 ++++--------
 indra/newview/llweb.cpp                            | 10 ++++----
 indra/newview/llweb.h                              |  9 ++++---
 .../skins/default/xui/en/floater_media_browser.xml |  2 +-
 6 files changed, 43 insertions(+), 28 deletions(-)

diff --git a/indra/newview/llfloatermediabrowser.cpp b/indra/newview/llfloatermediabrowser.cpp
index 5405de2f9a..c38ef0c014 100644
--- a/indra/newview/llfloatermediabrowser.cpp
+++ b/indra/newview/llfloatermediabrowser.cpp
@@ -63,6 +63,30 @@ LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& key)
 
 }
 
+//static 
+void LLFloaterMediaBrowser::create(const std::string &url, const std::string& target)
+{
+	std::string tag = target;
+	
+	if(target.empty() || target == "_blank")
+	{
+		// create a unique tag for this instance
+		LLUUID id;
+		id.generate();
+		tag = id.asString();
+	}
+	
+	// TODO: Figure out whether we need to close an existing instance and/or warn the user about the number of instances they have open
+	
+	LLFloaterMediaBrowser *browser = dynamic_cast<LLFloaterMediaBrowser*> (LLFloaterReg::showInstance("media_browser", tag));
+	llassert(browser);
+	if(browser)
+	{
+		// tell the browser instance to load the specified URL
+		browser->openMedia(url);
+	}
+}
+
 void LLFloaterMediaBrowser::draw()
 {
 	getChildView("go")->setEnabled(!mAddressCombo->getValue().asString().empty());
@@ -197,12 +221,6 @@ void LLFloaterMediaBrowser::setCurrentURL(const std::string& url)
 	getChildView("reload")->setEnabled(TRUE);
 }
 
-void LLFloaterMediaBrowser::onOpen(const LLSD& media_url)
-{
-	LLFloater::onOpen(media_url);
-	openMedia(media_url.asString());
-}
-
 //static 
 void LLFloaterMediaBrowser::onEnterAddress(LLUICtrl* ctrl, void* user_data)
 {
diff --git a/indra/newview/llfloatermediabrowser.h b/indra/newview/llfloatermediabrowser.h
index c315f9e797..1645ed4613 100644
--- a/indra/newview/llfloatermediabrowser.h
+++ b/indra/newview/llfloatermediabrowser.h
@@ -47,10 +47,11 @@ class LLFloaterMediaBrowser :
 public:
 	LLFloaterMediaBrowser(const LLSD& key);
 
+	static void create(const std::string &url, const std::string& target);
+	
 	/*virtual*/ BOOL postBuild();
 	/*virtual*/ void onClose(bool app_quitting);
 	/*virtual*/ void draw();
-	/*virtual*/ void onOpen(const LLSD& key);
 
 	// inherited from LLViewerMediaObserver
 	/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 77f7740449..7a17bfeb46 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -2826,25 +2826,18 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
 			LL_DEBUGS("Media") <<  "Media event:  MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << plugin->getClickTarget() << "\", uri is " << plugin->getClickURL() << LL_ENDL;
 			// retrieve the event parameters
 			std::string url = plugin->getClickURL();
+			std::string target = plugin->getClickTarget();
 			U32 target_type = plugin->getClickTargetType();
-			
+
 			switch (target_type)
 			{
-			case LLPluginClassMedia::TARGET_EXTERNAL:
-				// force url to external browser
-				LLWeb::loadURLExternal(url);
-				break;
-			case LLPluginClassMedia::TARGET_BLANK:
-				// open in SL media browser or external browser based on user pref
-				LLWeb::loadURL(url);
-				break;
 			case LLPluginClassMedia::TARGET_NONE:
 				// ignore this click and let media plugin handle it
 				break;
-			case LLPluginClassMedia::TARGET_OTHER:
-				LL_WARNS("LinkTarget") << "Unsupported link target type" << LL_ENDL;
+			default:
+				// loadURL now handles distinguishing between _blank, _external, and other named targets.
+				LLWeb::loadURL(url, target);
 				break;
-			default: break;
 			}
 		};
 		break;
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index 5c9633c036..b61109d490 100644
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -84,23 +84,23 @@ void LLWeb::initClass()
 
 
 // static
-void LLWeb::loadURL(const std::string& url)
+void LLWeb::loadURL(const std::string& url, const std::string& target)
 {
-	if (gSavedSettings.getBOOL("UseExternalBrowser"))
+	if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external"))
 	{
 		loadURLExternal(url);
 	}
 	else
 	{
-		loadURLInternal(url);
+		loadURLInternal(url, target);
 	}
 }
 
 
 // static
-void LLWeb::loadURLInternal(const std::string &url)
+void LLWeb::loadURLInternal(const std::string &url, const std::string& target)
 {
-	LLFloaterReg::showInstance("media_browser", url);
+	LLFloaterMediaBrowser::create(url, target);
 }
 
 
diff --git a/indra/newview/llweb.h b/indra/newview/llweb.h
index 1119b80bb4..20c7391dbf 100644
--- a/indra/newview/llweb.h
+++ b/indra/newview/llweb.h
@@ -49,11 +49,14 @@ public:
 	static void initClass();
 	
 	/// Load the given url in the user's preferred web browser
-	static void loadURL(const std::string& url);
+	static void loadURL(const std::string& url, const std::string& target);
+	static void loadURL(const std::string& url) { loadURL(url, LLStringUtil::null); }
 	/// Load the given url in the user's preferred web browser	
-	static void loadURL(const char* url) { loadURL( ll_safe_string(url) ); }
+	static void loadURL(const char* url, const std::string& target) { loadURL( ll_safe_string(url), target); }
+	static void loadURL(const char* url) { loadURL( ll_safe_string(url), LLStringUtil::null ); }
 	/// Load the given url in the Second Life internal web browser
-	static void loadURLInternal(const std::string &url);
+	static void loadURLInternal(const std::string &url, const std::string& target);
+	static void loadURLInternal(const std::string &url) { loadURLInternal(url, LLStringUtil::null); }
 	/// Load the given url in the operating system's web browser, async if we want to return immediately
 	/// before browser has spawned
 	static void loadURLExternal(const std::string& url);
diff --git a/indra/newview/skins/default/xui/en/floater_media_browser.xml b/indra/newview/skins/default/xui/en/floater_media_browser.xml
index c02d607586..18f3b9ab06 100644
--- a/indra/newview/skins/default/xui/en/floater_media_browser.xml
+++ b/indra/newview/skins/default/xui/en/floater_media_browser.xml
@@ -9,7 +9,7 @@
  name="floater_about"
  help_topic="floater_about"
  save_rect="true"
- single_instance="true"
+ auto_tile="true"
  title="MEDIA BROWSER"
  width="820">
     <floater.string
-- 
cgit v1.2.3


From 52936c4ffe97172a5d4926e252f2a25515c47895 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 5 Aug 2010 13:15:22 -0700
Subject: reverted unportable use of typeinfo* as hash key

---
 indra/llxuixml/llinitparam.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index 1cc7d06b73..9890bacea4 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -207,9 +207,9 @@ namespace LLInitParam
 		typedef boost::function<bool (const void*, const name_stack_t&)>								parser_write_func_t;
 		typedef boost::function<void (const name_stack_t&, S32, S32, const possible_values_t*)>	parser_inspect_func_t;
 
-		typedef boost::unordered_map<const void*, parser_read_func_t>		parser_read_func_map_t;
-		typedef boost::unordered_map<const void*, parser_write_func_t>		parser_write_func_map_t;
-		typedef boost::unordered_map<const void*, parser_inspect_func_t>	parser_inspect_func_map_t;
+		typedef std::map<const std::type_info*, parser_read_func_t, CompareTypeID>		parser_read_func_map_t;
+		typedef std::map<const std::type_info*, parser_write_func_t, CompareTypeID>		parser_write_func_map_t;
+		typedef std::map<const std::type_info*, parser_inspect_func_t, CompareTypeID>	parser_inspect_func_map_t;
 
 		Parser()
 		:	mParseSilently(false),
-- 
cgit v1.2.3


From d26e380a06b343bc46010922de46e9664831e3b4 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 5 Aug 2010 13:19:19 -0700
Subject: added newlines at end to make Linux builds happy

---
 indra/llui/lluistring.cpp      | 2 +-
 indra/llxuixml/llxuiparser.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp
index 385292e792..e343df0063 100644
--- a/indra/llui/lluistring.cpp
+++ b/indra/llui/lluistring.cpp
@@ -161,4 +161,4 @@ LLStringUtil::format_map_t& LLUIString::getArgs()
 		mArgs = new LLStringUtil::format_map_t;
 	}
 	return *mArgs;
-}
\ No newline at end of file
+}
diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index 00128c978a..16571a9969 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -1366,4 +1366,4 @@ bool LLFastXUIParser::readSDValue(Parser& parser, void* val_ptr)
 	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
 	*((LLSD*)val_ptr) = LLSD(self.mCurAttributeValueBegin);
 	return true;
-}
\ No newline at end of file
+}
-- 
cgit v1.2.3


From a974ed98d04d05d9c682e85d3b25cf591d2b58c0 Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Thu, 5 Aug 2010 14:18:55 -0700
Subject: Fix for a crash on startup.

Richard sent me the diff for this one, just pushing it on his behalf.
---
 indra/llxuixml/llxuiparser.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index 16571a9969..fe85ac41cc 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -1122,6 +1122,7 @@ void LLFastXUIParser::startElement(const char *name, const char **atts)
 		{
 			mNameStack.push_back(std::make_pair(child_name, newParseGeneration()));
 			num_tokens_pushed++;
+			mScope.push_back(child_name);
 		}
 		else
 		{
@@ -1154,7 +1155,7 @@ void LLFastXUIParser::startElement(const char *name, const char **atts)
 	}
 	else
 	{
-		mScope.push_back(name);
+		mScope.push_back(child_name);
 	}
 
 	mTokenSizeStack.push_back(num_tokens_pushed);
-- 
cgit v1.2.3


From 60a313a687c5380c4a6d1a451936c85db07b681a Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 6 Aug 2010 11:02:37 -0700
Subject: speed up population of region scripts list

---
 indra/newview/llfloaterscriptlimits.cpp | 62 ++++++++++++++++++---------------
 1 file changed, 34 insertions(+), 28 deletions(-)

diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp
index e827e19f82..a77fc4710a 100644
--- a/indra/newview/llfloaterscriptlimits.cpp
+++ b/indra/newview/llfloaterscriptlimits.cpp
@@ -712,38 +712,44 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
 				}
 			}
 
-			LLSD element;
+			LLScrollListItem::Params item_params;
+			item_params.value = task_id;
 
-			element["id"] = task_id;
-			element["columns"][0]["column"] = "size";
-			element["columns"][0]["value"] = llformat("%d", size);
-			element["columns"][0]["font"] = "SANSSERIF";
-			element["columns"][1]["column"] = "urls";
-			element["columns"][1]["value"] = llformat("%d", urls);
-			element["columns"][1]["font"] = "SANSSERIF";
-			element["columns"][2]["column"] = "name";
-			element["columns"][2]["value"] = name_buf;
-			element["columns"][2]["font"] = "SANSSERIF";
-			element["columns"][3]["column"] = "owner";
-			element["columns"][3]["value"] = owner_buf;
-			element["columns"][3]["font"] = "SANSSERIF";
-			element["columns"][4]["column"] = "parcel";
-			element["columns"][4]["value"] = parcel_name;
-			element["columns"][4]["font"] = "SANSSERIF";
-			element["columns"][5]["column"] = "location";
-			if(has_locations)
-			{
-				element["columns"][5]["value"] = llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z);
-			}
-			else
-			{
-				element["columns"][5]["value"] = "";
-			}
-			element["columns"][5]["font"] = "SANSSERIF";
+			LLScrollListCell::Params cell_params;
+			cell_params.font = LLFontGL::getFontSansSerif();
 
-			list->addElement(element);
+			cell_params.column = "size";
+			cell_params.value = size;
+			item_params.columns.add(cell_params);
+
+			cell_params.column = "urls";
+			cell_params.value = urls;
+			item_params.columns.add(cell_params);
+
+			cell_params.column = "name";
+			cell_params.value = name_buf;
+			item_params.columns.add(cell_params);
+
+			cell_params.column = "owner";
+			cell_params.value = owner_buf;
+			item_params.columns.add(cell_params);
+
+			cell_params.column = "parcel";
+			cell_params.value = parcel_name;
+			item_params.columns.add(cell_params);
+
+			cell_params.column = "location";
+			cell_params.value = has_locations
+				? llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z)
+				: "";
+			item_params.columns.add(cell_params);
+
+			list->addRow(item_params);
 			
+			LLSD element;
 			element["owner_id"] = owner_id;
+
+			element["id"] = task_id;
 			element["local_id"] = local_id;
 			mObjectListItems.push_back(element);
 		}
-- 
cgit v1.2.3


From 9609b2c81c1efc43c152e379ca56191c7295973a Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 6 Aug 2010 11:03:15 -0700
Subject: renamed LLFastXUIParser to LLSimpleXUIParser and added support for
 parsing xml node text contents

---
 indra/llui/lluictrlfactory.cpp |   2 +-
 indra/llxuixml/llxuiparser.cpp | 108 ++++++++++++++++++++++-------------------
 indra/llxuixml/llxuiparser.h   |  23 +++++++--
 3 files changed, 78 insertions(+), 55 deletions(-)

diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index 6ad104c1f4..c5bd6c7fce 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -103,7 +103,7 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa
 	if (!full_filename.empty())
 	{
 		LLUICtrlFactory::instance().pushFileName(full_filename);
-		LLFastXUIParser::instance().readXUI(full_filename, block);
+		LLSimpleXUIParser::instance().readXUI(full_filename, block);
 		LLUICtrlFactory::instance().popFileName();
 	}
 }
diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index 00128c978a..e010b4c125 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -976,7 +976,7 @@ void LLXUIParser::parserError(const std::string& message)
 
 
 //
-// LLFastXUIParser
+// LLSimpleXUIParser
 //
 
 struct ScopedFile
@@ -1008,7 +1008,7 @@ struct ScopedFile
 	LLFILE* mFile;
 };
 
-LLFastXUIParser::LLFastXUIParser()
+LLSimpleXUIParser::LLSimpleXUIParser()
 :	mLastWriteGeneration(-1),
 	mCurReadDepth(0)
 {
@@ -1028,19 +1028,19 @@ LLFastXUIParser::LLFastXUIParser()
 	registerParserFuncs<LLSD>(readSDValue, NULL);
 }
 
-LLFastXUIParser::~LLFastXUIParser()
+LLSimpleXUIParser::~LLSimpleXUIParser()
 {
 }
 
 
-bool LLFastXUIParser::readXUI(const std::string& filename, LLInitParam::BaseBlock& block, bool silent)
+bool LLSimpleXUIParser::readXUI(const std::string& filename, LLInitParam::BaseBlock& block, bool silent)
 {
 	LLFastTimer timer(FTM_PARSE_XUI);
 
 	mParser = XML_ParserCreate(NULL);
 	XML_SetUserData(mParser, this);
-	XML_SetElementHandler(					mParser,	startElementHandler, endElementHandler);
-	XML_SetCharacterDataHandler(			mParser,	characterDataHandler);
+	XML_SetElementHandler(			mParser,	startElementHandler, endElementHandler);
+	XML_SetCharacterDataHandler(	mParser,	characterDataHandler);
 
 	mBlock = &block;
 	mNameStack.clear();
@@ -1085,25 +1085,25 @@ bool LLFastXUIParser::readXUI(const std::string& filename, LLInitParam::BaseBloc
 	return true;
 }
 
-void LLFastXUIParser::startElementHandler(void *userData, const char *name, const char **atts)
+void LLSimpleXUIParser::startElementHandler(void *userData, const char *name, const char **atts)
 {
-	LLFastXUIParser* self = reinterpret_cast<LLFastXUIParser*>(userData);
+	LLSimpleXUIParser* self = reinterpret_cast<LLSimpleXUIParser*>(userData);
 	self->startElement(name, atts);
 }
 
-void LLFastXUIParser::endElementHandler(void *userData, const char *name)
+void LLSimpleXUIParser::endElementHandler(void *userData, const char *name)
 {
-	LLFastXUIParser* self = reinterpret_cast<LLFastXUIParser*>(userData);
+	LLSimpleXUIParser* self = reinterpret_cast<LLSimpleXUIParser*>(userData);
 	self->endElement(name);
 }
 
-void LLFastXUIParser::characterDataHandler(void *userData, const char *s, int len)
+void LLSimpleXUIParser::characterDataHandler(void *userData, const char *s, int len)
 {
-	LLFastXUIParser* self = reinterpret_cast<LLFastXUIParser*>(userData);
+	LLSimpleXUIParser* self = reinterpret_cast<LLSimpleXUIParser*>(userData);
 	self->characterData(s, len);
 }
 
-void LLFastXUIParser::startElement(const char *name, const char **atts)
+void LLSimpleXUIParser::startElement(const char *name, const char **atts)
 {
 	typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
 	boost::char_separator<char> sep(".");
@@ -1122,6 +1122,7 @@ void LLFastXUIParser::startElement(const char *name, const char **atts)
 		{
 			mNameStack.push_back(std::make_pair(child_name, newParseGeneration()));
 			num_tokens_pushed++;
+			mScope.push_back(child_name);
 		}
 		else
 		{
@@ -1154,14 +1155,14 @@ void LLFastXUIParser::startElement(const char *name, const char **atts)
 	}
 	else
 	{
-		mScope.push_back(name);
+		mScope.push_back(child_name);
 	}
 
 	mTokenSizeStack.push_back(num_tokens_pushed);
 	readAttributes(atts);
 }
 
-bool LLFastXUIParser::readAttributes(const char **atts)
+bool LLSimpleXUIParser::readAttributes(const char **atts)
 {
 	typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
 	boost::char_separator<char> sep(".");
@@ -1194,8 +1195,16 @@ bool LLFastXUIParser::readAttributes(const char **atts)
 }
 
 
-void LLFastXUIParser::endElement(const char *name)
+void LLSimpleXUIParser::endElement(const char *name)
 {
+	if (!mTextContents.empty())
+	{
+		mNameStack.push_back(std::make_pair(std::string("value"), newParseGeneration()));
+		mCurAttributeValueBegin = mTextContents.c_str();
+		mBlock->submitValue(mNameStack, *this);
+		mNameStack.pop_back();
+		mTextContents.clear();
+	}
 	mCurReadDepth--;
 	S32 num_tokens_to_pop = mTokenSizeStack.back();
 	mTokenSizeStack.pop_back();
@@ -1206,12 +1215,13 @@ void LLFastXUIParser::endElement(const char *name)
 	mScope.pop_back();
 }
 
-void LLFastXUIParser::characterData(const char *s, int len)
+void LLSimpleXUIParser::characterData(const char *s, int len)
 {
+	mTextContents += std::string(s, len);
 }
 
 
-/*virtual*/ std::string LLFastXUIParser::getCurrentElementName()
+/*virtual*/ std::string LLSimpleXUIParser::getCurrentElementName()
 {
 	std::string full_name;
 	for (name_stack_t::iterator it = mNameStack.begin();	
@@ -1226,7 +1236,7 @@ void LLFastXUIParser::characterData(const char *s, int len)
 
 const S32 LINE_NUMBER_HERE = 0;
 
-void LLFastXUIParser::parserWarning(const std::string& message)
+void LLSimpleXUIParser::parserWarning(const std::string& message)
 {
 #ifdef LL_WINDOWS
 	// use Visual Studo friendly formatting of output message for easy access to originating xml
@@ -1238,7 +1248,7 @@ void LLFastXUIParser::parserWarning(const std::string& message)
 #endif
 }
 
-void LLFastXUIParser::parserError(const std::string& message)
+void LLSimpleXUIParser::parserError(const std::string& message)
 {
 #ifdef LL_WINDOWS
 	llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()).c_str());
@@ -1249,9 +1259,9 @@ void LLFastXUIParser::parserError(const std::string& message)
 #endif
 }
 
-bool LLFastXUIParser::readBoolValue(Parser& parser, void* val_ptr)
+bool LLSimpleXUIParser::readBoolValue(Parser& parser, void* val_ptr)
 {
-	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLSimpleXUIParser& self = static_cast<LLSimpleXUIParser&>(parser);
 	if (!strcmp(self.mCurAttributeValueBegin, "true")) 
 	{
 		*((bool*)val_ptr) = true;
@@ -1266,64 +1276,64 @@ bool LLFastXUIParser::readBoolValue(Parser& parser, void* val_ptr)
 	return false;
 }
 
-bool LLFastXUIParser::readStringValue(Parser& parser, void* val_ptr)
+bool LLSimpleXUIParser::readStringValue(Parser& parser, void* val_ptr)
 {
-	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLSimpleXUIParser& self = static_cast<LLSimpleXUIParser&>(parser);
 	*((std::string*)val_ptr) = self.mCurAttributeValueBegin;
 	return true;
 }
 
-bool LLFastXUIParser::readU8Value(Parser& parser, void* val_ptr)
+bool LLSimpleXUIParser::readU8Value(Parser& parser, void* val_ptr)
 {
-	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLSimpleXUIParser& self = static_cast<LLSimpleXUIParser&>(parser);
 	return parse(self.mCurAttributeValueBegin, uint_p[assign_a(*(U8*)val_ptr)]).full;
 }
 
-bool LLFastXUIParser::readS8Value(Parser& parser, void* val_ptr)
+bool LLSimpleXUIParser::readS8Value(Parser& parser, void* val_ptr)
 {
-	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLSimpleXUIParser& self = static_cast<LLSimpleXUIParser&>(parser);
 	return parse(self.mCurAttributeValueBegin, int_p[assign_a(*(S8*)val_ptr)]).full;
 }
 
-bool LLFastXUIParser::readU16Value(Parser& parser, void* val_ptr)
+bool LLSimpleXUIParser::readU16Value(Parser& parser, void* val_ptr)
 {
-	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLSimpleXUIParser& self = static_cast<LLSimpleXUIParser&>(parser);
 	return parse(self.mCurAttributeValueBegin, uint_p[assign_a(*(U16*)val_ptr)]).full;
 }
 
-bool LLFastXUIParser::readS16Value(Parser& parser, void* val_ptr)
+bool LLSimpleXUIParser::readS16Value(Parser& parser, void* val_ptr)
 {
-	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLSimpleXUIParser& self = static_cast<LLSimpleXUIParser&>(parser);
 	return parse(self.mCurAttributeValueBegin, int_p[assign_a(*(S16*)val_ptr)]).full;
 }
 
-bool LLFastXUIParser::readU32Value(Parser& parser, void* val_ptr)
+bool LLSimpleXUIParser::readU32Value(Parser& parser, void* val_ptr)
 {
-	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLSimpleXUIParser& self = static_cast<LLSimpleXUIParser&>(parser);
 	return parse(self.mCurAttributeValueBegin, uint_p[assign_a(*(U32*)val_ptr)]).full;
 }
 
-bool LLFastXUIParser::readS32Value(Parser& parser, void* val_ptr)
+bool LLSimpleXUIParser::readS32Value(Parser& parser, void* val_ptr)
 {
-	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLSimpleXUIParser& self = static_cast<LLSimpleXUIParser&>(parser);
 	return parse(self.mCurAttributeValueBegin, int_p[assign_a(*(S32*)val_ptr)]).full;
 }
 
-bool LLFastXUIParser::readF32Value(Parser& parser, void* val_ptr)
+bool LLSimpleXUIParser::readF32Value(Parser& parser, void* val_ptr)
 {
-	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLSimpleXUIParser& self = static_cast<LLSimpleXUIParser&>(parser);
 	return parse(self.mCurAttributeValueBegin, real_p[assign_a(*(F32*)val_ptr)]).full;
 }
 
-bool LLFastXUIParser::readF64Value(Parser& parser, void* val_ptr)
+bool LLSimpleXUIParser::readF64Value(Parser& parser, void* val_ptr)
 {
-	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLSimpleXUIParser& self = static_cast<LLSimpleXUIParser&>(parser);
 	return parse(self.mCurAttributeValueBegin, real_p[assign_a(*(F64*)val_ptr)]).full;
 }
 	
-bool LLFastXUIParser::readColor4Value(Parser& parser, void* val_ptr)
+bool LLSimpleXUIParser::readColor4Value(Parser& parser, void* val_ptr)
 {
-	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLSimpleXUIParser& self = static_cast<LLSimpleXUIParser&>(parser);
 	LLColor4 value;
 
 	if (parse(self.mCurAttributeValueBegin, real_p[assign_a(value.mV[0])] >> real_p[assign_a(value.mV[1])] >> real_p[assign_a(value.mV[2])] >> real_p[assign_a(value.mV[3])], space_p).full)
@@ -1334,9 +1344,9 @@ bool LLFastXUIParser::readColor4Value(Parser& parser, void* val_ptr)
 	return false;
 }
 
-bool LLFastXUIParser::readUIColorValue(Parser& parser, void* val_ptr)
+bool LLSimpleXUIParser::readUIColorValue(Parser& parser, void* val_ptr)
 {
-	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLSimpleXUIParser& self = static_cast<LLSimpleXUIParser&>(parser);
 	LLColor4 value;
 	LLUIColor* colorp = (LLUIColor*)val_ptr;
 
@@ -1348,12 +1358,12 @@ bool LLFastXUIParser::readUIColorValue(Parser& parser, void* val_ptr)
 	return false;
 }
 
-bool LLFastXUIParser::readUUIDValue(Parser& parser, void* val_ptr)
+bool LLSimpleXUIParser::readUUIDValue(Parser& parser, void* val_ptr)
 {
-	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLSimpleXUIParser& self = static_cast<LLSimpleXUIParser&>(parser);
 	LLUUID temp_id;
 	// LLUUID::set is destructive, so use temporary value
-	if (temp_id.set(self.mCurAttributeValueBegin))
+	if (temp_id.set(std::string(self.mCurAttributeValueBegin)))
 	{
 		*(LLUUID*)(val_ptr) = temp_id;
 		return true;
@@ -1361,9 +1371,9 @@ bool LLFastXUIParser::readUUIDValue(Parser& parser, void* val_ptr)
 	return false;
 }
 
-bool LLFastXUIParser::readSDValue(Parser& parser, void* val_ptr)
+bool LLSimpleXUIParser::readSDValue(Parser& parser, void* val_ptr)
 {
-	LLFastXUIParser& self = static_cast<LLFastXUIParser&>(parser);
+	LLSimpleXUIParser& self = static_cast<LLSimpleXUIParser&>(parser);
 	*((LLSD*)val_ptr) = LLSD(self.mCurAttributeValueBegin);
 	return true;
 }
\ No newline at end of file
diff --git a/indra/llxuixml/llxuiparser.h b/indra/llxuixml/llxuiparser.h
index 4deb083e1c..eb7147f49e 100644
--- a/indra/llxuixml/llxuiparser.h
+++ b/indra/llxuixml/llxuiparser.h
@@ -171,14 +171,25 @@ private:
 	std::string						mCurFileName;
 };
 
-class LLFastXUIParser : public LLInitParam::Parser, public LLSingleton<LLFastXUIParser>
+// LLSimpleXUIParser is a streamlined SAX-based XUI parser that does not support localization 
+// or parsing of a tree of independent param blocks, such as child widgets.
+// Use this for reading non-localized files that only need a single param block as a result.
+//
+// NOTE: In order to support nested block parsing, we need callbacks for start element that
+// push new blocks contexts on the mScope stack.
+// NOTE: To support localization without building a DOM, we need to enforce consistent 
+// ordering of child elements from base file to localized diff file.  Then we can use a pair
+// of coroutines to perform matching of xml nodes during parsing.  Not sure if the overhead
+// of coroutines would offset the gain from SAX parsing
+
+class LLSimpleXUIParser : public LLInitParam::Parser, public LLSingleton<LLSimpleXUIParser>
 {
-LOG_CLASS(LLFastXUIParser);
+LOG_CLASS(LLSimpleXUIParser);
 
 protected:
-	LLFastXUIParser();
-	virtual ~LLFastXUIParser();
-	friend class LLSingleton<LLFastXUIParser>;
+	LLSimpleXUIParser();
+	virtual ~LLSimpleXUIParser();
+	friend class LLSingleton<LLSimpleXUIParser>;
 public:
 	typedef LLInitParam::Parser::name_stack_t name_stack_t;
 
@@ -187,6 +198,7 @@ public:
 	/*virtual*/ void parserError(const std::string& message);
 
 	bool readXUI(const std::string& filename, LLInitParam::BaseBlock& block, bool silent=false);
+	void setBlock(LLInitParam::BaseBlock* block);
 
 private:
 	//reader helper functions
@@ -222,6 +234,7 @@ private:
 	LLXMLNodePtr					mLastWrittenChild;
 	S32								mCurReadDepth;
 	std::string						mCurFileName;
+	std::string						mTextContents;
 	const char*						mCurAttributeValueBegin;
 	std::vector<S32>				mTokenSizeStack;
 	std::vector<std::string>		mScope;
-- 
cgit v1.2.3


From 5866710be7b64999ec82c5cd5e2d47d81fdeb918 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 6 Aug 2010 11:03:28 -0700
Subject: fixed crash on entering build mode

---
 indra/llrender/llrender.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 64238b2008..eb2c54198d 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -901,7 +901,7 @@ LLVector3 LLRender::getUITranslation()
 {
 	if (mUIOffset.empty())
 	{
-		llerrs << "UI offset stack empty." << llendl;
+		return LLVector3::zero;
 	}
 	return mUIOffset.back();
 }
@@ -910,7 +910,7 @@ LLVector3 LLRender::getUIScale()
 {
 	if (mUIScale.empty())
 	{
-		llerrs << "UI scale stack empty." << llendl;
+		return LLVector3(1.f, 1.f, 1.f);
 	}
 	return mUIScale.back();
 }
-- 
cgit v1.2.3


From 7b41819377ec1c6ffc835a0a05a1acf571f46aad Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 6 Aug 2010 11:49:43 -0700
Subject: removed spurious parsing of empty text contents

---
 indra/llxuixml/llxuiparser.cpp | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index e010b4c125..b3cb71cd61 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -1199,11 +1199,15 @@ void LLSimpleXUIParser::endElement(const char *name)
 {
 	if (!mTextContents.empty())
 	{
-		mNameStack.push_back(std::make_pair(std::string("value"), newParseGeneration()));
-		mCurAttributeValueBegin = mTextContents.c_str();
-		mBlock->submitValue(mNameStack, *this);
-		mNameStack.pop_back();
-		mTextContents.clear();
+		LLStringUtil::trim(mTextContents);
+		if (!mTextContents.empty())
+		{
+			mNameStack.push_back(std::make_pair(std::string("value"), newParseGeneration()));
+			mCurAttributeValueBegin = mTextContents.c_str();
+			mBlock->submitValue(mNameStack, *this, false);
+			mNameStack.pop_back();
+			mTextContents.clear();
+		}
 	}
 	mCurReadDepth--;
 	S32 num_tokens_to_pop = mTokenSizeStack.back();
-- 
cgit v1.2.3


From 71a45d8f9df0686be078f15dcbfb29f4893865ff Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 6 Aug 2010 14:44:26 -0700
Subject: fixes for right click fast timer export

---
 indra/newview/llfasttimerview.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 8bc3b5a75f..ec772c2295 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -123,7 +123,7 @@ BOOL LLFastTimerView::handleRightMouseDown(S32 x, S32 y, MASK mask)
 	{
 		S32 bar_idx = MAX_VISIBLE_HISTORY - ((y - mBarRect.mBottom) * (MAX_VISIBLE_HISTORY + 2) / mBarRect.getHeight());
 		bar_idx = llclamp(bar_idx, 0, MAX_VISIBLE_HISTORY);
-		mPrintStats = bar_idx;
+		mPrintStats = LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - bar_idx;
 	}
 	return FALSE;
 }
@@ -953,7 +953,7 @@ void LLFastTimerView::draw()
 			{
 				legend_stat += ", ";
 			}
-			first = true;
+			first = false;
 			legend_stat += idp->getName();
 
 			if (idp->getCollapsed())
@@ -980,8 +980,7 @@ void LLFastTimerView::draw()
 			U64 ticks;
 			if (mPrintStats > 0)
 			{
-				S32 hidx = (mPrintStats - 1) - mScrollIndex;
-				ticks = idp->getHistoricalCount(hidx);
+				ticks = idp->getHistoricalCount(mPrintStats);
 			}
 			else
 			{
-- 
cgit v1.2.3


From a11a8c4027eb949c8a33951b9e8c7475e59a2eeb Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 6 Aug 2010 15:49:38 -0700
Subject: double click to expand all timers in LLFastTimerView

---
 indra/newview/llfasttimerview.cpp | 11 +++++++++++
 indra/newview/llfasttimerview.h   |  1 +
 2 files changed, 12 insertions(+)

diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index ec772c2295..696ac4e6fa 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -140,6 +140,17 @@ LLFastTimer::NamedTimer* LLFastTimerView::getLegendID(S32 y)
 	return NULL;
 }
 
+BOOL LLFastTimerView::handleDoubleClick(S32 x, S32 y, MASK mask)
+{
+	for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer());
+		it != end_timer_tree();
+		++it)
+	{
+		(*it)->setCollapsed(false);
+	}
+	return TRUE;
+}
+
 BOOL LLFastTimerView::handleMouseDown(S32 x, S32 y, MASK mask)
 {
 
diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h
index ac06990913..6f64248f78 100644
--- a/indra/newview/llfasttimerview.h
+++ b/indra/newview/llfasttimerview.h
@@ -54,6 +54,7 @@ private:
 public:
 
 	virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
+	virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
 	virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
 	virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
 	virtual BOOL handleHover(S32 x, S32 y, MASK mask);
-- 
cgit v1.2.3


From c90a90407c30415bf9700d3b037a0b8918e261d3 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Mon, 9 Aug 2010 17:09:01 -0700
Subject: Added references to new Windows build of LLQtWebKit that contains
 Monroe's popup window changes.

---
 install.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/install.xml b/install.xml
index 28f13553d7..a3f5b5c7bc 100644
--- a/install.xml
+++ b/install.xml
@@ -995,9 +995,9 @@ anguage Infrstructure (CLI) international standard</string>
           <key>windows</key>
           <map>
             <key>md5sum</key>
-            <string>df1bdd683128e060d60e435f65d8f7e8</string>
+            <string>1591dab02d6135c204a7a31bf72d8ac1</string>
             <key>url</key>
-            <uri>http://viewer-source-downloads.s3.amazonaws.com/install_pkgs/llqtwebkit-windows-qt4.6-20100617.tar.bz2</uri>
+            <uri>http://viewer-source-downloads.s3.amazonaws.com/install_pkgs/llqtwebkit-windows-qt4.6-20100809.tar.bz2</uri>
           </map>
         </map>
       </map>
-- 
cgit v1.2.3


From 879d15903608b26f6b10f499d150bb72a65fa966 Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Mon, 9 Aug 2010 17:40:17 -0700
Subject: Limit the number of media browser windows the viewer will open at
 once.

The limit is controlled by the debug setting MediaBrowserWindowLimit.

When opening a new window would take us over the limit, the least recently opened window will be closed first.
---
 indra/newview/app_settings/settings.xml | 11 +++++++++++
 indra/newview/llfloatermediabrowser.cpp | 26 +++++++++++++++++++++++++-
 indra/newview/llfloatermediabrowser.h   |  1 +
 3 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 4c52fb015f..3326319e2d 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -6425,6 +6425,17 @@
         <key>Value</key>
             <real>1.0</real>
         </map>
+    <key>MediaBrowserWindowLimit</key>
+    <map>
+      <key>Comment</key>
+      <string>Maximum number of media brower windows that can be open at once (0 for no limit)</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>S32</string>
+      <key>Value</key>
+      <integer>5</integer>
+    </map>
   <key>MediaRollOffRate</key>
   <map>
     <key>Comment</key>
diff --git a/indra/newview/llfloatermediabrowser.cpp b/indra/newview/llfloatermediabrowser.cpp
index 268a0e0b93..2fc5bd72de 100644
--- a/indra/newview/llfloatermediabrowser.cpp
+++ b/indra/newview/llfloatermediabrowser.cpp
@@ -76,8 +76,32 @@ void LLFloaterMediaBrowser::create(const std::string &url, const std::string& ta
 		tag = id.asString();
 	}
 	
-	// TODO: Figure out whether we need to close an existing instance and/or warn the user about the number of instances they have open
+	S32 browser_window_limit = gSavedSettings.getS32("MediaBrowserWindowLimit");
 	
+	if(LLFloaterReg::findInstance("media_browser", tag) != NULL)
+	{
+		// There's already a media browser for this tag, so we won't be opening a new window.
+	}
+	else if(browser_window_limit != 0)
+	{
+		// showInstance will open a new window.  Figure out how many media browsers are already open, 
+		// and close the least recently opened one if this will put us over the limit.
+		
+		LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList("media_browser");
+		lldebugs << "total instance count is " << instances.size() << llendl;
+		
+		for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++)
+		{
+			lldebugs << "    " << (*iter)->getKey() << llendl;
+		}
+		
+		if(instances.size() >= browser_window_limit)
+		{
+			// Destroy the least recently opened instance
+			(*instances.begin())->closeFloater();
+		}
+	}
+
 	LLFloaterMediaBrowser *browser = dynamic_cast<LLFloaterMediaBrowser*> (LLFloaterReg::showInstance("media_browser", tag));
 	llassert(browser);
 	if(browser)
diff --git a/indra/newview/llfloatermediabrowser.h b/indra/newview/llfloatermediabrowser.h
index 1645ed4613..4255d814c0 100644
--- a/indra/newview/llfloatermediabrowser.h
+++ b/indra/newview/llfloatermediabrowser.h
@@ -45,6 +45,7 @@ class LLFloaterMediaBrowser :
 	public LLViewerMediaObserver
 {
 public:
+    LOG_CLASS(LLFloaterMediaBrowser);
 	LLFloaterMediaBrowser(const LLSD& key);
 
 	static void create(const std::string &url, const std::string& target);
-- 
cgit v1.2.3


From 010ef13f560ca97807537484781acb332f48b8e2 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Tue, 10 Aug 2010 09:58:56 -0700
Subject: Fix for unsigned/sighed warning that breaks Windows build.

---
 indra/newview/llfloatermediabrowser.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llfloatermediabrowser.cpp b/indra/newview/llfloatermediabrowser.cpp
index 2fc5bd72de..90147ff650 100644
--- a/indra/newview/llfloatermediabrowser.cpp
+++ b/indra/newview/llfloatermediabrowser.cpp
@@ -95,7 +95,7 @@ void LLFloaterMediaBrowser::create(const std::string &url, const std::string& ta
 			lldebugs << "    " << (*iter)->getKey() << llendl;
 		}
 		
-		if(instances.size() >= browser_window_limit)
+		if(instances.size() >= (size_t)browser_window_limit)
 		{
 			// Destroy the least recently opened instance
 			(*instances.begin())->closeFloater();
-- 
cgit v1.2.3


From 4e8c33e7252d38d00b5606e1960aa520c75e0227 Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Tue, 10 Aug 2010 13:04:01 -0700
Subject: Added support for targeted links opening new windows to
 llmediaplugintest.

---
 indra/test_apps/llplugintest/llmediaplugintest.cpp | 76 +++++++++++++++++++---
 indra/test_apps/llplugintest/llmediaplugintest.h   |  6 +-
 2 files changed, 72 insertions(+), 10 deletions(-)

diff --git a/indra/test_apps/llplugintest/llmediaplugintest.cpp b/indra/test_apps/llplugintest/llmediaplugintest.cpp
index 7a544debb2..166905c37c 100644
--- a/indra/test_apps/llplugintest/llmediaplugintest.cpp
+++ b/indra/test_apps/llplugintest/llmediaplugintest.cpp
@@ -959,6 +959,23 @@ mediaPanel*  LLMediaPluginTest::findMediaPanel( LLPluginClassMedia* source )
 	return result;
 }
 
+////////////////////////////////////////////////////////////////////////////////
+//
+mediaPanel* LLMediaPluginTest::findMediaPanel( const std::string &target_name )
+{
+	mediaPanel *result = NULL;
+
+	for( int panel = 0; panel < (int)mMediaPanels.size(); ++panel )
+	{
+		if ( mMediaPanels[ panel ]->mTarget == target_name )
+		{
+			result = mMediaPanels[ panel ];
+		}
+	}
+
+	return result;
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 //
 void LLMediaPluginTest::navigateToNewURI( std::string uri )
@@ -1571,7 +1588,7 @@ std::string LLMediaPluginTest::pluginNameFromMimeType( std::string& mime_type )
 
 ////////////////////////////////////////////////////////////////////////////////
 //
-void LLMediaPluginTest::addMediaPanel( std::string url )
+mediaPanel* LLMediaPluginTest::addMediaPanel( std::string url )
 {
 	// Get the plugin filename using the URL
 	std::string mime_type = mimeTypeFromUrl( url );
@@ -1603,7 +1620,7 @@ void LLMediaPluginTest::addMediaPanel( std::string url )
 	if (NULL == getcwd( cwd, FILENAME_MAX - 1 ))
 	{
 		std::cerr << "Couldn't get cwd - probably too long - failing to init." << std::endl;
-		return;
+		return NULL;
 	}
 	std::string user_data_path = std::string( cwd ) + "/";
 #endif
@@ -1673,6 +1690,8 @@ void LLMediaPluginTest::addMediaPanel( std::string url )
 
 		std::cout << "Adding new media panel for " << url << "(" << media_width << "x" << media_height << ") with index " << panel->mId << " - total panels = " << mMediaPanels.size() << std::endl;
 	}
+	
+	return panel;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -1778,15 +1797,15 @@ void LLMediaPluginTest::updateMediaPanel( mediaPanel* panel )
 
 ////////////////////////////////////////////////////////////////////////////////
 //
-void LLMediaPluginTest::replaceMediaPanel( mediaPanel* panel, std::string url )
+mediaPanel* LLMediaPluginTest::replaceMediaPanel( mediaPanel* panel, std::string url )
 {
 	// no media panels so we can't change anything - have to add
 	if ( mMediaPanels.size() == 0 )
-		return;
+		return NULL;
 
 	// sanity check
 	if ( ! panel )
-		return;
+		return NULL;
 
 	int index;
 	for(index = 0; index < (int)mMediaPanels.size(); index++)
@@ -1798,7 +1817,7 @@ void LLMediaPluginTest::replaceMediaPanel( mediaPanel* panel, std::string url )
 	if(index >= (int)mMediaPanels.size())
 	{
 		// panel isn't in mMediaPanels
-		return;
+		return NULL;
 	}
 
 	std::cout << "Replacing media panel with index " << panel->mId << std::endl;
@@ -1840,7 +1859,7 @@ void LLMediaPluginTest::replaceMediaPanel( mediaPanel* panel, std::string url )
 	if (NULL == getcwd( cwd, FILENAME_MAX - 1 ))
 	{
 		std::cerr << "Couldn't get cwd - probably too long - failing to init." << std::endl;
-		return;
+		return NULL;
 	}
 	std::string user_data_path = std::string( cwd ) + "/";
 #endif
@@ -1880,6 +1899,8 @@ void LLMediaPluginTest::replaceMediaPanel( mediaPanel* panel, std::string url )
 	// load and start the URL
 	panel->mMediaSource->loadURI( url );
 	panel->mMediaSource->start();
+	
+	return panel;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2139,7 +2160,46 @@ void LLMediaPluginTest::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent e
 		break;
 
 		case MEDIA_EVENT_CLICK_LINK_HREF:
-			std::cerr <<  "Media event:  MEDIA_EVENT_CLICK_LINK_HREF, uri is " << self->getClickURL() << std::endl;
+		{
+			std::cerr <<  "Media event:  MEDIA_EVENT_CLICK_LINK_HREF, uri is " << self->getClickURL() << ", target is " << self->getClickTarget() << std::endl;
+			// retrieve the event parameters
+			std::string url = self->getClickURL();
+			std::string target = self->getClickTarget();
+			U32 target_type = self->getClickTargetType();
+
+			switch (target_type)
+			{
+				case LLPluginClassMedia::TARGET_NONE:
+					// ignore this click
+				break;
+				
+				case LLPluginClassMedia::TARGET_EXTERNAL:
+					// this should open in an external browser, but since this is a test app we don't care.
+				break;
+				
+				case LLPluginClassMedia::TARGET_BLANK:
+					// Create a new panel with the specified URL.
+					addMediaPanel(url);
+				break;
+
+				case LLPluginClassMedia::TARGET_OTHER:
+					mediaPanel *target_panel = findMediaPanel(target);
+					if(target_panel)
+					{
+						target_panel = replaceMediaPanel(target_panel, url);
+					}
+					else
+					{
+						target_panel = addMediaPanel(url);
+					}
+
+					if(target_panel)
+					{
+						target_panel->mTarget = target;
+					}
+				break;
+			}
+		}
 		break;
 
 		case MEDIA_EVENT_CLICK_LINK_NOFOLLOW:
diff --git a/indra/test_apps/llplugintest/llmediaplugintest.h b/indra/test_apps/llplugintest/llmediaplugintest.h
index 5d08e42148..ecd6cbfc4f 100644
--- a/indra/test_apps/llplugintest/llmediaplugintest.h
+++ b/indra/test_apps/llplugintest/llmediaplugintest.h
@@ -56,6 +56,7 @@ struct mediaPanel
 		int mId;
 		std::string mStartUrl;
 		std::string mMimeType;
+		std::string mTarget;
 		LLPluginClassMedia *mMediaSource;
 		int mMediaWidth;
 		int mMediaHeight;
@@ -96,16 +97,17 @@ class LLMediaPluginTest : public LLPluginClassMediaOwner
 		void draw( int draw_type );
 		void windowPosToTexturePos( int window_x, int window_y, int& media_x, int& media_y, int& id );
 
-		void addMediaPanel( std::string url );
+		mediaPanel* addMediaPanel( std::string url );
 		void updateMediaPanel( mediaPanel* panel );
 		void remMediaPanel( mediaPanel* panel );
-		void replaceMediaPanel( mediaPanel* panel, std::string url );
+		mediaPanel* replaceMediaPanel( mediaPanel* panel, std::string url );
 		void getRandomMediaSize( int& width, int& height, std::string mime_type );
 		void navigateToNewURI( std::string uri );
         void initUrlHistory( std::string uri );
 		void selectPanelById( int id );
 		void selectPanel( mediaPanel* panel );
 		mediaPanel* findMediaPanel( LLPluginClassMedia* panel );
+		mediaPanel* findMediaPanel( const std::string &target_name );
 		void makePickTexture( int id, GLuint* texture_handle, unsigned char** texture_pixels );
 		void makeChrome();
 		void resetView();
-- 
cgit v1.2.3


From 9327ef1ea0107df45c4e2066b379206a51a36c25 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Wed, 11 Aug 2010 15:00:12 -0700
Subject: cleaned up LLFirstUse and added ignorable_dialogs to project xml

---
 indra/newview/CMakeLists.txt                     |   1 +
 indra/newview/app_settings/ignorable_dialogs.xml | 176 ----------------------
 indra/newview/llfirstuse.cpp                     | 180 +----------------------
 indra/newview/llfirstuse.h                       |  28 +---
 4 files changed, 4 insertions(+), 381 deletions(-)

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 64bcf12b06..3e0aa587b1 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1300,6 +1300,7 @@ set(viewer_APPSETTINGS_FILES
     app_settings/cmd_line.xml
     app_settings/grass.xml
     app_settings/high_graphics.xml
+    app_settings/ignorable_dialogs.xml
     app_settings/keys.ini
     app_settings/keywords.ini
     app_settings/logcontrol.xml
diff --git a/indra/newview/app_settings/ignorable_dialogs.xml b/indra/newview/app_settings/ignorable_dialogs.xml
index d0e1f62a84..f11e6b015e 100644
--- a/indra/newview/app_settings/ignorable_dialogs.xml
+++ b/indra/newview/app_settings/ignorable_dialogs.xml
@@ -1,138 +1,6 @@
 <?xml version="1.0" ?>
 <llsd>
 <map>
-    <key>FirstAppearance</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstAppearance warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FirstAttach</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstAttach warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FirstBalanceDecrease</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstBalanceDecrease warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FirstBalanceIncrease</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstBalanceIncrease warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FirstBuild</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstBuild warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FirstDebugMenus</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstDebugMenus warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FirstFlexible</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstFlexible warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FirstGoTo</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstGoTo warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FirstInventory</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstInventory warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FirstLeftClickNoHit</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstLeftClickNoHit warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FirstMap</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstMap warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FirstMedia</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstMedia warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
     <key>FirstOverrideKeys</key>
     <map>
       <key>Comment</key>
@@ -155,50 +23,6 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
-    <key>FirstSculptedPrim</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstSculptedPrim warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FirstSit</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstSit warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FirstTeleport</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstTeleport warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>FirstVoice</key>
-    <map>
-      <key>Comment</key>
-      <string>Enables FirstVoice warning dialog</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
     <key>AboutDirectX9</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index b3fdf60b11..7f74b18fd0 100644
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -45,7 +45,7 @@
 #include "llappviewer.h"
 #include "lltracker.h"
 
-/*
+
 // static
 std::set<std::string> LLFirstUse::sConfigVariables;
 
@@ -76,107 +76,7 @@ void LLFirstUse::resetFirstUse()
 		gWarningSettings.setBOOL(*iter, TRUE);
 	}
 }
-*/
-/*
-
-// Called whenever the viewer detects that your balance went up
-void LLFirstUse::useBalanceIncrease(S32 delta)
-{
-	if (gWarningSettings.getBOOL("FirstBalanceIncrease"))
-	{
-		gWarningSettings.setBOOL("FirstBalanceIncrease", FALSE);
-
-		LLSD args;
-		args["AMOUNT"] = llformat("%d",delta);
-		LLNotificationsUtil::add("FirstBalanceIncrease", args);
-	}
-}
-
-
-// Called whenever the viewer detects your balance went down
-void LLFirstUse::useBalanceDecrease(S32 delta)
-{
-	if (gWarningSettings.getBOOL("FirstBalanceDecrease"))
-	{
-		gWarningSettings.setBOOL("FirstBalanceDecrease", FALSE);
-
-		LLSD args;
-		args["AMOUNT"] = llformat("%d",-delta);
-		LLNotificationsUtil::add("FirstBalanceDecrease", args);
-	}
-}
-
-
-// static
-void LLFirstUse::useSit()
-{
-	// Our orientation island uses sitting to teach vehicle driving
-	// so just never show this message. JC
-	//if (gWarningSettings.getBOOL("FirstSit"))
-	//{
-	//	gWarningSettings.setBOOL("FirstSit", FALSE);
-        //
-	//	LLNotificationsUtil::add("FirstSit");
-	//}
-}
-
-// static
-void LLFirstUse::useMap()
-{
-	if (gWarningSettings.getBOOL("FirstMap"))
-	{
-		gWarningSettings.setBOOL("FirstMap", FALSE);
-
-		LLNotificationsUtil::add("FirstMap");
-	}
-}
-
-// static
-void LLFirstUse::useGoTo()
-{
-	// nothing for now JC
-}
-
-// static
-void LLFirstUse::useBuild()
-{
-	if (gWarningSettings.getBOOL("FirstBuild"))
-	{
-		gWarningSettings.setBOOL("FirstBuild", FALSE);
-
-		LLNotificationsUtil::add("FirstBuild");
-	}
-}
- 
- */
-/*
-// static
-void LLFirstUse::useLeftClickNoHit()
-{ 
-	if (gWarningSettings.getBOOL("FirstLeftClickNoHit"))
-	{
-		gWarningSettings.setBOOL("FirstLeftClickNoHit", FALSE);
-
-		LLNotificationsUtil::add("FirstLeftClickNoHit");
-	}
-}
-*/
-/*
-// static
-void LLFirstUse::useTeleport()
-{
-	if (gWarningSettings.getBOOL("FirstTeleport"))
-	{
-		LLVector3d teleportDestination = LLTracker::getTrackedPositionGlobal();
-		if(teleportDestination != LLVector3d::zero)
-		{
-			gWarningSettings.setBOOL("FirstTeleport", FALSE);
 
-		        LLNotificationsUtil::add("FirstTeleport");
-		}
-	}
-}
-*/
 // static
 void LLFirstUse::useOverrideKeys()
 {
@@ -192,36 +92,6 @@ void LLFirstUse::useOverrideKeys()
 		}
 	}
 }
-/*
-// static
-void LLFirstUse::useAttach()
-{
-	// nothing for now
-}
-
-// static
-void LLFirstUse::useAppearance()
-{
-	if (gWarningSettings.getBOOL("FirstAppearance"))
-	{
-		gWarningSettings.setBOOL("FirstAppearance", FALSE);
-
-		LLNotificationsUtil::add("FirstAppearance");
-	}
-}
-
-// static
-void LLFirstUse::useInventory()
-{
-	if (gWarningSettings.getBOOL("FirstInventory"))
-	{
-		gWarningSettings.setBOOL("FirstInventory", FALSE);
-
-		LLNotificationsUtil::add("FirstInventory");
-	}
-}
-
-*/
 
 // static
 void LLFirstUse::useSandbox()
@@ -236,51 +106,3 @@ void LLFirstUse::useSandbox()
 		LLNotificationsUtil::add("FirstSandbox", args);
 	}
 }
-/*
-// static
-void LLFirstUse::useFlexible()
-{
-	if (gWarningSettings.getBOOL("FirstFlexible"))
-	{
-		gWarningSettings.setBOOL("FirstFlexible", FALSE);
-
-		LLNotificationsUtil::add("FirstFlexible");
-	}
-}
-
-// static
-void LLFirstUse::useDebugMenus()
-{
-	if (gWarningSettings.getBOOL("FirstDebugMenus"))
-	{
-		gWarningSettings.setBOOL("FirstDebugMenus", FALSE);
-
-		LLNotificationsUtil::add("FirstDebugMenus");
-	}
-}
-
-// static
-void LLFirstUse::useSculptedPrim()
-{
-	if (gWarningSettings.getBOOL("FirstSculptedPrim"))
-	{
-		gWarningSettings.setBOOL("FirstSculptedPrim", FALSE);
-
-		LLNotificationsUtil::add("FirstSculptedPrim");
-		
-	}
-}
-
-// static 
-void LLFirstUse::useMedia()
-{
-	if (gWarningSettings.getBOOL("FirstMedia"))
-	{
-		gWarningSettings.setBOOL("FirstMedia", FALSE);
-
-		// Popup removed as a short-term fix for EXT-1643.
-		// Ultimately, the plan is to kill all First Use dialogs
-		//LLNotificationsUtil::add("FirstMedia");
-	}
-}
-*/
diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h
index 3c7551f6cb..20ddef04d7 100644
--- a/indra/newview/llfirstuse.h
+++ b/indra/newview/llfirstuse.h
@@ -79,43 +79,19 @@ object or from inventory.
 class LLFirstUse
 {
 public:
-/*	
+
 	// Add a config variable to be reset on resetFirstUse()
 	static void addConfigVariable(const std::string& var);
 	
 	// Sets all controls back to show the dialogs.
 	static void disableFirstUse();
 	static void resetFirstUse();
-
-	// These methods are called each time the appropriate action is
-	// taken.  The functions themselves handle only showing the dialog
-	// the first time, or subsequent times if the user wishes.
-	static void useBalanceIncrease(S32 delta);
-	static void useBalanceDecrease(S32 delta);
-	static void useSit();
-	static void useMap();
-	static void useGoTo();
-	static void useBuild();
-//	static void useLeftClickNoHit();
-	static void useTeleport();
-*/ 
 	static void useOverrideKeys();
-/*	
-	static void useAttach();
-	static void useAppearance();
-	static void useInventory();
- */
+
 	static void useSandbox();
 	
-/*
-	static void useFlexible();
-	static void useDebugMenus();
-	static void useSculptedPrim();
-	static void useMedia();
-	
 protected:
 	static std::set<std::string> sConfigVariables;
-*/
 };
 
 #endif
-- 
cgit v1.2.3


From be50a053ed4ae7d0b15fc20f1c6ca0973c56ffd9 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Thu, 12 Aug 2010 09:46:45 -0700
Subject: first pass at hints

---
 indra/newview/CMakeLists.txt                       |   3 ++
 indra/newview/app_settings/ignorable_dialogs.xml   |  34 +++++++++++++++++++++
 indra/newview/llbottomtray.cpp                     |   4 ++-
 indra/newview/llchatbar.cpp                        |   4 +++
 indra/newview/llfirstuse.cpp                       |  33 ++++++++++++++++++++
 indra/newview/llfirstuse.h                         |   4 +++
 indra/newview/llmoveview.cpp                       |   7 +++++
 indra/newview/llnearbychathandler.cpp              |   6 +++-
 indra/newview/llnotificationhandler.h              |  14 +++++++++
 indra/newview/llnotificationmanager.cpp            |   2 ++
 indra/newview/llsidetray.cpp                       |   2 ++
 indra/newview/llviewermessage.cpp                  |   3 ++
 indra/newview/llviewerwindow.cpp                   |   1 +
 indra/newview/llviewerwindow.h                     |   2 ++
 indra/newview/skins/default/textures/textures.xml  |   8 ++++-
 .../default/textures/windows/hint_arrow_down.png   | Bin 0 -> 3239 bytes
 .../default/textures/windows/hint_arrow_left.png   | Bin 0 -> 3163 bytes
 .../default/textures/windows/hint_arrow_right.png  | Bin 0 -> 3155 bytes
 .../default/textures/windows/hint_arrow_up.png     | Bin 0 -> 3248 bytes
 .../default/textures/windows/hint_background.png   | Bin 0 -> 3930 bytes
 indra/newview/skins/default/xui/en/main_view.xml   |   7 +++++
 .../newview/skins/default/xui/en/notifications.xml |  24 +++++++++++++++
 22 files changed, 155 insertions(+), 3 deletions(-)
 create mode 100644 indra/newview/skins/default/textures/windows/hint_arrow_down.png
 create mode 100644 indra/newview/skins/default/textures/windows/hint_arrow_left.png
 create mode 100644 indra/newview/skins/default/textures/windows/hint_arrow_right.png
 create mode 100644 indra/newview/skins/default/textures/windows/hint_arrow_up.png
 create mode 100644 indra/newview/skins/default/textures/windows/hint_background.png

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 3e0aa587b1..7d70b2a49b 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -230,6 +230,7 @@ set(viewer_SOURCE_FILES
     llgroupiconctrl.cpp
     llgrouplist.cpp
     llgroupmgr.cpp
+    llhints.cpp
     llhomelocationresponder.cpp
     llhudeffect.cpp
     llhudeffectbeam.cpp
@@ -300,6 +301,7 @@ set(viewer_SOURCE_FILES
     llnotificationalerthandler.cpp
     llnotificationgrouphandler.cpp
     llnotificationhandlerutil.cpp
+    llnotificationhinthandler.cpp
     llnotificationmanager.cpp
     llnotificationofferhandler.cpp
     llnotificationscripthandler.cpp
@@ -754,6 +756,7 @@ set(viewer_HEADER_FILES
     llgroupiconctrl.h
     llgrouplist.h
     llgroupmgr.h
+    llhints.h
     llhomelocationresponder.h
     llhudeffect.h
     llhudeffectbeam.h
diff --git a/indra/newview/app_settings/ignorable_dialogs.xml b/indra/newview/app_settings/ignorable_dialogs.xml
index f11e6b015e..a0b9e33aa9 100644
--- a/indra/newview/app_settings/ignorable_dialogs.xml
+++ b/indra/newview/app_settings/ignorable_dialogs.xml
@@ -1,6 +1,28 @@
 <?xml version="1.0" ?>
 <llsd>
 <map>
+    <key>FirstInventoryOffer</key>
+    <map>
+      <key>Comment</key>
+      <string>Shows hint when a person or object offers you an inventory item</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
+    <key>FirstOtherChatBeforeUser</key>
+    <map>
+      <key>Comment</key>
+      <string>Shows hint when someone else chats first</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
     <key>FirstOverrideKeys</key>
     <map>
       <key>Comment</key>
@@ -23,6 +45,18 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
+
+    <key>FirstSit</key>
+    <map>
+      <key>Comment</key>
+      <string>Shows hint when someone sits for the first time</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
     <key>AboutDirectX9</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 0e5e8d0fe7..7d4c0be3fa 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -47,6 +47,7 @@
 #include "llagentcamera.h"
 #include "llchiclet.h"
 #include "llfloatercamera.h"
+#include "llhints.h"
 #include "llimfloater.h" // for LLIMFloater
 #include "llnearbychatbar.h"
 #include "llspeakbutton.h"
@@ -474,8 +475,9 @@ BOOL LLBottomTray::postBuild()
 	mBottomTrayContextMenu =  LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_bottomtray.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
 	gMenuHolder->addChild(mBottomTrayContextMenu);
 
-
 	mNearbyChatBar = getChild<LLNearbyChatBar>("chat_bar");
+	LLHints::registerHintTarget("nearby_chat_bar", mNearbyChatBar->LLView::getHandle());
+
 	mToolbarStack = getChild<LLLayoutStack>("toolbar_stack");
 	mMovementButton = getChild<LLButton>("movement_btn");
 	mCamButton = getChild<LLButton>("camera_btn");
diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp
index 73fbe78298..96001a07a0 100644
--- a/indra/newview/llchatbar.cpp
+++ b/indra/newview/llchatbar.cpp
@@ -571,6 +571,10 @@ void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type,
 
 void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate)
 {
+	// as soon as we say something, we no longer care about teaching the user
+	// how to chat
+	gWarningSettings.setBOOL("FirstOtherChatBeforeUser", FALSE);
+	
 	// Look for "/20 foo" channel chats.
 	S32 channel = 0;
 	LLWString out_text = stripChannelNumber(wtext, &channel);
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index 7f74b18fd0..8906525676 100644
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -93,6 +93,39 @@ void LLFirstUse::useOverrideKeys()
 	}
 }
 
+// static
+void LLFirstUse::otherAvatarChat()
+{
+	if (gWarningSettings.getBOOL("FirstOtherChatBeforeUser"))
+	{
+		gWarningSettings.setBOOL("FirstOtherChatBeforeUser", FALSE);
+
+		LLNotificationsUtil::add("HintChat", LLSD(), LLSD().with("target", "nearby_chat_bar").with("direction", "top"));
+	}
+}
+
+// static
+void LLFirstUse::sit()
+{
+	if (gWarningSettings.getBOOL("FirstSit"))
+	{
+		gWarningSettings.setBOOL("FirstSit", FALSE);
+
+		LLNotificationsUtil::add("HintSit", LLSD(), LLSD().with("target", "stand_btn").with("direction", "top"));
+	}
+}
+
+// static
+void LLFirstUse::inventoryOffer()
+{
+	if (gWarningSettings.getBOOL("FirstInventoryOffer"))
+	{
+		gWarningSettings.setBOOL("FirstInventoryOffer", FALSE);
+
+		LLNotificationsUtil::add("HintInventory", LLSD(), LLSD().with("target", "inventory_btn").with("direction", "left"));
+	}
+}
+
 // static
 void LLFirstUse::useSandbox()
 {
diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h
index 20ddef04d7..ca7290fe17 100644
--- a/indra/newview/llfirstuse.h
+++ b/indra/newview/llfirstuse.h
@@ -86,7 +86,11 @@ public:
 	// Sets all controls back to show the dialogs.
 	static void disableFirstUse();
 	static void resetFirstUse();
+
 	static void useOverrideKeys();
+	static void otherAvatarChat();
+	static void sit();
+	static void inventoryOffer();
 
 	static void useSandbox();
 	
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index fc41137686..19615def93 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -45,7 +45,9 @@
 #include "llvoavatarself.h" // to check gAgentAvatarp->isSitting()
 #include "llbottomtray.h"
 #include "llbutton.h"
+#include "llfirstuse.h"
 #include "llfloaterreg.h"
+#include "llhints.h"
 #include "lljoystickbutton.h"
 #include "lluictrlfactory.h"
 #include "llviewerwindow.h"
@@ -566,6 +568,10 @@ void LLPanelStandStopFlying::setStandStopFlyingMode(EStandStopFlyingMode mode)
 {
 	LLPanelStandStopFlying* panel = getInstance();
 
+	if (mode == SSFM_STAND)
+	{
+		LLFirstUse::sit();
+	}
 	panel->mStandButton->setVisible(SSFM_STAND == mode);
 	panel->mStopFlyingButton->setVisible(SSFM_STOP_FLYING == mode);
 
@@ -596,6 +602,7 @@ BOOL LLPanelStandStopFlying::postBuild()
 	mStandButton->setCommitCallback(boost::bind(&LLPanelStandStopFlying::onStandButtonClick, this));
 	mStandButton->setCommitCallback(boost::bind(&LLFloaterMove::enableInstance, TRUE));
 	mStandButton->setVisible(FALSE);
+	LLHints::registerHintTarget("stand_btn", mStandButton->getHandle());
 	
 	mStopFlyingButton = getChild<LLButton>("stop_fly_btn");
 	//mStopFlyingButton->setCommitCallback(boost::bind(&LLFloaterMove::setFlyingMode, FALSE));
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index 1fadb126e4..31a59146d6 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -37,6 +37,7 @@
 
 #include "llbottomtray.h"
 #include "llchatitemscontainerctrl.h"
+#include "llfirstuse.h"
 #include "llfloaterscriptdebug.h"
 #include "llnearbychat.h"
 #include "llrecentpeople.h"
@@ -347,7 +348,10 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
 	if(chat_msg.mMuted == TRUE)
 		return;
 	if(chat_msg.mSourceType == CHAT_SOURCE_AGENT && chat_msg.mFromID.notNull())
-         LLRecentPeople::instance().add(chat_msg.mFromID);
+	{
+        LLRecentPeople::instance().add(chat_msg.mFromID);
+	 	LLFirstUse::otherAvatarChat();
+	}
 
 	if(chat_msg.mText.empty())
 		return;//don't process empty messages
diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h
index 99a1fedcf3..7b8f530178 100644
--- a/indra/newview/llnotificationhandler.h
+++ b/indra/newview/llnotificationhandler.h
@@ -269,6 +269,20 @@ protected:
 	void onRejectToast(LLUUID& id);
 };
 
+/**
+ * Handler for UI hints.
+ */
+class LLHintHandler : public LLSingleton<LLHintHandler>
+{
+public:
+	LLHintHandler();
+	virtual ~LLHintHandler();
+
+	// base interface functions
+	virtual bool processNotification(const LLSD& notify);
+};
+
+
 class LLHandlerUtil
 {
 public:
diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp
index 4401bb953f..86496c9d02 100644
--- a/indra/newview/llnotificationmanager.cpp
+++ b/indra/newview/llnotificationmanager.cpp
@@ -66,6 +66,7 @@ void LLNotificationManager::init()
 	LLNotificationChannel::buildChannel("AlertModal", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alertmodal"));
 	LLNotificationChannel::buildChannel("IM Notifications", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "notifytoast"));
 	LLNotificationChannel::buildChannel("Offer", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "offer"));
+	LLNotificationChannel::buildChannel("Hints", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "hint"));
   
 	LLNotifications::instance().getChannel("Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
 	LLNotifications::instance().getChannel("NotificationTips")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
@@ -74,6 +75,7 @@ void LLNotificationManager::init()
 	LLNotifications::instance().getChannel("AlertModal")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
 	LLNotifications::instance().getChannel("IM Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
 	LLNotifications::instance().getChannel("Offer")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
+	LLNotifications::instance().getChannel("Hints")->connectChanged(boost::bind(&LLHintHandler::processNotification, LLHintHandler::getInstance(), _1));
 
 	mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptHandler(NT_NOTIFY, LLSD()));
 	mNotifyHandlers["notifytip"] =  boost::shared_ptr<LLEventHandler>(new LLTipHandler(NT_NOTIFY, LLSD()));
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp
index 7104f3934d..066b694618 100644
--- a/indra/newview/llsidetray.cpp
+++ b/indra/newview/llsidetray.cpp
@@ -37,6 +37,7 @@
 #include "llagentcamera.h"
 #include "llappviewer.h"
 #include "llbottomtray.h"
+#include "llhints.h"
 #include "llsidetray.h"
 #include "llviewerwindow.h"
 #include "llaccordionctrl.h"
@@ -430,6 +431,7 @@ void	LLSideTray::createButtons	()
 			mTabButtons[name] = button;
 		}
 	}
+	LLHints::registerHintTarget("inventory_btn", mTabButtons["sidebar_inventory"]->getHandle());
 }
 
 void		LLSideTray::processTriState ()
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index a04c919310..9bb734a3d3 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -56,6 +56,7 @@
 #include "llagentcamera.h"
 #include "llcallingcard.h"
 #include "llbuycurrencyhtml.h"
+#include "llfirstuse.h"
 #include "llfloaterbuyland.h"
 #include "llfloaterland.h"
 #include "llfloaterregioninfo.h"
@@ -1763,6 +1764,8 @@ void inventory_offer_handler(LLOfferInfo* info)
 		return;
 	}
 
+	LLFirstUse::inventoryOffer();
+
 	// Avoid the Accept/Discard dialog if the user so desires. JC
 	if (gSavedSettings.getBOOL("AutoAcceptNewInventory")
 		&& (info->mType == LLAssetType::AT_NOTECARD
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b36af7d95b..566f4b45ba 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1529,6 +1529,7 @@ void LLViewerWindow::initBase()
 	mNonSideTrayView = main_view->getChildView("non_side_tray_view")->getHandle();
 	mFloaterViewHolder = main_view->getChildView("floater_view_holder")->getHandle();
 	mPopupView = main_view->getChild<LLPopupView>("popup_holder");
+	mHintHolder = main_view->getChild<LLView>("hint_holder")->getHandle();
 
 	// Constrain floaters to inside the menu and status bar regions.
 	gFloaterView = main_view->getChild<LLFloaterView>("Floater View");
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index 1e0200a075..cd1ee8a5fd 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -294,6 +294,7 @@ public:
 	void			updateWorldViewRect(bool use_full_window=false);
 	LLView*			getNonSideTrayView() { return mNonSideTrayView.get(); }
 	LLView*			getFloaterViewHolder() { return mFloaterViewHolder.get(); }
+	LLView*			getHintHolder() { return mHintHolder.get(); }
 	BOOL			handleKey(KEY key, MASK mask);
 	void			handleScrollWheel	(S32 clicks);
 
@@ -453,6 +454,7 @@ protected:
 	LLHandle<LLView> mWorldViewPlaceholder;	// widget that spans the portion of screen dedicated to rendering the 3d world
 	LLHandle<LLView> mNonSideTrayView;		// parent of world view + bottom bar, etc...everything but the side tray
 	LLHandle<LLView> mFloaterViewHolder;	// container for floater_view
+	LLHandle<LLView> mHintHolder;			// container for hints
 	LLPopupView*	mPopupView;			// container for transient popups
 	
 	class LLDebugText* mDebugText; // Internal class for debug text
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 082b37d80b..9fbbfb1d2b 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -645,5 +645,11 @@ with the same filename but different name
   <texture name="buy_off" file_name="widgets/buy_off.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/>
   <texture name="buy_over" file_name="widgets/buy_over.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/>
   <texture name="buy_press" file_name="widgets/buy_press.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/>
-  
+
+  <texture name="hint_background" file_name="windows/hint_background.png" preload="false" scale.left="8" scale.top="70" scale.right="195" scale.bottom="11"/>
+  <texture name="hint_arrow_left" file_name="windows/hint_arrow_left.png" preload="false"/>
+  <texture name="hint_arrow_right" file_name="windows/hint_arrow_right.png" preload="false"/>
+  <texture name="hint_arrow_up" file_name="windows/hint_arrow_up.png" preload="false"/>
+  <texture name="hint_arrow_down" file_name="windows/hint_arrow_down.png" preload="false"/>
+
 </textures>
diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_down.png b/indra/newview/skins/default/textures/windows/hint_arrow_down.png
new file mode 100644
index 0000000000..11ab3c2d0c
Binary files /dev/null and b/indra/newview/skins/default/textures/windows/hint_arrow_down.png differ
diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_left.png b/indra/newview/skins/default/textures/windows/hint_arrow_left.png
new file mode 100644
index 0000000000..e5c597a550
Binary files /dev/null and b/indra/newview/skins/default/textures/windows/hint_arrow_left.png differ
diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_right.png b/indra/newview/skins/default/textures/windows/hint_arrow_right.png
new file mode 100644
index 0000000000..3f89187e13
Binary files /dev/null and b/indra/newview/skins/default/textures/windows/hint_arrow_right.png differ
diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_up.png b/indra/newview/skins/default/textures/windows/hint_arrow_up.png
new file mode 100644
index 0000000000..1050097efb
Binary files /dev/null and b/indra/newview/skins/default/textures/windows/hint_arrow_up.png differ
diff --git a/indra/newview/skins/default/textures/windows/hint_background.png b/indra/newview/skins/default/textures/windows/hint_background.png
new file mode 100644
index 0000000000..0839a95205
Binary files /dev/null and b/indra/newview/skins/default/textures/windows/hint_background.png differ
diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml
index a1ca910cbb..0bf5717de8 100644
--- a/indra/newview/skins/default/xui/en/main_view.xml
+++ b/indra/newview/skins/default/xui/en/main_view.xml
@@ -208,6 +208,13 @@
           bottom="-1"
           height="11" />
   </panel>
+  <view top="0"
+        left="0"
+        width="1024"
+        height="768"
+        name="hint_holder"
+        mouse_opaque="false"
+        follows="all"/>
   <menu_holder top="0"
                follows="all"
                height="768"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 95ee374e39..962e3ac582 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6376,6 +6376,30 @@ Mute everyone?
     <unique/>
   </notification>
 
+  <notification
+  name="HintChat"
+  label="Hint for Chatting"
+  type="hint">
+    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+    <!--<unique/>-->
+  </notification>
+
+  <notification
+  name="HintSit"
+  label="Hint for Sitting"
+  type="hint">
+    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+    <!--<unique/>-->
+  </notification>
+
+  <notification
+  name="HintInventory"
+  label="Hint for Inventory"
+  type="hint">
+    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+    <!--<unique/>-->
+  </notification>
+
   <global name="UnsupportedCPU">
 - Your CPU speed does not meet the minimum requirements.
   </global>
-- 
cgit v1.2.3


From e16c1f6fdd300f284f0b39b76b4e82f7366b5cdb Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Thu, 12 Aug 2010 10:08:39 -0700
Subject: forgot some files

---
 indra/newview/llhints.cpp | 250 ++++++++++++++++++++++++++++++++++++++++++++++
 indra/newview/llhints.h   |  51 ++++++++++
 2 files changed, 301 insertions(+)
 create mode 100644 indra/newview/llhints.cpp
 create mode 100644 indra/newview/llhints.h

diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp
new file mode 100644
index 0000000000..a8c3183301
--- /dev/null
+++ b/indra/newview/llhints.cpp
@@ -0,0 +1,250 @@
+/**
+ * @file llhints.cpp
+ * @brief Hint popups for displaying context sensitive help in a UI overlay
+ *
+ * $LicenseInfo:firstyear=2000&license=viewergpl$
+ *
+ * Copyright (c) 2000-2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+
+#include "llviewerprecompiledheaders.h" // must be first include
+
+#include "llhints.h"
+
+#include "llbutton.h"
+#include "lltextbox.h"
+#include "llviewerwindow.h"
+#include "llsdparam.h"
+
+class LLHintPopup : public LLPanel
+{
+public:
+
+	typedef enum e_popup_direction
+	{
+		LEFT,
+		TOP,
+		RIGHT,
+		BOTTOM
+	} EPopupDirection;
+
+	struct PopupDirections : public LLInitParam::TypeValuesHelper<LLHintPopup::EPopupDirection, PopupDirections>
+	{
+		static void declareValues()
+		{
+			declare("left", LLHintPopup::LEFT);
+			declare("right", LLHintPopup::RIGHT);
+			declare("top", LLHintPopup::TOP);
+			declare("bottom", LLHintPopup::BOTTOM);
+		}
+	};
+
+	struct Params : public LLInitParam::Block<Params, LLPanel::Params>
+	{
+		Mandatory<LLNotificationPtr>	notification;
+		Optional<std::string>			target;
+		Optional<EPopupDirection, PopupDirections>	direction;
+		Optional<S32>					distance;
+		Optional<LLUIImage*>			left_arrow,
+										up_arrow,
+										right_arrow,
+										down_arrow;									
+
+		Params()
+		:	direction("direction", TOP),
+			distance("distance", 24),
+			target("target"),
+			left_arrow("left_arrow", LLUI::getUIImage("hint_arrow_left")),
+			up_arrow("up_arrow", LLUI::getUIImage("hint_arrow_up")),
+			right_arrow("right_arrow", LLUI::getUIImage("hint_arrow_right")),
+			down_arrow("down_arrow", LLUI::getUIImage("hint_arrow_down"))
+		{}
+	};
+
+	LLHintPopup(const Params&);
+
+	void setHintTarget(LLHandle<LLView> target) { mTarget = target; }
+	/*virtual*/ BOOL postBuild();
+
+	void onClickClose() { hide(); }
+	void draw();
+	void hide() { die(); }
+
+private:
+	LLNotificationPtr	mNotification;
+	LLHandle<LLView>	mTarget;
+	EPopupDirection		mDirection;
+	S32					mDistance;
+	LLUIImagePtr		mArrowLeft,
+						mArrowUp,
+						mArrowRight,
+						mArrowDown;
+};
+
+
+
+
+LLHintPopup::LLHintPopup(const LLHintPopup::Params& p)
+:	mNotification(p.notification),
+	mDirection(p.direction),
+	mDistance(p.distance),
+	mTarget(LLHints::getHintTarget(p.target)),
+	mArrowLeft(p.left_arrow),
+	mArrowUp(p.up_arrow),
+	mArrowRight(p.right_arrow),
+	mArrowDown(p.down_arrow),
+	LLPanel(p)
+{
+	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_hint.xml");
+}
+
+BOOL LLHintPopup::postBuild()
+{
+	LLTextBox& hint_text = getChildRef<LLTextBox>("hint_text");
+	hint_text.setText(mNotification->getMessage());
+	
+	getChild<LLButton>("close")->setClickedCallback(boost::bind(&LLHintPopup::onClickClose, this));
+	getChild<LLTextBox>("hint_title")->setText(mNotification->getLabel());
+
+	LLRect text_bounds = hint_text.getTextBoundingRect();
+	S32 delta_height = text_bounds.getHeight() - hint_text.getRect().getHeight();
+	reshape(getRect().getWidth(), getRect().getHeight() + delta_height);
+	return TRUE;
+}
+
+void LLHintPopup::draw()
+{
+	LLView* targetp = mTarget.get();
+	if (!targetp || !targetp->isInVisibleChain()) 
+	{
+		hide();
+	}
+	else
+	{
+		LLRect target_rect;
+		targetp->localRectToOtherView(targetp->getLocalRect(), &target_rect, getParent());
+
+		LLRect my_local_rect = getLocalRect();
+		LLRect my_rect = getRect();
+		LLRect arrow_rect;
+		LLUIImagePtr arrow_imagep;
+
+		const S32 OVERLAP = 5;
+
+		switch(mDirection)
+		{
+		case LEFT:
+			my_rect.setCenterAndSize(	target_rect.mLeft - (my_rect.getWidth() / 2 + mDistance), 
+										target_rect.getCenterY(), 
+										my_rect.getWidth(), 
+										my_rect.getHeight());
+			arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 - OVERLAP,
+										my_local_rect.getCenterY(),
+										mArrowRight->getWidth(), 
+										mArrowRight->getHeight());
+			arrow_imagep = mArrowRight;
+			break;
+		case TOP:
+			my_rect.setCenterAndSize(	target_rect.getCenterX(), 
+										target_rect.mTop + (my_rect.getHeight() / 2 + mDistance), 
+										my_rect.getWidth(), 
+										my_rect.getHeight());
+			arrow_rect.setCenterAndSize(my_local_rect.getCenterX(),
+										my_local_rect.mBottom - mArrowDown->getHeight() / 2 + OVERLAP,
+										mArrowDown->getWidth(), 
+										mArrowDown->getHeight());
+			arrow_imagep = mArrowDown;
+			break;
+		case RIGHT:
+			my_rect.setCenterAndSize(	target_rect.getCenterX(), 
+										target_rect.mTop - (my_rect.getHeight() / 2 + mDistance), 
+										my_rect.getWidth(), 
+										my_rect.getHeight());
+			arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + OVERLAP,
+										my_local_rect.getCenterY(),
+										mArrowLeft->getWidth(), 
+										mArrowLeft->getHeight());
+			arrow_imagep = mArrowLeft;
+			break;
+		case BOTTOM:
+			my_rect.setCenterAndSize(	target_rect.mLeft + (my_rect.getWidth() / 2 + mDistance), 
+										target_rect.getCenterY(), 
+										my_rect.getWidth(), 
+										my_rect.getHeight());
+			arrow_rect.setCenterAndSize(my_local_rect.getCenterX(),
+										my_local_rect.mTop + mArrowUp->getHeight() / 2 - OVERLAP,
+										mArrowUp->getWidth(), 
+										mArrowUp->getHeight());
+			arrow_imagep = mArrowUp;
+			break;
+		}
+		setShape(my_rect);
+		LLPanel::draw();
+
+		arrow_imagep->draw(arrow_rect);
+	}
+}
+
+
+LLRegistry<std::string, LLHandle<LLView> > LLHints::sTargetRegistry;
+
+//static
+void LLHints::show(LLNotificationPtr hint)
+{
+	LLHintPopup::Params p;
+	LLParamSDParser::instance().readSD(hint->getPayload(), p);
+
+	p.notification = hint;
+
+	LLHintPopup* popup = new LLHintPopup(p);
+	LLView* hint_holder = gViewerWindow->getHintHolder();
+	if (hint_holder)
+	{
+		hint_holder->addChild(popup);
+		popup->centerWithin(hint_holder->getLocalRect());
+	}
+}
+
+//static
+void LLHints::registerHintTarget(const std::string& name, LLHandle<LLView> target)
+{
+	sTargetRegistry.defaultRegistrar().add(name, target);
+}
+
+//static 
+LLHandle<LLView> LLHints::getHintTarget(const std::string& name)
+{
+	LLHandle<LLView>* handlep = sTargetRegistry.getValue(name);
+	if (handlep) 
+	{
+		return *handlep;
+	}
+	else
+	{
+		return LLHandle<LLView>();
+	}
+}
diff --git a/indra/newview/llhints.h b/indra/newview/llhints.h
new file mode 100644
index 0000000000..b5255db95b
--- /dev/null
+++ b/indra/newview/llhints.h
@@ -0,0 +1,51 @@
+/**
+ * @file llhints.h
+ * @brief Hint popups for displaying context sensitive help in a UI overlay
+ *
+ * $LicenseInfo:firstyear=2000&license=viewergpl$
+ *
+ * Copyright (c) 2000-2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLHINTS_H
+#define LL_LLHINTS_H
+
+#include "llpanel.h"
+#include "llnotifications.h"
+
+
+class LLHints
+{
+public:
+	static void show(LLNotificationPtr hint);
+	static void registerHintTarget(const std::string& name, LLHandle<LLView> target);
+	static LLHandle<LLView> getHintTarget(const std::string& name);
+private:
+	static LLRegistry<std::string, LLHandle<LLView> > sTargetRegistry;
+};
+
+
+#endif
\ No newline at end of file
-- 
cgit v1.2.3


From 73f1f43b8bd9ae1c3bc7f96d652c30d772da113b Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Thu, 12 Aug 2010 10:11:30 -0700
Subject: forgot another file

---
 indra/newview/llnotificationhinthandler.cpp | 58 +++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 indra/newview/llnotificationhinthandler.cpp

diff --git a/indra/newview/llnotificationhinthandler.cpp b/indra/newview/llnotificationhinthandler.cpp
new file mode 100644
index 0000000000..f5c0330b2a
--- /dev/null
+++ b/indra/newview/llnotificationhinthandler.cpp
@@ -0,0 +1,58 @@
+/**
+ * @file llnotificationhinthandler.cpp
+ * @brief Notification Handler Class for UI Hints
+ *
+ * $LicenseInfo:firstyear=2000&license=viewergpl$
+ *
+ * Copyright (c) 2000-2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+
+#include "llviewerprecompiledheaders.h" // must be first include
+
+#include "llnotificationhandler.h"
+#include "llhints.h"
+#include "llnotifications.h"
+
+using namespace LLNotificationsUI;
+
+LLHintHandler::LLHintHandler()
+{
+}
+
+LLHintHandler::~LLHintHandler()
+{
+}
+
+bool LLHintHandler::processNotification(const LLSD& notify)
+{
+	if (notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "load")
+	{
+		LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
+		LLHints::show(notification);
+	}
+	return false;
+}
-- 
cgit v1.2.3


From 657e462b6a46bee09fe91e84ea37763db79c868c Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Thu, 12 Aug 2010 12:19:04 -0700
Subject: forgot yet another file

---
 indra/newview/skins/default/xui/en/panel_hint.xml | 34 +++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 indra/newview/skins/default/xui/en/panel_hint.xml

diff --git a/indra/newview/skins/default/xui/en/panel_hint.xml b/indra/newview/skins/default/xui/en/panel_hint.xml
new file mode 100644
index 0000000000..7cb8f58c37
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_hint.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ name="hint"
+ width="205"
+ height="100"
+ background_opaque="true"
+ background_visible="true"
+ layout="topleft" 
+ bg_opaque_image="hint_background">
+  <text name="hint_title"
+        font="SansSerifMedium" 
+        left="8"
+        right="180"
+        top="8"
+        bottom="20"
+        follows="left|right|top"
+        text_color="White"
+        wrap="false"/>
+  <text name="hint_text"
+        left="8"
+        right="197"
+        top="26"
+        bottom="90"
+        follows="all" 
+        text_color="White"
+        wrap="true"/>
+  <button right="197" 
+          top="8"
+          width="16" 
+          height="16"
+          name="close" 
+          image_unselected="Icon_Close_Foreground"
+          image_selected="Icon_Close_Press"/>
+</panel>
-- 
cgit v1.2.3


From bd897431e14aff091d5f45425816ddec4b2538c7 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 12 Aug 2010 12:20:38 -0700
Subject: remaining hints defined

---
 indra/newview/app_settings/ignorable_dialogs.xml   | 48 +++++++++++-
 indra/newview/llbottomtray.cpp                     |  5 +-
 indra/newview/llfirstuse.cpp                       | 88 ++++++++++++++--------
 indra/newview/llfirstuse.h                         | 16 +++-
 indra/newview/llhints.cpp                          | 40 ++++++----
 indra/newview/llhints.h                            |  3 +
 indra/newview/llnotificationhinthandler.cpp        | 10 ++-
 indra/newview/llsidepanelinventory.cpp             |  3 +
 indra/newview/llsidetray.cpp                       |  2 +
 indra/newview/llstatusbar.cpp                      |  3 +
 .../newview/skins/default/xui/en/notifications.xml | 31 +++++++-
 11 files changed, 189 insertions(+), 60 deletions(-)

diff --git a/indra/newview/app_settings/ignorable_dialogs.xml b/indra/newview/app_settings/ignorable_dialogs.xml
index a0b9e33aa9..0720ccee49 100644
--- a/indra/newview/app_settings/ignorable_dialogs.xml
+++ b/indra/newview/app_settings/ignorable_dialogs.xml
@@ -4,7 +4,7 @@
     <key>FirstInventoryOffer</key>
     <map>
       <key>Comment</key>
-      <string>Shows hint when a person or object offers you an inventory item</string>
+      <string>Shows hint when a person or object offers resident an inventory item</string>
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
@@ -12,7 +12,51 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
-    <key>FirstOtherChatBeforeUser</key>
+  <key>FirstNotUseDestinationGuide</key>
+  <map>
+    <key>Comment</key>
+    <string>Shows hint when resident doesn't activate destination guide</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>1</integer>
+  </map>
+  <key>FirstNotUseSidePanel</key>
+  <map>
+    <key>Comment</key>
+    <string>Shows hint when resident doesn't activate side panel</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>1</integer>
+  </map>
+  <key>FirstNotMoving</key>
+  <map>
+    <key>Comment</key>
+    <string>Shows hint when resident doesn't move</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>1</integer>
+  </map>
+  <key>FirstReceiveLindens</key>
+  <map>
+    <key>Comment</key>
+    <string>Shows hint when resident receives linden dollars</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>1</integer>
+  </map>
+  <key>FirstOtherChatBeforeUser</key>
     <map>
       <key>Comment</key>
       <string>Shows hint when someone else chats first</string>
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 7d4c0be3fa..e0b605a724 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -69,10 +69,6 @@ template class LLBottomTray* LLSingleton<class LLBottomTray>::getInstance();
 namespace
 {
 	const std::string& PANEL_CHICLET_NAME	= "chiclet_list_panel";
-	const std::string& PANEL_CHATBAR_NAME	= "chat_bar";
-	const std::string& PANEL_MOVEMENT_NAME	= "movement_panel";
-	const std::string& PANEL_CAMERA_NAME	= "cam_panel";
-	const std::string& PANEL_GESTURE_NAME	= "gesture_panel";
 
 	S32 get_panel_min_width(LLLayoutStack* stack, LLView* panel)
 	{
@@ -480,6 +476,7 @@ BOOL LLBottomTray::postBuild()
 
 	mToolbarStack = getChild<LLLayoutStack>("toolbar_stack");
 	mMovementButton = getChild<LLButton>("movement_btn");
+	LLHints::registerHintTarget("move_btn", mMovementButton->getHandle());
 	mCamButton = getChild<LLButton>("camera_btn");
 	setRightMouseDownCallback(boost::bind(&LLBottomTray::showBottomTrayContextMenu,this, _2, _3,_4));
 
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index 8906525676..d2dff49904 100644
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -36,7 +36,7 @@
 
 // library includes
 #include "indra_constants.h"
-#include "llnotificationsutil.h"
+#include "llnotifications.h"
 
 // viewer includes
 #include "llagent.h"	// for gAgent.inPrelude()
@@ -48,6 +48,7 @@
 
 // static
 std::set<std::string> LLFirstUse::sConfigVariables;
+std::map<std::string, LLNotificationPtr> LLFirstUse::sNotifications;
 
 // static
 void LLFirstUse::addConfigVariable(const std::string& var)
@@ -84,58 +85,79 @@ void LLFirstUse::useOverrideKeys()
 	// so don't show this message until you get off OI. JC
 	if (!gAgent.inPrelude())
 	{
-		if (gWarningSettings.getBOOL("FirstOverrideKeys"))
-		{
-			gWarningSettings.setBOOL("FirstOverrideKeys", FALSE);
-
-			LLNotificationsUtil::add("FirstOverrideKeys");
-		}
+		firstUseNotification("FirstOverrideKeys", true, "FirstOverrideKeys");
 	}
 }
 
 // static
-void LLFirstUse::otherAvatarChat()
+void LLFirstUse::otherAvatarChat(bool enable)
 {
-	if (gWarningSettings.getBOOL("FirstOtherChatBeforeUser"))
-	{
-		gWarningSettings.setBOOL("FirstOtherChatBeforeUser", FALSE);
+	firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "nearby_chat_bar").with("direction", "top"));
+}
 
-		LLNotificationsUtil::add("HintChat", LLSD(), LLSD().with("target", "nearby_chat_bar").with("direction", "top"));
-	}
+// static
+void LLFirstUse::sit(bool enable)
+{
+	firstUseNotification("FirstSit", enable, "HintSit", LLSD(), LLSD().with("target", "stand_btn").with("direction", "top"));
 }
 
 // static
-void LLFirstUse::sit()
+void LLFirstUse::inventoryOffer(bool enable)
 {
-	if (gWarningSettings.getBOOL("FirstSit"))
-	{
-		gWarningSettings.setBOOL("FirstSit", FALSE);
+	firstUseNotification("FirstInventoryOffer", enable, "HintInventory", LLSD(), LLSD().with("target", "inventory_btn").with("direction", "left"));
+}
 
-		LLNotificationsUtil::add("HintSit", LLSD(), LLSD().with("target", "stand_btn").with("direction", "top"));
-	}
+// static
+void LLFirstUse::useSandbox()
+{
+	firstUseNotification("FirstSandbox", true, "FirstSandbox", LLSD().with("HOURS", SANDBOX_CLEAN_FREQ).with("TIME", SANDBOX_FIRST_CLEAN_HOUR));
 }
 
 // static
-void LLFirstUse::inventoryOffer()
+void LLFirstUse::notUsingDestinationGuide(bool enable)
 {
-	if (gWarningSettings.getBOOL("FirstInventoryOffer"))
-	{
-		gWarningSettings.setBOOL("FirstInventoryOffer", FALSE);
+	firstUseNotification("FirstNotUseDestinationGuide", enable, "HintDestinationGuide", LLSD(), LLSD().with("target", "dest_guide_btn").with("direction", "left"));
+}
 
-		LLNotificationsUtil::add("HintInventory", LLSD(), LLSD().with("target", "inventory_btn").with("direction", "left"));
-	}
+// static
+void LLFirstUse::notUsingSidePanel(bool enable)
+{
+	firstUseNotification("FirstNotUseSidePanel", enable, "HintSidePanel", LLSD(), LLSD().with("target", "side_panel_btn").with("direction", "left"));
 }
 
 // static
-void LLFirstUse::useSandbox()
+void LLFirstUse::notMoving(bool enable)
 {
-	if (gWarningSettings.getBOOL("FirstSandbox"))
-	{
-		gWarningSettings.setBOOL("FirstSandbox", FALSE);
+	firstUseNotification("FirstNotMoving", enable, "HintMove", LLSD(), LLSD().with("target", "move_btn").with("direction", "top"));
+}
+
+// static
+void LLFirstUse::receiveLindens(bool enable)
+{
+	firstUseNotification("FirstReceiveLindens", enable, "HintLindenDollar", LLSD(), LLSD().with("target", "linden_balance").with("direction", "bottom"));
+}
+
+
+//static 
+void LLFirstUse::firstUseNotification(const std::string& control_var, bool enable, const std::string& notification_name, LLSD args, LLSD payload)
+{
+	LLNotificationPtr notif = sNotifications[notification_name];
 
-		LLSD args;
-		args["HOURS"] = llformat("%d",SANDBOX_CLEAN_FREQ);
-		args["TIME"] = llformat("%d",SANDBOX_FIRST_CLEAN_HOUR);
-		LLNotificationsUtil::add("FirstSandbox", args);
+	if (enable)
+	{
+		if (!notif && gWarningSettings.getBOOL(control_var))
+		{ // create new notification
+			sNotifications[notification_name] = LLNotifications::instance().add(LLNotification::Params().name(notification_name).substitutions(args).payload(payload));
+			gWarningSettings.setBOOL(control_var, FALSE);
+		}
+	}	
+	else
+	{ // want to hide notification
+		if (notif)
+		{ // cancel existing notification
+			LLNotifications::instance().cancel(notif);
+			sNotifications.erase(notification_name);
+		}
 	}
+
 }
diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h
index ca7290fe17..abf7d9836e 100644
--- a/indra/newview/llfirstuse.h
+++ b/indra/newview/llfirstuse.h
@@ -76,6 +76,9 @@ object or from inventory.
 14. First time you create/edit a sculpted prim.
 */
 
+class LLNotification;
+
+
 class LLFirstUse
 {
 public:
@@ -88,14 +91,19 @@ public:
 	static void resetFirstUse();
 
 	static void useOverrideKeys();
-	static void otherAvatarChat();
-	static void sit();
-	static void inventoryOffer();
-
+	static void otherAvatarChat(bool enable = true);
+	static void sit(bool enable = true);
+	static void notUsingDestinationGuide(bool enable = true);
+	static void notUsingSidePanel(bool enable = true);
+	static void notMoving(bool enable = true);
+	static void inventoryOffer(bool enable = true);
+	static void receiveLindens(bool enable = true);
 	static void useSandbox();
 	
 protected:
+	static void firstUseNotification(const std::string& control_var, bool enable, const std::string& notification_name, LLSD args = LLSD(), LLSD payload = LLSD());
 	static std::set<std::string> sConfigVariables;
+	static std::map<std::string, boost::shared_ptr<LLNotification> > sNotifications;
 };
 
 #endif
diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp
index a8c3183301..2f3504efed 100644
--- a/indra/newview/llhints.cpp
+++ b/indra/newview/llhints.cpp
@@ -149,7 +149,7 @@ void LLHintPopup::draw()
 		targetp->localRectToOtherView(targetp->getLocalRect(), &target_rect, getParent());
 
 		LLRect my_local_rect = getLocalRect();
-		LLRect my_rect = getRect();
+		LLRect my_rect;
 		LLRect arrow_rect;
 		LLUIImagePtr arrow_imagep;
 
@@ -158,10 +158,10 @@ void LLHintPopup::draw()
 		switch(mDirection)
 		{
 		case LEFT:
-			my_rect.setCenterAndSize(	target_rect.mLeft - (my_rect.getWidth() / 2 + mDistance), 
+			my_rect.setCenterAndSize(	target_rect.mLeft - (my_local_rect.getWidth() / 2 + mDistance), 
 										target_rect.getCenterY(), 
-										my_rect.getWidth(), 
-										my_rect.getHeight());
+										my_local_rect.getWidth(), 
+										my_local_rect.getHeight());
 			arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 - OVERLAP,
 										my_local_rect.getCenterY(),
 										mArrowRight->getWidth(), 
@@ -170,9 +170,9 @@ void LLHintPopup::draw()
 			break;
 		case TOP:
 			my_rect.setCenterAndSize(	target_rect.getCenterX(), 
-										target_rect.mTop + (my_rect.getHeight() / 2 + mDistance), 
-										my_rect.getWidth(), 
-										my_rect.getHeight());
+										target_rect.mTop + (my_local_rect.getHeight() / 2 + mDistance), 
+										my_local_rect.getWidth(), 
+										my_local_rect.getHeight());
 			arrow_rect.setCenterAndSize(my_local_rect.getCenterX(),
 										my_local_rect.mBottom - mArrowDown->getHeight() / 2 + OVERLAP,
 										mArrowDown->getWidth(), 
@@ -181,9 +181,9 @@ void LLHintPopup::draw()
 			break;
 		case RIGHT:
 			my_rect.setCenterAndSize(	target_rect.getCenterX(), 
-										target_rect.mTop - (my_rect.getHeight() / 2 + mDistance), 
-										my_rect.getWidth(), 
-										my_rect.getHeight());
+										target_rect.mTop - (my_local_rect.getHeight() / 2 + mDistance), 
+										my_local_rect.getWidth(), 
+										my_local_rect.getHeight());
 			arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + OVERLAP,
 										my_local_rect.getCenterY(),
 										mArrowLeft->getWidth(), 
@@ -191,10 +191,10 @@ void LLHintPopup::draw()
 			arrow_imagep = mArrowLeft;
 			break;
 		case BOTTOM:
-			my_rect.setCenterAndSize(	target_rect.mLeft + (my_rect.getWidth() / 2 + mDistance), 
+			my_rect.setCenterAndSize(	target_rect.mLeft + (my_local_rect.getWidth() / 2 + mDistance), 
 										target_rect.getCenterY(), 
-										my_rect.getWidth(), 
-										my_rect.getHeight());
+										my_local_rect.getWidth(), 
+										my_local_rect.getHeight());
 			arrow_rect.setCenterAndSize(my_local_rect.getCenterX(),
 										my_local_rect.mTop + mArrowUp->getHeight() / 2 - OVERLAP,
 										mArrowUp->getWidth(), 
@@ -211,6 +211,7 @@ void LLHintPopup::draw()
 
 
 LLRegistry<std::string, LLHandle<LLView> > LLHints::sTargetRegistry;
+std::map<LLNotificationPtr, class LLHintPopup*> LLHints::sHints;
 
 //static
 void LLHints::show(LLNotificationPtr hint)
@@ -221,6 +222,9 @@ void LLHints::show(LLNotificationPtr hint)
 	p.notification = hint;
 
 	LLHintPopup* popup = new LLHintPopup(p);
+	
+	sHints[hint] = popup;
+
 	LLView* hint_holder = gViewerWindow->getHintHolder();
 	if (hint_holder)
 	{
@@ -229,6 +233,16 @@ void LLHints::show(LLNotificationPtr hint)
 	}
 }
 
+void LLHints::hide(LLNotificationPtr hint)
+{
+	hint_map_t::iterator found_it = sHints.find(hint);
+	if (found_it != sHints.end())
+	{
+		found_it->second->hide();
+		sHints.erase(found_it);
+	}
+}
+
 //static
 void LLHints::registerHintTarget(const std::string& name, LLHandle<LLView> target)
 {
diff --git a/indra/newview/llhints.h b/indra/newview/llhints.h
index b5255db95b..4ecdc9937c 100644
--- a/indra/newview/llhints.h
+++ b/indra/newview/llhints.h
@@ -41,10 +41,13 @@ class LLHints
 {
 public:
 	static void show(LLNotificationPtr hint);
+	static void hide(LLNotificationPtr hint);
 	static void registerHintTarget(const std::string& name, LLHandle<LLView> target);
 	static LLHandle<LLView> getHintTarget(const std::string& name);
 private:
 	static LLRegistry<std::string, LLHandle<LLView> > sTargetRegistry;
+	typedef std::map<LLNotificationPtr, class LLHintPopup*> hint_map_t;
+	static hint_map_t sHints;
 };
 
 
diff --git a/indra/newview/llnotificationhinthandler.cpp b/indra/newview/llnotificationhinthandler.cpp
index f5c0330b2a..a9460821b0 100644
--- a/indra/newview/llnotificationhinthandler.cpp
+++ b/indra/newview/llnotificationhinthandler.cpp
@@ -49,10 +49,16 @@ LLHintHandler::~LLHintHandler()
 
 bool LLHintHandler::processNotification(const LLSD& notify)
 {
-	if (notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "load")
+	LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
+
+	std::string sigtype = notify["sigtype"].asString();
+	if (sigtype == "add" || sigtype == "load")
 	{
-		LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
 		LLHints::show(notification);
 	}
+	else if (sigtype == "delete")
+	{
+		LLHints::hide(notification);
+	}
 	return false;
 }
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 0951586dd5..7eda4fad20 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -36,6 +36,7 @@
 #include "llappearancemgr.h"
 #include "llavataractions.h"
 #include "llbutton.h"
+#include "llfirstuse.h"
 #include "llinventorybridge.h"
 #include "llinventoryfunctions.h"
 #include "llinventorypanel.h"
@@ -148,6 +149,8 @@ void LLSidepanelInventory::onOpen(const LLSD& key)
 			mTaskPanel->setObjectSelection(LLSelectMgr::getInstance()->getSelection());
 		showTaskInfoPanel();
 	}
+
+	LLFirstUse::inventoryOffer(false);
 }
 
 void LLSidepanelInventory::onInfoButtonClicked()
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp
index 066b694618..7e8dc2747b 100644
--- a/indra/newview/llsidetray.cpp
+++ b/indra/newview/llsidetray.cpp
@@ -423,6 +423,7 @@ void	LLSideTray::createButtons	()
 		{
 			mCollapseButton = createButton("",sidebar_tab->mImage,sidebar_tab->getTabTitle(),
 				boost::bind(&LLSideTray::onToggleCollapse, this));
+			LLHints::registerHintTarget("side_panel_btn", mCollapseButton->getHandle());
 		}
 		else
 		{
@@ -432,6 +433,7 @@ void	LLSideTray::createButtons	()
 		}
 	}
 	LLHints::registerHintTarget("inventory_btn", mTabButtons["sidebar_inventory"]->getHandle());
+	LLHints::registerHintTarget("dest_guide_btn", mTabButtons["sidebar_places"]->getHandle());
 }
 
 void		LLSideTray::processTriState ()
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index a6bb4d4d5f..46d148c088 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -47,6 +47,7 @@
 #include "llpanelvolumepulldown.h"
 #include "llfloaterregioninfo.h"
 #include "llfloaterscriptdebug.h"
+#include "llhints.h"
 #include "llhudicon.h"
 #include "llnavigationbar.h"
 #include "llkeyboard.h"
@@ -191,6 +192,8 @@ BOOL LLStatusBar::postBuild()
 	mMediaToggle->setClickedCallback( &LLStatusBar::onClickMediaToggle, this );
 	mMediaToggle->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterNearbyMedia, this));
 
+	LLHints::registerHintTarget("linden_balance", getChild<LLView>("balance_bg")->getHandle());
+
 	gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2));
 
 	// Adding Net Stat Graph
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index d7684e434e..8db89a7622 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6389,12 +6389,33 @@ Mute everyone?
   label="Hint for Chatting"
   type="hint">
     Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
-    <!--<unique/>-->
   </notification>
 
   <notification
   name="HintSit"
   label="Hint for Sitting"
+  type="hint">
+    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+  </notification>
+  
+  <notification
+  name="HintDestinationGuide"
+  label="Hint for Destination Guide"
+  type="hint">
+    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+  </notification>
+  
+  <notification
+    name="HintSidePanel"
+    label="Hint for Side Panel"
+    type="hint">
+    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+    <!--<unique/>-->
+  </notification>
+
+  <notification
+  name="HintMove"
+  label="Hint for Movement"
   type="hint">
     Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
     <!--<unique/>-->
@@ -6405,7 +6426,13 @@ Mute everyone?
   label="Hint for Inventory"
   type="hint">
     Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
-    <!--<unique/>-->
+  </notification>
+
+  <notification
+  name="HintLindenDollar"
+  label="Hint for L$"
+  type="hint">
+    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
   </notification>
 
   <global name="UnsupportedCPU">
-- 
cgit v1.2.3


From 2c999688c4c792630865bd97c2b45ff886d9a26c Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 12 Aug 2010 15:18:25 -0700
Subject: added remaining hints and fade in/fade out behavior

---
 indra/newview/app_settings/settings.xml            | 33 ++++++++++++
 indra/newview/llagent.cpp                          | 21 ++++++++
 indra/newview/llagent.h                            |  1 +
 indra/newview/llappviewer.cpp                      |  3 ++
 indra/newview/llappviewer.h                        |  1 +
 indra/newview/llfirstuse.cpp                       |  8 +--
 indra/newview/llfirstuse.h                         |  2 +-
 indra/newview/llhints.cpp                          | 62 +++++++++++++++++-----
 indra/newview/llmoveview.cpp                       |  2 +
 indra/newview/llnearbychatbar.cpp                  |  2 +
 indra/newview/llnearbychathandler.cpp              |  5 +-
 indra/newview/llpanelplaces.cpp                    |  3 ++
 indra/newview/llsidepanelinventory.cpp             |  4 +-
 indra/newview/llsidetray.cpp                       |  2 +
 indra/newview/llstatusbar.cpp                      |  7 +++
 indra/newview/llviewerwindow.cpp                   | 13 +++++
 .../newview/skins/default/xui/en/notifications.xml | 28 +++++-----
 indra/newview/skins/default/xui/en/panel_hint.xml  |  1 +
 18 files changed, 164 insertions(+), 34 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 3326319e2d..12fb8741ca 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -11947,5 +11947,38 @@
       <key>Value</key>
       <integer>10</integer>
     </map>
+    <key>NotMovingHintTimeout</key>
+    <map>
+      <key>Comment</key>
+      <string>Number of seconds to wait for resident to move before displaying move hint.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <real>120.0</real>
+    </map>
+    <key>DestinationGuideHintTimeout</key>
+    <map>
+      <key>Comment</key>
+      <string>Number of seconds to wait before telling resident about destination guide.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <real>600.0</real>
+    </map>
+    <key>SidePanelHintTimeout</key>
+    <map>
+      <key>Comment</key>
+      <string>Number of seconds to wait before telling resident about side panel.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <real>300.0</real>
+    </map>
 </map>
 </llsd>
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index e85d108bb2..0ff88f7451 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -44,6 +44,7 @@
 #include "llcallingcard.h"
 #include "llchannelmanager.h"
 #include "llconsole.h"
+#include "llfirstuse.h"
 #include "llfloatercamera.h"
 #include "llfloaterreg.h"
 #include "llfloatertools.h"
@@ -306,6 +307,9 @@ void LLAgent::ageChat()
 //-----------------------------------------------------------------------------
 void LLAgent::moveAt(S32 direction, bool reset)
 {
+	mMoveTimer.reset();
+	LLFirstUse::notMoving(false);
+
 	// age chat timer so it fades more quickly when you are intentionally moving
 	ageChat();
 
@@ -331,6 +335,9 @@ void LLAgent::moveAt(S32 direction, bool reset)
 //-----------------------------------------------------------------------------
 void LLAgent::moveAtNudge(S32 direction)
 {
+	mMoveTimer.reset();
+	LLFirstUse::notMoving(false);
+
 	// age chat timer so it fades more quickly when you are intentionally moving
 	ageChat();
 
@@ -353,6 +360,9 @@ void LLAgent::moveAtNudge(S32 direction)
 //-----------------------------------------------------------------------------
 void LLAgent::moveLeft(S32 direction)
 {
+	mMoveTimer.reset();
+	LLFirstUse::notMoving(false);
+
 	// age chat timer so it fades more quickly when you are intentionally moving
 	ageChat();
 
@@ -375,6 +385,9 @@ void LLAgent::moveLeft(S32 direction)
 //-----------------------------------------------------------------------------
 void LLAgent::moveLeftNudge(S32 direction)
 {
+	mMoveTimer.reset();
+	LLFirstUse::notMoving(false);
+
 	// age chat timer so it fades more quickly when you are intentionally moving
 	ageChat();
 
@@ -397,6 +410,9 @@ void LLAgent::moveLeftNudge(S32 direction)
 //-----------------------------------------------------------------------------
 void LLAgent::moveUp(S32 direction)
 {
+	mMoveTimer.reset();
+	LLFirstUse::notMoving(false);
+
 	// age chat timer so it fades more quickly when you are intentionally moving
 	ageChat();
 
@@ -1534,6 +1550,11 @@ void LLAgent::propagate(const F32 dt)
 //-----------------------------------------------------------------------------
 void LLAgent::updateAgentPosition(const F32 dt, const F32 yaw_radians, const S32 mouse_x, const S32 mouse_y)
 {
+	if (mMoveTimer.getElapsedTimeF32() > gSavedSettings.getF32("NotMovingHintTimeout"))
+	{
+		LLFirstUse::notMoving();
+	}
+
 	propagate(dt);
 
 	// static S32 cameraUpdateCount = 0;
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 32f9b00135..0185f874f9 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -270,6 +270,7 @@ public:
 private:
 	LLFrameTimer	mFidgetTimer;
 	LLFrameTimer	mFocusObjectFadeTimer;
+	LLFrameTimer	mMoveTimer;
 	F32				mNextFidgetTime;
 	S32				mCurrentFidget;
 
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index d222d94ec6..768be116f6 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -268,6 +268,7 @@ const F64 FRAME_STALL_THRESHOLD = 1.0;
 
 LLTimer gRenderStartTime;
 LLFrameTimer gForegroundTime;
+LLFrameTimer gLoggedInTime;
 LLTimer gLogoutTimer;
 static const F32 LOGOUT_REQUEST_TIME = 6.f;  // this will be cut short by the LogoutReply msg.
 F32 gLogoutMaxTime = LOGOUT_REQUEST_TIME;
@@ -597,6 +598,7 @@ LLAppViewer::LLAppViewer() :
 
 	setupErrorHandling();
 	sInstance = this;
+	gLoggedInTime.stop();
 }
 
 LLAppViewer::~LLAppViewer()
@@ -4281,6 +4283,7 @@ void LLAppViewer::pingMainloopTimeout(const std::string& state, F32 secs)
 
 void LLAppViewer::handleLoginComplete()
 {
+	gLoggedInTime.start();
 	initMainloopTimeout("Mainloop Init");
 
 	// Store some data to DebugInfo in case of a freeze.
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 0b862a92a1..e5e27dc908 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -313,6 +313,7 @@ extern U32 		gFrameStalls;
 
 extern LLTimer gRenderStartTime;
 extern LLFrameTimer gForegroundTime;
+extern LLFrameTimer gLoggedInTime;
 
 extern F32 gLogoutMaxTime;
 extern LLTimer gLogoutTimer;
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index d2dff49904..4708087846 100644
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -90,7 +90,7 @@ void LLFirstUse::useOverrideKeys()
 }
 
 // static
-void LLFirstUse::otherAvatarChat(bool enable)
+void LLFirstUse::otherAvatarChatFirst(bool enable)
 {
 	firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "nearby_chat_bar").with("direction", "top"));
 }
@@ -116,13 +116,15 @@ void LLFirstUse::useSandbox()
 // static
 void LLFirstUse::notUsingDestinationGuide(bool enable)
 {
-	firstUseNotification("FirstNotUseDestinationGuide", enable, "HintDestinationGuide", LLSD(), LLSD().with("target", "dest_guide_btn").with("direction", "left"));
+	// not doing this yet
+	//firstUseNotification("FirstNotUseDestinationGuide", enable, "HintDestinationGuide", LLSD(), LLSD().with("target", "dest_guide_btn").with("direction", "left"));
 }
 
 // static
 void LLFirstUse::notUsingSidePanel(bool enable)
 {
-	firstUseNotification("FirstNotUseSidePanel", enable, "HintSidePanel", LLSD(), LLSD().with("target", "side_panel_btn").with("direction", "left"));
+	// not doing this yet
+	//firstUseNotification("FirstNotUseSidePanel", enable, "HintSidePanel", LLSD(), LLSD().with("target", "side_panel_btn").with("direction", "left"));
 }
 
 // static
diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h
index abf7d9836e..48943cd9ab 100644
--- a/indra/newview/llfirstuse.h
+++ b/indra/newview/llfirstuse.h
@@ -91,7 +91,7 @@ public:
 	static void resetFirstUse();
 
 	static void useOverrideKeys();
-	static void otherAvatarChat(bool enable = true);
+	static void otherAvatarChatFirst(bool enable = true);
 	static void sit(bool enable = true);
 	static void notUsingDestinationGuide(bool enable = true);
 	static void notUsingSidePanel(bool enable = true);
diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp
index 2f3504efed..66799535c1 100644
--- a/indra/newview/llhints.cpp
+++ b/indra/newview/llhints.cpp
@@ -72,7 +72,13 @@ public:
 		Optional<LLUIImage*>			left_arrow,
 										up_arrow,
 										right_arrow,
-										down_arrow;									
+										down_arrow;	
+		Optional<S32>					left_arrow_offset,
+										up_arrow_offset,
+										right_arrow_offset,
+										down_arrow_offset;
+		Optional<F32>					fade_in_time,
+										fade_out_time;
 
 		Params()
 		:	direction("direction", TOP),
@@ -81,7 +87,13 @@ public:
 			left_arrow("left_arrow", LLUI::getUIImage("hint_arrow_left")),
 			up_arrow("up_arrow", LLUI::getUIImage("hint_arrow_up")),
 			right_arrow("right_arrow", LLUI::getUIImage("hint_arrow_right")),
-			down_arrow("down_arrow", LLUI::getUIImage("hint_arrow_down"))
+			down_arrow("down_arrow", LLUI::getUIImage("hint_arrow_down")),
+			left_arrow_offset("left_arrow_offset", 3),
+			up_arrow_offset("up_arrow_offset", -2),
+			right_arrow_offset("right_arrow_offset", -3),
+			down_arrow_offset("down_arrow_offset", 5),
+			fade_in_time("fade_in_time", 0.2f),
+			fade_out_time("fade_out_time", 0.5f)
 		{}
 	};
 
@@ -92,7 +104,7 @@ public:
 
 	void onClickClose() { hide(); }
 	void draw();
-	void hide() { die(); }
+	void hide() { mHidden = true; mFadeTimer.reset(); }
 
 private:
 	LLNotificationPtr	mNotification;
@@ -103,6 +115,14 @@ private:
 						mArrowUp,
 						mArrowRight,
 						mArrowDown;
+	S32					mArrowLeftOffset,
+						mArrowUpOffset,
+						mArrowRightOffset,
+						mArrowDownOffset;
+	LLFrameTimer		mFadeTimer;
+	F32					mFadeInTime,
+						mFadeOutTime;
+	bool				mHidden;
 };
 
 
@@ -117,6 +137,13 @@ LLHintPopup::LLHintPopup(const LLHintPopup::Params& p)
 	mArrowUp(p.up_arrow),
 	mArrowRight(p.right_arrow),
 	mArrowDown(p.down_arrow),
+	mArrowLeftOffset(p.left_arrow_offset),
+	mArrowUpOffset(p.up_arrow_offset),
+	mArrowRightOffset(p.right_arrow_offset),
+	mArrowDownOffset(p.down_arrow_offset),
+	mHidden(false),
+	mFadeInTime(p.fade_in_time),
+	mFadeOutTime(p.fade_out_time),
 	LLPanel(p)
 {
 	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_hint.xml");
@@ -138,6 +165,17 @@ BOOL LLHintPopup::postBuild()
 
 void LLHintPopup::draw()
 {
+	F32 alpha = 1.f;
+	if (mHidden)
+	{
+		alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeOutTime, 1.f, 0.f);
+	}
+	else
+	{
+		alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeInTime, 0.f, 1.f);
+	}
+	LLViewDrawContext context(alpha);
+
 	LLView* targetp = mTarget.get();
 	if (!targetp || !targetp->isInVisibleChain()) 
 	{
@@ -153,8 +191,6 @@ void LLHintPopup::draw()
 		LLRect arrow_rect;
 		LLUIImagePtr arrow_imagep;
 
-		const S32 OVERLAP = 5;
-
 		switch(mDirection)
 		{
 		case LEFT:
@@ -162,7 +198,7 @@ void LLHintPopup::draw()
 										target_rect.getCenterY(), 
 										my_local_rect.getWidth(), 
 										my_local_rect.getHeight());
-			arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 - OVERLAP,
+			arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 + mArrowRightOffset,
 										my_local_rect.getCenterY(),
 										mArrowRight->getWidth(), 
 										mArrowRight->getHeight());
@@ -174,7 +210,7 @@ void LLHintPopup::draw()
 										my_local_rect.getWidth(), 
 										my_local_rect.getHeight());
 			arrow_rect.setCenterAndSize(my_local_rect.getCenterX(),
-										my_local_rect.mBottom - mArrowDown->getHeight() / 2 + OVERLAP,
+										my_local_rect.mBottom - mArrowDown->getHeight() / 2 + mArrowDownOffset,
 										mArrowDown->getWidth(), 
 										mArrowDown->getHeight());
 			arrow_imagep = mArrowDown;
@@ -184,19 +220,19 @@ void LLHintPopup::draw()
 										target_rect.mTop - (my_local_rect.getHeight() / 2 + mDistance), 
 										my_local_rect.getWidth(), 
 										my_local_rect.getHeight());
-			arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + OVERLAP,
+			arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + mArrowLeftOffset,
 										my_local_rect.getCenterY(),
 										mArrowLeft->getWidth(), 
 										mArrowLeft->getHeight());
 			arrow_imagep = mArrowLeft;
 			break;
 		case BOTTOM:
-			my_rect.setCenterAndSize(	target_rect.mLeft + (my_local_rect.getWidth() / 2 + mDistance), 
-										target_rect.getCenterY(), 
+			my_rect.setCenterAndSize(	target_rect.getCenterX(), 
+										target_rect.mBottom - (my_local_rect.getHeight() / 2 + mDistance),
 										my_local_rect.getWidth(), 
 										my_local_rect.getHeight());
 			arrow_rect.setCenterAndSize(my_local_rect.getCenterX(),
-										my_local_rect.mTop + mArrowUp->getHeight() / 2 - OVERLAP,
+										my_local_rect.mTop + mArrowUp->getHeight() / 2 + mArrowUpOffset,
 										mArrowUp->getWidth(), 
 										mArrowUp->getHeight());
 			arrow_imagep = mArrowUp;
@@ -205,7 +241,7 @@ void LLHintPopup::draw()
 		setShape(my_rect);
 		LLPanel::draw();
 
-		arrow_imagep->draw(arrow_rect);
+		arrow_imagep->draw(arrow_rect, LLColor4(1.f, 1.f, 1.f, alpha));
 	}
 }
 
@@ -217,7 +253,7 @@ std::map<LLNotificationPtr, class LLHintPopup*> LLHints::sHints;
 void LLHints::show(LLNotificationPtr hint)
 {
 	LLHintPopup::Params p;
-	LLParamSDParser::instance().readSD(hint->getPayload(), p);
+	LLParamSDParser::instance().readSD(hint->getPayload(), p);
 
 	p.notification = hint;
 
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 19615def93..148a5786cb 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -169,6 +169,7 @@ void LLFloaterMove::setVisible(BOOL visible)
 
 	if (visible)
 	{
+		LLFirstUse::notMoving(false);
 		// Attach the Stand/Stop Flying panel.
 		LLPanelStandStopFlying* ssf_panel = LLPanelStandStopFlying::getInstance();
 		ssf_panel->reparent(this);
@@ -571,6 +572,7 @@ void LLPanelStandStopFlying::setStandStopFlyingMode(EStandStopFlyingMode mode)
 	if (mode == SSFM_STAND)
 	{
 		LLFirstUse::sit();
+		LLFirstUse::notMoving(false);
 	}
 	panel->mStandButton->setVisible(SSFM_STAND == mode);
 	panel->mStopFlyingButton->setVisible(SSFM_STOP_FLYING == mode);
diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index 6cfd810c10..41a19a54a8 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -38,6 +38,7 @@
 #include "llfloaterreg.h"
 #include "lltrans.h"
 
+#include "llfirstuse.h"
 #include "llnearbychatbar.h"
 #include "llbottomtray.h"
 #include "llagent.h"
@@ -490,6 +491,7 @@ BOOL LLNearbyChatBar::matchChatTypeTrigger(const std::string& in_str, std::strin
 
 void LLNearbyChatBar::onChatBoxKeystroke(LLLineEditor* caller, void* userdata)
 {
+	LLFirstUse::otherAvatarChatFirst(false);
 
 	LLNearbyChatBar* self = (LLNearbyChatBar *)userdata;
 
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index 31a59146d6..4011552112 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -350,7 +350,10 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
 	if(chat_msg.mSourceType == CHAT_SOURCE_AGENT && chat_msg.mFromID.notNull())
 	{
         LLRecentPeople::instance().add(chat_msg.mFromID);
-	 	LLFirstUse::otherAvatarChat();
+		if (chat_msg.mFromID != gAgentID)
+		{
+	 		LLFirstUse::otherAvatarChatFirst();
+		}
 	}
 
 	if(chat_msg.mText.empty())
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp
index abf2b94b09..c8a9176d92 100644
--- a/indra/newview/llpanelplaces.cpp
+++ b/indra/newview/llpanelplaces.cpp
@@ -42,6 +42,7 @@
 
 #include "llcombobox.h"
 #include "llfiltereditor.h"
+#include "llfirstuse.h"
 #include "llfloaterreg.h"
 #include "llnotificationsutil.h"
 #include "lltabcontainer.h"
@@ -351,6 +352,8 @@ BOOL LLPanelPlaces::postBuild()
 
 void LLPanelPlaces::onOpen(const LLSD& key)
 {
+	LLFirstUse::notUsingDestinationGuide(false);
+
 	if (!mPlaceProfile || !mLandmarkInfo)
 		return;
 
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 7eda4fad20..f9189bfb22 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -129,6 +129,8 @@ BOOL LLSidepanelInventory::postBuild()
 
 void LLSidepanelInventory::onOpen(const LLSD& key)
 {
+	LLFirstUse::inventoryOffer(false);
+
 	if(key.size() == 0)
 		return;
 
@@ -149,8 +151,6 @@ void LLSidepanelInventory::onOpen(const LLSD& key)
 			mTaskPanel->setObjectSelection(LLSelectMgr::getInstance()->getSelection());
 		showTaskInfoPanel();
 	}
-
-	LLFirstUse::inventoryOffer(false);
 }
 
 void LLSidepanelInventory::onInfoButtonClicked()
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp
index 7e8dc2747b..7cfc774883 100644
--- a/indra/newview/llsidetray.cpp
+++ b/indra/newview/llsidetray.cpp
@@ -37,6 +37,7 @@
 #include "llagentcamera.h"
 #include "llappviewer.h"
 #include "llbottomtray.h"
+#include "llfirstuse.h"
 #include "llhints.h"
 #include "llsidetray.h"
 #include "llviewerwindow.h"
@@ -470,6 +471,7 @@ void		LLSideTray::onTabButtonClick(string name)
 
 void		LLSideTray::onToggleCollapse()
 {
+	LLFirstUse::notUsingSidePanel(false);
 	if(mCollapsed)
 	{
 		expandSideBar();
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 46d148c088..6a081a573e 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -39,6 +39,7 @@
 #include "llagentcamera.h"
 #include "llbutton.h"
 #include "llcommandhandler.h"
+#include "llfirstuse.h"
 #include "llviewercontrol.h"
 #include "llfloaterbuycurrency.h"
 #include "llbuycurrencyhtml.h"
@@ -341,6 +342,11 @@ void LLStatusBar::creditBalance(S32 credit)
 
 void LLStatusBar::setBalance(S32 balance)
 {
+	if (balance > getBalance() && getBalance() != 0)
+	{
+		LLFirstUse::receiveLindens();
+	}
+
 	std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance );
 
 	LLTextBox* balance_box = getChild<LLTextBox>("balance");
@@ -463,6 +469,7 @@ void LLStatusBar::onClickBuyCurrency()
 	// open a currency floater - actual one open depends on 
 	// value specified in settings.xml
 	LLBuyCurrencyHTML::openCurrencyFloater();
+	LLFirstUse::receiveLindens(false);
 }
 
 void LLStatusBar::onMouseEnterVolume()
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 566f4b45ba..cfb8b077e5 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -102,6 +102,7 @@
 #include "llface.h"
 #include "llfeaturemanager.h"
 #include "llfilepicker.h"
+#include "llfirstuse.h"
 #include "llfloater.h"
 #include "llfloaterbuildoptions.h"
 #include "llfloaterbuyland.h"
@@ -2423,6 +2424,18 @@ void LLViewerWindow::updateUI()
 
 	static std::string last_handle_msg;
 
+	if (gLoggedInTime.getStarted())
+	{
+		if (gLoggedInTime.getElapsedTimeF32() > gSavedSettings.getF32("DestinationGuideHintTimeout"))
+		{
+			LLFirstUse::notUsingDestinationGuide();
+		}
+		if (gLoggedInTime.getElapsedTimeF32() > gSavedSettings.getF32("SidePanelHintTimeout"))
+		{
+			LLFirstUse::notUsingSidePanel();
+		}
+	}
+
 	LLConsole::updateClass();
 
 	// animate layout stacks so we have up to date rect for world view
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 8db89a7622..a2d06f77a9 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6386,53 +6386,53 @@ Mute everyone?
 
   <notification
   name="HintChat"
-  label="Hint for Chatting"
+  label="Chat"
   type="hint">
-    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+    To join the conversation, type into the chat field below.
   </notification>
 
   <notification
   name="HintSit"
-  label="Hint for Sitting"
+  label="Stand"
   type="hint">
-    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+    To stand up and exit the sitting position, click the Stand button.
   </notification>
   
   <notification
   name="HintDestinationGuide"
-  label="Hint for Destination Guide"
+  label="Explore the World"
   type="hint">
-    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+    The Destination Guide contains thousands of new places to discover. Select a location and choose Teleport to start exploring.
   </notification>
   
   <notification
     name="HintSidePanel"
-    label="Hint for Side Panel"
+    label="Side Panel"
     type="hint">
-    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+    Get quick access to your inventory, outfits, profiles and more in the side panel.
     <!--<unique/>-->
   </notification>
 
   <notification
   name="HintMove"
-  label="Hint for Movement"
+  label="Move"
   type="hint">
-    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+    To walk or run, open the Move Panel and use the directional arrows to navigate. You can also use the directional keys on your keyboard.
     <!--<unique/>-->
   </notification>
 
   <notification
   name="HintInventory"
-  label="Hint for Inventory"
+  label="Inventory"
   type="hint">
-    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+    Check your inventory to find items. Newest items can be easily found in the Recent tab.
   </notification>
 
   <notification
   name="HintLindenDollar"
-  label="Hint for L$"
+  label="You've got Linden Dollars!"
   type="hint">
-    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
+    Here's your current balance of L$. Click Buy L$ to purchase more Linden Dollars.
   </notification>
 
   <global name="UnsupportedCPU">
diff --git a/indra/newview/skins/default/xui/en/panel_hint.xml b/indra/newview/skins/default/xui/en/panel_hint.xml
index 7cb8f58c37..54ea08e5d4 100644
--- a/indra/newview/skins/default/xui/en/panel_hint.xml
+++ b/indra/newview/skins/default/xui/en/panel_hint.xml
@@ -29,6 +29,7 @@
           width="16" 
           height="16"
           name="close" 
+          follows="right|top" 
           image_unselected="Icon_Close_Foreground"
           image_selected="Icon_Close_Press"/>
 </panel>
-- 
cgit v1.2.3


From e5cfdd1cb8fdab09ef160967b55a75b06e4b2373 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 12 Aug 2010 15:26:53 -0700
Subject: fixed move hint always showing up immediately

---
 indra/newview/llagent.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 0ff88f7451..aade16cc7b 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -233,8 +233,9 @@ LLAgent::LLAgent() :
 		mControlsTakenPassedOnCount[i] = 0;
 	}
 
-
 	mListener.reset(new LLAgentListener(*this));
+
+	mMoveTimer.stop();
 }
 
 // Requires gSavedSettings to be initialized.
@@ -243,6 +244,8 @@ LLAgent::LLAgent() :
 //-----------------------------------------------------------------------------
 void LLAgent::init()
 {
+	mMoveTimer.start();
+
 	gSavedSettings.declareBOOL("SlowMotionAnimation", FALSE, "Declared in code", FALSE);
 	gSavedSettings.getControl("SlowMotionAnimation")->getSignal()->connect(boost::bind(&handleSlowMotionAnimation, _2));
 	
@@ -1550,7 +1553,7 @@ void LLAgent::propagate(const F32 dt)
 //-----------------------------------------------------------------------------
 void LLAgent::updateAgentPosition(const F32 dt, const F32 yaw_radians, const S32 mouse_x, const S32 mouse_y)
 {
-	if (mMoveTimer.getElapsedTimeF32() > gSavedSettings.getF32("NotMovingHintTimeout"))
+	if (mMoveTimer.getStarted() && mMoveTimer.getElapsedTimeF32() > gSavedSettings.getF32("NotMovingHintTimeout"))
 	{
 		LLFirstUse::notMoving();
 	}
-- 
cgit v1.2.3


From 2696bb058290ebfb261f0f43130a9a3d72253041 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 12 Aug 2010 15:27:37 -0700
Subject: added newline at end

---
 indra/newview/llhints.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llhints.h b/indra/newview/llhints.h
index 4ecdc9937c..d2580df012 100644
--- a/indra/newview/llhints.h
+++ b/indra/newview/llhints.h
@@ -51,4 +51,4 @@ private:
 };
 
 
-#endif
\ No newline at end of file
+#endif
-- 
cgit v1.2.3


From 187c229aca41a2a26caf05bd7d8d6c0d6a378699 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 13 Aug 2010 12:21:28 -0700
Subject: fix for hints reappearing even after criteria passed

---
 indra/newview/llagent.cpp    | 1 +
 indra/newview/llfirstuse.cpp | 1 +
 2 files changed, 2 insertions(+)

diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index aade16cc7b..70bda3893e 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -1556,6 +1556,7 @@ void LLAgent::updateAgentPosition(const F32 dt, const F32 yaw_radians, const S32
 	if (mMoveTimer.getStarted() && mMoveTimer.getElapsedTimeF32() > gSavedSettings.getF32("NotMovingHintTimeout"))
 	{
 		LLFirstUse::notMoving();
+		mMoveTimer.stop();
 	}
 
 	propagate(dt);
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index 4708087846..15de138c95 100644
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -160,6 +160,7 @@ void LLFirstUse::firstUseNotification(const std::string& control_var, bool enabl
 			LLNotifications::instance().cancel(notif);
 			sNotifications.erase(notification_name);
 		}
+		gWarningSettings.setBOOL(control_var, FALSE);
 	}
 
 }
-- 
cgit v1.2.3


From 4ef75f35c195a4e2657a0e01d6b92cd40e6779f5 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 13 Aug 2010 12:56:28 -0700
Subject: stopped hints from appearing temporarily when retriggered

---
 indra/newview/llhints.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp
index 66799535c1..14a9871a7d 100644
--- a/indra/newview/llhints.cpp
+++ b/indra/newview/llhints.cpp
@@ -104,7 +104,7 @@ public:
 
 	void onClickClose() { hide(); }
 	void draw();
-	void hide() { mHidden = true; mFadeTimer.reset(); }
+	void hide() { if(!mHidden) {mHidden = true; mFadeTimer.reset();} }
 
 private:
 	LLNotificationPtr	mNotification;
@@ -169,6 +169,10 @@ void LLHintPopup::draw()
 	if (mHidden)
 	{
 		alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeOutTime, 1.f, 0.f);
+		if (alpha == 0.f)
+		{
+			die();
+		}
 	}
 	else
 	{
-- 
cgit v1.2.3


From 014a4f3dc9dbe2eef7e463267d264d981e173835 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 13 Aug 2010 13:31:17 -0700
Subject: fixed progress view z ordering hacks DEV-52665 FIX Inventory and Chat
 hints shown during login before viewer fully loads on load up screen

---
 indra/newview/llprogressview.cpp                 |  5 -----
 indra/newview/llstartup.cpp                      |  7 -------
 indra/newview/llviewerwindow.cpp                 |  8 --------
 indra/newview/llviewerwindow.h                   |  1 -
 indra/newview/skins/default/xui/en/main_view.xml | 18 +++++++++---------
 5 files changed, 9 insertions(+), 30 deletions(-)

diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp
index 9b5e38d0aa..c4bf65e06d 100644
--- a/indra/newview/llprogressview.cpp
+++ b/indra/newview/llprogressview.cpp
@@ -134,15 +134,10 @@ void LLProgressView::setVisible(BOOL visible)
 	if (getVisible() && !visible)
 	{
 		mFadeTimer.start();
-		// hiding progress view, so show menu bars
-		LLUI::getRootView()->getChildView("menu_bar_holder")->setVisible(TRUE);
 	}
 	// showing progress view
 	else if (!getVisible() && visible)
 	{
-		// showing progress view, so hide menu bars
-		LLUI::getRootView()->getChildView("menu_bar_holder")->setVisible(FALSE);
-		
 		setFocus(TRUE);
 		mFadeTimer.stop();
 		mProgressTimer.start();
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 2475870b17..f6f70f5a43 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -800,10 +800,6 @@ bool idle_startup()
 
 	if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState())
 	{
-		// Move the progress view in front of the UI immediately when login is performed
-		// this allows not to see main menu after Alt+Tab was pressed while login. EXT-744.
-		gViewerWindow->moveProgressViewToFront();
-
 		//reset the values that could have come in from a slurl
 		// DEV-42215: Make sure they're not empty -- gUserCredential
 		// might already have been set from gSavedSettings, and it's too bad
@@ -1257,9 +1253,6 @@ bool idle_startup()
 
 		if (!gNoRender)
 		{
-			// Move the progress view in front of the UI
-			gViewerWindow->moveProgressViewToFront();
-
 			// direct logging to the debug console's line buffer
 			LLError::logToFixedBuffer(gDebugView->mDebugConsolep);
 			
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index cfb8b077e5..d8c7eabefb 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4250,14 +4250,6 @@ BOOL LLViewerWindow::getShowProgress() const
 	return (mProgressView && mProgressView->getVisible());
 }
 
-void LLViewerWindow::moveProgressViewToFront()
-{
-	if( mProgressView && mRootView )
-	{
-		mRootView->sendChildToFront(mProgressView);
-	}
-}
-
 void LLViewerWindow::setProgressString(const std::string& string)
 {
 	if (mProgressView)
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index cd1ee8a5fd..02f63661ee 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -277,7 +277,6 @@ public:
 													
 	void			setShowProgress(const BOOL show);
 	BOOL			getShowProgress() const;
-	void			moveProgressViewToFront();
 	void			setProgressString(const std::string& string);
 	void			setProgressPercent(const F32 percent);
 	void			setProgressMessage(const std::string& msg);
diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml
index 0bf5717de8..01ee8264e6 100644
--- a/indra/newview/skins/default/xui/en/main_view.xml
+++ b/indra/newview/skins/default/xui/en/main_view.xml
@@ -184,15 +184,6 @@
                            visible="false"
                            width="1024"/>
   </panel>
-  <panel top="0"
-         follows="all"
-         height="768"
-         mouse_opaque="true"
-         name="progress_view"
-         filename="panel_progress.xml"
-         class="progress_view"
-         width="1024"
-         visible="false"/>
   <panel top="0"
          follows="all"
          height="768"
@@ -215,6 +206,15 @@
         name="hint_holder"
         mouse_opaque="false"
         follows="all"/>
+  <panel top="0"
+         follows="all"
+         height="768"
+         mouse_opaque="true"
+         name="progress_view"
+         filename="panel_progress.xml"
+         class="progress_view"
+         width="1024"
+         visible="false"/>
   <menu_holder top="0"
                follows="all"
                height="768"
-- 
cgit v1.2.3


From e427c671f036de1addf90fa9a2ed09035b099392 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 13 Aug 2010 16:00:14 -0700
Subject: fixed fast timer average frame time rollover error

---
 indra/llcommon/llfasttimer_class.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp
index dfbae09864..e9ac709254 100644
--- a/indra/llcommon/llfasttimer_class.cpp
+++ b/indra/llcommon/llfasttimer_class.cpp
@@ -474,9 +474,9 @@ void LLFastTimer::NamedTimer::accumulateTimings()
 			int hidx = cur_frame % HISTORY_NUM;
 
 			timerp->mCountHistory[hidx] = timerp->mTotalTimeCounter;
-			timerp->mCountAverage = (timerp->mCountAverage * cur_frame + timerp->mTotalTimeCounter) / (cur_frame+1);
+			timerp->mCountAverage = ((U64)timerp->mCountAverage * cur_frame + timerp->mTotalTimeCounter) / (cur_frame+1);
 			timerp->mCallHistory[hidx] = timerp->getFrameState().mCalls;
-			timerp->mCallAverage = (timerp->mCallAverage * cur_frame + timerp->getFrameState().mCalls) / (cur_frame+1);
+			timerp->mCallAverage = ((U64)timerp->mCallAverage * cur_frame + timerp->getFrameState().mCalls) / (cur_frame+1);
 		}
 	}
 }
-- 
cgit v1.2.3


From 720b29b1b42fb16ecff835bc1a103bc66499ab94 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Mon, 16 Aug 2010 14:58:31 -0700
Subject: added ability to replace existing entries in a LLRegistry

---
 indra/llxuixml/llregistry.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/indra/llxuixml/llregistry.h b/indra/llxuixml/llregistry.h
index 2c04d8c419..53d4ac8e34 100644
--- a/indra/llxuixml/llregistry.h
+++ b/indra/llxuixml/llregistry.h
@@ -76,6 +76,11 @@ public:
 			mMap.erase(key);
 		}
 
+		void replace(ref_const_key_t key, ref_const_value_t value)
+		{
+			mMap[key] = value;
+		}
+
 		typename registry_map_t::const_iterator beginItems() const
 		{
 			return mMap.begin();
-- 
cgit v1.2.3


From 1fe2cb24f4288840fd682cae8274c193d66a1886 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Mon, 16 Aug 2010 14:59:06 -0700
Subject: fixed slicing problem with paramblocks where block descriptors are
 invalid after copying a derived block type to a base block value.

---
 indra/llxuixml/llinitparam.cpp |  5 +----
 indra/llxuixml/llinitparam.h   | 13 +++++++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp
index 8d6aa405e2..99191d2dbe 100644
--- a/indra/llxuixml/llinitparam.cpp
+++ b/indra/llxuixml/llinitparam.cpp
@@ -84,8 +84,7 @@ namespace LLInitParam
 	// BaseBlock
 	//
 	BaseBlock::BaseBlock()
-	:	mChangeVersion(0),
-		mBlockDescriptor(NULL)
+	:	mChangeVersion(0)
 	{}
 
 	BaseBlock::~BaseBlock()
@@ -94,8 +93,6 @@ namespace LLInitParam
 	// called by each derived class in least to most derived order
 	void BaseBlock::init(BlockDescriptor& descriptor, BlockDescriptor& base_descriptor, size_t block_size)
 	{
-		mBlockDescriptor = &descriptor;
-
 		descriptor.mCurrentBlockPtr = this;
 		descriptor.mMaxParamOffset = block_size;
 
diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index 9890bacea4..5461ad9d05 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -480,8 +480,8 @@ namespace LLInitParam
 		bool serializeBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), const BaseBlock* diff_block = NULL) const;
 		bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t()) const;
 
-		const BlockDescriptor& mostDerivedBlockDescriptor() const { return *mBlockDescriptor; }
-		BlockDescriptor& mostDerivedBlockDescriptor() { return *mBlockDescriptor; }
+		virtual const BlockDescriptor& mostDerivedBlockDescriptor() const { return selfBlockDescriptor(); }
+		virtual BlockDescriptor& mostDerivedBlockDescriptor() { return selfBlockDescriptor(); }
 
 		// take all provided params from other and apply to self
 		bool overwriteFrom(const BaseBlock& other)
@@ -506,8 +506,6 @@ namespace LLInitParam
 		// can be updated in getters
 		mutable S32				mChangeVersion;
 
-		BlockDescriptor*		mBlockDescriptor;	// most derived block descriptor
-
 		static BlockDescriptor& selfBlockDescriptor()
 		{
 			static BlockDescriptor sBlockDescriptor;
@@ -1313,6 +1311,9 @@ namespace LLInitParam
 			BaseBlock::setLastChangedParam(last_param, user_provided);
 		}
 
+		virtual const BlockDescriptor& mostDerivedBlockDescriptor() const { return selfBlockDescriptor(); }
+		virtual BlockDescriptor& mostDerivedBlockDescriptor() { return selfBlockDescriptor(); }
+
 	protected:
 		Choice()
 		:	mCurChoice(0)
@@ -1422,6 +1423,10 @@ namespace LLInitParam
 		{
 			return BaseBlock::merge(selfBlockDescriptor(), other, false);
 		}
+
+		virtual const BlockDescriptor& mostDerivedBlockDescriptor() const { return selfBlockDescriptor(); }
+		virtual BlockDescriptor& mostDerivedBlockDescriptor() { return selfBlockDescriptor(); }
+
 	protected:
 		Block()
 		{
-- 
cgit v1.2.3


From 94e406157d0b133d51b5dbb95aab296b46eae10e Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Mon, 16 Aug 2010 14:59:29 -0700
Subject: added ability to cancel all notifications with a given name

---
 indra/llui/llnotifications.cpp | 15 +++++++++++++++
 indra/llui/llnotifications.h   |  1 +
 2 files changed, 16 insertions(+)

diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 7fa3c2cf65..2da8f1eb1b 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1423,6 +1423,21 @@ void LLNotifications::cancel(LLNotificationPtr pNotif)
 	updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif);
 }
 
+void LLNotifications::cancelByName(const std::string& name)
+{
+	for (LLNotificationSet::iterator it=mItems.begin(), end_it = mItems.end(), next_it = it;
+		it != end_it;
+		it = next_it, ++next_it)
+	{
+		LLNotificationPtr pNotif = *it;
+		if (pNotif->getName() == name)
+		{
+			pNotif->cancel();
+			updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif);
+		}
+	}
+}
+
 void LLNotifications::update(const LLNotificationPtr pNotif)
 {
 	LLNotificationSet::iterator it=mItems.find(pNotif);
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 1cdd744a68..fcf988222d 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -900,6 +900,7 @@ public:
 
 	void add(const LLNotificationPtr pNotif);
 	void cancel(LLNotificationPtr pNotif);
+	void cancelByName(const std::string& name);
 	void update(const LLNotificationPtr pNotif);
 
 	LLNotificationPtr find(LLUUID uuid);
-- 
cgit v1.2.3


From c20bd2dfee1068d5a23eef9a10d21c2035c0b324 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Mon, 16 Aug 2010 15:00:51 -0700
Subject: cleaned up LLUICtrlFactory... removed redundant functionality moved
 buildPanel to LLPanel

---
 indra/llui/llaccordionctrl.cpp                    |   2 +-
 indra/llui/llpanel.cpp                            | 101 +++++++++++++-
 indra/llui/llpanel.h                              |  62 ++++++++-
 indra/llui/lltextbase.h                           |   1 +
 indra/llui/lluictrlfactory.cpp                    | 152 ++--------------------
 indra/llui/lluictrlfactory.h                      | 120 ++---------------
 indra/llui/llview.cpp                             |   4 +-
 indra/newview/llagent.cpp                         |  11 +-
 indra/newview/llagent.h                           |   8 --
 indra/newview/llappviewer.cpp                     |   8 +-
 indra/newview/llavatarlist.cpp                    |   2 +-
 indra/newview/llavatarlistitem.cpp                |   2 +-
 indra/newview/llbottomtray.cpp                    |   9 +-
 indra/newview/llcallfloater.cpp                   |   2 +-
 indra/newview/llchathistory.cpp                   |   4 +-
 indra/newview/llchatitemscontainerctrl.cpp        |   2 +-
 indra/newview/llfloatercamera.cpp                 |   2 +-
 indra/newview/llfloaterinventory.cpp              |   2 +-
 indra/newview/llfloaternotificationsconsole.cpp   |   2 +-
 indra/newview/llfloaterregioninfo.cpp             |  12 +-
 indra/newview/llfloaterscriptlimits.cpp           |   4 +-
 indra/newview/llfloateruipreview.cpp              |   4 +-
 indra/newview/llgrouplist.cpp                     |   2 +-
 indra/newview/llhudview.cpp                       |   2 +-
 indra/newview/llimfloatercontainer.cpp            |   8 +-
 indra/newview/llinventorylistitem.cpp             |   8 +-
 indra/newview/llmoveview.cpp                      |   4 +-
 indra/newview/llnavigationbar.cpp                 |   2 +-
 indra/newview/llnearbychathandler.cpp             | 120 ++++++++++-------
 indra/newview/llpanelavatartag.cpp                |   2 +-
 indra/newview/llpanelclassified.cpp               |   4 +-
 indra/newview/llpanelgenerictip.cpp               |   2 +-
 indra/newview/llpanelgroupinvite.cpp              |   2 +-
 indra/newview/llpanellandmarks.cpp                |   2 +-
 indra/newview/llpanellogin.cpp                    |   2 +-
 indra/newview/llpanelme.cpp                       |   2 +-
 indra/newview/llpanelmediasettingsgeneral.cpp     |   2 +-
 indra/newview/llpanelmediasettingspermissions.cpp |   2 +-
 indra/newview/llpanelmediasettingssecurity.cpp    |   2 +-
 indra/newview/llpanelnearbymedia.cpp              |   2 +-
 indra/newview/llpanelonlinestatus.cpp             |   2 +-
 indra/newview/llpaneloutfitedit.cpp               |   2 +-
 indra/newview/llpaneloutfitsinventory.cpp         |   4 +-
 indra/newview/llpanelpick.cpp                     |   4 +-
 indra/newview/llpanelpicks.cpp                    |   4 +-
 indra/newview/llpanelplaces.cpp                   |   6 +-
 indra/newview/llpanelprimmediacontrols.cpp        |   2 +-
 indra/newview/llpanelprofile.cpp                  |   4 +-
 indra/newview/llpanelprofileview.cpp              |   2 +-
 indra/newview/llpanelteleporthistory.cpp          |   4 +-
 indra/newview/llpaneltopinfobar.cpp               |   2 +-
 indra/newview/llpanelvolumepulldown.cpp           |   2 +-
 indra/newview/llscrollingpanelparam.cpp           |   2 +-
 indra/newview/llsidepanelinventory.cpp            |  16 +--
 indra/newview/llstatusbar.cpp                     |   2 +-
 indra/newview/llsyswellitem.cpp                   |   2 +-
 indra/newview/llsyswellwindow.cpp                 |   4 +-
 indra/newview/lltoast.h                           |   4 +
 indra/newview/lltoastgroupnotifypanel.cpp         |   2 +-
 indra/newview/lltoastimpanel.cpp                  |   2 +-
 indra/newview/lltoastnotifypanel.cpp              |   2 +-
 indra/newview/llviewerwindow.cpp                  |   6 +-
 62 files changed, 351 insertions(+), 415 deletions(-)

diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp
index c3ef734823..9337626c8e 100644
--- a/indra/llui/llaccordionctrl.cpp
+++ b/indra/llui/llaccordionctrl.cpp
@@ -89,7 +89,7 @@ LLAccordionCtrl::LLAccordionCtrl() : LLPanel()
 
 	mSingleExpansion = false;
 	mFitParent = false;
-	LLUICtrlFactory::getInstance()->buildPanel(this, "accordion_parent.xml");	
+	buildPanel(this, "accordion_parent.xml");	
 }
 
 //---------------------------------------------------------------------------------
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 0f769bd6dc..bfca0bd45e 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -41,6 +41,7 @@
 #include "llfontgl.h"
 #include "llrect.h"
 #include "llerror.h"
+#include "lldir.h"
 #include "lltimer.h"
 
 #include "llaccordionctrltab.h"
@@ -58,6 +59,8 @@
 #include "lltabcontainer.h"
 
 static LLDefaultChildRegistry::Register<LLPanel> r1("panel", &LLPanel::fromXML);
+LLPanel::factory_stack_t	LLPanel::sFactoryStack;
+
 
 // Compiler optimization, generate extern template
 template class LLPanel* LLView::getChild<class LLPanel>(
@@ -400,7 +403,7 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_
 
 		if (!panelp)
 		{
-			panelp = LLUICtrlFactory::getInstance()->createFactoryPanel(name);
+			panelp = createFactoryPanel(name);
 			llassert(panelp);
 			
 			if (!panelp)
@@ -413,20 +416,20 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_
 	// factory panels may have registered their own factory maps
 	if (!panelp->getFactoryMap().empty())
 	{
-		LLUICtrlFactory::instance().pushFactoryFunctions(&panelp->getFactoryMap());
+		sFactoryStack.push_back(&panelp->getFactoryMap());
 	}
 	// for local registry callbacks; define in constructor, referenced in XUI or postBuild
 	panelp->mCommitCallbackRegistrar.pushScope(); 
 	panelp->mEnableCallbackRegistrar.pushScope();
 
-	panelp->initPanelXML(node, parent, output_node);
+	panelp->initPanelXML(node, parent, output_node, LLUICtrlFactory::getDefaultParams<LLPanel>());
 	
 	panelp->mCommitCallbackRegistrar.popScope();
 	panelp->mEnableCallbackRegistrar.popScope();
 
 	if (!panelp->getFactoryMap().empty())
 	{
-		LLUICtrlFactory::instance().popFactoryFunctions();
+		sFactoryStack.pop_back();
 	}
 
 	return panelp;
@@ -493,11 +496,9 @@ static LLFastTimer::DeclareTimer FTM_PANEL_SETUP("Panel Setup");
 static LLFastTimer::DeclareTimer FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference");
 static LLFastTimer::DeclareTimer FTM_PANEL_POSTBUILD("Panel PostBuild");
 
-BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node)
+BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node, const LLPanel::Params& default_params)
 {
-	const LLPanel::Params& default_params(LLUICtrlFactory::getDefaultParams<LLPanel>());
 	Params params(default_params);
-
 	{
 		LLFastTimer timer(FTM_PANEL_SETUP);
 
@@ -965,3 +966,89 @@ boost::signals2::connection LLPanel::setVisibleCallback( const commit_signal_t::
 
 	return mVisibleSignal->connect(cb);
 }
+
+static LLFastTimer::DeclareTimer FTM_BUILD_PANELS("Build Panels");
+
+//-----------------------------------------------------------------------------
+// buildPanel()
+//-----------------------------------------------------------------------------
+BOOL LLPanel::buildPanel(LLPanel* panelp, const std::string& filename, LLXMLNodePtr output_node, const LLPanel::Params& default_params)
+{
+	LLFastTimer timer(FTM_BUILD_PANELS);
+	BOOL didPost = FALSE;
+	LLXMLNodePtr root;
+
+	//if exporting, only load the language being exported, 
+	//instead of layering localized version on top of english
+	if (output_node)
+	{	
+		if (!LLUICtrlFactory::getLocalizedXMLNode(filename, root))
+		{
+			llwarns << "Couldn't parse panel from: " << LLUI::getLocalizedSkinPath() + gDirUtilp->getDirDelimiter() + filename  << llendl;
+			return didPost;
+		}
+	}
+	else if (!LLUICtrlFactory::getLayeredXMLNode(filename, root))
+	{
+		llwarns << "Couldn't parse panel from: " << LLUI::getSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl;
+		return didPost;
+	}
+
+	// root must be called panel
+	if( !root->hasName("panel" ) )
+	{
+		llwarns << "Root node should be named panel in : " << filename << llendl;
+		return didPost;
+	}
+
+	lldebugs << "Building panel " << filename << llendl;
+
+	LLUICtrlFactory::instance().pushFileName(filename);
+	{
+		if (!panelp->getFactoryMap().empty())
+		{
+			sFactoryStack.push_back(&panelp->getFactoryMap());
+		}
+		
+		 // for local registry callbacks; define in constructor, referenced in XUI or postBuild
+		panelp->getCommitCallbackRegistrar().pushScope();
+		panelp->getEnableCallbackRegistrar().pushScope();
+		
+		didPost = panelp->initPanelXML(root, NULL, output_node, default_params);
+
+		panelp->getCommitCallbackRegistrar().popScope();
+		panelp->getEnableCallbackRegistrar().popScope();
+		
+		panelp->setXMLFilename(filename);
+
+		if (!panelp->getFactoryMap().empty())
+		{
+			sFactoryStack.pop_back();
+		}
+	}
+	LLUICtrlFactory::instance().popFileName();
+	return didPost;
+}
+
+//-----------------------------------------------------------------------------
+// createFactoryPanel()
+//-----------------------------------------------------------------------------
+LLPanel* LLPanel::createFactoryPanel(const std::string& name)
+{
+	std::deque<const LLCallbackMap::map_t*>::iterator itor;
+	for (itor = sFactoryStack.begin(); itor != sFactoryStack.end(); ++itor)
+	{
+		const LLCallbackMap::map_t* factory_map = *itor;
+
+		// Look up this panel's name in the map.
+		LLCallbackMap::map_const_iter_t iter = factory_map->find( name );
+		if (iter != factory_map->end())
+		{
+			// Use the factory to create the panel, instead of using a default LLPanel.
+			LLPanel *ret = (LLPanel*) iter->second.mCallback( iter->second.mData );
+			return ret;
+		}
+	}
+	LLPanel::Params panel_p;
+	return LLUICtrlFactory::create<LLPanel>(panel_p);
+}
\ No newline at end of file
diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h
index 784054cd86..6fc8ca204f 100644
--- a/indra/llui/llpanel.h
+++ b/indra/llui/llpanel.h
@@ -110,7 +110,10 @@ protected:
 	LLPanel(const LLPanel::Params& params = getDefaultParams());
 	
 public:
-// 	LLPanel(const std::string& name, const LLRect& rect = LLRect(), BOOL bordered = TRUE);
+	static 	BOOL buildPanel(LLPanel* panelp, const std::string &filename, LLXMLNodePtr output_node = NULL, const LLPanel::Params&default_params = getDefaultParams());
+
+	static LLPanel* createFactoryPanel(const std::string& name);
+
 	/*virtual*/ ~LLPanel();
 
 	// LLView interface
@@ -163,7 +166,7 @@ public:
 	EnableCallbackRegistry::ScopedRegistrar& getEnableCallbackRegistrar() { return mEnableCallbackRegistrar; }
 	
 	void initFromParams(const Params& p);
-	BOOL initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL);
+	BOOL initPanelXML(	LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node, const LLPanel::Params& default_params);
 	
 	bool hasString(const std::string& name);
 	std::string getString(const std::string& name, const LLStringUtil::format_map_t& args) const;
@@ -283,6 +286,8 @@ private:
 	// for setting the xml filename when building panel in context dependent cases
 	std::string		mXMLFilename;
 
+	typedef std::deque<const LLCallbackMap::map_t*> factory_stack_t;
+	static factory_stack_t	sFactoryStack;
 }; // end class LLPanel
 
 // Build time optimization, generate once in .cpp file
@@ -291,4 +296,57 @@ extern template class LLPanel* LLView::getChild<class LLPanel>(
 	const std::string& name, BOOL recurse) const;
 #endif
 
+typedef boost::function<LLPanel* (void)> LLPanelClassCreatorFunc;
+
+// local static instance for registering a particular panel class
+
+class LLRegisterPanelClass
+:	public LLSingleton< LLRegisterPanelClass >
+{
+public:
+	// reigister with either the provided builder, or the generic templated builder
+	void addPanelClass(const std::string& tag,LLPanelClassCreatorFunc func)
+	{
+		mPanelClassesNames[tag] = func;
+	}
+
+	LLPanel* createPanelClass(const std::string& tag)
+	{
+		param_name_map_t::iterator iT =  mPanelClassesNames.find(tag);
+		if(iT == mPanelClassesNames.end())
+			return 0;
+		return iT->second();
+	}
+	template<typename T>
+	static T* defaultPanelClassBuilder()
+	{
+		T* pT = new T();
+		return pT;
+	}
+
+private:
+	typedef std::map< std::string, LLPanelClassCreatorFunc> param_name_map_t;
+	
+	param_name_map_t mPanelClassesNames;
+};
+
+
+// local static instance for registering a particular panel class
+template<typename T>
+class LLRegisterPanelClassWrapper
+:	public LLRegisterPanelClass
+{
+public:
+	// reigister with either the provided builder, or the generic templated builder
+	LLRegisterPanelClassWrapper(const std::string& tag);
+};
+
+
+template<typename T>
+LLRegisterPanelClassWrapper<T>::LLRegisterPanelClassWrapper(const std::string& tag) 
+{
+	LLRegisterPanelClass::instance().addPanelClass(tag,&LLRegisterPanelClass::defaultPanelClassBuilder<T>);
+}
+
+
 #endif
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index db010d1cf6..2314ece6df 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -241,6 +241,7 @@ class LLTextBase
 public:
 	friend class LLTextSegment;
 	friend class LLNormalTextSegment;
+	friend class LLUICtrlFactory;
 
 	struct LineSpacingParams : public LLInitParam::Choice<LineSpacingParams>
 	{
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index c5bd6c7fce..913c8bdb7d 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -218,7 +218,7 @@ bool LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filen
 	{
 		if (!floaterp->getFactoryMap().empty())
 		{
-			mFactoryStack.push_front(&floaterp->getFactoryMap());
+			LLPanel::sFactoryStack.push_front(&floaterp->getFactoryMap());
 		}
 
 		 // for local registry callbacks; define in constructor, referenced in XUI or postBuild
@@ -234,7 +234,7 @@ bool LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filen
 		
 		if (!floaterp->getFactoryMap().empty())
 		{
-			mFactoryStack.pop_front();
+			LLPanel::sFactoryStack.pop_front();
 		}
 	}
 	popFileName();
@@ -250,69 +250,6 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename)
 	return 0;
 }
 
-static LLFastTimer::DeclareTimer FTM_BUILD_PANELS("Build Panels");
-
-//-----------------------------------------------------------------------------
-// buildPanel()
-//-----------------------------------------------------------------------------
-BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const std::string& filename, LLXMLNodePtr output_node)
-{
-	LLFastTimer timer(FTM_BUILD_PANELS);
-	BOOL didPost = FALSE;
-	LLXMLNodePtr root;
-
-	//if exporting, only load the language being exported, 
-	//instead of layering localized version on top of english
-	if (output_node)
-	{	
-		if (!LLUICtrlFactory::getLocalizedXMLNode(filename, root))
-		{
-			llwarns << "Couldn't parse panel from: " << LLUI::getLocalizedSkinPath() + gDirUtilp->getDirDelimiter() + filename  << llendl;
-			return didPost;
-		}
-	}
-	else if (!LLUICtrlFactory::getLayeredXMLNode(filename, root))
-	{
-		llwarns << "Couldn't parse panel from: " << LLUI::getSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl;
-		return didPost;
-	}
-
-	// root must be called panel
-	if( !root->hasName("panel" ) )
-	{
-		llwarns << "Root node should be named panel in : " << filename << llendl;
-		return didPost;
-	}
-
-	lldebugs << "Building panel " << filename << llendl;
-
-	pushFileName(filename);
-	{
-		if (!panelp->getFactoryMap().empty())
-		{
-			mFactoryStack.push_front(&panelp->getFactoryMap());
-		}
-		
-		 // for local registry callbacks; define in constructor, referenced in XUI or postBuild
-		panelp->getCommitCallbackRegistrar().pushScope();
-		panelp->getEnableCallbackRegistrar().pushScope();
-		
-		didPost = panelp->initPanelXML(root, NULL, output_node);
-
-		panelp->getCommitCallbackRegistrar().popScope();
-		panelp->getEnableCallbackRegistrar().popScope();
-		
-		panelp->setXMLFilename(filename);
-
-		if (!panelp->getFactoryMap().empty())
-		{
-			mFactoryStack.pop_front();
-		}
-	}
-	popFileName();
-	return didPost;
-}
-
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
@@ -344,29 +281,6 @@ LLView *LLUICtrlFactory::createFromXML(LLXMLNodePtr node, LLView* parent, const
 	return view;
 }
 
-//-----------------------------------------------------------------------------
-// createFactoryPanel()
-//-----------------------------------------------------------------------------
-LLPanel* LLUICtrlFactory::createFactoryPanel(const std::string& name)
-{
-	std::deque<const LLCallbackMap::map_t*>::iterator itor;
-	for (itor = mFactoryStack.begin(); itor != mFactoryStack.end(); ++itor)
-	{
-		const LLCallbackMap::map_t* factory_map = *itor;
-
-		// Look up this panel's name in the map.
-		LLCallbackMap::map_const_iter_t iter = factory_map->find( name );
-		if (iter != factory_map->end())
-		{
-			// Use the factory to create the panel, instead of using a default LLPanel.
-			LLPanel *ret = (LLPanel*) iter->second.mCallback( iter->second.mData );
-			return ret;
-		}
-	}
-	LLPanel::Params panel_p;
-	return create<LLPanel>(panel_p);
-}
-
 std::string LLUICtrlFactory::getCurFileName() 
 { 
 	return mFileNames.empty() ? "" : gDirUtilp->getWorkingDir() + gDirUtilp->getDirDelimiter() + mFileNames.back(); 
@@ -383,36 +297,6 @@ void LLUICtrlFactory::popFileName()
 	mFileNames.pop_back(); 
 }
 
-
-//-----------------------------------------------------------------------------
-
-//static
-BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const std::string& name, LLColor4& color)
-{
-	std::string colorstring;
-	BOOL res = node->getAttributeString(name.c_str(), colorstring);
-	if (res)
-	{
-		if (LLUIColorTable::instance().colorExists(colorstring))
-		{
-			color.setVec(LLUIColorTable::instance().getColor(colorstring));
-		}
-		else
-		{
-			res = FALSE;
-		}
-	}
-	if (!res)
-	{
-		res = LLColor4::parseColor(colorstring, &color);
-	}	
-	if (!res)
-	{
-		res = node->getAttributeColor(name.c_str(), color);
-	}
-	return res;
-}
-
 //static
 void LLUICtrlFactory::setCtrlParent(LLView* view, LLView* parent, S32 tab_group)
 {
@@ -428,28 +312,22 @@ std::string LLUICtrlFactory::findSkinnedFilename(const std::string& filename)
 	return gDirUtilp->findSkinnedFilename(LLUI::getSkinPath(), filename);
 }
 
-void LLUICtrlFactory::pushFactoryFunctions(const LLCallbackMap::map_t* map)
-{
-	mFactoryStack.push_back(map);
-}
-
-void LLUICtrlFactory::popFactoryFunctions()
-{
-	if (!mFactoryStack.empty())
-	{
-		mFactoryStack.pop_back();
-	}
-}
-
 //static 
 void LLUICtrlFactory::copyName(LLXMLNodePtr src, LLXMLNodePtr dest)
 {
 	dest->setName(src->getName()->mString);
 }
 
+template<typename T>
+const LLInitParam::BaseBlock& get_empty_param_block()
+{
+	static typename T::Params params;
+	return params;
+}
+
 // adds a widget and its param block to various registries
 //static 
-void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const std::type_info* param_block_type, dummy_widget_creator_func_t creator_func, const std::string& tag)
+void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const std::type_info* param_block_type, const std::string& tag)
 {
 	// associate parameter block type with template .xml file
 	std::string* existing_tag = LLWidgetNameRegistry::instance().getValue(param_block_type);
@@ -469,17 +347,9 @@ void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const st
 		}
 	}
 	LLWidgetNameRegistry::instance().defaultRegistrar().add(param_block_type, tag);
-	// associate widget type with factory function
-	LLDefaultWidgetRegistry::instance().defaultRegistrar().add(widget_type, creator_func);
 	//FIXME: comment this in when working on schema generation
 	//LLWidgetTypeRegistry::instance().defaultRegistrar().add(tag, widget_type);
-	//LLDefaultParamBlockRegistry::instance().defaultRegistrar().add(widget_type, &getEmptyParamBlock<T>);
-}
-
-//static
-dummy_widget_creator_func_t* LLUICtrlFactory::getDefaultWidgetFunc(const std::type_info* widget_type)
-{
-	return LLDefaultWidgetRegistry::instance().getValue(widget_type);
+	//LLDefaultParamBlockRegistry::instance().defaultRegistrar().add(widget_type, &get_empty_param_block<T>);
 }
 
 //static 
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index dc43b311a7..c4d3aa38d8 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -33,24 +33,14 @@
 #ifndef LLUICTRLFACTORY_H
 #define LLUICTRLFACTORY_H
 
-#include "llcallbackmap.h"
+#include "llfasttimer.h"
 #include "llinitparam.h"
 #include "llregistry.h"
-#include "v4color.h"
-#include "llfasttimer.h"
-
 #include "llxuiparser.h"
 
-#include <boost/function.hpp>
-#include <iosfwd>
-#include <stack>
-#include <set>
-
-class LLPanel;
 class LLFloater;
 class LLView;
 
-
 // sort functor for typeid maps
 struct LLCompareTypeID
 {
@@ -91,12 +81,6 @@ class LLWidgetNameRegistry
 :	public LLRegistrySingleton<const std::type_info*, std::string, LLWidgetNameRegistry , LLCompareTypeID>
 {};
 
-// lookup factory functions for default widget instances by widget type
-typedef LLView* (*dummy_widget_creator_func_t)(const std::string&);
-class LLDefaultWidgetRegistry
-:	public LLRegistrySingleton<const std::type_info*, dummy_widget_creator_func_t, LLDefaultWidgetRegistry, LLCompareTypeID>
-{};
-
 // lookup function for generating empty param block by widget type
 // this is used for schema generation
 //typedef const LLInitParam::BaseBlock& (*empty_param_block_func_t)();
@@ -164,23 +148,16 @@ public:
 	}
 
 	bool buildFloater(LLFloater* floaterp, const std::string &filename, LLXMLNodePtr output_node);
-	BOOL buildPanel(LLPanel* panelp, const std::string &filename, LLXMLNodePtr output_node = NULL);
 
 	// Does what you want for LLFloaters and LLPanels
 	// Returns 0 on success
 	S32 saveToXML(LLView* viewp, const std::string& filename);
 
+	// filename tracking for debugging info
 	std::string getCurFileName();
 	void pushFileName(const std::string& name);
 	void popFileName();
 
-	static BOOL getAttributeColor(LLXMLNodePtr node, const std::string& name, LLColor4& color);
-
-	LLPanel* createFactoryPanel(const std::string& name);
-
-	void pushFactoryFunctions(const LLCallbackMap::map_t* map);
-	void popFactoryFunctions();
-
 	template<typename T>
 	static T* createWidget(const typename T::Params& params, LLView* parent = NULL)
 	{
@@ -192,12 +169,10 @@ public:
 			//return NULL;
 		}
 
-		{
-			LLFastTimer timer(FTM_WIDGET_CONSTRUCTION);
+		{ LLFastTimer _(FTM_WIDGET_CONSTRUCTION);
 			widget = new T(params);	
 		}
-		{
-			LLFastTimer timer(FTM_INIT_FROM_PARAMS);
+		{ LLFastTimer _(FTM_INIT_FROM_PARAMS);
 			widget->initFromParams(params);
 		}
 
@@ -272,17 +247,9 @@ fail:
 	template<class T>
 	static T* getDefaultWidget(const std::string& name)
 	{
-		dummy_widget_creator_func_t* dummy_func = getDefaultWidgetFunc(&typeid(T));
-		return dummy_func ? dynamic_cast<T*>((*dummy_func)(name)) : NULL;
-	}
-
-	template <class T> 
-	static LLView* createDefaultWidget(const std::string& name) 
-	{
-		typename T::Params params;
-		params.name(name);
-		
-		return create<T>(params);
+		T::Params widget_params;
+		widget_params.name = name;
+		return create<T>(widget_params);
 	}
 
 	static void copyName(LLXMLNodePtr src, LLXMLNodePtr dest);
@@ -335,12 +302,9 @@ fail:
 	static void loadWidgetTemplate(const std::string& widget_tag, LLInitParam::BaseBlock& block);
 
 	// helper function for adding widget type info to various registries
-	static void registerWidget(const std::type_info* widget_type, const std::type_info* param_block_type, dummy_widget_creator_func_t creator_func, const std::string& tag);
+	static void registerWidget(const std::type_info* widget_type, const std::type_info* param_block_type, const std::string& tag);
 
 private:
-	// return default widget instance factory func for a given type
-	static dummy_widget_creator_func_t* getDefaultWidgetFunc(const std::type_info* widget_type);
-
 	static const std::string* getWidgetTag(const std::type_info* widget_type);
 
 	// this exists to get around dependency on llview
@@ -349,20 +313,10 @@ private:
 	// Avoid directly using LLUI and LLDir in the template code
 	static std::string findSkinnedFilename(const std::string& filename);
 
-	typedef std::deque<const LLCallbackMap::map_t*> factory_stack_t;
-	factory_stack_t					mFactoryStack;
-
-	LLPanel*		mDummyPanel;
+	class LLPanel*		mDummyPanel;
 	std::vector<std::string>	mFileNames;
 };
 
-template<typename T>
-const LLInitParam::BaseBlock& getEmptyParamBlock()
-{
-	static typename T::Params params;
-	return params;
-}
-
 // this is here to make gcc happy with reference to LLUICtrlFactory
 template<typename DERIVED>
 template<typename T> 
@@ -370,7 +324,7 @@ LLChildRegistry<DERIVED>::Register<T>::Register(const char* tag, LLWidgetCreator
 :	LLChildRegistry<DERIVED>::StaticRegistrar(tag, func.empty() ? (LLWidgetCreatorFunc)&LLUICtrlFactory::defaultBuilder<T> : func)
 {
 	// add this widget to various registries
-	LLUICtrlFactory::instance().registerWidget(&typeid(T), &typeid(typename T::Params), &LLUICtrlFactory::createDefaultWidget<T>, tag);
+	LLUICtrlFactory::instance().registerWidget(&typeid(T), &typeid(typename T::Params), tag);
 	
 	// since registry_t depends on T, do this in line here
 	// TODO: uncomment this for schema generation
@@ -378,58 +332,4 @@ LLChildRegistry<DERIVED>::Register<T>::Register(const char* tag, LLWidgetCreator
 	//LLChildRegistryRegistry::instance().defaultRegistrar().add(&typeid(T), registry_t::instance());
 }
 
-
-typedef boost::function<LLPanel* (void)> LLPanelClassCreatorFunc;
-
-// local static instance for registering a particular panel class
-
-class LLRegisterPanelClass
-:	public LLSingleton< LLRegisterPanelClass >
-{
-public:
-	// reigister with either the provided builder, or the generic templated builder
-	void addPanelClass(const std::string& tag,LLPanelClassCreatorFunc func)
-	{
-		mPanelClassesNames[tag] = func;
-	}
-
-	LLPanel* createPanelClass(const std::string& tag)
-	{
-		param_name_map_t::iterator iT =  mPanelClassesNames.find(tag);
-		if(iT == mPanelClassesNames.end())
-			return 0;
-		return iT->second();
-	}
-	template<typename T>
-	static T* defaultPanelClassBuilder()
-	{
-		T* pT = new T();
-		return pT;
-	}
-
-private:
-	typedef std::map< std::string, LLPanelClassCreatorFunc> param_name_map_t;
-	
-	param_name_map_t mPanelClassesNames;
-};
-
-
-// local static instance for registering a particular panel class
-template<typename T>
-class LLRegisterPanelClassWrapper
-:	public LLRegisterPanelClass
-{
-public:
-	// reigister with either the provided builder, or the generic templated builder
-	LLRegisterPanelClassWrapper(const std::string& tag);
-};
-
-
-template<typename T>
-LLRegisterPanelClassWrapper<T>::LLRegisterPanelClassWrapper(const std::string& tag) 
-{
-	LLRegisterPanelClass::instance().addPanelClass(tag,&LLRegisterPanelClass::defaultPanelClassBuilder<T>);
-}
-
-
 #endif //LLUICTRLFACTORY_H
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 4d3708302b..3ee4a85de0 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -1698,7 +1698,9 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse) const
 		child = getDefaultWidget<LLView>(name);
 		if (!child)
 		{
-			 child = LLUICtrlFactory::createDefaultWidget<LLView>(name);
+			LLView::Params view_params;
+			view_params.name = name;
+			child = LLUICtrlFactory::create<LLView>(view_params);
 		}
 	}
 	return child;
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 70bda3893e..54ab928522 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -200,8 +200,6 @@ LLAgent::LLAgent() :
 	mbFlagsDirty(FALSE),
 	mbFlagsNeedReset(FALSE),
 
-	mbJump(FALSE),
-
 	mAutoPilot(FALSE),
 	mAutoPilotFlyOnStop(FALSE),
 	mAutoPilotTargetGlobal(),
@@ -561,6 +559,9 @@ void LLAgent::toggleFlying()
 {
 	BOOL fly = !gAgent.getFlying();
 
+	gAgent.mMoveTimer.reset();
+	LLFirstUse::notMoving(false);
+
 	gAgent.setFlying( fly );
 	gAgentCamera.resetView();
 }
@@ -2987,12 +2988,6 @@ void LLAgent::processScriptControlChange(LLMessageSystem *msg, void **)
 					total_count++;
 				}
 			}
-		
-			// Any control taken?  If so, might be first time.
-			//if (total_count > 0)
-			//{
-				//LLFirstUse::useOverrideKeys();
-			//}
 		}
 		else
 		{
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 0185f874f9..6485cd8fd8 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -363,14 +363,6 @@ public:
 private:
 	BOOL			mIsBusy;
 
-	//--------------------------------------------------------------------
-	// Jump
-	//--------------------------------------------------------------------
-public:
-	BOOL			getJump() const	{ return mbJump; }
-private:
-	BOOL 			mbJump;
-
 	//--------------------------------------------------------------------
 	// Grab
 	//--------------------------------------------------------------------
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 768be116f6..8e448d53ee 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -367,19 +367,19 @@ bool	create_text_segment_icon_from_url_match(LLUrlMatch* match,LLTextBase* base)
 
 	if(gAgent.isInGroup(match_id, TRUE))
 	{
-		LLGroupIconCtrl::Params icon_params = LLUICtrlFactory::instance().getDefaultParams<LLGroupIconCtrl>();
+		LLGroupIconCtrl::Params icon_params;
 		icon_params.group_id = match_id;
 		icon_params.rect = LLRect(0, 16, 16, 0);
 		icon_params.visible = true;
-		icon = LLUICtrlFactory::instance().createWidget<LLGroupIconCtrl>(icon_params);
+		icon = LLUICtrlFactory::instance().create<LLGroupIconCtrl>(icon_params);
 	}
 	else
 	{
-		LLAvatarIconCtrl::Params icon_params = LLUICtrlFactory::instance().getDefaultParams<LLAvatarIconCtrl>();
+		LLAvatarIconCtrl::Params icon_params;
 		icon_params.avatar_id = match_id;
 		icon_params.rect = LLRect(0, 16, 16, 0);
 		icon_params.visible = true;
-		icon = LLUICtrlFactory::instance().createWidget<LLAvatarIconCtrl>(icon_params);
+		icon = LLUICtrlFactory::instance().create<LLAvatarIconCtrl>(icon_params);
 	}
 
 	LLInlineViewSegment::Params params;
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 57e186b6a8..f448816f76 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -498,7 +498,7 @@ LLAvalineListItem::LLAvalineListItem(bool hide_number/* = true*/) : LLAvatarList
 , mIsHideNumber(hide_number)
 {
 	// should not use buildPanel from the base class to ensure LLAvalineListItem::postBuild is called.
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_list_item.xml");
+	buildPanel(this, "panel_avatar_list_item.xml");
 }
 
 BOOL LLAvalineListItem::postBuild()
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp
index eead0c9b3e..18a5d74527 100644
--- a/indra/newview/llavatarlistitem.cpp
+++ b/indra/newview/llavatarlistitem.cpp
@@ -75,7 +75,7 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/)
 {
 	if (not_from_ui_factory)
 	{
-		LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_list_item.xml");
+		buildPanel(this, "panel_avatar_list_item.xml");
 	}
 	// *NOTE: mantipov: do not use any member here. They can be uninitialized here in case instance
 	// is created from the UICtrlFactory
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index e0b605a724..310b406bfd 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -112,14 +112,14 @@ public:
 		  mGesturePanel(NULL)
 	{
 		mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL);
-		LLUICtrlFactory::getInstance()->buildPanel(this, "panel_bottomtray_lite.xml");
+		buildPanel(this, "panel_bottomtray_lite.xml");
 		// Necessary for focus movement among child controls
 		setFocusRoot(TRUE);
 	}
 
 	BOOL postBuild()
 	{
-		mNearbyChatBar = getChild<LLNearbyChatBar>("chat_bar");
+		mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar");
 		mGesturePanel = getChild<LLPanel>("gesture_panel");
 
 		// Hide "show_nearby_chat" button 
@@ -163,7 +163,7 @@ LLBottomTray::LLBottomTray(const LLSD&)
 
 	mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL);
 
-	LLUICtrlFactory::getInstance()->buildPanel(this,"panel_bottomtray.xml");
+	buildPanel(this,"panel_bottomtray.xml");
 
 	LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraItem, _2));
 
@@ -471,8 +471,7 @@ BOOL LLBottomTray::postBuild()
 	mBottomTrayContextMenu =  LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_bottomtray.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
 	gMenuHolder->addChild(mBottomTrayContextMenu);
 
-	mNearbyChatBar = getChild<LLNearbyChatBar>("chat_bar");
-	LLHints::registerHintTarget("nearby_chat_bar", mNearbyChatBar->LLView::getHandle());
+	mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar");
 
 	mToolbarStack = getChild<LLLayoutStack>("toolbar_stack");
 	mMovementButton = getChild<LLButton>("movement_btn");
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index a03fe79512..00a343c99c 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -147,7 +147,7 @@ BOOL LLCallFloater::postBuild()
 
 	childSetAction("leave_call_btn", boost::bind(&LLCallFloater::leaveCall, this));
 
-	mNonAvatarCaller = getChild<LLNonAvatarCaller>("non_avatar_caller");
+	mNonAvatarCaller = findChild<LLNonAvatarCaller>("non_avatar_caller");
 	mNonAvatarCaller->setVisible(FALSE);
 
 	LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("speak_flyout_btn");
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 7204e6c39c..b6788b7739 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -107,7 +107,7 @@ public:
 	static LLChatHistoryHeader* createInstance(const std::string& file_name)
 	{
 		LLChatHistoryHeader* pInstance = new LLChatHistoryHeader;
-		LLUICtrlFactory::getInstance()->buildPanel(pInstance, file_name);	
+		buildPanel(pInstance, file_name);	
 		return pInstance;
 	}
 
@@ -402,7 +402,7 @@ protected:
 			return;
 		}
 
-		LLTextBase* name = getChild<LLTextBase>("user_name");
+		LLTextBox* name = getChild<LLTextBox>("user_name");
 		LLRect sticky_rect = name->getRect();
 		S32 icon_x = llmin(sticky_rect.mLeft + name->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3);
 		sInfoCtrl->setOrigin(icon_x, sticky_rect.getCenterY() - sInfoCtrl->getRect().getHeight() / 2 ) ;
diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp
index 35a244c461..ed4803f87a 100644
--- a/indra/newview/llchatitemscontainerctrl.cpp
+++ b/indra/newview/llchatitemscontainerctrl.cpp
@@ -57,7 +57,7 @@ static const S32 msg_height_pad = 5;
 LLNearbyChatToastPanel* LLNearbyChatToastPanel::createInstance()
 {
 	LLNearbyChatToastPanel* item = new LLNearbyChatToastPanel();
-	LLUICtrlFactory::getInstance()->buildPanel(item, "panel_chat_item.xml");
+	buildPanel(item, "panel_chat_item.xml");
 	item->setFollows(FOLLOWS_NONE);
 	return item;
 }
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp
index f181872faa..73715e4726 100644
--- a/indra/newview/llfloatercamera.cpp
+++ b/indra/newview/llfloatercamera.cpp
@@ -351,7 +351,7 @@ BOOL LLFloaterCamera::postBuild()
 	setTitleVisible(TRUE); // restore title visibility after chrome applying
 
 	mRotate = getChild<LLJoystickCameraRotate>(ORBIT);
-	mZoom = getChild<LLPanelCameraZoom>(ZOOM);
+	mZoom = findChild<LLPanelCameraZoom>(ZOOM);
 	mTrack = getChild<LLJoystickCameraTrack>(PAN);
 
 	assignButton2Mode(CAMERA_CTRL_MODE_MODES,			"avatarview_btn");
diff --git a/indra/newview/llfloaterinventory.cpp b/indra/newview/llfloaterinventory.cpp
index 4bffd41d29..1e15b86762 100644
--- a/indra/newview/llfloaterinventory.cpp
+++ b/indra/newview/llfloaterinventory.cpp
@@ -60,7 +60,7 @@ LLFloaterInventory::~LLFloaterInventory()
 
 BOOL LLFloaterInventory::postBuild()
 {
-	mPanelMainInventory = getChild<LLPanelMainInventory>("Inventory Panel");
+	mPanelMainInventory = findChild<LLPanelMainInventory>("Inventory Panel");
 	return TRUE;
 }
 
diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp
index 105d7f9201..9e3422c2b2 100644
--- a/indra/newview/llfloaternotificationsconsole.cpp
+++ b/indra/newview/llfloaternotificationsconsole.cpp
@@ -65,7 +65,7 @@ LLNotificationChannelPanel::LLNotificationChannelPanel(const std::string& channe
 	mChannelRejectsPtr = LLNotificationChannelPtr(
 		LLNotificationChannel::buildChannel(channel_name + "rejects", mChannelPtr->getParentChannelName(),
 											!boost::bind(mChannelPtr->getFilter(), _1)));
-	LLUICtrlFactory::instance().buildPanel(this, "panel_notifications_channel.xml");
+	buildPanel(this, "panel_notifications_channel.xml");
 }
 
 BOOL LLNotificationChannelPanel::postBuild()
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 8af4955f92..a8af80b952 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -180,32 +180,32 @@ BOOL LLFloaterRegionInfo::postBuild()
 	mInfoPanels.push_back(panel);
 	panel->getCommitCallbackRegistrar().add("RegionInfo.ManageTelehub",	boost::bind(&LLPanelRegionInfo::onClickManageTelehub, panel));
 	
-	LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_general.xml");
+	buildPanel(panel, "panel_region_general.xml");
 	mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true));
 
 	panel = new LLPanelRegionDebugInfo;
 	mInfoPanels.push_back(panel);
-	LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_debug.xml");
+	buildPanel(panel, "panel_region_debug.xml");
 	mTab->addTabPanel(panel);
 
 	panel = new LLPanelRegionTextureInfo;
 	mInfoPanels.push_back(panel);
-	LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_texture.xml");
+	buildPanel(panel, "panel_region_texture.xml");
 	mTab->addTabPanel(panel);
 
 	panel = new LLPanelRegionTerrainInfo;
 	mInfoPanels.push_back(panel);
-	LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_terrain.xml");
+	buildPanel(panel, "panel_region_terrain.xml");
 	mTab->addTabPanel(panel);
 
 	panel = new LLPanelEstateInfo;
 	mInfoPanels.push_back(panel);
-	LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_estate.xml");
+	buildPanel(panel, "panel_region_estate.xml");
 	mTab->addTabPanel(panel);
 
 	panel = new LLPanelEstateCovenant;
 	mInfoPanels.push_back(panel);
-	LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_covenant.xml");
+	buildPanel(panel, "panel_region_covenant.xml");
 	mTab->addTabPanel(panel);
 
 	gMessageSystem->setHandlerFunc(
diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp
index a77fc4710a..a6f3acd18d 100644
--- a/indra/newview/llfloaterscriptlimits.cpp
+++ b/indra/newview/llfloaterscriptlimits.cpp
@@ -121,7 +121,7 @@ BOOL LLFloaterScriptLimits::postBuild()
 		LLPanelScriptLimitsRegionMemory* panel_memory;
 		panel_memory = new LLPanelScriptLimitsRegionMemory;
 		mInfoPanels.push_back(panel_memory);
-		LLUICtrlFactory::getInstance()->buildPanel(panel_memory, "panel_script_limits_region_memory.xml");
+		buildPanel(panel_memory, "panel_script_limits_region_memory.xml");
 		mTab->addTabPanel(panel_memory);
 	}
 	
@@ -130,7 +130,7 @@ BOOL LLFloaterScriptLimits::postBuild()
 	{
 		LLPanelScriptLimitsAttachment* panel_attachments = new LLPanelScriptLimitsAttachment;
 		mInfoPanels.push_back(panel_attachments);
-		LLUICtrlFactory::getInstance()->buildPanel(panel_attachments, "panel_script_limits_my_avatar.xml");
+		buildPanel(panel_attachments, "panel_script_limits_my_avatar.xml");
 		mTab->addTabPanel(panel_attachments);
 	}
 	
diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp
index 41f4580495..d32f809457 100644
--- a/indra/newview/llfloateruipreview.cpp
+++ b/indra/newview/llfloateruipreview.cpp
@@ -891,7 +891,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)
 		if (save)
 		{
 			LLXMLNodePtr panel_write = new LLXMLNode();
-			LLUICtrlFactory::getInstance()->buildPanel(panel, path, panel_write);		// build it
+			buildPanel(panel, path, panel_write);		// build it
 			
 			if (!panel_write->isNull())
 			{
@@ -905,7 +905,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)
 		}
 		else
 		{
-			LLUICtrlFactory::getInstance()->buildPanel(panel, path);		// build it
+			buildPanel(panel, path);		// build it
 			LLRect new_size = panel->getRect();								// get its rectangle
 			panel->setOrigin(0,0);											// reset its origin point so it's not offset by -left or other XUI attributes
 			(*floaterp)->setTitle(path);									// use the file name as its title, since panels have no guaranteed meaningful name attribute
diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp
index 125936b9c7..af931810a2 100644
--- a/indra/newview/llgrouplist.cpp
+++ b/indra/newview/llgrouplist.cpp
@@ -289,7 +289,7 @@ mGroupNameBox(NULL),
 mInfoBtn(NULL),
 mGroupID(LLUUID::null)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group_list_item.xml");
+	buildPanel(this, "panel_group_list_item.xml");
 
 	// Remember group icon width including its padding from the name text box,
 	// so that we can hide and show the icon again later.
diff --git a/indra/newview/llhudview.cpp b/indra/newview/llhudview.cpp
index 261d9f1df7..beb3b4340a 100644
--- a/indra/newview/llhudview.cpp
+++ b/indra/newview/llhudview.cpp
@@ -56,7 +56,7 @@ const S32 HUD_ARROW_SIZE = 32;
 
 LLHUDView::LLHUDView(const LLRect& r)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_hud.xml");
+	buildPanel(this, "panel_hud.xml");
 	setShape(r, true);
 }
 
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 9eb11a6ac4..8a84c7a9c9 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -100,9 +100,9 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
 
 	if(gAgent.isInGroup(session_id, TRUE))
 	{
-		LLGroupIconCtrl::Params icon_params = LLUICtrlFactory::instance().getDefaultParams<LLGroupIconCtrl>();
+		LLGroupIconCtrl::Params icon_params;
 		icon_params.group_id = session_id;
-		icon = LLUICtrlFactory::instance().createWidget<LLGroupIconCtrl>(icon_params);
+		icon = LLUICtrlFactory::instance().create<LLGroupIconCtrl>(icon_params);
 
 		mSessions[session_id] = floaterp;
 		floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, session_id));
@@ -111,9 +111,9 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
 	{
 		LLUUID avatar_id = LLIMModel::getInstance()->getOtherParticipantID(session_id);
 
-		LLAvatarIconCtrl::Params icon_params = LLUICtrlFactory::instance().getDefaultParams<LLAvatarIconCtrl>();
+		LLAvatarIconCtrl::Params icon_params;
 		icon_params.avatar_id = avatar_id;
-		icon = LLUICtrlFactory::instance().createWidget<LLAvatarIconCtrl>(icon_params);
+		icon = LLUICtrlFactory::instance().create<LLAvatarIconCtrl>(icon_params);
 
 		mSessions[session_id] = floaterp;
 		floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, session_id));
diff --git a/indra/newview/llinventorylistitem.cpp b/indra/newview/llinventorylistitem.cpp
index b1f5b3be2f..b3d658b0cf 100644
--- a/indra/newview/llinventorylistitem.cpp
+++ b/indra/newview/llinventorylistitem.cpp
@@ -307,7 +307,9 @@ LLPanelInventoryListItemBase::LLPanelInventoryListItemBase(LLViewerInventoryItem
 	}
 	else
 	{
-		mIconCtrl = dynamic_cast<LLIconCtrl*>(LLUICtrlFactory::createDefaultWidget<LLIconCtrl>("item_icon"));
+		LLIconCtrl::Params icon_params;
+		icon_params.name = "item_icon";
+		mIconCtrl = LLUICtrlFactory::create<LLIconCtrl>(icon_params);
 	}
 
 	LLTextBox::Params text_params(params.item_name);
@@ -320,7 +322,9 @@ LLPanelInventoryListItemBase::LLPanelInventoryListItemBase(LLViewerInventoryItem
 	}
 	else
 	{
-		mTitleCtrl = dynamic_cast<LLTextBox*>(LLUICtrlFactory::createDefaultWidget<LLTextBox>("item_title"));
+		LLTextBox::Params text_aprams;
+		text_params.name = "item_title";
+		mTitleCtrl = LLUICtrlFactory::create<LLTextBox>(text_params);
 	}
 }
 
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 148a5786cb..680f937e83 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -703,7 +703,7 @@ void LLPanelStandStopFlying::reparent(LLFloaterMove* move_view)
 LLPanelStandStopFlying* LLPanelStandStopFlying::getStandStopFlyingPanel()
 {
 	LLPanelStandStopFlying* panel = new LLPanelStandStopFlying();
-	LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_stand_stop_flying.xml");
+	buildPanel(panel, "panel_stand_stop_flying.xml");
 
 	panel->setVisible(FALSE);
 	//LLUI::getRootView()->addChild(panel);
@@ -716,6 +716,8 @@ LLPanelStandStopFlying* LLPanelStandStopFlying::getStandStopFlyingPanel()
 
 void LLPanelStandStopFlying::onStandButtonClick()
 {
+	LLFirstUse::sit(false);
+
 	LLSelectMgr::getInstance()->deselectAllForStandingUp();
 	gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
 
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
index 18ef3e19ee..e53103237c 100644
--- a/indra/newview/llnavigationbar.cpp
+++ b/indra/newview/llnavigationbar.cpp
@@ -278,7 +278,7 @@ LLNavigationBar::LLNavigationBar()
 	mPurgeTPHistoryItems(false),
 	mSaveToLocationHistory(false)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_navigation_bar.xml");
+	buildPanel(this, "panel_navigation_bar.xml");
 
 	// set a listener function for LoginComplete event
 	LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLNavigationBar::handleLoginComplete, this));
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index 4011552112..024929430c 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -39,6 +39,7 @@
 #include "llchatitemscontainerctrl.h"
 #include "llfirstuse.h"
 #include "llfloaterscriptdebug.h"
+#include "llhints.h"
 #include "llnearbychat.h"
 #include "llrecentpeople.h"
 
@@ -62,7 +63,13 @@ LLToastPanelBase* createToastPanel()
 class LLNearbyChatScreenChannel: public LLScreenChannelBase
 {
 public:
-	LLNearbyChatScreenChannel(const LLUUID& id):LLScreenChannelBase(id) { mStopProcessing = false;};
+	typedef std::vector<LLHandle<LLToast> > toast_vec_t;
+	typedef std::list<LLHandle<LLToast> > toast_list_t;
+
+	LLNearbyChatScreenChannel(const LLUUID& id):LLScreenChannelBase(id) 
+	{
+		mStopProcessing = false;
+	}
 
 	void addNotification	(LLSD& notification);
 	void arrangeToasts		();
@@ -82,15 +89,12 @@ public:
 	}
 
 	// hide all toasts from screen, but not remove them from a channel
-	virtual void		hideToastsFromScreen() 
-	{
-	};
 	// removes all toasts from a channel
 	virtual void		removeToastsFromChannel() 
 	{
-		for(std::vector<LLToast*>::iterator it = m_active_toasts.begin(); it != m_active_toasts.end(); ++it)
+		for(toast_vec_t::iterator it = m_active_toasts.begin(); it != m_active_toasts.end(); ++it)
 		{
-			addToToastPool((*it));
+			addToToastPool(it->get());
 		}
 		m_active_toasts.clear();
 	};
@@ -105,10 +109,11 @@ public:
 protected:
 	void	addToToastPool(LLToast* toast)
 	{
+		if (!toast) return;
 		toast->setVisible(FALSE);
 		toast->stopTimer();
 		toast->setIsHidden(true);
-		m_toast_pool.push_back(toast);
+		m_toast_pool.push_back(toast->getHandle());
 	}
 
 	void	createOverflowToast(S32 bottom, F32 timer);
@@ -117,8 +122,8 @@ protected:
 
 	bool	createPoolToast();
 	
-	std::vector<LLToast*> m_active_toasts;
-	std::list<LLToast*> m_toast_pool;
+	toast_vec_t m_active_toasts;
+	toast_list_t m_toast_pool;
 
 	bool	mStopProcessing;
 };
@@ -139,7 +144,7 @@ void LLNearbyChatScreenChannel::onToastFade(LLToast* toast)
 	if(!toast)
 		return;
 
-	std::vector<LLToast*>::iterator pos = std::find(m_active_toasts.begin(),m_active_toasts.end(),toast);
+	toast_vec_t::iterator pos = std::find(m_active_toasts.begin(),m_active_toasts.end(),toast->getHandle());
 	if(pos!=m_active_toasts.end())
 		m_active_toasts.erase(pos);
 
@@ -166,7 +171,7 @@ bool	LLNearbyChatScreenChannel::createPoolToast()
 	toast->setOnFadeCallback(boost::bind(&LLNearbyChatScreenChannel::onToastFade, this, _1));
 	toast->setOnToastDestroyedCallback(boost::bind(&LLNearbyChatScreenChannel::onToastDestroyed, this, _1));
 	
-	m_toast_pool.push_back(toast);
+	m_toast_pool.push_back(toast->getHandle());
 	return true;
 }
 
@@ -184,17 +189,20 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification)
 	{
 		LLUUID fromID = notification["from_id"].asUUID();		// agent id or object id
 		std::string from = notification["from"].asString();
-		LLToast* toast = m_active_toasts[0];
-		LLNearbyChatToastPanel* panel = dynamic_cast<LLNearbyChatToastPanel*>(toast->getPanel());
-
-		if(panel && panel->messageID() == fromID && panel->getFromName() == from && panel->canAddText())
+		LLToast* toast = m_active_toasts[0].get();
+		if (toast)
 		{
-			panel->addMessage(notification);
-			toast->reshapeToPanel();
-			toast->resetTimer();
-	
-			arrangeToasts();
-			return;
+			LLNearbyChatToastPanel* panel = dynamic_cast<LLNearbyChatToastPanel*>(toast->getPanel());
+
+			if(panel && panel->messageID() == fromID && panel->getFromName() == from && panel->canAddText())
+			{
+				panel->addMessage(notification);
+				toast->reshapeToPanel();
+				toast->resetTimer();
+		
+				arrangeToasts();
+				return;
+			}
 		}
 	}
 	
@@ -222,7 +230,7 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification)
 
 	//take 1st element from pool, (re)initialize it, put it in active toasts
 
-	LLToast* toast = m_toast_pool.back();
+	LLToast* toast = m_toast_pool.back().get();
 
 	m_toast_pool.pop_back();
 
@@ -235,25 +243,36 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification)
 	toast->reshapeToPanel();
 	toast->resetTimer();
 	
-	m_active_toasts.push_back(toast);
+	m_active_toasts.push_back(toast->getHandle());
 
 	arrangeToasts();
 }
 
 void LLNearbyChatScreenChannel::arrangeToasts()
 {
-	if(m_active_toasts.size() == 0 || isHovering())
-		return;
-
-	hideToastsFromScreen();
+	if(!isHovering())
+	{
+		showToastsBottom();
+	}
 
-	showToastsBottom();
+	if (m_active_toasts.empty())
+	{
+		LLHints::registerHintTarget("incoming_chat", LLHandle<LLView>());
+	}
+	else
+	{
+		LLToast* toast = m_active_toasts.front().get();
+		if (toast)
+		{
+			LLHints::registerHintTarget("incoming_chat", m_active_toasts.front().get()->LLView::getHandle());
+		}
+	}
 }
 
-int sort_toasts_predicate(LLToast* first,LLToast* second)
+int sort_toasts_predicate(LLHandle<LLToast> first, LLHandle<LLToast> second)
 {
-	F32 v1 = first->getTimer()->getEventTimer().getElapsedTimeF32();
-	F32 v2 = second->getTimer()->getEventTimer().getElapsedTimeF32();
+	F32 v1 = first.get()->getTimer()->getEventTimer().getElapsedTimeF32();
+	F32 v2 = second.get()->getTimer()->getEventTimer().getElapsedTimeF32();
 	return v1 < v2;
 }
 
@@ -271,20 +290,22 @@ void LLNearbyChatScreenChannel::showToastsBottom()
 
 	//calc max visible item and hide other toasts.
 
-	for(std::vector<LLToast*>::iterator it = m_active_toasts.begin(); it != m_active_toasts.end(); ++it)
+	for(toast_vec_t::iterator it = m_active_toasts.begin(); it != m_active_toasts.end(); ++it)
 	{
-		S32 toast_top = bottom + (*it)->getRect().getHeight() + margin;
+		LLToast* toast = it->get();
+		if (!toast) continue;
+
+		S32 toast_top = bottom + toast->getRect().getHeight() + margin;
 
 		if(toast_top > gFloaterView->getRect().getHeight())
 		{
 			while(it!=m_active_toasts.end())
 			{
-				addToToastPool((*it));
+				addToToastPool(it->get());
 				it=m_active_toasts.erase(it);
 			}
 			break;
 		}
-		LLToast* toast = (*it);
 
 		toast_rect = toast->getRect();
 		toast_rect.setLeftTopAndSize(getRect().mLeft , bottom + toast_rect.getHeight(), toast_rect.getWidth() ,toast_rect.getHeight());
@@ -295,13 +316,16 @@ void LLNearbyChatScreenChannel::showToastsBottom()
 	
 	// use reverse order to provide correct z-order and avoid toast blinking
 	
-	for(std::vector<LLToast*>::reverse_iterator it = m_active_toasts.rbegin(); it != m_active_toasts.rend(); ++it)
+	for(toast_vec_t::reverse_iterator it = m_active_toasts.rbegin(); it != m_active_toasts.rend(); ++it)
 	{
-		LLToast* toast = (*it);
-		toast->setIsHidden(false);
-		toast->setVisible(TRUE);
-
+		LLToast* toast = it->get();
+		if (toast)
+		{
+			toast->setIsHidden(false);
+			toast->setVisible(TRUE);
+		}
 	}
+
 }
 
 void LLNearbyChatScreenChannel::reshape			(S32 width, S32 height, BOOL called_from_parent)
@@ -347,14 +371,6 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
 {
 	if(chat_msg.mMuted == TRUE)
 		return;
-	if(chat_msg.mSourceType == CHAT_SOURCE_AGENT && chat_msg.mFromID.notNull())
-	{
-        LLRecentPeople::instance().add(chat_msg.mFromID);
-		if (chat_msg.mFromID != gAgentID)
-		{
-	 		LLFirstUse::otherAvatarChatFirst();
-		}
-	}
 
 	if(chat_msg.mText.empty())
 		return;//don't process empty messages
@@ -457,7 +473,13 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
 		notification["font_size"] = (S32)LLViewerChat::getChatFontSize() ;
 		channel->addNotification(notification);	
 	}
-	
+
+	if(chat_msg.mSourceType == CHAT_SOURCE_AGENT 
+		&& chat_msg.mFromID.notNull() 
+		&& chat_msg.mFromID != gAgentID)
+	{
+ 		LLFirstUse::otherAvatarChatFirst();
+	}
 }
 
 void LLNearbyChatHandler::onDeleteToast(LLToast* toast)
diff --git a/indra/newview/llpanelavatartag.cpp b/indra/newview/llpanelavatartag.cpp
index 7563cc7f61..0ffb10b18b 100644
--- a/indra/newview/llpanelavatartag.cpp
+++ b/indra/newview/llpanelavatartag.cpp
@@ -43,7 +43,7 @@ LLPanelAvatarTag::LLPanelAvatarTag(const LLUUID& key, const std::string im_time)
 	, mAvatarId(LLUUID::null)
 //	, mFadeTimer()
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_tag.xml");
+	buildPanel(this, "panel_avatar_tag.xml");
 	setLeftButtonClickCallback(boost::bind(&LLPanelAvatarTag::onClick, this));
 	setAvatarId(key);
 	setTime(im_time);
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp
index 09b718f8b8..4d3d54ed15 100644
--- a/indra/newview/llpanelclassified.cpp
+++ b/indra/newview/llpanelclassified.cpp
@@ -144,7 +144,7 @@ LLPanelClassifiedInfo::~LLPanelClassifiedInfo()
 LLPanelClassifiedInfo* LLPanelClassifiedInfo::create()
 {
 	LLPanelClassifiedInfo* panel = new LLPanelClassifiedInfo();
-	LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_classified_info.xml");
+	buildPanel(panel, "panel_classified_info.xml");
 	return panel;
 }
 
@@ -617,7 +617,7 @@ LLPanelClassifiedEdit::~LLPanelClassifiedEdit()
 LLPanelClassifiedEdit* LLPanelClassifiedEdit::create()
 {
 	LLPanelClassifiedEdit* panel = new LLPanelClassifiedEdit();
-	LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_edit_classified.xml");
+	buildPanel(panel, "panel_edit_classified.xml");
 	return panel;
 }
 
diff --git a/indra/newview/llpanelgenerictip.cpp b/indra/newview/llpanelgenerictip.cpp
index 5a71f7f315..709ed33ed1 100644
--- a/indra/newview/llpanelgenerictip.cpp
+++ b/indra/newview/llpanelgenerictip.cpp
@@ -42,7 +42,7 @@ LLPanelGenericTip::LLPanelGenericTip(
 		const LLNotificationPtr& notification) :
 		LLPanelTipToast(notification)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_generic_tip.xml");
+	buildPanel(this, "panel_generic_tip.xml");
 
 	getChild<LLUICtrl>("message")->setValue(notification->getMessage());
 
diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp
index 11d3768a3d..b610fa9899 100644
--- a/indra/newview/llpanelgroupinvite.cpp
+++ b/indra/newview/llpanelgroupinvite.cpp
@@ -375,7 +375,7 @@ LLPanelGroupInvite::LLPanelGroupInvite(const LLUUID& group_id)
 	  mPendingUpdate(FALSE)
 {
 	// Pass on construction of this panel to the control factory.
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group_invite.xml");
+	buildPanel(this, "panel_group_invite.xml");
 }
 
 LLPanelGroupInvite::~LLPanelGroupInvite()
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 6f47fc60b0..9ad39d568c 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -202,7 +202,7 @@ LLLandmarksPanel::LLLandmarksPanel()
 	mInventoryObserver = new LLLandmarksPanelObserver(this);
 	gInventory.addObserver(mInventoryObserver);
 
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_landmarks.xml");
+	buildPanel(this, "panel_landmarks.xml");
 }
 
 LLLandmarksPanel::~LLLandmarksPanel()
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 58ed01896a..6b71e37337 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -193,7 +193,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
 	// Logo
 	mLogoImage = LLUI::getUIImage("startup_logo");
 
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_login.xml");
+	buildPanel(this, "panel_login.xml");
 	
 #if USE_VIEWER_AUTH
 	//leave room for the login menu bar
diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp
index 017f6de63b..389fe8edbf 100644
--- a/indra/newview/llpanelme.cpp
+++ b/indra/newview/llpanelme.cpp
@@ -168,7 +168,7 @@ void LLPanelMe::onCancelClicked()
 LLPanelMyProfileEdit::LLPanelMyProfileEdit() 
  : LLPanelMyProfile()
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_edit_profile.xml");
+	buildPanel(this, "panel_edit_profile.xml");
 
 	setAvatarId(gAgent.getID());
 }
diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp
index 7a61872bc7..54703d3cdc 100644
--- a/indra/newview/llpanelmediasettingsgeneral.cpp
+++ b/indra/newview/llpanelmediasettingsgeneral.cpp
@@ -80,7 +80,7 @@ LLPanelMediaSettingsGeneral::LLPanelMediaSettingsGeneral() :
 	mMediaEditable(false)
 {
 	// build dialog from XML
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_settings_general.xml");
+	buildPanel(this, "panel_media_settings_general.xml");
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llpanelmediasettingspermissions.cpp b/indra/newview/llpanelmediasettingspermissions.cpp
index 5effba515b..389003dc45 100644
--- a/indra/newview/llpanelmediasettingspermissions.cpp
+++ b/indra/newview/llpanelmediasettingspermissions.cpp
@@ -65,7 +65,7 @@ LLPanelMediaSettingsPermissions::LLPanelMediaSettingsPermissions() :
     mPermsWorldControl( 0 )
 {
     // build dialog from XML
-    LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_settings_permissions.xml");
+    buildPanel(this, "panel_media_settings_permissions.xml");
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llpanelmediasettingssecurity.cpp b/indra/newview/llpanelmediasettingssecurity.cpp
index 1b1346c41a..502ba179d3 100644
--- a/indra/newview/llpanelmediasettingssecurity.cpp
+++ b/indra/newview/llpanelmediasettingssecurity.cpp
@@ -59,7 +59,7 @@ LLPanelMediaSettingsSecurity::LLPanelMediaSettingsSecurity() :
 	mCommitCallbackRegistrar.add("Media.whitelistDelete",	boost::bind(&LLPanelMediaSettingsSecurity::onBtnDel, this));	
 
 	// build dialog from XML
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_settings_security.xml");
+	buildPanel(this, "panel_media_settings_security.xml");
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp
index 7f4609b83e..e477d71712 100644
--- a/indra/newview/llpanelnearbymedia.cpp
+++ b/indra/newview/llpanelnearbymedia.cpp
@@ -102,7 +102,7 @@ LLPanelNearByMedia::LLPanelNearByMedia()
 	mCommitCallbackRegistrar.add("SelectedMediaCtrl.Zoom",		boost::bind(&LLPanelNearByMedia::onClickSelectedMediaZoom, this));
 	mCommitCallbackRegistrar.add("SelectedMediaCtrl.Unzoom",	boost::bind(&LLPanelNearByMedia::onClickSelectedMediaUnzoom, this));
 	
-	LLUICtrlFactory::instance().buildPanel(this, "panel_nearby_media.xml");
+	buildPanel(this, "panel_nearby_media.xml");
 }
 
 LLPanelNearByMedia::~LLPanelNearByMedia()
diff --git a/indra/newview/llpanelonlinestatus.cpp b/indra/newview/llpanelonlinestatus.cpp
index 7de4e8e49d..43c3ed782d 100644
--- a/indra/newview/llpanelonlinestatus.cpp
+++ b/indra/newview/llpanelonlinestatus.cpp
@@ -41,7 +41,7 @@ LLPanelOnlineStatus::LLPanelOnlineStatus(
 	LLPanelTipToast(notification)
 {
 
-	LLUICtrlFactory::getInstance()->buildPanel(this,
+	buildPanel(this,
 			"panel_online_status_toast.xml");
 
 
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index cfd31b6829..81bd6b5414 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -491,7 +491,7 @@ BOOL LLPanelOutfitEdit::postBuild()
 
 	setVisibleCallback(boost::bind(&LLPanelOutfitEdit::onVisibilityChange, this, _2));
 
-	mCOFWearables = getChild<LLCOFWearables>("cof_wearables_list");
+	mCOFWearables = findChild<LLCOFWearables>("cof_wearables_list");
 	mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::filterWearablesBySelectedItem, this));
 
 	mCOFWearables->getCOFCallbacks().mAddWearable = boost::bind(&LLPanelOutfitEdit::onAddWearableClicked, this);
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index 16ef7998b3..3c33824cd3 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -307,10 +307,10 @@ bool LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata)
 
 void LLPanelOutfitsInventory::initTabPanels()
 {
-	mCurrentOutfitPanel = getChild<LLPanelWearing>(COF_TAB_NAME);
+	mCurrentOutfitPanel = findChild<LLPanelWearing>(COF_TAB_NAME);
 	mCurrentOutfitPanel->setSelectionChangeCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this));
 
-	mMyOutfitsPanel = getChild<LLOutfitsList>(OUTFITS_TAB_NAME);
+	mMyOutfitsPanel = findChild<LLOutfitsList>(OUTFITS_TAB_NAME);
 	mMyOutfitsPanel->setSelectionChangeCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this));
 
 	mAppearanceTabs = getChild<LLTabContainer>("appearance_tabs");
diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp
index 54eb21422e..0417c65f7a 100644
--- a/indra/newview/llpanelpick.cpp
+++ b/indra/newview/llpanelpick.cpp
@@ -80,7 +80,7 @@
 LLPanelPickInfo* LLPanelPickInfo::create()
 {
 	LLPanelPickInfo* panel = new LLPanelPickInfo();
-	LLUICtrlFactory::getInstance()->buildPanel(panel, XML_PANEL_PICK_INFO);
+	buildPanel(panel, XML_PANEL_PICK_INFO);
 	return panel;
 }
 
@@ -350,7 +350,7 @@ void LLPanelPickInfo::onClickBack()
 LLPanelPickEdit* LLPanelPickEdit::create()
 {
 	LLPanelPickEdit* panel = new LLPanelPickEdit();
-	LLUICtrlFactory::getInstance()->buildPanel(panel, XML_PANEL_EDIT_PICK);
+	buildPanel(panel, XML_PANEL_EDIT_PICK);
 	return panel;
 }
 
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
index 65254e50b4..653f3726a9 100644
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -1045,7 +1045,7 @@ LLPickItem::LLPickItem()
 , mSnapshotID(LLUUID::null)
 , mNeedData(true)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this,"panel_pick_list_item.xml");
+	buildPanel(this,"panel_pick_list_item.xml");
 }
 
 LLPickItem::~LLPickItem()
@@ -1175,7 +1175,7 @@ LLClassifiedItem::LLClassifiedItem(const LLUUID& avatar_id, const LLUUID& classi
  , mAvatarId(avatar_id)
  , mClassifiedId(classified_id)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this,"panel_classifieds_list_item.xml");
+	buildPanel(this,"panel_classifieds_list_item.xml");
 
 	LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this);
 	LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId());
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp
index c8a9176d92..83e674ee92 100644
--- a/indra/newview/llpanelplaces.cpp
+++ b/indra/newview/llpanelplaces.cpp
@@ -252,7 +252,7 @@ LLPanelPlaces::LLPanelPlaces()
 	LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(
 			boost::bind(&LLPanelPlaces::updateVerbs, this));
 
-	//LLUICtrlFactory::getInstance()->buildPanel(this, "panel_places.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
+	//buildPanel(this, "panel_places.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
 }
 
 LLPanelPlaces::~LLPanelPlaces()
@@ -327,8 +327,8 @@ BOOL LLPanelPlaces::postBuild()
 		mFilterEditor->setCommitCallback(boost::bind(&LLPanelPlaces::onFilterEdit, this, _2, false));
 	}
 
-	mPlaceProfile = getChild<LLPanelPlaceProfile>("panel_place_profile");
-	mLandmarkInfo = getChild<LLPanelLandmarkInfo>("panel_landmark_info");
+	mPlaceProfile = findChild<LLPanelPlaceProfile>("panel_place_profile");
+	mLandmarkInfo = findChild<LLPanelLandmarkInfo>("panel_landmark_info");
 	if (!mPlaceProfile || !mLandmarkInfo)
 		return FALSE;
 
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index 583b41aa57..68522ffac3 100644
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -119,7 +119,7 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() :
 	mCommitCallbackRegistrar.add("MediaCtrl.SkipBack",		boost::bind(&LLPanelPrimMediaControls::onClickSkipBack, this));
 	mCommitCallbackRegistrar.add("MediaCtrl.SkipForward",	boost::bind(&LLPanelPrimMediaControls::onClickSkipForward, this));
 	
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_prim_media_controls.xml");
+	buildPanel(this, "panel_prim_media_controls.xml");
 	mInactivityTimer.reset();
 	mFadeTimer.stop();
 	mCurrentZoom = ZOOM_NONE;
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 18da8dd48c..272622fcf7 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -133,11 +133,11 @@ BOOL LLPanelProfile::postBuild()
 
 	getTabCtrl()->setCommitCallback(boost::bind(&LLPanelProfile::onTabSelected, this, _2));
 
-	LLPanelPicks* panel_picks = getChild<LLPanelPicks>(PANEL_PICKS);
+	LLPanelPicks* panel_picks = findChild<LLPanelPicks>(PANEL_PICKS);
 	panel_picks->setProfilePanel(this);
 
 	getTabContainer()[PANEL_PICKS] = panel_picks;
-	getTabContainer()[PANEL_PROFILE] = getChild<LLPanelAvatarProfile>(PANEL_PROFILE);
+	getTabContainer()[PANEL_PROFILE] = findChild<LLPanelAvatarProfile>(PANEL_PROFILE);
 
 	return TRUE;
 }
diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp
index d59e694be6..56a211091c 100644
--- a/indra/newview/llpanelprofileview.cpp
+++ b/indra/newview/llpanelprofileview.cpp
@@ -120,7 +120,7 @@ BOOL LLPanelProfileView::postBuild()
 {
 	LLPanelProfile::postBuild();
 
-	getTabContainer()[PANEL_NOTES] = getChild<LLPanelAvatarNotes>(PANEL_NOTES);
+	getTabContainer()[PANEL_NOTES] = findChild<LLPanelAvatarNotes>(PANEL_NOTES);
 	
 	//*TODO remove this, according to style guide we don't use status combobox
 	getTabContainer()[PANEL_PROFILE]->getChildView("online_me_status_text")->setVisible( FALSE);
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index af58912b38..b398d75feb 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -131,7 +131,7 @@ LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistor
 	mRegionName(region_name),
 	mHighlight(hl)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_teleport_history_item.xml");
+	buildPanel(this, "panel_teleport_history_item.xml");
 }
 
 LLTeleportHistoryFlatItem::~LLTeleportHistoryFlatItem()
@@ -382,7 +382,7 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel()
 		mLastSelectedFlatlList(NULL),
 		mLastSelectedItemIndex(-1)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_teleport_history.xml");
+	buildPanel(this, "panel_teleport_history.xml");
 }
 
 LLTeleportHistoryPanel::~LLTeleportHistoryPanel()
diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp
index e73d1fb7c2..6e69e6d44c 100644
--- a/indra/newview/llpaneltopinfobar.cpp
+++ b/indra/newview/llpaneltopinfobar.cpp
@@ -72,7 +72,7 @@ LLPanelTopInfoBar::LLPanelTopInfoBar(): mParcelChangedObserver(0)
 	LLUICtrl::CommitCallbackRegistry::currentRegistrar()
 			.add("TopInfoBar.Action", boost::bind(&LLPanelTopInfoBar::onContextMenuItemClicked, this, _2));
 
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_topinfo_bar.xml");
+	buildPanel(this, "panel_topinfo_bar.xml");
 }
 
 LLPanelTopInfoBar::~LLPanelTopInfoBar()
diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp
index 7d70a8a891..a038badb01 100644
--- a/indra/newview/llpanelvolumepulldown.cpp
+++ b/indra/newview/llpanelvolumepulldown.cpp
@@ -60,7 +60,7 @@ LLPanelVolumePulldown::LLPanelVolumePulldown()
 
     mCommitCallbackRegistrar.add("Vol.setControlFalse", boost::bind(&LLPanelVolumePulldown::setControlFalse, this, _2));
 	mCommitCallbackRegistrar.add("Vol.GoAudioPrefs", boost::bind(&LLPanelVolumePulldown::onAdvancedButtonClick, this, _2));
-	LLUICtrlFactory::instance().buildPanel(this, "panel_volume_pulldown.xml");
+	buildPanel(this, "panel_volume_pulldown.xml");
 }
 
 BOOL LLPanelVolumePulldown::postBuild()
diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp
index d715c47631..4c2469909b 100644
--- a/indra/newview/llscrollingpanelparam.cpp
+++ b/indra/newview/llscrollingpanelparam.cpp
@@ -62,7 +62,7 @@ LLScrollingPanelParam::LLScrollingPanelParam( const LLPanel::Params& panel_param
 	  mAllowModify(allow_modify),
 	  mWearable(wearable)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_scrolling_param.xml");
+	buildPanel(this, "panel_scrolling_param.xml");
 
 	// *HACK To avoid hard coding texture position, lets use border's position for texture. 
 	LLViewBorder* left_border = getChild<LLViewBorder>("left_border");
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index f9189bfb22..aa29f6cb26 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -56,7 +56,7 @@ LLSidepanelInventory::LLSidepanelInventory()
 		mPanelMainInventory(NULL)
 {
 
-	//LLUICtrlFactory::getInstance()->buildPanel(this, "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
+	//buildPanel(this, "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
 }
 
 LLSidepanelInventory::~LLSidepanelInventory()
@@ -90,7 +90,7 @@ BOOL LLSidepanelInventory::postBuild()
 		mOverflowBtn = mInventoryPanel->getChild<LLButton>("overflow_btn");
 		mOverflowBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onOverflowButtonClicked, this));
 		
-		mPanelMainInventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
+		mPanelMainInventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
 		mPanelMainInventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2));
 		LLTabContainer* tabs = mPanelMainInventory->getChild<LLTabContainer>("inventory filter tabs");
 		tabs->setCommitCallback(boost::bind(&LLSidepanelInventory::updateVerbs, this));
@@ -108,7 +108,7 @@ BOOL LLSidepanelInventory::postBuild()
 
 	// UI elements from item panel
 	{
-		mItemPanel = getChild<LLSidepanelItemInfo>("sidepanel__item_panel");
+		mItemPanel = findChild<LLSidepanelItemInfo>("sidepanel__item_panel");
 		
 		LLButton* back_btn = mItemPanel->getChild<LLButton>("back_btn");
 		back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this));
@@ -116,7 +116,7 @@ BOOL LLSidepanelInventory::postBuild()
 
 	// UI elements from task panel
 	{
-		mTaskPanel = getChild<LLSidepanelTaskInfo>("sidepanel__task_panel");
+		mTaskPanel = findChild<LLSidepanelTaskInfo>("sidepanel__task_panel");
 		if (mTaskPanel)
 		{
 			LLButton* back_btn = mTaskPanel->getChild<LLButton>("back_btn");
@@ -176,7 +176,7 @@ void LLSidepanelInventory::onShopButtonClicked()
 
 void LLSidepanelInventory::performActionOnSelection(const std::string &action)
 {
-	LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
+	LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
 	LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem();
 	if (!current_item)
 	{
@@ -314,7 +314,7 @@ void LLSidepanelInventory::updateVerbs()
 bool LLSidepanelInventory::canShare()
 {
 	LLPanelMainInventory* panel_main_inventory =
-		mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
+		mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
 
 	LLFolderView* root_folder =
 		panel_main_inventory->getActivePanel()->getRootFolder();
@@ -332,7 +332,7 @@ bool LLSidepanelInventory::canShare()
 
 LLInventoryItem *LLSidepanelInventory::getSelectedItem()
 {
-	LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
+	LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
 	LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem();
 	if (!current_item)
 	{
@@ -345,7 +345,7 @@ LLInventoryItem *LLSidepanelInventory::getSelectedItem()
 
 U32 LLSidepanelInventory::getSelectedCount()
 {
-	LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
+	LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
 	std::set<LLUUID> selection_list = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList();
 	return selection_list.size();
 }
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 6a081a573e..8d61bb94e1 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -142,7 +142,7 @@ LLStatusBar::LLStatusBar(const LLRect& rect)
 	mBalanceTimer = new LLFrameTimer();
 	mHealthTimer = new LLFrameTimer();
 
-	LLUICtrlFactory::getInstance()->buildPanel(this,"panel_status_bar.xml");
+	buildPanel(this,"panel_status_bar.xml");
 }
 
 LLStatusBar::~LLStatusBar()
diff --git a/indra/newview/llsyswellitem.cpp b/indra/newview/llsyswellitem.cpp
index 1f3d6a582d..79b053da24 100644
--- a/indra/newview/llsyswellitem.cpp
+++ b/indra/newview/llsyswellitem.cpp
@@ -44,7 +44,7 @@ LLSysWellItem::LLSysWellItem(const Params& p) : LLPanel(p),
 												mTitle(NULL),
 												mCloseBtn(NULL)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_sys_well_item.xml");
+	buildPanel(this, "panel_sys_well_item.xml");
 
 	mTitle = getChild<LLTextBox>("title");
 	mCloseBtn = getChild<LLButton>("close_btn");
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp
index 1a8c2b8fc0..89fd22a2a0 100644
--- a/indra/newview/llsyswellwindow.cpp
+++ b/indra/newview/llsyswellwindow.cpp
@@ -255,7 +255,7 @@ LLIMWellWindow::RowPanel::RowPanel(const LLSysWellWindow* parent, const LLUUID&
 		S32 chicletCounter, const std::string& name, const LLUUID& otherParticipantId) :
 		LLPanel(LLPanel::Params()), mChiclet(NULL), mParent(parent)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_activeim_row.xml", NULL);
+	buildPanel(this, "panel_activeim_row.xml", NULL);
 
 	// Choose which of the pre-created chiclets (IM/group) to use.
 	// The other one gets hidden.
@@ -352,7 +352,7 @@ LLIMWellWindow::ObjectRowPanel::ObjectRowPanel(const LLUUID& notification_id, bo
  : LLPanel()
  , mChiclet(NULL)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_active_object_row.xml", NULL);
+	buildPanel(this, "panel_active_object_row.xml", NULL);
 
 	initChiclet(notification_id);
 
diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h
index c0da656685..8217aae0f2 100644
--- a/indra/newview/lltoast.h
+++ b/indra/newview/lltoast.h
@@ -194,6 +194,8 @@ public:
 
 	virtual S32	notifyParent(const LLSD& info);
 
+	LLHandle<LLToast> getHandle() { mHandle.bind(this); return mHandle; }
+
 private:
 
 	void onToastMouseEnter();
@@ -206,6 +208,8 @@ private:
 	LLUUID				mSessionID;
 	LLNotificationPtr	mNotification;
 
+	LLRootHandle<LLToast>	mHandle;
+		
 	LLPanel* mWrapperPanel;
 
 	// timer counts a lifetime of a toast
diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp
index 57b80fc792..7c2e68f942 100644
--- a/indra/newview/lltoastgroupnotifypanel.cpp
+++ b/indra/newview/lltoastgroupnotifypanel.cpp
@@ -60,7 +60,7 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification
 :	LLToastPanel(notification),
 	mInventoryOffer(NULL)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group_notify.xml");
+	buildPanel(this, "panel_group_notify.xml");
 	const LLSD& payload = notification->getPayload();
 	LLGroupData groupData;
 	if (!gAgent.getGroupData(payload["group_id"].asUUID(),groupData))
diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp
index 26d3bd5192..fc01b7f0d5 100644
--- a/indra/newview/lltoastimpanel.cpp
+++ b/indra/newview/lltoastimpanel.cpp
@@ -51,7 +51,7 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) :	LLToastPanel(p.notif
 								mAvatarIcon(NULL), mAvatarName(NULL),
 								mTime(NULL), mMessage(NULL), mGroupIcon(NULL)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_instant_message.xml");
+	buildPanel(this, "panel_instant_message.xml");
 
 	mGroupIcon = getChild<LLGroupIconCtrl>("group_icon");
 	mAvatarIcon = getChild<LLAvatarIconCtrl>("avatar_icon");
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index 38f67720b7..32e12035ee 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -67,7 +67,7 @@ mNumButtons(0),
 mAddedDefaultBtn(false),
 mCloseNotificationOnDestroy(true)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_notification.xml");
+	buildPanel(this, "panel_notification.xml");
 	if(rect != LLRect::null)
 	{
 		this->setShape(rect);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index d8c7eabefb..c5dee710cb 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1521,7 +1521,7 @@ void LLViewerWindow::initBase()
 	// (But wait to add it as a child of the root view so that it will be in front of the 
 	// other views.)
 	MainPanel* main_view = new MainPanel();
-	LLUICtrlFactory::instance().buildPanel(main_view, "main_view.xml");
+	LLPanel::buildPanel(main_view, "main_view.xml");
 	main_view->setShape(full_window);
 	getRootView()->addChild(main_view);
 
@@ -1529,7 +1529,7 @@ void LLViewerWindow::initBase()
 	mWorldViewPlaceholder = main_view->getChildView("world_view_rect")->getHandle();
 	mNonSideTrayView = main_view->getChildView("non_side_tray_view")->getHandle();
 	mFloaterViewHolder = main_view->getChildView("floater_view_holder")->getHandle();
-	mPopupView = main_view->getChild<LLPopupView>("popup_holder");
+	mPopupView = main_view->findChild<LLPopupView>("popup_holder");
 	mHintHolder = main_view->getChild<LLView>("hint_holder")->getHandle();
 
 	// Constrain floaters to inside the menu and status bar regions.
@@ -1568,7 +1568,7 @@ void LLViewerWindow::initBase()
 	LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLFloaterPreference::initBusyResponse));
 
 	// Add the progress bar view (startup view), which overrides everything
-	mProgressView = getRootView()->getChild<LLProgressView>("progress_view");
+	mProgressView = getRootView()->findChild<LLProgressView>("progress_view");
 	setShowProgress(FALSE);
 	setProgressCancelButtonVisible(FALSE);
 
-- 
cgit v1.2.3


From 32e4cda7dc730d505190db3d6658d6dd94bfc28f Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Mon, 16 Aug 2010 15:01:39 -0700
Subject: made hints only expire when explicitly responded to, not implicitly
 after first seeing them added hint_popup.xml for hint styling

---
 indra/newview/llfirstuse.cpp                       |  60 +++---
 indra/newview/llfirstuse.h                         |   5 +-
 indra/newview/llhints.cpp                          | 234 ++++++++++++---------
 .../newview/skins/default/xui/en/notifications.xml |  13 +-
 indra/newview/skins/default/xui/en/panel_hint.xml  |   9 +-
 .../skins/default/xui/en/widgets/hint_popup.xml    |  19 ++
 6 files changed, 205 insertions(+), 135 deletions(-)
 create mode 100644 indra/newview/skins/default/xui/en/widgets/hint_popup.xml

diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index 15de138c95..038579c0bd 100644
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -48,7 +48,6 @@
 
 // static
 std::set<std::string> LLFirstUse::sConfigVariables;
-std::map<std::string, LLNotificationPtr> LLFirstUse::sNotifications;
 
 // static
 void LLFirstUse::addConfigVariable(const std::string& var)
@@ -78,21 +77,10 @@ void LLFirstUse::resetFirstUse()
 	}
 }
 
-// static
-void LLFirstUse::useOverrideKeys()
-{
-	// Our orientation island uses key overrides to teach vehicle driving
-	// so don't show this message until you get off OI. JC
-	if (!gAgent.inPrelude())
-	{
-		firstUseNotification("FirstOverrideKeys", true, "FirstOverrideKeys");
-	}
-}
-
 // static
 void LLFirstUse::otherAvatarChatFirst(bool enable)
 {
-	firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "nearby_chat_bar").with("direction", "top"));
+	firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "incoming_chat").with("direction", "right"));
 }
 
 // static
@@ -143,24 +131,48 @@ void LLFirstUse::receiveLindens(bool enable)
 //static 
 void LLFirstUse::firstUseNotification(const std::string& control_var, bool enable, const std::string& notification_name, LLSD args, LLSD payload)
 {
-	LLNotificationPtr notif = sNotifications[notification_name];
+	init();
 
 	if (enable)
 	{
-		if (!notif && gWarningSettings.getBOOL(control_var))
+		LL_DEBUGS("LLFirstUse") << "Trigger first use notification " << notification_name << LL_ENDL;
+
+		// if notification doesn't already exist and this notification hasn't been disabled...
+		if (gWarningSettings.getBOOL(control_var))
 		{ // create new notification
-			sNotifications[notification_name] = LLNotifications::instance().add(LLNotification::Params().name(notification_name).substitutions(args).payload(payload));
-			gWarningSettings.setBOOL(control_var, FALSE);
+			LLNotifications::instance().add(LLNotification::Params().name(notification_name).substitutions(args).payload(payload.with("control_var", control_var)));
 		}
 	}	
 	else
-	{ // want to hide notification
-		if (notif)
-		{ // cancel existing notification
-			LLNotifications::instance().cancel(notif);
-			sNotifications.erase(notification_name);
-		}
-		gWarningSettings.setBOOL(control_var, FALSE);
+	{
+		LL_DEBUGS("LLFirstUse") << "Disabling first use notification " << notification_name << LL_ENDL;
+		LLNotifications::instance().cancelByName(notification_name);
+	}
+
+}
+
+// static
+void LLFirstUse::init()
+{
+	static bool initialized = false;
+	if (!initialized)
+	{
+		LLNotifications::instance().getChannel("Hints")->connectChanged(processNotification);
 	}
+	initialized = true;
+}
 
+//static 
+bool LLFirstUse::processNotification(const LLSD& notify)
+{
+	if (notify["sigtype"].asString() == "delete")
+	{
+		LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
+		if (notification)
+		{
+			// disable any future notifications
+			gWarningSettings.setBOOL(notification->getPayload()["control_var"], FALSE);
+		}
+	}
+	return false;
 }
diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h
index 48943cd9ab..9c4ab14006 100644
--- a/indra/newview/llfirstuse.h
+++ b/indra/newview/llfirstuse.h
@@ -90,7 +90,6 @@ public:
 	static void disableFirstUse();
 	static void resetFirstUse();
 
-	static void useOverrideKeys();
 	static void otherAvatarChatFirst(bool enable = true);
 	static void sit(bool enable = true);
 	static void notUsingDestinationGuide(bool enable = true);
@@ -103,7 +102,9 @@ public:
 protected:
 	static void firstUseNotification(const std::string& control_var, bool enable, const std::string& notification_name, LLSD args = LLSD(), LLSD payload = LLSD());
 	static std::set<std::string> sConfigVariables;
-	static std::map<std::string, boost::shared_ptr<LLNotification> > sNotifications;
+
+	static void init();
+	static bool processNotification(const LLSD& notify);
 };
 
 #endif
diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp
index 14a9871a7d..c4cea86a31 100644
--- a/indra/newview/llhints.cpp
+++ b/indra/newview/llhints.cpp
@@ -63,11 +63,21 @@ public:
 		}
 	};
 
+	struct TargetParams : public LLInitParam::Block<TargetParams>
+	{
+		Mandatory<std::string>	target;
+		Mandatory<EPopupDirection, PopupDirections> direction;
+
+		TargetParams()
+		:	target("target"),
+			direction("direction")
+		{}
+	};
+
 	struct Params : public LLInitParam::Block<Params, LLPanel::Params>
 	{
 		Mandatory<LLNotificationPtr>	notification;
-		Optional<std::string>			target;
-		Optional<EPopupDirection, PopupDirections>	direction;
+		Optional<TargetParams>			target_params;
 		Optional<S32>					distance;
 		Optional<LLUIImage*>			left_arrow,
 										up_arrow,
@@ -81,34 +91,31 @@ public:
 										fade_out_time;
 
 		Params()
-		:	direction("direction", TOP),
-			distance("distance", 24),
-			target("target"),
-			left_arrow("left_arrow", LLUI::getUIImage("hint_arrow_left")),
-			up_arrow("up_arrow", LLUI::getUIImage("hint_arrow_up")),
-			right_arrow("right_arrow", LLUI::getUIImage("hint_arrow_right")),
-			down_arrow("down_arrow", LLUI::getUIImage("hint_arrow_down")),
-			left_arrow_offset("left_arrow_offset", 3),
-			up_arrow_offset("up_arrow_offset", -2),
-			right_arrow_offset("right_arrow_offset", -3),
-			down_arrow_offset("down_arrow_offset", 5),
-			fade_in_time("fade_in_time", 0.2f),
-			fade_out_time("fade_out_time", 0.5f)
+		:	distance("distance"),
+			left_arrow("left_arrow"),
+			up_arrow("up_arrow"),
+			right_arrow("right_arrow"),
+			down_arrow("down_arrow"),
+			left_arrow_offset("left_arrow_offset"),
+			up_arrow_offset("up_arrow_offset"),
+			right_arrow_offset("right_arrow_offset"),
+			down_arrow_offset("down_arrow_offset"),
+			fade_in_time("fade_in_time"),
+			fade_out_time("fade_out_time")
 		{}
 	};
 
 	LLHintPopup(const Params&);
 
-	void setHintTarget(LLHandle<LLView> target) { mTarget = target; }
 	/*virtual*/ BOOL postBuild();
 
-	void onClickClose() { hide(); }
+	void onClickClose() { hide(); LLNotifications::instance().cancel(mNotification); }
 	void draw();
 	void hide() { if(!mHidden) {mHidden = true; mFadeTimer.reset();} }
 
 private:
 	LLNotificationPtr	mNotification;
-	LLHandle<LLView>	mTarget;
+	std::string			mTarget;
 	EPopupDirection		mDirection;
 	S32					mDistance;
 	LLUIImagePtr		mArrowLeft,
@@ -125,14 +132,14 @@ private:
 	bool				mHidden;
 };
 
-
+static LLDefaultChildRegistry::Register<LLHintPopup> r("hint_popup");
 
 
 LLHintPopup::LLHintPopup(const LLHintPopup::Params& p)
 :	mNotification(p.notification),
-	mDirection(p.direction),
+	mDirection(p.target_params.direction),
 	mDistance(p.distance),
-	mTarget(LLHints::getHintTarget(p.target)),
+	mTarget(p.target_params.target),
 	mArrowLeft(p.left_arrow),
 	mArrowUp(p.up_arrow),
 	mArrowRight(p.right_arrow),
@@ -146,7 +153,7 @@ LLHintPopup::LLHintPopup(const LLHintPopup::Params& p)
 	mFadeOutTime(p.fade_out_time),
 	LLPanel(p)
 {
-	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_hint.xml");
+	buildPanel(this, "panel_hint.xml", NULL, p);
 }
 
 BOOL LLHintPopup::postBuild()
@@ -172,80 +179,108 @@ void LLHintPopup::draw()
 		if (alpha == 0.f)
 		{
 			die();
+			return;
 		}
 	}
 	else
 	{
 		alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeInTime, 0.f, 1.f);
 	}
-	LLViewDrawContext context(alpha);
-
-	LLView* targetp = mTarget.get();
-	if (!targetp || !targetp->isInVisibleChain()) 
-	{
-		hide();
-	}
-	else
-	{
-		LLRect target_rect;
-		targetp->localRectToOtherView(targetp->getLocalRect(), &target_rect, getParent());
-
-		LLRect my_local_rect = getLocalRect();
-		LLRect my_rect;
-		LLRect arrow_rect;
-		LLUIImagePtr arrow_imagep;
+	
+	{	LLViewDrawContext context(alpha); 
 
-		switch(mDirection)
+		if (mTarget.empty())
 		{
-		case LEFT:
-			my_rect.setCenterAndSize(	target_rect.mLeft - (my_local_rect.getWidth() / 2 + mDistance), 
-										target_rect.getCenterY(), 
-										my_local_rect.getWidth(), 
-										my_local_rect.getHeight());
-			arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 + mArrowRightOffset,
-										my_local_rect.getCenterY(),
-										mArrowRight->getWidth(), 
-										mArrowRight->getHeight());
-			arrow_imagep = mArrowRight;
-			break;
-		case TOP:
-			my_rect.setCenterAndSize(	target_rect.getCenterX(), 
-										target_rect.mTop + (my_local_rect.getHeight() / 2 + mDistance), 
-										my_local_rect.getWidth(), 
-										my_local_rect.getHeight());
-			arrow_rect.setCenterAndSize(my_local_rect.getCenterX(),
-										my_local_rect.mBottom - mArrowDown->getHeight() / 2 + mArrowDownOffset,
-										mArrowDown->getWidth(), 
-										mArrowDown->getHeight());
-			arrow_imagep = mArrowDown;
-			break;
-		case RIGHT:
-			my_rect.setCenterAndSize(	target_rect.getCenterX(), 
-										target_rect.mTop - (my_local_rect.getHeight() / 2 + mDistance), 
-										my_local_rect.getWidth(), 
-										my_local_rect.getHeight());
-			arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + mArrowLeftOffset,
-										my_local_rect.getCenterY(),
-										mArrowLeft->getWidth(), 
-										mArrowLeft->getHeight());
-			arrow_imagep = mArrowLeft;
-			break;
-		case BOTTOM:
-			my_rect.setCenterAndSize(	target_rect.getCenterX(), 
-										target_rect.mBottom - (my_local_rect.getHeight() / 2 + mDistance),
-										my_local_rect.getWidth(), 
-										my_local_rect.getHeight());
-			arrow_rect.setCenterAndSize(my_local_rect.getCenterX(),
-										my_local_rect.mTop + mArrowUp->getHeight() / 2 + mArrowUpOffset,
-										mArrowUp->getWidth(), 
-										mArrowUp->getHeight());
-			arrow_imagep = mArrowUp;
-			break;
+			// just draw contents, no arrow, in default position
+			LLPanel::draw();
+		}
+		else 
+		{
+			LLView* targetp = LLHints::getHintTarget(mTarget).get();
+			if (!targetp)
+			{
+				// target widget is no longer valid, go away
+				die();
+			}
+			else if (!targetp->isInVisibleChain()) 
+			{
+				// if target is invisible, don't draw, but keep alive in case widget comes back
+			}
+			else
+			{
+				LLRect target_rect;
+				targetp->localRectToOtherView(targetp->getLocalRect(), &target_rect, getParent());
+
+				LLRect my_local_rect = getLocalRect();
+				LLRect my_rect;
+				LLRect arrow_rect;
+				LLUIImagePtr arrow_imagep;
+
+				switch(mDirection)
+				{
+				case LEFT:
+					my_rect.setCenterAndSize(	target_rect.mLeft - (my_local_rect.getWidth() / 2 + mDistance), 
+												target_rect.getCenterY(), 
+												my_local_rect.getWidth(), 
+												my_local_rect.getHeight());
+					if (mArrowRight)
+					{
+						arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 + mArrowRightOffset,
+													my_local_rect.getCenterY(),
+													mArrowRight->getWidth(), 
+													mArrowRight->getHeight());
+						arrow_imagep = mArrowRight;
+					}
+					break;
+				case TOP:
+					my_rect.setCenterAndSize(	target_rect.getCenterX(), 
+												target_rect.mTop + (my_local_rect.getHeight() / 2 + mDistance), 
+												my_local_rect.getWidth(), 
+												my_local_rect.getHeight());
+					if (mArrowDown)
+					{
+						arrow_rect.setCenterAndSize(my_local_rect.getCenterX(),
+													my_local_rect.mBottom - mArrowDown->getHeight() / 2 + mArrowDownOffset,
+													mArrowDown->getWidth(), 
+													mArrowDown->getHeight());
+						arrow_imagep = mArrowDown;
+					}
+					break;
+				case RIGHT:
+					my_rect.setCenterAndSize(	target_rect.mRight + (my_local_rect.getWidth() / 2 + mDistance), 
+												target_rect.getCenterY(),
+												my_local_rect.getWidth(), 
+												my_local_rect.getHeight());
+					if (mArrowLeft)
+					{
+						arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + mArrowLeftOffset,
+													my_local_rect.getCenterY(),
+													mArrowLeft->getWidth(), 
+													mArrowLeft->getHeight());
+						arrow_imagep = mArrowLeft;
+					}
+					break;
+				case BOTTOM:
+					my_rect.setCenterAndSize(	target_rect.getCenterX(), 
+												target_rect.mBottom - (my_local_rect.getHeight() / 2 + mDistance),
+												my_local_rect.getWidth(), 
+												my_local_rect.getHeight());
+					if (mArrowUp)
+					{
+						arrow_rect.setCenterAndSize(my_local_rect.getCenterX(),
+													my_local_rect.mTop + mArrowUp->getHeight() / 2 + mArrowUpOffset,
+													mArrowUp->getWidth(), 
+													mArrowUp->getHeight());
+						arrow_imagep = mArrowUp;
+					}
+					break;
+				}
+				setShape(my_rect);
+				LLPanel::draw();
+
+				if (arrow_imagep) arrow_imagep->draw(arrow_rect, LLColor4(1.f, 1.f, 1.f, alpha));
+			}
 		}
-		setShape(my_rect);
-		LLPanel::draw();
-
-		arrow_imagep->draw(arrow_rect, LLColor4(1.f, 1.f, 1.f, alpha));
 	}
 }
 
@@ -256,20 +291,23 @@ std::map<LLNotificationPtr, class LLHintPopup*> LLHints::sHints;
 //static
 void LLHints::show(LLNotificationPtr hint)
 {
-	LLHintPopup::Params p;
-	LLParamSDParser::instance().readSD(hint->getPayload(), p);
+	LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams<LLHintPopup>());
 
+	LLParamSDParser::instance().readSD(hint->getPayload(), p);
 	p.notification = hint;
 
-	LLHintPopup* popup = new LLHintPopup(p);
-	
-	sHints[hint] = popup;
-
-	LLView* hint_holder = gViewerWindow->getHintHolder();
-	if (hint_holder)
+	if (p.validateBlock())
 	{
-		hint_holder->addChild(popup);
-		popup->centerWithin(hint_holder->getLocalRect());
+		LLHintPopup* popup = new LLHintPopup(p);
+
+		sHints[hint] = popup;
+
+		LLView* hint_holder = gViewerWindow->getHintHolder();
+		if (hint_holder)
+		{
+			hint_holder->addChild(popup);
+			popup->centerWithin(hint_holder->getLocalRect());
+		}
 	}
 }
 
@@ -286,7 +324,7 @@ void LLHints::hide(LLNotificationPtr hint)
 //static
 void LLHints::registerHintTarget(const std::string& name, LLHandle<LLView> target)
 {
-	sTargetRegistry.defaultRegistrar().add(name, target);
+	sTargetRegistry.defaultRegistrar().replace(name, target);
 }
 
 //static 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 60b0b1e8dc..47bb0fe45b 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6402,6 +6402,7 @@ Mute everyone?
   label="Chat"
   type="hint">
     To join the conversation, type into the chat field below.
+    <unique/>
   </notification>
 
   <notification
@@ -6409,21 +6410,23 @@ Mute everyone?
   label="Stand"
   type="hint">
     To stand up and exit the sitting position, click the Stand button.
+    <unique/>
   </notification>
-  
+
   <notification
   name="HintDestinationGuide"
   label="Explore the World"
   type="hint">
     The Destination Guide contains thousands of new places to discover. Select a location and choose Teleport to start exploring.
+    <unique/>
   </notification>
-  
+
   <notification
     name="HintSidePanel"
     label="Side Panel"
     type="hint">
     Get quick access to your inventory, outfits, profiles and more in the side panel.
-    <!--<unique/>-->
+    <unique/>
   </notification>
 
   <notification
@@ -6431,7 +6434,7 @@ Mute everyone?
   label="Move"
   type="hint">
     To walk or run, open the Move Panel and use the directional arrows to navigate. You can also use the directional keys on your keyboard.
-    <!--<unique/>-->
+    <unique/>
   </notification>
 
   <notification
@@ -6439,6 +6442,7 @@ Mute everyone?
   label="Inventory"
   type="hint">
     Check your inventory to find items. Newest items can be easily found in the Recent tab.
+    <unique/>
   </notification>
 
   <notification
@@ -6446,6 +6450,7 @@ Mute everyone?
   label="You've got Linden Dollars!"
   type="hint">
     Here's your current balance of L$. Click Buy L$ to purchase more Linden Dollars.
+    <unique/>
   </notification>
 
   <global name="UnsupportedCPU">
diff --git a/indra/newview/skins/default/xui/en/panel_hint.xml b/indra/newview/skins/default/xui/en/panel_hint.xml
index 54ea08e5d4..839dbc58f2 100644
--- a/indra/newview/skins/default/xui/en/panel_hint.xml
+++ b/indra/newview/skins/default/xui/en/panel_hint.xml
@@ -1,12 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
- name="hint"
  width="205"
- height="100"
- background_opaque="true"
- background_visible="true"
- layout="topleft" 
- bg_opaque_image="hint_background">
+ height="100">
   <text name="hint_title"
         font="SansSerifMedium" 
         left="8"
@@ -20,7 +15,7 @@
         left="8"
         right="197"
         top="26"
-        bottom="90"
+        bottom="92"
         follows="all" 
         text_color="White"
         wrap="true"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/hint_popup.xml b/indra/newview/skins/default/xui/en/widgets/hint_popup.xml
new file mode 100644
index 0000000000..fbd92f982e
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/widgets/hint_popup.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<hint_popup
+ name="hint"
+ background_opaque="true"
+ background_visible="true"
+ layout="topleft"
+ bg_opaque_image="hint_background"
+ distance="24"
+ left_arrow="hint_arrow_left"
+ up_arrow="hint_arrow_up" 
+ right_arrow="hint_arrow_right"
+ down_arrow="hint_arrow_down"
+ left_arrow_offset="3"
+ up_arrow_offset="-2"
+ right_arrow_offset="-3"
+ down_arrow_offset="5"
+ fade_in_time="0.2"
+ fade_out_time="0.3">
+</hint_popup>
-- 
cgit v1.2.3


From d06500eaddd12f09189b47abfdd6990a652f8b51 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Mon, 16 Aug 2010 15:02:24 -0700
Subject: fixed EOL

---
 indra/llui/llpanel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index bfca0bd45e..f79429e0f6 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -1051,4 +1051,4 @@ LLPanel* LLPanel::createFactoryPanel(const std::string& name)
 	}
 	LLPanel::Params panel_p;
 	return LLUICtrlFactory::create<LLPanel>(panel_p);
-}
\ No newline at end of file
+}
-- 
cgit v1.2.3


From 7dce65a5db84988b2cab3d9c977a86c08124701c Mon Sep 17 00:00:00 2001
From: Richard Nelson <richard@lindenlab.com>
Date: Mon, 16 Aug 2010 15:36:56 -0700
Subject: fix for gcc

---
 indra/llui/lluictrlfactory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index c4d3aa38d8..0b0a235f8f 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -247,7 +247,7 @@ fail:
 	template<class T>
 	static T* getDefaultWidget(const std::string& name)
 	{
-		T::Params widget_params;
+		typename T::Params widget_params;
 		widget_params.name = name;
 		return create<T>(widget_params);
 	}
-- 
cgit v1.2.3


From 124bc854dd7c3dffc044f306cf836a5d6c68bd2e Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Mon, 16 Aug 2010 17:44:23 -0700
Subject: moved buildFloater out of lluictrlfactory to llfloater.cpp

---
 indra/llui/llfloater.cpp                        | 63 +++++++++++++++++++++++
 indra/llui/llfloater.h                          |  1 +
 indra/llui/llfloaterreg.cpp                     |  2 +-
 indra/llui/llpanel.h                            |  4 +-
 indra/llui/lluictrlfactory.cpp                  | 66 +------------------------
 indra/llui/lluictrlfactory.h                    |  3 --
 indra/llui/llview.h                             | 32 ++++++------
 indra/newview/llcompilequeue.cpp                |  1 -
 indra/newview/llfloaterabout.cpp                |  1 -
 indra/newview/llfloaterauction.cpp              |  1 -
 indra/newview/llfloateravatarpicker.cpp         |  1 -
 indra/newview/llfloateravatartextures.cpp       |  1 -
 indra/newview/llfloaterbeacons.cpp              |  2 -
 indra/newview/llfloaterbuildoptions.cpp         |  1 -
 indra/newview/llfloaterbulkpermission.cpp       |  1 -
 indra/newview/llfloaterbump.cpp                 |  1 -
 indra/newview/llfloaterbuy.cpp                  |  1 -
 indra/newview/llfloaterbuycontents.cpp          |  1 -
 indra/newview/llfloaterbuyland.cpp              |  3 +-
 indra/newview/llfloatercolorpicker.cpp          |  3 --
 indra/newview/llfloaterdaycycle.cpp             |  1 -
 indra/newview/llfloaterenvsettings.cpp          |  1 -
 indra/newview/llfloatergodtools.cpp             |  2 -
 indra/newview/llfloaterhardwaresettings.cpp     |  1 -
 indra/newview/llfloaterhud.cpp                  |  2 -
 indra/newview/llfloaterinspect.cpp              |  1 -
 indra/newview/llfloaterjoystick.cpp             |  2 -
 indra/newview/llfloaterlagmeter.cpp             |  1 -
 indra/newview/llfloaterland.cpp                 |  2 -
 indra/newview/llfloaterlandholdings.cpp         |  1 -
 indra/newview/llfloatermap.cpp                  |  1 -
 indra/newview/llfloatermediabrowser.cpp         |  2 -
 indra/newview/llfloaternotificationsconsole.cpp |  3 --
 indra/newview/llfloateropenobject.cpp           |  1 -
 indra/newview/llfloaterperms.cpp                |  1 -
 indra/newview/llfloaterpostcard.cpp             |  1 -
 indra/newview/llfloaterpostprocess.cpp          |  1 -
 indra/newview/llfloaterpreference.cpp           |  1 -
 indra/newview/llfloaterproperties.cpp           |  2 -
 indra/newview/llfloaterregioninfo.cpp           |  1 -
 indra/newview/llfloaterreporter.cpp             |  1 -
 indra/newview/llfloaterscriptdebug.cpp          |  4 --
 indra/newview/llfloatersettingsdebug.cpp        |  1 -
 indra/newview/llfloatersnapshot.cpp             |  1 -
 indra/newview/llfloatertelehub.cpp              |  1 -
 indra/newview/llfloatertools.cpp                |  1 -
 indra/newview/llfloatertopobjects.cpp           |  1 -
 indra/newview/llfloateruipreview.cpp            |  5 +-
 indra/newview/llfloaterurlentry.cpp             |  2 +-
 indra/newview/llfloatervoicedevicesettings.cpp  |  1 -
 indra/newview/llfloaterwater.cpp                |  1 -
 indra/newview/llfloaterwhitelistentry.cpp       |  1 -
 indra/newview/llfloaterwindlight.cpp            |  1 -
 indra/newview/llfloaterwindowsize.cpp           |  1 -
 indra/newview/llfloaterworldmap.cpp             |  1 -
 indra/newview/llpanelmaininventory.cpp          |  1 -
 indra/newview/llpanelmaininventory.h            |  1 +
 indra/newview/llpreviewanim.cpp                 |  1 -
 indra/newview/llpreviewgesture.cpp              |  3 --
 indra/newview/llpreviewnotecard.cpp             |  1 -
 indra/newview/llpreviewscript.cpp               |  6 +--
 indra/newview/llpreviewsound.cpp                |  1 -
 indra/newview/llpreviewtexture.cpp              |  1 -
 indra/newview/llsidepaneliteminfo.cpp           |  2 -
 indra/newview/lltexturectrl.cpp                 |  1 -
 indra/newview/lltoast.cpp                       |  2 +-
 indra/newview/llviewermenu.cpp                  |  2 +-
 67 files changed, 93 insertions(+), 169 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 838f93d3f9..d66b3c1707 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -42,6 +42,7 @@
 #include "lluictrlfactory.h"
 #include "llbutton.h"
 #include "llcheckboxctrl.h"
+#include "lldir.h"
 #include "lldraghandle.h"
 #include "llfloaterreg.h"
 #include "llfocusmgr.h"
@@ -2883,3 +2884,65 @@ bool LLFloater::isVisible(const LLFloater* floater)
 {
     return floater && floater->getVisible();
 }
+
+static LLFastTimer::DeclareTimer FTM_BUILD_FLOATERS("Build Floaters");
+
+/* static */
+bool LLFloater::buildFloater(LLFloater* floaterp, const std::string& filename, LLXMLNodePtr output_node)
+{
+	LLFastTimer timer(FTM_BUILD_FLOATERS);
+	LLXMLNodePtr root;
+
+	//if exporting, only load the language being exported, 
+	//instead of layering localized version on top of english
+	if (output_node)
+	{
+		if (!LLUICtrlFactory::getLocalizedXMLNode(filename, root))
+		{
+			llwarns << "Couldn't parse floater from: " << LLUI::getLocalizedSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl;
+			return false;
+		}
+	}
+	else if (!LLUICtrlFactory::getLayeredXMLNode(filename, root))
+	{
+		llwarns << "Couldn't parse floater from: " << LLUI::getSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl;
+		return false;
+	}
+	
+	// root must be called floater
+	if( !(root->hasName("floater") || root->hasName("multi_floater")) )
+	{
+		llwarns << "Root node should be named floater in: " << filename << llendl;
+		return false;
+	}
+	
+	bool res = true;
+	
+	lldebugs << "Building floater " << filename << llendl;
+	LLUICtrlFactory::instance().pushFileName(filename);
+	{
+		if (!floaterp->getFactoryMap().empty())
+		{
+			LLPanel::sFactoryStack.push_front(&floaterp->getFactoryMap());
+		}
+
+		 // for local registry callbacks; define in constructor, referenced in XUI or postBuild
+		floaterp->getCommitCallbackRegistrar().pushScope();
+		floaterp->getEnableCallbackRegistrar().pushScope();
+		
+		res = floaterp->initFloaterXML(root, floaterp->getParent(), filename, output_node);
+
+		floaterp->setXMLFilename(filename);
+		
+		floaterp->getCommitCallbackRegistrar().popScope();
+		floaterp->getEnableCallbackRegistrar().popScope();
+		
+		if (!floaterp->getFactoryMap().empty())
+		{
+			LLPanel::sFactoryStack.pop_front();
+		}
+	}
+	LLUICtrlFactory::instance().popFileName();
+	
+	return res;
+}
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index e7d365238b..69762c7723 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -147,6 +147,7 @@ public:
 
 	// Don't export top/left for rect, only height/width
 	static void setupParamsForExport(Params& p, LLView* parent);
+	static bool buildFloater(LLFloater* floaterp, const std::string &filename, LLXMLNodePtr output_node);
 
 	void initFromParams(const LLFloater::Params& p);
 	bool initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node = NULL);
diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp
index 85f9af126c..2c31854011 100644
--- a/indra/llui/llfloaterreg.cpp
+++ b/indra/llui/llfloaterreg.cpp
@@ -127,7 +127,7 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key)
 
 				res = build_func(key);
 				
-				bool success = LLUICtrlFactory::getInstance()->buildFloater(res, xui_file, NULL);
+				bool success = LLFloater::buildFloater(res, xui_file, NULL);
 				if (!success)
 				{
 					llwarns << "Failed to build floater type: '" << name << "'." << llendl;
diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h
index 6fc8ca204f..de16d28e27 100644
--- a/indra/llui/llpanel.h
+++ b/indra/llui/llpanel.h
@@ -265,6 +265,8 @@ protected:
 	commit_signal_t* mVisibleSignal;		// Called when visibility changes, passes new visibility as LLSD()
 
 	std::string		mHelpTopic;         // the name of this panel's help topic to display in the Help Viewer
+	typedef std::deque<const LLCallbackMap::map_t*> factory_stack_t;
+	static factory_stack_t	sFactoryStack;
 	
 private:
 	BOOL			mBgVisible;				// any background at all?
@@ -286,8 +288,6 @@ private:
 	// for setting the xml filename when building panel in context dependent cases
 	std::string		mXMLFilename;
 
-	typedef std::deque<const LLCallbackMap::map_t*> factory_stack_t;
-	static factory_stack_t	sFactoryStack;
 }; // end class LLPanel
 
 // Build time optimization, generate once in .cpp file
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index 913c8bdb7d..ee700ee6eb 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -48,7 +48,7 @@
 #include "llquaternion.h"
 
 // this library includes
-#include "llfloater.h"
+#include "llpanel.h"
 
 LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION("Widget Construction");
 LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS("Widget InitFromParams");
@@ -178,70 +178,6 @@ bool LLUICtrlFactory::getLocalizedXMLNode(const std::string &xui_filename, LLXML
 	}
 }
 
-static LLFastTimer::DeclareTimer FTM_BUILD_FLOATERS("Build Floaters");
-
-//-----------------------------------------------------------------------------
-// buildFloater()
-//-----------------------------------------------------------------------------
-bool LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filename, LLXMLNodePtr output_node)
-{
-	LLFastTimer timer(FTM_BUILD_FLOATERS);
-	LLXMLNodePtr root;
-
-	//if exporting, only load the language being exported, 
-	//instead of layering localized version on top of english
-	if (output_node)
-	{
-		if (!LLUICtrlFactory::getLocalizedXMLNode(filename, root))
-		{
-			llwarns << "Couldn't parse floater from: " << LLUI::getLocalizedSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl;
-			return false;
-		}
-	}
-	else if (!LLUICtrlFactory::getLayeredXMLNode(filename, root))
-	{
-		llwarns << "Couldn't parse floater from: " << LLUI::getSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl;
-		return false;
-	}
-	
-	// root must be called floater
-	if( !(root->hasName("floater") || root->hasName("multi_floater")) )
-	{
-		llwarns << "Root node should be named floater in: " << filename << llendl;
-		return false;
-	}
-	
-	bool res = true;
-	
-	lldebugs << "Building floater " << filename << llendl;
-	pushFileName(filename);
-	{
-		if (!floaterp->getFactoryMap().empty())
-		{
-			LLPanel::sFactoryStack.push_front(&floaterp->getFactoryMap());
-		}
-
-		 // for local registry callbacks; define in constructor, referenced in XUI or postBuild
-		floaterp->getCommitCallbackRegistrar().pushScope();
-		floaterp->getEnableCallbackRegistrar().pushScope();
-		
-		res = floaterp->initFloaterXML(root, floaterp->getParent(), filename, output_node);
-
-		floaterp->setXMLFilename(filename);
-		
-		floaterp->getCommitCallbackRegistrar().popScope();
-		floaterp->getEnableCallbackRegistrar().popScope();
-		
-		if (!floaterp->getFactoryMap().empty())
-		{
-			LLPanel::sFactoryStack.pop_front();
-		}
-	}
-	popFileName();
-	
-	return res;
-}
-
 //-----------------------------------------------------------------------------
 // saveToXML()
 //-----------------------------------------------------------------------------
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index c4d3aa38d8..47f1ba465a 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -38,7 +38,6 @@
 #include "llregistry.h"
 #include "llxuiparser.h"
 
-class LLFloater;
 class LLView;
 
 // sort functor for typeid maps
@@ -147,8 +146,6 @@ public:
 		return ParamDefaults<typename T::Params, 0>::instance().get();
 	}
 
-	bool buildFloater(LLFloater* floaterp, const std::string &filename, LLXMLNodePtr output_node);
-
 	// Does what you want for LLFloaters and LLPanels
 	// Returns 0 on success
 	S32 saveToXML(LLView* viewp, const std::string& filename);
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 37f5232f91..0f796fb408 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -134,26 +134,26 @@ public:
 
 		Optional<std::string>		layout;
 		Optional<LLRect>			rect;
+
 		// Historical bottom-left layout used bottom_delta and left_delta
 		// for relative positioning.  New layout "topleft" prefers specifying
 		// based on top edge.
-		Optional<S32>				bottom_delta,	// deprecated
-									top_pad,	// from last bottom to my top
-									top_delta,	// from last top to my top
-									left_pad,	// from last right to my left
-									left_delta;	// from last left to my left
-								
-		// these are nested attributes for LLLayoutPanel
+		Optional<S32>				bottom_delta,	// from last bottom to my bottom
+									top_pad,		// from last bottom to my top
+									top_delta,		// from last top to my top
+									left_pad,		// from last right to my left
+									left_delta;		// from last left to my left
+
 		//FIXME: get parent context involved in parsing traversal
-		Ignored						user_resize,
-									auto_resize,
-									needs_translate,
-									min_width,
-									max_width,
-									xmlns,
-									xmlns_xsi,
-									xsi_schemaLocation,
-									xsi_type;
+		Ignored						user_resize,		// nested attribute for LLLayoutPanel
+									auto_resize,		// nested attribute for LLLayoutPanel
+									needs_translate,	// cue for translation tools
+									min_width,			// nested attribute for LLLayoutPanel
+									max_width,			// nested attribute for LLLayoutPanel
+									xmlns,				// xml namespace
+									xmlns_xsi,			// xml namespace
+									xsi_schemaLocation,	// xml schema
+									xsi_type;			// xml schema type
 
 		Params();
 	};
diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp
index e91bf33502..78544ac144 100644
--- a/indra/newview/llcompilequeue.cpp
+++ b/indra/newview/llcompilequeue.cpp
@@ -95,7 +95,6 @@ LLFloaterScriptQueue::LLFloaterScriptQueue(const LLSD& key) :
 	mDone(false),
 	mMono(false)
 {
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_script_queue.xml", FALSE);
 }
 
 // Destroys the object
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index 4bd3151f2e..d122d8780f 100644
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -100,7 +100,6 @@ public:
 LLFloaterAbout::LLFloaterAbout(const LLSD& key) 
 :	LLFloater(key)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about.xml");
 	
 }
 
diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp
index b0265e6cd2..837d956c6f 100644
--- a/indra/newview/llfloaterauction.cpp
+++ b/indra/newview/llfloaterauction.cpp
@@ -80,7 +80,6 @@ LLFloaterAuction::LLFloaterAuction(const LLSD& key)
   : LLFloater(key),
 	mParcelID(-1)
 {
-//	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_auction.xml");
 	mCommitCallbackRegistrar.add("ClickSnapshot",	boost::bind(&LLFloaterAuction::onClickSnapshot, this));
 	mCommitCallbackRegistrar.add("ClickSellToAnyone",		boost::bind(&LLFloaterAuction::onClickSellToAnyone, this));
 	mCommitCallbackRegistrar.add("ClickStartAuction",		boost::bind(&LLFloaterAuction::onClickStartAuction, this));
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index 7dbf6ebd5b..01e59bb190 100644
--- a/indra/newview/llfloateravatarpicker.cpp
+++ b/indra/newview/llfloateravatarpicker.cpp
@@ -85,7 +85,6 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key)
 	mNearMeListComplete(FALSE),
 	mCloseOnSelect(FALSE)
 {
-// 	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_picker.xml");
 	mCommitCallbackRegistrar.add("Refresh.FriendList", boost::bind(&LLFloaterAvatarPicker::populateFriend, this));
 }
 
diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp
index 847462a6c3..efc020aa2a 100644
--- a/indra/newview/llfloateravatartextures.cpp
+++ b/indra/newview/llfloateravatartextures.cpp
@@ -46,7 +46,6 @@ LLFloaterAvatarTextures::LLFloaterAvatarTextures(const LLSD& id)
   : LLFloater(id),
 	mID(id.asUUID())
 {
-// 	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_textures.xml");
 }
 
 LLFloaterAvatarTextures::~LLFloaterAvatarTextures()
diff --git a/indra/newview/llfloaterbeacons.cpp b/indra/newview/llfloaterbeacons.cpp
index 975c888a2b..3058eacd48 100644
--- a/indra/newview/llfloaterbeacons.cpp
+++ b/indra/newview/llfloaterbeacons.cpp
@@ -42,8 +42,6 @@
 LLFloaterBeacons::LLFloaterBeacons(const LLSD& seed)
 :	LLFloater(seed)
 {
-//	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_beacons.xml");
-
 	// Initialize pipeline states from saved settings.
 	// OK to do at floater constructor time because beacons do not display unless the floater is open
 	// therefore it is OK to not initialize the pipeline state before needed.
diff --git a/indra/newview/llfloaterbuildoptions.cpp b/indra/newview/llfloaterbuildoptions.cpp
index 30e9428df9..e59693aa92 100644
--- a/indra/newview/llfloaterbuildoptions.cpp
+++ b/indra/newview/llfloaterbuildoptions.cpp
@@ -46,7 +46,6 @@
 LLFloaterBuildOptions::LLFloaterBuildOptions(const LLSD& key)
   : LLFloater(key)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_build_options.xml");
 }
 
 LLFloaterBuildOptions::~LLFloaterBuildOptions()
diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp
index 766fc0723c..d2138bcb3c 100644
--- a/indra/newview/llfloaterbulkpermission.cpp
+++ b/indra/newview/llfloaterbulkpermission.cpp
@@ -63,7 +63,6 @@ LLFloaterBulkPermission::LLFloaterBulkPermission(const LLSD& seed)
 	mDone(FALSE)
 {
 	mID.generate();
-//	LLUICtrlFactory::getInstance()->buildFloater(this,"floater_bulk_perms.xml");
 	mCommitCallbackRegistrar.add("BulkPermission.Apply",	boost::bind(&LLFloaterBulkPermission::onApplyBtn, this));
 	mCommitCallbackRegistrar.add("BulkPermission.Close",	boost::bind(&LLFloaterBulkPermission::onCloseBtn, this));
 	mCommitCallbackRegistrar.add("BulkPermission.CheckAll",	boost::bind(&LLFloaterBulkPermission::onCheckAll, this));
diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp
index e925796526..c9275ce8cc 100644
--- a/indra/newview/llfloaterbump.cpp
+++ b/indra/newview/llfloaterbump.cpp
@@ -51,7 +51,6 @@ LLFloaterBump::LLFloaterBump(const LLSD& key)
 :	LLFloater(key)
 {
 	if(gNoRender) return;
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_bumps.xml");
 }
 
 
diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp
index eee4310ec7..4493e723bc 100644
--- a/indra/newview/llfloaterbuy.cpp
+++ b/indra/newview/llfloaterbuy.cpp
@@ -57,7 +57,6 @@
 LLFloaterBuy::LLFloaterBuy(const LLSD& key)
 :	LLFloater(key)
 {
-// 	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_buy_object.xml");
 }
 
 BOOL LLFloaterBuy::postBuild()
diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp
index 76ec5da303..3cdd7b801b 100644
--- a/indra/newview/llfloaterbuycontents.cpp
+++ b/indra/newview/llfloaterbuycontents.cpp
@@ -60,7 +60,6 @@
 LLFloaterBuyContents::LLFloaterBuyContents(const LLSD& key)
 :	LLFloater(key)
 {
-// 	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_buy_contents.xml");
 }
 
 BOOL LLFloaterBuyContents::postBuild()
diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp
index 455cce5e56..78b0f73887 100644
--- a/indra/newview/llfloaterbuyland.cpp
+++ b/indra/newview/llfloaterbuyland.cpp
@@ -299,8 +299,7 @@ LLFloaterBuyLandUI::LLFloaterBuyLandUI(const LLSD& key)
 	mParcelBuyInfo(0)
 {
 	LLViewerParcelMgr::getInstance()->addObserver(&mParcelSelectionObserver);
-	
-// 	LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_buy_land.xml");
+
 }
 
 LLFloaterBuyLandUI::~LLFloaterBuyLandUI()
diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp
index 6922c515cd..0887c0353d 100644
--- a/indra/newview/llfloatercolorpicker.cpp
+++ b/indra/newview/llfloatercolorpicker.cpp
@@ -113,9 +113,6 @@ LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show
 	  mCanApplyImmediately	( show_apply_immediate ),
 	  mContextConeOpacity	( 0.f )
 {
-	// build the majority of the gui using the factory builder
-	LLUICtrlFactory::getInstance()->buildFloater ( this, "floater_color_picker.xml", NULL );
-	
 	// create user interface for this picker
 	createUI ();
 
diff --git a/indra/newview/llfloaterdaycycle.cpp b/indra/newview/llfloaterdaycycle.cpp
index 50ea2765e7..182a108275 100644
--- a/indra/newview/llfloaterdaycycle.cpp
+++ b/indra/newview/llfloaterdaycycle.cpp
@@ -65,7 +65,6 @@ const F32 LLFloaterDayCycle::sHoursPerDay = 24.0f;
 LLFloaterDayCycle::LLFloaterDayCycle(const LLSD& key)	
 : LLFloater(key)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_day_cycle_options.xml");
 }
 
 BOOL LLFloaterDayCycle::postBuild()
diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp
index eb344b91d3..c05ec0ba2c 100644
--- a/indra/newview/llfloaterenvsettings.cpp
+++ b/indra/newview/llfloaterenvsettings.cpp
@@ -56,7 +56,6 @@
 LLFloaterEnvSettings::LLFloaterEnvSettings(const LLSD& key)
   : LLFloater(key)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_env_settings.xml");
 }
 // virtual
 LLFloaterEnvSettings::~LLFloaterEnvSettings()
diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp
index 61f5098af1..f60aaf3541 100644
--- a/indra/newview/llfloatergodtools.cpp
+++ b/indra/newview/llfloatergodtools.cpp
@@ -127,8 +127,6 @@ LLFloaterGodTools::LLFloaterGodTools(const LLSD& key)
 	mFactoryMap["region"] = LLCallbackMap(createPanelRegion, this);
 	mFactoryMap["objects"] = LLCallbackMap(createPanelObjects, this);
 	mFactoryMap["request"] = LLCallbackMap(createPanelRequest, this);
-//	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_god_tools.xml");
-
 }
 
 BOOL LLFloaterGodTools::postBuild()
diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp
index a97e00122a..be033de15f 100644
--- a/indra/newview/llfloaterhardwaresettings.cpp
+++ b/indra/newview/llfloaterhardwaresettings.cpp
@@ -62,7 +62,6 @@ LLFloaterHardwareSettings::LLFloaterHardwareSettings(const LLSD& key)
 	  mFogRatio(0.0),
 	  mProbeHardwareOnStartup(FALSE)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hardware_settings.xml");
 }
 
 LLFloaterHardwareSettings::~LLFloaterHardwareSettings()
diff --git a/indra/newview/llfloaterhud.cpp b/indra/newview/llfloaterhud.cpp
index 930bbe9e6b..ba8e99cb7e 100644
--- a/indra/newview/llfloaterhud.cpp
+++ b/indra/newview/llfloaterhud.cpp
@@ -60,8 +60,6 @@ LLFloaterHUD::LLFloaterHUD(const LLSD& key)
 		return;
 	}
 	
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hud.xml");
-	
 	// Don't grab the focus as it will impede performing in-world actions
 	// while using the HUD
 	setIsChrome(TRUE);
diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp
index 4d4681a68d..93d4a8766a 100644
--- a/indra/newview/llfloaterinspect.cpp
+++ b/indra/newview/llfloaterinspect.cpp
@@ -53,7 +53,6 @@ LLFloaterInspect::LLFloaterInspect(const LLSD& key)
   : LLFloater(key),
 	mDirty(FALSE)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inspect.xml");
 	mCommitCallbackRegistrar.add("Inspect.OwnerProfile",	boost::bind(&LLFloaterInspect::onClickOwnerProfile, this));
 	mCommitCallbackRegistrar.add("Inspect.CreatorProfile",	boost::bind(&LLFloaterInspect::onClickCreatorProfile, this));
 	mCommitCallbackRegistrar.add("Inspect.SelectObject",	boost::bind(&LLFloaterInspect::onSelectObject, this));
diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp
index 9c7957603e..9fa8006b7f 100644
--- a/indra/newview/llfloaterjoystick.cpp
+++ b/indra/newview/llfloaterjoystick.cpp
@@ -50,8 +50,6 @@
 LLFloaterJoystick::LLFloaterJoystick(const LLSD& data)
 	: LLFloater(data)
 {
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_joystick.xml");
-
 	initFromSettings();
 }
 
diff --git a/indra/newview/llfloaterlagmeter.cpp b/indra/newview/llfloaterlagmeter.cpp
index 9a2c34b40f..0cdf3be8c0 100644
--- a/indra/newview/llfloaterlagmeter.cpp
+++ b/indra/newview/llfloaterlagmeter.cpp
@@ -53,7 +53,6 @@ const std::string LAG_GOOD_IMAGE_NAME     = "lag_status_good.tga";
 LLFloaterLagMeter::LLFloaterLagMeter(const LLSD& key)
 	:	LLFloater(key)
 {
-//	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_lagmeter.xml");
 	mCommitCallbackRegistrar.add("LagMeter.ClickShrink",  boost::bind(&LLFloaterLagMeter::onClickShrink, this));	
 }
 
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 19e28720ae..a1692d2b76 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -254,8 +254,6 @@ LLFloaterLand::LLFloaterLand(const LLSD& seed)
 	mFactoryMap["land_media_panel"] =	LLCallbackMap(createPanelLandMedia, this);
 	mFactoryMap["land_access_panel"] =	LLCallbackMap(createPanelLandAccess, this);
 
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about_land.xml", false);
-
 	sObserver = new LLParcelSelectionObserver();
 	LLViewerParcelMgr::getInstance()->addObserver( sObserver );
 }
diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp
index 12d27b8790..4ca851b8d2 100644
--- a/indra/newview/llfloaterlandholdings.cpp
+++ b/indra/newview/llfloaterlandholdings.cpp
@@ -66,7 +66,6 @@ LLFloaterLandHoldings::LLFloaterLandHoldings(const LLSD& key)
 	mSortColumn(""),
 	mSortAscending(TRUE)
 {
-// 	LLUICtrlFactory::getInstance()->buildFloater(floater, "floater_land_holdings.xml");
 }
 
 BOOL LLFloaterLandHoldings::postBuild()
diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp
index df176a1f6d..94aee4ea7d 100644
--- a/indra/newview/llfloatermap.cpp
+++ b/indra/newview/llfloatermap.cpp
@@ -75,7 +75,6 @@ LLFloaterMap::LLFloaterMap(const LLSD& key)
 	  mTextBoxSouthWest(NULL),
 	  mMap(NULL)
 {
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_map.xml", FALSE);
 }
 
 LLFloaterMap::~LLFloaterMap()
diff --git a/indra/newview/llfloatermediabrowser.cpp b/indra/newview/llfloatermediabrowser.cpp
index 90147ff650..ad996b5dc8 100644
--- a/indra/newview/llfloatermediabrowser.cpp
+++ b/indra/newview/llfloatermediabrowser.cpp
@@ -59,8 +59,6 @@
 LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& key)
 	: LLFloater(key)
 {
-//	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_media_browser.xml");
-
 }
 
 //static 
diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp
index 9e3422c2b2..b7bca5c6cd 100644
--- a/indra/newview/llfloaternotificationsconsole.cpp
+++ b/indra/newview/llfloaternotificationsconsole.cpp
@@ -173,8 +173,6 @@ LLFloaterNotificationConsole::LLFloaterNotificationConsole(const LLSD& key)
 : LLFloater(key)
 {
 	mCommitCallbackRegistrar.add("ClickAdd",     boost::bind(&LLFloaterNotificationConsole::onClickAdd, this));	
-
-	//LLUICtrlFactory::instance().buildFloater(this, "floater_notifications_console.xml");
 }
 
 BOOL LLFloaterNotificationConsole::postBuild()
@@ -254,7 +252,6 @@ LLFloaterNotification::LLFloaterNotification(LLNotification* note)
 :	LLFloater(LLSD()),
 	mNote(note)
 {
-	LLUICtrlFactory::instance().buildFloater(this, "floater_notification.xml", NULL);
 }
 
 BOOL LLFloaterNotification::postBuild()
diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp
index a2a3d300e7..d1c6ddb5b3 100644
--- a/indra/newview/llfloateropenobject.cpp
+++ b/indra/newview/llfloateropenobject.cpp
@@ -62,7 +62,6 @@ LLFloaterOpenObject::LLFloaterOpenObject(const LLSD& key)
 	mPanelInventoryObject(NULL),
 	mDirty(TRUE)
 {
-//	LLUICtrlFactory::getInstance()->buildFloater(this,"floater_openobject.xml");
 	mCommitCallbackRegistrar.add("OpenObject.MoveToInventory",	boost::bind(&LLFloaterOpenObject::onClickMoveToInventory, this));
 	mCommitCallbackRegistrar.add("OpenObject.MoveAndWear",		boost::bind(&LLFloaterOpenObject::onClickMoveAndWear, this));
 }
diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp
index 7edc27d4c3..a6188af871 100644
--- a/indra/newview/llfloaterperms.cpp
+++ b/indra/newview/llfloaterperms.cpp
@@ -43,7 +43,6 @@
 LLFloaterPerms::LLFloaterPerms(const LLSD& seed)
 : LLFloater(seed)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_perm_prefs.xml");
 	mCommitCallbackRegistrar.add("Perms.Copy",	boost::bind(&LLFloaterPerms::onCommitCopy, this));
 	mCommitCallbackRegistrar.add("Perms.OK",	boost::bind(&LLFloaterPerms::onClickOK, this));
 	mCommitCallbackRegistrar.add("Perms.Cancel",	boost::bind(&LLFloaterPerms::onClickCancel, this));
diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp
index dc4553ef96..99b0c8567d 100644
--- a/indra/newview/llfloaterpostcard.cpp
+++ b/indra/newview/llfloaterpostcard.cpp
@@ -82,7 +82,6 @@ LLFloaterPostcard::LLFloaterPostcard(const LLSD& key)
 	mViewerImage(NULL),
 	mHasFirstMsgFocus(false)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_postcard.xml");
 }
 
 // Destroys the object
diff --git a/indra/newview/llfloaterpostprocess.cpp b/indra/newview/llfloaterpostprocess.cpp
index 06c0a94afa..c6050b4832 100644
--- a/indra/newview/llfloaterpostprocess.cpp
+++ b/indra/newview/llfloaterpostprocess.cpp
@@ -48,7 +48,6 @@
 LLFloaterPostProcess::LLFloaterPostProcess(const LLSD& key)
   : LLFloater(key)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_post_process.xml");
 }
 
 LLFloaterPostProcess::~LLFloaterPostProcess()
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index a4b45e04f2..d1bae173f4 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -137,7 +137,6 @@ LLVoiceSetKeyDialog::LLVoiceSetKeyDialog(const LLSD& key)
   : LLModalDialog(key),
 	mParent(NULL)
 {
-// 	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_select_key.xml", NULL);
 }
 
 //virtual
diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp
index b6a98bdada..c577541c66 100644
--- a/indra/newview/llfloaterproperties.cpp
+++ b/indra/newview/llfloaterproperties.cpp
@@ -114,8 +114,6 @@ LLFloaterProperties::LLFloaterProperties(const LLUUID& item_id)
 	mDirty(TRUE)
 {
 	mPropertiesObserver = new LLPropertiesObserver(this);
-	
-	//LLUICtrlFactory::getInstance()->buildFloater(this,"floater_inventory_item_properties.xml");
 }
 
 // Destroys the object
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index a8af80b952..b61d90043e 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -167,7 +167,6 @@ LLUUID LLFloaterRegionInfo::sRequestInvoice;
 LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed)
 	: LLFloater(seed)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_info.xml", FALSE);
 }
 
 BOOL LLFloaterRegionInfo::postBuild()
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp
index 230d4be85b..196bf2d5f2 100644
--- a/indra/newview/llfloaterreporter.cpp
+++ b/indra/newview/llfloaterreporter.cpp
@@ -109,7 +109,6 @@ LLFloaterReporter::LLFloaterReporter(const LLSD& key)
 	mCopyrightWarningSeen( FALSE ),
 	mResourceDatap(new LLResourceData())
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_abuse.xml");
 }
 
 // static
diff --git a/indra/newview/llfloaterscriptdebug.cpp b/indra/newview/llfloaterscriptdebug.cpp
index 4a82f3a11c..ad11a3ac5f 100644
--- a/indra/newview/llfloaterscriptdebug.cpp
+++ b/indra/newview/llfloaterscriptdebug.cpp
@@ -58,8 +58,6 @@
 LLFloaterScriptDebug::LLFloaterScriptDebug(const LLSD& key)
   : LLMultiFloater(key)
 {
-// 	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_script_debug.xml");
-	
 	// avoid resizing of the window to match 
 	// the initial size of the tabbed-childs, whenever a tab is opened or closed
 	mAutoResize = FALSE;
@@ -147,8 +145,6 @@ LLFloaterScriptDebugOutput::LLFloaterScriptDebugOutput(const LLSD& object_id)
   : LLFloater(LLSD(object_id)),
 	mObjectID(object_id.asUUID())
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_script_debug_panel.xml");
-	
 	// enabled autocous blocks controling focus via  LLFloaterReg::showInstance
 	setAutoFocus(FALSE);
 }
diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp
index 77e0e4e677..fde84607fe 100644
--- a/indra/newview/llfloatersettingsdebug.cpp
+++ b/indra/newview/llfloatersettingsdebug.cpp
@@ -45,7 +45,6 @@
 LLFloaterSettingsDebug::LLFloaterSettingsDebug(const LLSD& key) 
 :	LLFloater(key)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_settings_debug.xml");
 	mCommitCallbackRegistrar.add("SettingSelect",	boost::bind(&LLFloaterSettingsDebug::onSettingSelect, this,_1));
 	mCommitCallbackRegistrar.add("CommitSettings",	boost::bind(&LLFloaterSettingsDebug::onCommitSettings, this));
 	mCommitCallbackRegistrar.add("ClickDefault",	boost::bind(&LLFloaterSettingsDebug::onClickDefault, this));
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index e8a89bb705..8a08687bb8 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -2076,7 +2076,6 @@ LLFloaterSnapshot::LLFloaterSnapshot(const LLSD& key)
 	: LLFloater(key),
 	  impl (*(new Impl))
 {
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_snapshot.xml", FALSE);
 }
 
 // Destroys the object
diff --git a/indra/newview/llfloatertelehub.cpp b/indra/newview/llfloatertelehub.cpp
index 6bd1e70f13..f748d737fb 100644
--- a/indra/newview/llfloatertelehub.cpp
+++ b/indra/newview/llfloatertelehub.cpp
@@ -57,7 +57,6 @@ LLFloaterTelehub::LLFloaterTelehub(const LLSD& key)
 	mTelehubRot(),
 	mNumSpawn(0)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_telehub.xml");
 }
 
 BOOL LLFloaterTelehub::postBuild()
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 0988588d9c..173feff786 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -356,7 +356,6 @@ LLFloaterTools::LLFloaterTools(const LLSD& key)
 	mFactoryMap["Contents"] = LLCallbackMap(createPanelContents, this);//LLPanelContents
 	mFactoryMap["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo
 	
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_tools.xml",FALSE);
 	mCommitCallbackRegistrar.add("BuildTool.setTool",			boost::bind(&LLFloaterTools::setTool,this, _2));
 	mCommitCallbackRegistrar.add("BuildTool.commitZoom",		boost::bind(&commit_slider_zoom, _1));
 	mCommitCallbackRegistrar.add("BuildTool.commitRadioFocus",	boost::bind(&commit_radio_group_focus, _1));
diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp
index d80f26657d..37ddd774da 100644
--- a/indra/newview/llfloatertopobjects.cpp
+++ b/indra/newview/llfloatertopobjects.cpp
@@ -70,7 +70,6 @@ void LLFloaterTopObjects::show()
 	}
 
 	sInstance = new LLFloaterTopObjects();
-//	LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_top_objects.xml");
 	sInstance->center();
 }
 */
diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp
index d32f809457..7c2a449343 100644
--- a/indra/newview/llfloateruipreview.cpp
+++ b/indra/newview/llfloateruipreview.cpp
@@ -400,7 +400,6 @@ LLFloaterUIPreview::LLFloaterUIPreview(const LLSD& key)
 	mLastDisplayedX(0),
 	mLastDisplayedY(0)
 {
-	// called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_ui_preview.xml");
 }
 
 // Destructor
@@ -838,7 +837,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)
 		if (save)
 		{
 			LLXMLNodePtr floater_write = new LLXMLNode();			
-			LLUICtrlFactory::getInstance()->buildFloater(*floaterp, path, floater_write);	// just build it
+			buildFloater(*floaterp, path, floater_write);	// just build it
 
 			if (!floater_write->isNull())
 			{
@@ -852,7 +851,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)
 		}
 		else
 		{
-			LLUICtrlFactory::getInstance()->buildFloater(*floaterp, path, NULL);	// just build it
+			buildFloater(*floaterp, path, NULL);	// just build it
 			(*floaterp)->openFloater((*floaterp)->getKey());
 			(*floaterp)->setCanResize((*floaterp)->isResizable());
 		}
diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp
index fa871d84a6..a192cfda3d 100644
--- a/indra/newview/llfloaterurlentry.cpp
+++ b/indra/newview/llfloaterurlentry.cpp
@@ -88,7 +88,7 @@ LLFloaterURLEntry::LLFloaterURLEntry(LLHandle<LLPanel> parent)
 	: LLFloater(LLSD()),
 	  mPanelLandMediaHandle(parent)
 {
-	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_url_entry.xml", NULL);
+	buildFloater(this, "floater_url_entry.xml", NULL);
 }
 
 //-----------------------------------------------------------------------------
diff --git a/indra/newview/llfloatervoicedevicesettings.cpp b/indra/newview/llfloatervoicedevicesettings.cpp
index 036ef32016..af280ea9dc 100644
--- a/indra/newview/llfloatervoicedevicesettings.cpp
+++ b/indra/newview/llfloatervoicedevicesettings.cpp
@@ -338,7 +338,6 @@ LLFloaterVoiceDeviceSettings::LLFloaterVoiceDeviceSettings(const LLSD& seed)
 	mFactoryMap["device_settings"] = LLCallbackMap(createPanelVoiceDeviceSettings, this);
 	// do not automatically open singleton floaters (as result of getInstance())
 //	BOOL no_open = FALSE;
-//	Called from floater reg:  LLUICtrlFactory::getInstance()->buildFloater(this, "floater_device_settings.xml", no_open);	
 }
 BOOL LLFloaterVoiceDeviceSettings::postBuild()
 {
diff --git a/indra/newview/llfloaterwater.cpp b/indra/newview/llfloaterwater.cpp
index 0f0d85cacb..af15b89044 100644
--- a/indra/newview/llfloaterwater.cpp
+++ b/indra/newview/llfloaterwater.cpp
@@ -69,7 +69,6 @@ std::set<std::string> LLFloaterWater::sDefaultPresets;
 LLFloaterWater::LLFloaterWater(const LLSD& key)
   : LLFloater(key)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_water.xml");
 }
 
 LLFloaterWater::~LLFloaterWater()
diff --git a/indra/newview/llfloaterwhitelistentry.cpp b/indra/newview/llfloaterwhitelistentry.cpp
index 705c8afd00..1ce151d7ed 100644
--- a/indra/newview/llfloaterwhitelistentry.cpp
+++ b/indra/newview/llfloaterwhitelistentry.cpp
@@ -47,7 +47,6 @@
 LLFloaterWhiteListEntry::LLFloaterWhiteListEntry( const LLSD& key ) :
 	LLFloater(key)
 {
-//	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_whitelist_entry.xml");
 }
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp
index c8ea6e406b..001d5c9cd6 100644
--- a/indra/newview/llfloaterwindlight.cpp
+++ b/indra/newview/llfloaterwindlight.cpp
@@ -72,7 +72,6 @@ static const F32 WL_SUN_AMBIENT_SLIDER_SCALE = 3.0f;
 LLFloaterWindLight::LLFloaterWindLight(const LLSD& key)
   : LLFloater(key)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_windlight_options.xml");
 }
 
 LLFloaterWindLight::~LLFloaterWindLight()
diff --git a/indra/newview/llfloaterwindowsize.cpp b/indra/newview/llfloaterwindowsize.cpp
index 5519be6f08..1ab796cb9b 100644
--- a/indra/newview/llfloaterwindowsize.cpp
+++ b/indra/newview/llfloaterwindowsize.cpp
@@ -86,7 +86,6 @@ public:
 LLFloaterWindowSize::LLFloaterWindowSize(const LLSD& key) 
 :	LLFloater(key)
 {
-	//LLUICtrlFactory::getInstance()->buildFloater(this, "floater_window_size.xml");	
 }
 
 LLFloaterWindowSize::~LLFloaterWindowSize()
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 7fd073ea67..bc999cf1a7 100644
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -205,7 +205,6 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key)
 	
 	mFactoryMap["objects_mapview"] = LLCallbackMap(createWorldMapView, NULL);
 	
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_world_map.xml", FALSE);
 	mCommitCallbackRegistrar.add("WMap.Coordinates",	boost::bind(&LLFloaterWorldMap::onCoordinatesCommit, this));
 	mCommitCallbackRegistrar.add("WMap.Location",		boost::bind(&LLFloaterWorldMap::onLocationCommit, this));
 	mCommitCallbackRegistrar.add("WMap.AvatarCombo",	boost::bind(&LLFloaterWorldMap::onAvatarComboCommit, this));
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index d7ffdacb70..9db79df78e 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -648,7 +648,6 @@ LLFloaterInventoryFinder::LLFloaterInventoryFinder(LLPanelMainInventory* invento
 	mPanelMainInventory(inventory_view),
 	mFilter(inventory_view->getPanel()->getFilter())
 {
-	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inventory_view_finder.xml", NULL);
 	updateElementsFromFilter();
 }
 
diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h
index 82b72ac224..816d2f76fb 100644
--- a/indra/newview/llpanelmaininventory.h
+++ b/indra/newview/llpanelmaininventory.h
@@ -47,6 +47,7 @@ class LLFilterEditor;
 class LLTabContainer;
 class LLFloaterInventoryFinder;
 class LLMenuGL;
+class LLFloater;
 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // Class LLPanelMainInventory
diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp
index a59ed53889..d65969c05d 100644
--- a/indra/newview/llpreviewanim.cpp
+++ b/indra/newview/llpreviewanim.cpp
@@ -49,7 +49,6 @@ extern LLAgent gAgent;
 LLPreviewAnim::LLPreviewAnim(const LLSD& key)
 	: LLPreview( key )
 {
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_animation.xml", FALSE);
 }
 
 // static
diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp
index 6ef7c85e31..b9caaecbc1 100644
--- a/indra/newview/llpreviewgesture.cpp
+++ b/indra/newview/llpreviewgesture.cpp
@@ -317,9 +317,6 @@ LLPreviewGesture::LLPreviewGesture(const LLSD& key)
 	NONE_LABEL =  LLTrans::getString("---");
 	SHIFT_LABEL = LLTrans::getString("KBShift");
 	CTRL_LABEL = LLTrans::getString("KBCtrl");
-	
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_gesture.xml", FALSE);
-
 }
 
 
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp
index ee86d3a2c6..11cb2ec242 100644
--- a/indra/newview/llpreviewnotecard.cpp
+++ b/indra/newview/llpreviewnotecard.cpp
@@ -77,7 +77,6 @@ LLPreviewNotecard::LLPreviewNotecard(const LLSD& key) //const LLUUID& item_id,
 	{
 		mAssetID = item->getAssetUUID();
 	}	
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_notecard.xml", FALSE);
 }
 
 LLPreviewNotecard::~LLPreviewNotecard()
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 73845e2772..ce465927bb 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -157,7 +157,7 @@ LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core)
 :	LLFloater(LLSD()),
 	mEditorCore(editor_core)
 {
-	LLUICtrlFactory::getInstance()->buildFloater(this,"floater_script_search.xml", NULL);
+	buildFloater(this,"floater_script_search.xml", NULL);
 
 	sInstance = this;
 	
@@ -660,7 +660,7 @@ void LLScriptEdCore::onBtnDynamicHelp()
 	if (!live_help_floater)
 	{
 		live_help_floater = new LLFloater(LLSD());
-		LLUICtrlFactory::getInstance()->buildFloater(live_help_floater, "floater_lsl_guide.xml", NULL);
+		LLFloater::buildFloater(live_help_floater, "floater_lsl_guide.xml", NULL);
 		LLFloater* parent = dynamic_cast<LLFloater*>(getParent());
 		llassert(parent);
 		if (parent)
@@ -948,7 +948,6 @@ LLPreviewLSL::LLPreviewLSL(const LLSD& key )
 	mPendingUploads(0)
 {
 	mFactoryMap["script panel"] = LLCallbackMap(LLPreviewLSL::createScriptEdPanel, this);
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_script_preview.xml", FALSE);
 }
 
 // virtual
@@ -1423,7 +1422,6 @@ LLLiveLSLEditor::LLLiveLSLEditor(const LLSD& key) :
 	mIsNew(false)
 {
 	mFactoryMap["script ed panel"] = LLCallbackMap(LLLiveLSLEditor::createScriptEdPanel, this);
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_live_lsleditor.xml", FALSE);
 }
 
 BOOL LLLiveLSLEditor::postBuild()
diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp
index d9bcf5fba6..8d6f06502d 100644
--- a/indra/newview/llpreviewsound.cpp
+++ b/indra/newview/llpreviewsound.cpp
@@ -51,7 +51,6 @@ const F32 SOUND_GAIN = 1.0f;
 LLPreviewSound::LLPreviewSound(const LLSD& key)
   : LLPreview( key )
 {
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_sound.xml", FALSE);
 }
 
 // virtual
diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp
index c1cb386556..b583fa4134 100644
--- a/indra/newview/llpreviewtexture.cpp
+++ b/indra/newview/llpreviewtexture.cpp
@@ -83,7 +83,6 @@ LLPreviewTexture::LLPreviewTexture(const LLSD& key)
 	{
 		mPreviewToSave = TRUE;
 	}
-	//Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_texture.xml", FALSE);
 }
 
 LLPreviewTexture::~LLPreviewTexture()
diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp
index 56bb7167b6..22a2748356 100644
--- a/indra/newview/llsidepaneliteminfo.cpp
+++ b/indra/newview/llsidepaneliteminfo.cpp
@@ -94,8 +94,6 @@ LLSidepanelItemInfo::LLSidepanelItemInfo()
   : mItemID(LLUUID::null)
 {
 	mPropertiesObserver = new LLItemPropertiesObserver(this);
-	
-	//LLUICtrlFactory::getInstance()->buildFloater(this,"floater_inventory_item_properties.xml");
 }
 
 // Destroys the object
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 127e4010ca..2bf9483a23 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -203,7 +203,6 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
 	mSelectedItemPinned( FALSE )
 {
 	mCanApplyImmediately = can_apply_immediately;
-	LLUICtrlFactory::getInstance()->buildFloater(this,"floater_texture_ctrl.xml",NULL);
 	setCanMinimize(FALSE);
 }
 
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index 2bb573c263..06c95b5e9c 100644
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -83,7 +83,7 @@ LLToast::LLToast(const LLToast::Params& p)
 {
 	mTimer.reset(new LLToastLifeTimer(this, p.lifetime_secs));
 
-	LLUICtrlFactory::getInstance()->buildFloater(this, "panel_toast.xml", NULL);
+	buildFloater(this, "panel_toast.xml", NULL);
 
 	setCanDrag(FALSE);
 
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 2a72e255d0..141d7d6b86 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -7255,7 +7255,7 @@ void handle_load_from_xml(void*)
 	{
 		std::string filename = picker.getFirstFile();
 		LLFloater* floater = new LLFloater(LLSD());
-		LLUICtrlFactory::getInstance()->buildFloater(floater, filename, NULL);
+		LLFloater::buildFloater(floater, filename, NULL);
 	}
 }
 
-- 
cgit v1.2.3


From 98bcaa1071ac4fb0b98a719c7fc7bdb3682dae4c Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Mon, 16 Aug 2010 17:56:46 -0700
Subject: made hint popups "chrome", meaning they can't steal focus

---
 indra/newview/skins/default/xui/en/widgets/hint_popup.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/skins/default/xui/en/widgets/hint_popup.xml b/indra/newview/skins/default/xui/en/widgets/hint_popup.xml
index fbd92f982e..a9975941af 100644
--- a/indra/newview/skins/default/xui/en/widgets/hint_popup.xml
+++ b/indra/newview/skins/default/xui/en/widgets/hint_popup.xml
@@ -3,6 +3,7 @@
  name="hint"
  background_opaque="true"
  background_visible="true"
+ chrome="true" 
  layout="topleft"
  bg_opaque_image="hint_background"
  distance="24"
-- 
cgit v1.2.3


From 29bbaef4aac059ca26c35a46f70e655e58f963bf Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Tue, 17 Aug 2010 17:03:23 -0700
Subject: Fixed a couple of compile errors.

---
 indra/integration_tests/llui_libtest/llui_libtest.cpp | 8 ++++----
 indra/newview/llfirstuse.cpp                          | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/indra/integration_tests/llui_libtest/llui_libtest.cpp b/indra/integration_tests/llui_libtest/llui_libtest.cpp
index abd8f7dbde..c981ba23d7 100644
--- a/indra/integration_tests/llui_libtest/llui_libtest.cpp
+++ b/indra/integration_tests/llui_libtest/llui_libtest.cpp
@@ -191,10 +191,10 @@ void export_test_floaters()
 		// Build a floater and output new attributes
 		LLXMLNodePtr output_node = new LLXMLNode();
 		LLFloater* floater = new LLFloater(LLSD());
-		LLUICtrlFactory::getInstance()->buildFloater(floater,
-													 filename,
-												//	 FALSE,	// don't open floater
-													 output_node);
+		LLFloater::buildFloater(floater,
+								filename,
+								//	 FALSE,	// don't open floater
+								output_node);
 		std::string out_filename = xui_dir + filename;
 		std::string::size_type extension_pos = out_filename.rfind(".xml");
 		out_filename.resize(extension_pos);
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index 038579c0bd..e9a9203a96 100644
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -157,7 +157,7 @@ void LLFirstUse::init()
 	static bool initialized = false;
 	if (!initialized)
 	{
-		LLNotifications::instance().getChannel("Hints")->connectChanged(processNotification);
+		LLNotifications::instance().getChannel("Hints")->connectChanged(&processNotification);
 	}
 	initialized = true;
 }
-- 
cgit v1.2.3


From 5ed8b55283e93a0487f3056789102a8dcdd7db3a Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Tue, 17 Aug 2010 17:56:26 -0700
Subject: Updated Mac build of llqtwebkit, with javascript window.close
 handling.

Built from:

revision aacdf69cbf5aa12d77c179296e31ef643ed1ef4a in http://qt.gitorious.org/+lindenqt/qt/lindenqt (currently head of the 'lindenqt' branch)
revision feff21029074 in http://bitbucket.org/lindenlab/llqtwebkit/ (currently head of the default branch)
---
 install.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/install.xml b/install.xml
index a3f5b5c7bc..19905fc1f7 100644
--- a/install.xml
+++ b/install.xml
@@ -981,9 +981,9 @@ anguage Infrstructure (CLI) international standard</string>
           <key>darwin</key>
           <map>
             <key>md5sum</key>
-            <string>093c977ef0ef2396cc235b3620329a87</string>
+            <string>9f4243cf304366030d02f2881357a928</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-4.6-darwin-20100805.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-4.6-darwin-20100817.tar.bz2</uri>
           </map>
           <key>linux</key>
           <map>
-- 
cgit v1.2.3


From a2657be5782f20c3cbab542b5a3775d78e21cdfa Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Tue, 17 Aug 2010 17:56:54 -0700
Subject: Viewer side changes to support javascript window.close handling.

---
 indra/llplugin/llpluginclassmedia.cpp              | 4 ++++
 indra/llplugin/llpluginclassmediaowner.h           | 1 +
 indra/media_plugins/webkit/media_plugin_webkit.cpp | 9 +++++++++
 indra/newview/llfloatermediabrowser.cpp            | 5 +++++
 indra/newview/llmediactrl.cpp                      | 6 ++++++
 indra/newview/llviewerparcelmedia.cpp              | 6 ++++++
 indra/test_apps/llplugintest/llmediaplugintest.cpp | 4 ++++
 7 files changed, 35 insertions(+)

diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp
index 41ace62964..6209a09bbd 100644
--- a/indra/llplugin/llpluginclassmedia.cpp
+++ b/indra/llplugin/llpluginclassmedia.cpp
@@ -1010,6 +1010,10 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
 				mOwner->handleCookieSet(this, message.getValue("cookie"));
 			}
 		}
+		else if(message_name == "close_request")
+		{
+			mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLOSE_REQUEST);
+		}
 		else
 		{
 			LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL;
diff --git a/indra/llplugin/llpluginclassmediaowner.h b/indra/llplugin/llpluginclassmediaowner.h
index 5669b81fd1..ac4fdd9ada 100644
--- a/indra/llplugin/llpluginclassmediaowner.h
+++ b/indra/llplugin/llpluginclassmediaowner.h
@@ -59,6 +59,7 @@ public:
 		MEDIA_EVENT_LOCATION_CHANGED,		// browser location (URL) has changed (maybe due to internal navagation/frames/etc)
 		MEDIA_EVENT_CLICK_LINK_HREF,		// I'm not entirely sure what the semantics of these two are
 		MEDIA_EVENT_CLICK_LINK_NOFOLLOW,
+		MEDIA_EVENT_CLOSE_REQUEST,			// The plugin requested its window be closed (currently hooked up to javascript window.close in webkit)
 		
 		MEDIA_EVENT_PLUGIN_FAILED_LAUNCH,	// The plugin failed to launch 
 		MEDIA_EVENT_PLUGIN_FAILED			// The plugin died unexpectedly
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index 3b00edec4e..2dc0c93521 100644
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -539,6 +539,15 @@ private:
 //		message.setValueBoolean("dead", (event.getIntValue() != 0))
 		sendMessage(message);
 	}
+
+	////////////////////////////////////////////////////////////////////////////////
+	// virtual
+	void onWindowCloseRequested(const EventType& event)
+	{
+		llwarns << "onWindowCloseRequested " << llendl;
+		LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "close_request");
+		sendMessage(message);
+	}
 	
 	LLQtWebKit::EKeyboardModifier decodeModifiers(std::string &modifiers)
 	{
diff --git a/indra/newview/llfloatermediabrowser.cpp b/indra/newview/llfloatermediabrowser.cpp
index ad996b5dc8..bf797fdc95 100644
--- a/indra/newview/llfloatermediabrowser.cpp
+++ b/indra/newview/llfloatermediabrowser.cpp
@@ -223,6 +223,11 @@ void LLFloaterMediaBrowser::handleMediaEvent(LLPluginClassMedia* self, EMediaEve
 		getChildView("back")->setEnabled(self->getHistoryBackAvailable());
 		getChildView("forward")->setEnabled(self->getHistoryForwardAvailable());
 	}
+	else if(event == MEDIA_EVENT_CLOSE_REQUEST)
+	{
+		// The browser instance wants its window closed.
+		closeFloater();
+	}
 }
 void LLFloaterMediaBrowser::setCurrentURL(const std::string& url)
 {
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index d6d128eb29..0739125081 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -956,6 +956,12 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
 			LL_DEBUGS("Media") <<  "Media event:  MEDIA_EVENT_NAME_CHANGED" << LL_ENDL;
 		};
 		break;
+		
+		case MEDIA_EVENT_CLOSE_REQUEST:
+		{
+			LL_DEBUGS("Media") <<  "Media event:  MEDIA_EVENT_CLOSE_REQUEST" << LL_ENDL;
+		}
+		break;
 	};
 
 	// chain all events to any potential observers of this object.
diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp
index 202f8822e3..e1d88c799b 100644
--- a/indra/newview/llviewerparcelmedia.cpp
+++ b/indra/newview/llviewerparcelmedia.cpp
@@ -574,6 +574,12 @@ void LLViewerParcelMedia::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
 			LL_DEBUGS("Media") <<  "Media event:  MEDIA_EVENT_NAME_CHANGED" << LL_ENDL;
 		};
 		break;
+
+		case MEDIA_EVENT_CLOSE_REQUEST:
+		{
+			LL_DEBUGS("Media") <<  "Media event:  MEDIA_EVENT_CLOSE_REQUEST" << LL_ENDL;
+		}
+		break;
 	};
 }
 
diff --git a/indra/test_apps/llplugintest/llmediaplugintest.cpp b/indra/test_apps/llplugintest/llmediaplugintest.cpp
index 166905c37c..4e39f1ccd1 100644
--- a/indra/test_apps/llplugintest/llmediaplugintest.cpp
+++ b/indra/test_apps/llplugintest/llmediaplugintest.cpp
@@ -2213,6 +2213,10 @@ void LLMediaPluginTest::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent e
 		case MEDIA_EVENT_PLUGIN_FAILED_LAUNCH:
 			std::cerr <<  "Media event:  MEDIA_EVENT_PLUGIN_FAILED_LAUNCH" << std::endl;
 		break;
+
+		case MEDIA_EVENT_CLOSE_REQUEST:
+			std::cerr <<  "Media event:  MEDIA_EVENT_CLOSE_REQUEST" << std::endl;
+		break;
 	}
 }
 
-- 
cgit v1.2.3


From 87d9a34ab869a6e31d83cae8cc55beaebc0c7ff9 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 18 Aug 2010 11:50:24 -0700
Subject: DEV-52669 FIX Inventory Notification not given if first Inventory
 Item comes from buying object contents

---
 indra/newview/llviewermessage.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 9bb734a3d3..067c0f3a80 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1080,6 +1080,7 @@ bool check_offer_throttle(const std::string& from_name, bool check_only)
  
 void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_name)
 {
+	LLFirstUse::inventoryOffer();
 	for (uuid_vec_t::const_iterator obj_iter = objects.begin();
 		 obj_iter != objects.end();
 		 ++obj_iter)
-- 
cgit v1.2.3


From 3aa8148ed94bcf495784efe51ad9d466d566868d Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 18 Aug 2010 12:16:29 -0700
Subject: fix for occasional crash when dismissing hint

---
 indra/llui/llnotifications.cpp | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 2da8f1eb1b..7cc6e8e8f6 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1425,17 +1425,26 @@ void LLNotifications::cancel(LLNotificationPtr pNotif)
 
 void LLNotifications::cancelByName(const std::string& name)
 {
-	for (LLNotificationSet::iterator it=mItems.begin(), end_it = mItems.end(), next_it = it;
+	std::vector<LLNotificationPtr> notifs_to_cancel;
+	for (LLNotificationSet::iterator it=mItems.begin(), end_it = mItems.end();
 		it != end_it;
-		it = next_it, ++next_it)
+		++it)
 	{
 		LLNotificationPtr pNotif = *it;
 		if (pNotif->getName() == name)
 		{
-			pNotif->cancel();
-			updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif);
+			notifs_to_cancel.push_back(pNotif);
 		}
 	}
+
+	for (std::vector<LLNotificationPtr>::iterator it = notifs_to_cancel.begin(), end_it = notifs_to_cancel.end();
+		it != end_it;
+		++it)
+	{
+		LLNotificationPtr pNotif = *it;
+		pNotif->cancel();
+		updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif);
+	}
 }
 
 void LLNotifications::update(const LLNotificationPtr pNotif)
-- 
cgit v1.2.3


From 25367cb33a4ae3df474b2d77e04bf44625efde4b Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Wed, 18 Aug 2010 16:58:57 -0700
Subject: Add support for an "_internal" target that forces a link to open in
 the embedded browser, regardless of the state of the "UseExternalBrowser"
 pref.

---
 indra/newview/llweb.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index b61109d490..c6219334f4 100644
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -86,7 +86,12 @@ void LLWeb::initClass()
 // static
 void LLWeb::loadURL(const std::string& url, const std::string& target)
 {
-	if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external"))
+	if(target == "_internal")
+	{
+		// Force load in the internal browser, as if with a blank target.
+		loadURLInternal(url);
+	}
+	else if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external"))
 	{
 		loadURLExternal(url);
 	}
-- 
cgit v1.2.3


From f17e3a6eb42f0f30b8d7a178cd9214a26162dde6 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 19 Aug 2010 10:54:03 -0700
Subject: DEV-52666 FIX Chat and Move Hints shown when user performs action...

---
 indra/newview/llfirstuse.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index e9a9203a96..1ede2be978 100644
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -147,6 +147,8 @@ void LLFirstUse::firstUseNotification(const std::string& control_var, bool enabl
 	{
 		LL_DEBUGS("LLFirstUse") << "Disabling first use notification " << notification_name << LL_ENDL;
 		LLNotifications::instance().cancelByName(notification_name);
+		// redundantly clear settings var here, in case there are no notifications to cancel
+		gWarningSettings.setBOOL(control_var, FALSE);
 	}
 
 }
-- 
cgit v1.2.3


From af108e324ae45ba3a055e7b55bea3f3b03c7f48d Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 19 Aug 2010 13:24:37 -0700
Subject: DEV-52669 FIX Inventory notification not given if first item comes
 from buying contents

---
 indra/newview/llfirstuse.cpp           |  2 +-
 indra/newview/llfirstuse.h             |  2 +-
 indra/newview/llfloaterbuycontents.cpp |  5 +++++
 indra/newview/llsidepanelinventory.cpp |  2 +-
 indra/newview/llviewermessage.cpp      | 14 +++++++++++---
 5 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index 1ede2be978..c153f8b787 100644
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -90,7 +90,7 @@ void LLFirstUse::sit(bool enable)
 }
 
 // static
-void LLFirstUse::inventoryOffer(bool enable)
+void LLFirstUse::newInventory(bool enable)
 {
 	firstUseNotification("FirstInventoryOffer", enable, "HintInventory", LLSD(), LLSD().with("target", "inventory_btn").with("direction", "left"));
 }
diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h
index 9c4ab14006..174706f1f4 100644
--- a/indra/newview/llfirstuse.h
+++ b/indra/newview/llfirstuse.h
@@ -95,7 +95,7 @@ public:
 	static void notUsingDestinationGuide(bool enable = true);
 	static void notUsingSidePanel(bool enable = true);
 	static void notMoving(bool enable = true);
-	static void inventoryOffer(bool enable = true);
+	static void newInventory(bool enable = true);
 	static void receiveLindens(bool enable = true);
 	static void useSandbox();
 	
diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp
index 3cdd7b801b..8e93a6bf03 100644
--- a/indra/newview/llfloaterbuycontents.cpp
+++ b/indra/newview/llfloaterbuycontents.cpp
@@ -47,6 +47,7 @@
 #include "llinventorydefines.h"
 #include "llinventoryfunctions.h"
 #include "llinventorymodel.h"	// for gInventory
+#include "llfirstuse.h"
 #include "llfloaterreg.h"
 #include "llfloaterinventory.h"	// for LLInventoryIcon::getIcon
 #include "llnotificationsutil.h"
@@ -289,6 +290,10 @@ void LLFloaterBuyContents::onClickBuy()
 	// it doesn't match region info then sale is canceled.
 	LLSelectMgr::getInstance()->sendBuy(gAgent.getID(), category_id, mSaleInfo);
 
+	// NOTE: do this here instead of on receipt of object, since contents are transfered
+	// via a generic BulkUpdateInventory message with no way of distinguishing it from
+	// other inventory operations
+	LLFirstUse::newInventory();
 	closeFloater();
 }
 
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index aa29f6cb26..66a8a520af 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -129,7 +129,7 @@ BOOL LLSidepanelInventory::postBuild()
 
 void LLSidepanelInventory::onOpen(const LLSD& key)
 {
-	LLFirstUse::inventoryOffer(false);
+	LLFirstUse::newInventory(false);
 
 	if(key.size() == 0)
 		return;
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 067c0f3a80..71dff61f41 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -937,6 +937,15 @@ protected:
 //one global instance to bind them
 LLOpenTaskOffer* gNewInventoryObserver=NULL;
 
+class LLNewInventoryHintObserver : public LLInventoryAddedObserver
+{
+protected:
+	/*virtual*/ void done()
+	{
+		LLFirstUse::newInventory();
+	}
+};
+
 void start_new_inventory_observer()
 {
 	if (!gNewInventoryObserver) //task offer observer 
@@ -952,6 +961,8 @@ void start_new_inventory_observer()
 		gInventoryMoveObserver = new LLViewerInventoryMoveFromWorldObserver;
 		gInventory.addObserver(gInventoryMoveObserver);
 	}
+
+	gInventory.addObserver(new LLNewInventoryHintObserver());
 }
 
 class LLDiscardAgentOffer : public LLInventoryFetchItemsObserver
@@ -1080,7 +1091,6 @@ bool check_offer_throttle(const std::string& from_name, bool check_only)
  
 void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_name)
 {
-	LLFirstUse::inventoryOffer();
 	for (uuid_vec_t::const_iterator obj_iter = objects.begin();
 		 obj_iter != objects.end();
 		 ++obj_iter)
@@ -1765,8 +1775,6 @@ void inventory_offer_handler(LLOfferInfo* info)
 		return;
 	}
 
-	LLFirstUse::inventoryOffer();
-
 	// Avoid the Accept/Discard dialog if the user so desires. JC
 	if (gSavedSettings.getBOOL("AutoAcceptNewInventory")
 		&& (info->mType == LLAssetType::AT_NOTECARD
-- 
cgit v1.2.3


From 7c80b591610e8f7467c40ce3585796e67390fb3e Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 19 Aug 2010 13:39:01 -0700
Subject: DEV-52553 FIX Font color/opacity issue in Group Panels DEV-52554 FIX
 Font color/opacity issue in About Second Life floater DEV-52617 FIX Font
 color/opacity issue in Profile Panel DEV-52618 FIX Font color/opacity issue
 in Covenant tab of About Land reviewed by Monroe

---
 indra/newview/skins/default/xui/en/widgets/text_editor.xml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/indra/newview/skins/default/xui/en/widgets/text_editor.xml b/indra/newview/skins/default/xui/en/widgets/text_editor.xml
index 180120ec89..0f7f50b312 100644
--- a/indra/newview/skins/default/xui/en/widgets/text_editor.xml
+++ b/indra/newview/skins/default/xui/en/widgets/text_editor.xml
@@ -2,5 +2,4 @@
 <!-- Core parameters are in simple_text_editor.xml -->
 <text_editor
   parse_urls="false"
-  text_readonly_color="LabelDisabledColor"
   show_context_menu="true"/>
-- 
cgit v1.2.3


From bc12956a304c0c9c8d67a86a4e6d2e108026c169 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 19 Aug 2010 13:59:46 -0700
Subject: Fix for bad accelerator string lookups

---
 indra/llxuixml/lltrans.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/indra/llxuixml/lltrans.h b/indra/llxuixml/lltrans.h
index 6c8d28b346..30c96f8121 100644
--- a/indra/llxuixml/lltrans.h
+++ b/indra/llxuixml/lltrans.h
@@ -107,7 +107,16 @@ public:
 	{
 		std::string key_str(keystring);
 		std::string trans_str;
-		return findString(trans_str, "Key_" + key_str) ? trans_str : key_str; 
+		if (findString(trans_str, "Key_" + key_str))
+		{
+			return trans_str;
+		}
+		else if (findString(trans_str, key_str))
+		{
+			return trans_str;
+		}
+		llwarns << "Failed to find keyboard string " << keystring << llendl;
+		return key_str;
 	}
 
 	// get the default args
-- 
cgit v1.2.3


From 48e0087ce3096e3ebe778124cdb21b87eedcc07c Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 19 Aug 2010 15:29:09 -0700
Subject: removed keyboarstring spam

---
 indra/llxuixml/lltrans.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/indra/llxuixml/lltrans.h b/indra/llxuixml/lltrans.h
index 30c96f8121..4a99c5e0e2 100644
--- a/indra/llxuixml/lltrans.h
+++ b/indra/llxuixml/lltrans.h
@@ -115,7 +115,6 @@ public:
 		{
 			return trans_str;
 		}
-		llwarns << "Failed to find keyboard string " << keystring << llendl;
 		return key_str;
 	}
 
-- 
cgit v1.2.3


From b7266b13c96e76a64e7220baa1d4cd3cb0f9bb29 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 19 Aug 2010 17:35:49 -0700
Subject: eliminated spam when parsing hints llsd

---
 indra/newview/llhints.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp
index c4cea86a31..f758df2ef8 100644
--- a/indra/newview/llhints.cpp
+++ b/indra/newview/llhints.cpp
@@ -293,7 +293,7 @@ void LLHints::show(LLNotificationPtr hint)
 {
 	LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams<LLHintPopup>());
 
-	LLParamSDParser::instance().readSD(hint->getPayload(), p);
+	LLParamSDParser::instance().readSD(hint->getPayload(), p, true);
 	p.notification = hint;
 
 	if (p.validateBlock())
-- 
cgit v1.2.3


From ae46afb7076959161316be1faf8a16ed21dbf854 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 19 Aug 2010 17:36:38 -0700
Subject: eliminated some WTF code

---
 indra/newview/llfavoritesbar.cpp | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 6b7a257a4b..98c6642e08 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -167,22 +167,13 @@ public:
 		
 		if (!region_name.empty())
 		{
-			LLToolTip::Params params;
 			std::string extra_message = llformat("%s (%d, %d, %d)", region_name.c_str(), 
 				mLandmarkInfoGetter.getPosX(), mLandmarkInfoGetter.getPosY(), mLandmarkInfoGetter.getPosZ());
 
+			LLToolTip::Params params;
 			params.message = llformat("%s\n%s", getLabelSelected().c_str(), extra_message.c_str());
-			
-			LLRect rect = calcScreenRect();
-			LLFontGL* standart_font = LLFontGL::getFontSansSerif();
-			if(standart_font)
-			{
-				S32 w = llmax((S32)(standart_font->getWidthF32(getLabelSelected())+0.5),(S32)(standart_font->getWidthF32(extra_message)+0.5));
-				rect.mRight = rect.mLeft + w;
-				params.max_width = w;
-			}
-			
-			params.sticky_rect = rect; 
+			params.max_width = 1000;			
+			params.sticky_rect = calcScreenRect(); 
 
 			LLToolTipMgr::instance().show(params);
 		}
-- 
cgit v1.2.3


From 44e312541acd151c9d3ae264fae44e2d10284969 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 19 Aug 2010 17:37:12 -0700
Subject: made favorites button tooltips override parent generic tooltip more
 consistently

---
 indra/llui/lltooltip.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp
index 025725476e..b3699c738e 100644
--- a/indra/llui/lltooltip.cpp
+++ b/indra/llui/lltooltip.cpp
@@ -84,9 +84,9 @@ BOOL LLToolTipView::handleHover(S32 x, S32 y, MASK mask)
 
 	LLToolTipMgr& tooltip_mgr = LLToolTipMgr::instance();
 
-	if (x != last_x && y != last_y)
+	if (x != last_x && y != last_y && !tooltip_mgr.getMouseNearRect().pointInRect(x, y))
 	{
-		// allow new tooltips because mouse moved
+		// allow new tooltips because mouse moved outside of mouse near rect
 		tooltip_mgr.unblockToolTips();
 	}
 
@@ -586,6 +586,7 @@ void LLToolTipMgr::updateToolTipVisibility()
 		if (mToolTip->getVisibleTime() > tooltip_timeout)
 		{
 			hideToolTips();
+			unblockToolTips();
 		}
 	}
 }
-- 
cgit v1.2.3


From 02d8197019dcecec7aee80a104c4644ddb4807ca Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 20 Aug 2010 10:14:28 -0700
Subject: changed buildPanel/buildFloater to member functions buildFromFile
 streamlined LLUICtrlFactory's interface

---
 .../llui_libtest/llui_libtest.cpp                  |  7 +-
 indra/llui/llaccordionctrl.cpp                     |  2 +-
 indra/llui/llfloater.cpp                           | 21 +++---
 indra/llui/llfloater.h                             |  2 +-
 indra/llui/llfloaterreg.cpp                        |  2 +-
 indra/llui/llpanel.cpp                             | 20 +++---
 indra/llui/llpanel.h                               |  2 +-
 indra/llui/lluictrlfactory.h                       | 80 +++++++++++-----------
 indra/newview/llavatarlist.cpp                     |  2 +-
 indra/newview/llavatarlistitem.cpp                 |  2 +-
 indra/newview/llbottomtray.cpp                     |  4 +-
 indra/newview/llchathistory.cpp                    |  2 +-
 indra/newview/llchatitemscontainerctrl.cpp         |  2 +-
 indra/newview/llfavoritesbar.cpp                   | 45 ++++++------
 indra/newview/llfavoritesbar.h                     |  4 +-
 indra/newview/llfloaternotificationsconsole.cpp    |  2 +-
 indra/newview/llfloaterregioninfo.cpp              | 12 ++--
 indra/newview/llfloaterscriptlimits.cpp            |  4 +-
 indra/newview/llfloateruipreview.cpp               |  8 +--
 indra/newview/llfloaterurlentry.cpp                |  2 +-
 indra/newview/llgrouplist.cpp                      |  2 +-
 indra/newview/llhints.cpp                          | 10 ++-
 indra/newview/llhudview.cpp                        |  2 +-
 indra/newview/llmoveview.cpp                       |  2 +-
 indra/newview/llnavigationbar.cpp                  |  2 +-
 indra/newview/lloutfitslist.cpp                    | 40 +++++++----
 indra/newview/lloutfitslist.h                      |  6 --
 indra/newview/llpanelavatartag.cpp                 |  2 +-
 indra/newview/llpanelclassified.cpp                |  4 +-
 indra/newview/llpanelgenerictip.cpp                |  2 +-
 indra/newview/llpanelgroupinvite.cpp               |  2 +-
 indra/newview/llpanellandmarks.cpp                 |  2 +-
 indra/newview/llpanellogin.cpp                     |  2 +-
 indra/newview/llpanelme.cpp                        |  2 +-
 indra/newview/llpanelmediasettingsgeneral.cpp      |  2 +-
 indra/newview/llpanelmediasettingspermissions.cpp  |  2 +-
 indra/newview/llpanelmediasettingssecurity.cpp     |  2 +-
 indra/newview/llpanelnearbymedia.cpp               |  2 +-
 indra/newview/llpanelonlinestatus.cpp              |  2 +-
 indra/newview/llpanelpick.cpp                      |  4 +-
 indra/newview/llpanelpicks.cpp                     |  4 +-
 indra/newview/llpanelplaces.cpp                    |  2 +-
 indra/newview/llpanelprimmediacontrols.cpp         |  2 +-
 indra/newview/llpanelteleporthistory.cpp           |  4 +-
 indra/newview/llpaneltopinfobar.cpp                |  2 +-
 indra/newview/llpanelvolumepulldown.cpp            |  2 +-
 indra/newview/llpreviewscript.cpp                  |  4 +-
 indra/newview/llscrollingpanelparam.cpp            |  2 +-
 indra/newview/llsidepanelinventory.cpp             |  2 +-
 indra/newview/llstatusbar.cpp                      |  2 +-
 indra/newview/llsyswellitem.cpp                    |  2 +-
 indra/newview/llsyswellwindow.cpp                  |  4 +-
 indra/newview/lltoast.cpp                          |  2 +-
 indra/newview/lltoastgroupnotifypanel.cpp          |  2 +-
 indra/newview/lltoastimpanel.cpp                   |  2 +-
 indra/newview/lltoastnotifypanel.cpp               |  2 +-
 indra/newview/llviewermenu.cpp                     |  2 +-
 indra/newview/llviewerwindow.cpp                   |  2 +-
 58 files changed, 187 insertions(+), 176 deletions(-)

diff --git a/indra/integration_tests/llui_libtest/llui_libtest.cpp b/indra/integration_tests/llui_libtest/llui_libtest.cpp
index abd8f7dbde..8383066e46 100644
--- a/indra/integration_tests/llui_libtest/llui_libtest.cpp
+++ b/indra/integration_tests/llui_libtest/llui_libtest.cpp
@@ -191,10 +191,9 @@ void export_test_floaters()
 		// Build a floater and output new attributes
 		LLXMLNodePtr output_node = new LLXMLNode();
 		LLFloater* floater = new LLFloater(LLSD());
-		LLUICtrlFactory::getInstance()->buildFloater(floater,
-													 filename,
-												//	 FALSE,	// don't open floater
-													 output_node);
+		floater->buildFromFile(	filename,
+								//	 FALSE,	// don't open floater
+								output_node);
 		std::string out_filename = xui_dir + filename;
 		std::string::size_type extension_pos = out_filename.rfind(".xml");
 		out_filename.resize(extension_pos);
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp
index 9337626c8e..5ce52185e3 100644
--- a/indra/llui/llaccordionctrl.cpp
+++ b/indra/llui/llaccordionctrl.cpp
@@ -89,7 +89,7 @@ LLAccordionCtrl::LLAccordionCtrl() : LLPanel()
 
 	mSingleExpansion = false;
 	mFitParent = false;
-	buildPanel(this, "accordion_parent.xml");	
+	buildFromFile( "accordion_parent.xml");	
 }
 
 //---------------------------------------------------------------------------------
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index d66b3c1707..0cd692b4a4 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -2887,8 +2887,7 @@ bool LLFloater::isVisible(const LLFloater* floater)
 
 static LLFastTimer::DeclareTimer FTM_BUILD_FLOATERS("Build Floaters");
 
-/* static */
-bool LLFloater::buildFloater(LLFloater* floaterp, const std::string& filename, LLXMLNodePtr output_node)
+bool LLFloater::buildFromFile(const std::string& filename, LLXMLNodePtr output_node)
 {
 	LLFastTimer timer(FTM_BUILD_FLOATERS);
 	LLXMLNodePtr root;
@@ -2921,23 +2920,23 @@ bool LLFloater::buildFloater(LLFloater* floaterp, const std::string& filename, L
 	lldebugs << "Building floater " << filename << llendl;
 	LLUICtrlFactory::instance().pushFileName(filename);
 	{
-		if (!floaterp->getFactoryMap().empty())
+		if (!getFactoryMap().empty())
 		{
-			LLPanel::sFactoryStack.push_front(&floaterp->getFactoryMap());
+			LLPanel::sFactoryStack.push_front(&getFactoryMap());
 		}
 
 		 // for local registry callbacks; define in constructor, referenced in XUI or postBuild
-		floaterp->getCommitCallbackRegistrar().pushScope();
-		floaterp->getEnableCallbackRegistrar().pushScope();
+		getCommitCallbackRegistrar().pushScope();
+		getEnableCallbackRegistrar().pushScope();
 		
-		res = floaterp->initFloaterXML(root, floaterp->getParent(), filename, output_node);
+		res = initFloaterXML(root, getParent(), filename, output_node);
 
-		floaterp->setXMLFilename(filename);
+		setXMLFilename(filename);
 		
-		floaterp->getCommitCallbackRegistrar().popScope();
-		floaterp->getEnableCallbackRegistrar().popScope();
+		getCommitCallbackRegistrar().popScope();
+		getEnableCallbackRegistrar().popScope();
 		
-		if (!floaterp->getFactoryMap().empty())
+		if (!getFactoryMap().empty())
 		{
 			LLPanel::sFactoryStack.pop_front();
 		}
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 69762c7723..750cf23c7d 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -147,7 +147,7 @@ public:
 
 	// Don't export top/left for rect, only height/width
 	static void setupParamsForExport(Params& p, LLView* parent);
-	static bool buildFloater(LLFloater* floaterp, const std::string &filename, LLXMLNodePtr output_node);
+	bool buildFromFile(const std::string &filename, LLXMLNodePtr output_node = NULL);
 
 	void initFromParams(const LLFloater::Params& p);
 	bool initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node = NULL);
diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp
index 2c31854011..39a67ee57b 100644
--- a/indra/llui/llfloaterreg.cpp
+++ b/indra/llui/llfloaterreg.cpp
@@ -127,7 +127,7 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key)
 
 				res = build_func(key);
 				
-				bool success = LLFloater::buildFloater(res, xui_file, NULL);
+				bool success = res->buildFromFile(xui_file, NULL);
 				if (!success)
 				{
 					llwarns << "Failed to build floater type: '" << name << "'." << llendl;
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index f79429e0f6..51c8f6c743 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -972,7 +972,7 @@ static LLFastTimer::DeclareTimer FTM_BUILD_PANELS("Build Panels");
 //-----------------------------------------------------------------------------
 // buildPanel()
 //-----------------------------------------------------------------------------
-BOOL LLPanel::buildPanel(LLPanel* panelp, const std::string& filename, LLXMLNodePtr output_node, const LLPanel::Params& default_params)
+BOOL LLPanel::buildFromFile(const std::string& filename, LLXMLNodePtr output_node, const LLPanel::Params& default_params)
 {
 	LLFastTimer timer(FTM_BUILD_PANELS);
 	BOOL didPost = FALSE;
@@ -1005,23 +1005,23 @@ BOOL LLPanel::buildPanel(LLPanel* panelp, const std::string& filename, LLXMLNode
 
 	LLUICtrlFactory::instance().pushFileName(filename);
 	{
-		if (!panelp->getFactoryMap().empty())
+		if (!getFactoryMap().empty())
 		{
-			sFactoryStack.push_back(&panelp->getFactoryMap());
+			sFactoryStack.push_back(&getFactoryMap());
 		}
 		
 		 // for local registry callbacks; define in constructor, referenced in XUI or postBuild
-		panelp->getCommitCallbackRegistrar().pushScope();
-		panelp->getEnableCallbackRegistrar().pushScope();
+		getCommitCallbackRegistrar().pushScope();
+		getEnableCallbackRegistrar().pushScope();
 		
-		didPost = panelp->initPanelXML(root, NULL, output_node, default_params);
+		didPost = initPanelXML(root, NULL, output_node, default_params);
 
-		panelp->getCommitCallbackRegistrar().popScope();
-		panelp->getEnableCallbackRegistrar().popScope();
+		getCommitCallbackRegistrar().popScope();
+		getEnableCallbackRegistrar().popScope();
 		
-		panelp->setXMLFilename(filename);
+		setXMLFilename(filename);
 
-		if (!panelp->getFactoryMap().empty())
+		if (!getFactoryMap().empty())
 		{
 			sFactoryStack.pop_back();
 		}
diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h
index de16d28e27..cacd1fdcf0 100644
--- a/indra/llui/llpanel.h
+++ b/indra/llui/llpanel.h
@@ -110,7 +110,7 @@ protected:
 	LLPanel(const LLPanel::Params& params = getDefaultParams());
 	
 public:
-	static 	BOOL buildPanel(LLPanel* panelp, const std::string &filename, LLXMLNodePtr output_node = NULL, const LLPanel::Params&default_params = getDefaultParams());
+	BOOL buildFromFile(const std::string &filename, LLXMLNodePtr output_node = NULL, const LLPanel::Params&default_params = getDefaultParams());
 
 	static LLPanel* createFactoryPanel(const std::string& name);
 
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index 16fb618c88..82076335d7 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -155,38 +155,12 @@ public:
 	void pushFileName(const std::string& name);
 	void popFileName();
 
-	template<typename T>
-	static T* createWidget(const typename T::Params& params, LLView* parent = NULL)
-	{
-		T* widget = NULL;
-
-		if (!params.validateBlock())
-		{
-			llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl;
-			//return NULL;
-		}
-
-		{ LLFastTimer _(FTM_WIDGET_CONSTRUCTION);
-			widget = new T(params);	
-		}
-		{ LLFastTimer _(FTM_INIT_FROM_PARAMS);
-			widget->initFromParams(params);
-		}
-
-		if (parent)
-		{
-			S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : S32_MAX;
-			setCtrlParent(widget, parent, tab_group);
-		}
-		return widget;
-	}
-
 	template<typename T>
 	static T* create(typename T::Params& params, LLView* parent = NULL)
 	{
 		params.fillFrom(ParamDefaults<typename T::Params, 0>::instance().get());
 
-		T* widget = createWidget<T>(params, parent);
+		T* widget = createWidgetImpl<T>(params, parent);
 		if (widget)
 		{
 			widget->postBuild();
@@ -249,8 +223,47 @@ fail:
 		return create<T>(widget_params);
 	}
 
+	static void createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t&, LLXMLNodePtr output_node = NULL);
+
+	static bool getLayeredXMLNode(const std::string &filename, LLXMLNodePtr& root);
+	static bool getLocalizedXMLNode(const std::string &xui_filename, LLXMLNodePtr& root);
+
+private:
+	template <typename T> friend class LLChildRegistry;
+
 	static void copyName(LLXMLNodePtr src, LLXMLNodePtr dest);
 
+	// helper function for adding widget type info to various registries
+	static void registerWidget(const std::type_info* widget_type, const std::type_info* param_block_type, const std::string& tag);
+
+	static void loadWidgetTemplate(const std::string& widget_tag, LLInitParam::BaseBlock& block);
+
+	template<typename T>
+	static T* createWidgetImpl(const typename T::Params& params, LLView* parent = NULL)
+	{
+		T* widget = NULL;
+
+		if (!params.validateBlock())
+		{
+			llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl;
+			//return NULL;
+		}
+
+		{ LLFastTimer _(FTM_WIDGET_CONSTRUCTION);
+			widget = new T(params);	
+		}
+		{ LLFastTimer _(FTM_INIT_FROM_PARAMS);
+			widget->initFromParams(params);
+		}
+
+		if (parent)
+		{
+			S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : S32_MAX;
+			setCtrlParent(widget, parent, tab_group);
+		}
+		return widget;
+	}
+
 	template<typename T>
 	static T* defaultBuilder(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node)
 	{
@@ -275,7 +288,7 @@ fail:
 		// Apply layout transformations, usually munging rect
 		params.from_xui = true;
 		T::applyXUILayout(params, parent);
-		T* widget = createWidget<T>(params, parent);
+		T* widget = createWidgetImpl<T>(params, parent);
 
 		typedef typename T::child_registry_t registry_t;
 
@@ -290,18 +303,7 @@ fail:
 		return widget;
 	}
 
-	static void createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t&, LLXMLNodePtr output_node = NULL);
-
-	static bool getLayeredXMLNode(const std::string &filename, LLXMLNodePtr& root);
-	
-	static bool getLocalizedXMLNode(const std::string &xui_filename, LLXMLNodePtr& root);
-
-	static void loadWidgetTemplate(const std::string& widget_tag, LLInitParam::BaseBlock& block);
 
-	// helper function for adding widget type info to various registries
-	static void registerWidget(const std::type_info* widget_type, const std::type_info* param_block_type, const std::string& tag);
-
-private:
 	static const std::string* getWidgetTag(const std::type_info* widget_type);
 
 	// this exists to get around dependency on llview
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index f448816f76..95ced5067d 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -498,7 +498,7 @@ LLAvalineListItem::LLAvalineListItem(bool hide_number/* = true*/) : LLAvatarList
 , mIsHideNumber(hide_number)
 {
 	// should not use buildPanel from the base class to ensure LLAvalineListItem::postBuild is called.
-	buildPanel(this, "panel_avatar_list_item.xml");
+	buildFromFile( "panel_avatar_list_item.xml");
 }
 
 BOOL LLAvalineListItem::postBuild()
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp
index 18a5d74527..81c9b64c12 100644
--- a/indra/newview/llavatarlistitem.cpp
+++ b/indra/newview/llavatarlistitem.cpp
@@ -75,7 +75,7 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/)
 {
 	if (not_from_ui_factory)
 	{
-		buildPanel(this, "panel_avatar_list_item.xml");
+		buildFromFile("panel_avatar_list_item.xml");
 	}
 	// *NOTE: mantipov: do not use any member here. They can be uninitialized here in case instance
 	// is created from the UICtrlFactory
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 310b406bfd..c4eda5f107 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -112,7 +112,7 @@ public:
 		  mGesturePanel(NULL)
 	{
 		mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL);
-		buildPanel(this, "panel_bottomtray_lite.xml");
+		buildFromFile("panel_bottomtray_lite.xml");
 		// Necessary for focus movement among child controls
 		setFocusRoot(TRUE);
 	}
@@ -163,7 +163,7 @@ LLBottomTray::LLBottomTray(const LLSD&)
 
 	mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL);
 
-	buildPanel(this,"panel_bottomtray.xml");
+	buildFromFile("panel_bottomtray.xml");
 
 	LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraItem, _2));
 
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index b6788b7739..e1e425fa8c 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -107,7 +107,7 @@ public:
 	static LLChatHistoryHeader* createInstance(const std::string& file_name)
 	{
 		LLChatHistoryHeader* pInstance = new LLChatHistoryHeader;
-		buildPanel(pInstance, file_name);	
+		pInstance->buildFromFile(file_name);	
 		return pInstance;
 	}
 
diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp
index ed4803f87a..b1c878ed76 100644
--- a/indra/newview/llchatitemscontainerctrl.cpp
+++ b/indra/newview/llchatitemscontainerctrl.cpp
@@ -57,7 +57,7 @@ static const S32 msg_height_pad = 5;
 LLNearbyChatToastPanel* LLNearbyChatToastPanel::createInstance()
 {
 	LLNearbyChatToastPanel* item = new LLNearbyChatToastPanel();
-	buildPanel(item, "panel_chat_item.xml");
+	item->buildFromFile("panel_chat_item.xml");
 	item->setFollows(FOLLOWS_NONE);
 	return item;
 }
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 6b7a257a4b..b8776d0af2 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -667,16 +667,22 @@ void LLFavoritesBarCtrl::draw()
 	}
 }
 
-LLXMLNodePtr LLFavoritesBarCtrl::getButtonXMLNode()
+const LLButton::Params& LLFavoritesBarCtrl::getButtonParams()
 {
-	LLXMLNodePtr buttonXMLNode = NULL;
-	bool success = LLUICtrlFactory::getLayeredXMLNode("favorites_bar_button.xml", buttonXMLNode);
-	if (!success)
+	static LLButton::Params button_params;
+	static bool params_initialized = false;
+
+	if (!params_initialized)
 	{
-		llwarns << "Failed to create Favorites Bar button from favorites_bar_button.xml" << llendl;
-		buttonXMLNode = NULL;
+		LLXMLNodePtr button_xml_node;
+		if(LLUICtrlFactory::getLayeredXMLNode("favorites_bar_button.xml", button_xml_node))
+		{
+			LLXUIParser::instance().readXUI(button_xml_node, button_params, "favorites_bar_button.xml");
+		}
+		params_initialized = true;
 	}
-	return buttonXMLNode;
+
+	return button_params;
 }
 
 void LLFavoritesBarCtrl::updateButtons()
@@ -688,11 +694,8 @@ void LLFavoritesBarCtrl::updateButtons()
 		return;
 	}
 
-	static LLXMLNodePtr buttonXMLNode = getButtonXMLNode();
-	if (buttonXMLNode.isNull())
-	{
-		return;
-	}
+	const LLButton::Params& button_params = getButtonParams();
+
 	if(mItems.empty())
 	{
 		mBarLabel->setVisible(TRUE);
@@ -768,7 +771,7 @@ void LLFavoritesBarCtrl::updateButtons()
 		int j = first_changed_item_index;
 		for (; j < mItems.count(); j++)
 		{
-			last_new_button = createButton(mItems[j], buttonXMLNode, last_right_edge);
+			last_new_button = createButton(mItems[j], button_params, last_right_edge);
 			if (!last_new_button)
 			{
 				break;
@@ -786,8 +789,7 @@ void LLFavoritesBarCtrl::updateButtons()
 			//or there are some new favorites, or width had been changed
 			// so if we need to display chevron button,  we must update dropdown items too. 
 			mUpdateDropDownItems = true;
-			S32 buttonHGap = 2; // default value
-			buttonXMLNode->getAttributeS32("left", buttonHGap);
+			S32 buttonHGap = button_params.rect.left; // default value
 			LLRect rect;
 			// Chevron button should stay right aligned
 			rect.setOriginAndSize(getRect().mRight - mChevronButton->getRect().getWidth() - buttonHGap, 0,
@@ -814,12 +816,10 @@ void LLFavoritesBarCtrl::updateButtons()
 	}
 }
 
-LLButton* LLFavoritesBarCtrl::createButton(const LLPointer<LLViewerInventoryItem> item, LLXMLNodePtr &buttonXMLNode, S32 x_offset)
+LLButton* LLFavoritesBarCtrl::createButton(const LLPointer<LLViewerInventoryItem> item, const LLButton::Params& button_params, S32 x_offset)
 {
-	S32 def_button_width = 120;
-	buttonXMLNode->getAttributeS32("width", def_button_width);
-	S32 button_x_delta = 2; // default value
-	buttonXMLNode->getAttributeS32("left", button_x_delta);
+	S32 def_button_width = button_params.rect.width;
+	S32 button_x_delta = button_params.rect.left; // default value
 	S32 curr_x = x_offset;
 
 	/**
@@ -837,13 +837,16 @@ LLButton* LLFavoritesBarCtrl::createButton(const LLPointer<LLViewerInventoryItem
 	{
 		return NULL;
 	}
-	fav_btn = LLUICtrlFactory::defaultBuilder<LLFavoriteLandmarkButton>(buttonXMLNode, this, NULL);
+	LLButton::Params fav_btn_params(button_params);
+	fav_btn = LLUICtrlFactory::create<LLFavoriteLandmarkButton>(fav_btn_params);
 	if (NULL == fav_btn)
 	{
 		llwarns << "Unable to create LLFavoriteLandmarkButton widget: " << item->getName() << llendl;
 		return NULL;
 	}
 	
+	addChild(fav_btn);
+
 	LLRect butt_rect (fav_btn->getRect());
 	fav_btn->setLandmarkID(item->getUUID());
 	butt_rect.setOriginAndSize(curr_x + button_x_delta, fav_btn->getRect().mBottom, width, fav_btn->getRect().getHeight());
diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h
index 2c6d8d1580..62f2825bbe 100644
--- a/indra/newview/llfavoritesbar.h
+++ b/indra/newview/llfavoritesbar.h
@@ -77,8 +77,8 @@ public:
 
 protected:
 	void updateButtons();
-	LLButton* createButton(const LLPointer<LLViewerInventoryItem> item, LLXMLNodePtr &root, S32 x_offset );
-	LLXMLNodePtr getButtonXMLNode();
+	LLButton* createButton(const LLPointer<LLViewerInventoryItem> item, const LLButton::Params& button_params, S32 x_offset );
+	const LLButton::Params& getButtonParams();
 	BOOL collectFavoriteItems(LLInventoryModel::item_array_t &items);
 
 	void onButtonClick(LLUUID id);
diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp
index b7bca5c6cd..3d37c878ad 100644
--- a/indra/newview/llfloaternotificationsconsole.cpp
+++ b/indra/newview/llfloaternotificationsconsole.cpp
@@ -65,7 +65,7 @@ LLNotificationChannelPanel::LLNotificationChannelPanel(const std::string& channe
 	mChannelRejectsPtr = LLNotificationChannelPtr(
 		LLNotificationChannel::buildChannel(channel_name + "rejects", mChannelPtr->getParentChannelName(),
 											!boost::bind(mChannelPtr->getFilter(), _1)));
-	buildPanel(this, "panel_notifications_channel.xml");
+	buildFromFile( "panel_notifications_channel.xml");
 }
 
 BOOL LLNotificationChannelPanel::postBuild()
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index b61d90043e..8c552d0c06 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -179,32 +179,32 @@ BOOL LLFloaterRegionInfo::postBuild()
 	mInfoPanels.push_back(panel);
 	panel->getCommitCallbackRegistrar().add("RegionInfo.ManageTelehub",	boost::bind(&LLPanelRegionInfo::onClickManageTelehub, panel));
 	
-	buildPanel(panel, "panel_region_general.xml");
+	panel->buildFromFile("panel_region_general.xml");
 	mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true));
 
 	panel = new LLPanelRegionDebugInfo;
 	mInfoPanels.push_back(panel);
-	buildPanel(panel, "panel_region_debug.xml");
+	panel->buildFromFile("panel_region_debug.xml");
 	mTab->addTabPanel(panel);
 
 	panel = new LLPanelRegionTextureInfo;
 	mInfoPanels.push_back(panel);
-	buildPanel(panel, "panel_region_texture.xml");
+	panel->buildFromFile("panel_region_texture.xml");
 	mTab->addTabPanel(panel);
 
 	panel = new LLPanelRegionTerrainInfo;
 	mInfoPanels.push_back(panel);
-	buildPanel(panel, "panel_region_terrain.xml");
+	panel->buildFromFile("panel_region_terrain.xml");
 	mTab->addTabPanel(panel);
 
 	panel = new LLPanelEstateInfo;
 	mInfoPanels.push_back(panel);
-	buildPanel(panel, "panel_region_estate.xml");
+	panel->buildFromFile("panel_region_estate.xml");
 	mTab->addTabPanel(panel);
 
 	panel = new LLPanelEstateCovenant;
 	mInfoPanels.push_back(panel);
-	buildPanel(panel, "panel_region_covenant.xml");
+	panel->buildFromFile("panel_region_covenant.xml");
 	mTab->addTabPanel(panel);
 
 	gMessageSystem->setHandlerFunc(
diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp
index a6f3acd18d..6a20998245 100644
--- a/indra/newview/llfloaterscriptlimits.cpp
+++ b/indra/newview/llfloaterscriptlimits.cpp
@@ -121,7 +121,7 @@ BOOL LLFloaterScriptLimits::postBuild()
 		LLPanelScriptLimitsRegionMemory* panel_memory;
 		panel_memory = new LLPanelScriptLimitsRegionMemory;
 		mInfoPanels.push_back(panel_memory);
-		buildPanel(panel_memory, "panel_script_limits_region_memory.xml");
+		panel_memory->buildFromFile( "panel_script_limits_region_memory.xml");
 		mTab->addTabPanel(panel_memory);
 	}
 	
@@ -130,7 +130,7 @@ BOOL LLFloaterScriptLimits::postBuild()
 	{
 		LLPanelScriptLimitsAttachment* panel_attachments = new LLPanelScriptLimitsAttachment;
 		mInfoPanels.push_back(panel_attachments);
-		buildPanel(panel_attachments, "panel_script_limits_my_avatar.xml");
+		panel_attachments->buildFromFile("panel_script_limits_my_avatar.xml");
 		mTab->addTabPanel(panel_attachments);
 	}
 	
diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp
index 7c2a449343..19790c8868 100644
--- a/indra/newview/llfloateruipreview.cpp
+++ b/indra/newview/llfloateruipreview.cpp
@@ -837,7 +837,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)
 		if (save)
 		{
 			LLXMLNodePtr floater_write = new LLXMLNode();			
-			buildFloater(*floaterp, path, floater_write);	// just build it
+			*floaterp->buildFromFile(path, floater_write);	// just build it
 
 			if (!floater_write->isNull())
 			{
@@ -851,7 +851,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)
 		}
 		else
 		{
-			buildFloater(*floaterp, path, NULL);	// just build it
+			(*floaterp)->buildFromFile(path);	// just build it
 			(*floaterp)->openFloater((*floaterp)->getKey());
 			(*floaterp)->setCanResize((*floaterp)->isResizable());
 		}
@@ -890,7 +890,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)
 		if (save)
 		{
 			LLXMLNodePtr panel_write = new LLXMLNode();
-			buildPanel(panel, path, panel_write);		// build it
+			panel->buildFromFile(path, panel_write);		// build it
 			
 			if (!panel_write->isNull())
 			{
@@ -904,7 +904,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)
 		}
 		else
 		{
-			buildPanel(panel, path);		// build it
+			panel->buildFromFile(path);										// build it
 			LLRect new_size = panel->getRect();								// get its rectangle
 			panel->setOrigin(0,0);											// reset its origin point so it's not offset by -left or other XUI attributes
 			(*floaterp)->setTitle(path);									// use the file name as its title, since panels have no guaranteed meaningful name attribute
diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp
index a192cfda3d..639b664920 100644
--- a/indra/newview/llfloaterurlentry.cpp
+++ b/indra/newview/llfloaterurlentry.cpp
@@ -88,7 +88,7 @@ LLFloaterURLEntry::LLFloaterURLEntry(LLHandle<LLPanel> parent)
 	: LLFloater(LLSD()),
 	  mPanelLandMediaHandle(parent)
 {
-	buildFloater(this, "floater_url_entry.xml", NULL);
+	buildFromFile("floater_url_entry.xml");
 }
 
 //-----------------------------------------------------------------------------
diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp
index af931810a2..f2ca6ea5d1 100644
--- a/indra/newview/llgrouplist.cpp
+++ b/indra/newview/llgrouplist.cpp
@@ -289,7 +289,7 @@ mGroupNameBox(NULL),
 mInfoBtn(NULL),
 mGroupID(LLUUID::null)
 {
-	buildPanel(this, "panel_group_list_item.xml");
+	buildFromFile( "panel_group_list_item.xml");
 
 	// Remember group icon width including its padding from the name text box,
 	// so that we can hide and show the icon again later.
diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp
index c4cea86a31..e0ced5caeb 100644
--- a/indra/newview/llhints.cpp
+++ b/indra/newview/llhints.cpp
@@ -137,9 +137,8 @@ static LLDefaultChildRegistry::Register<LLHintPopup> r("hint_popup");
 
 LLHintPopup::LLHintPopup(const LLHintPopup::Params& p)
 :	mNotification(p.notification),
-	mDirection(p.target_params.direction),
+	mDirection(TOP),
 	mDistance(p.distance),
-	mTarget(p.target_params.target),
 	mArrowLeft(p.left_arrow),
 	mArrowUp(p.up_arrow),
 	mArrowRight(p.right_arrow),
@@ -153,7 +152,12 @@ LLHintPopup::LLHintPopup(const LLHintPopup::Params& p)
 	mFadeOutTime(p.fade_out_time),
 	LLPanel(p)
 {
-	buildPanel(this, "panel_hint.xml", NULL, p);
+	if (p.target_params.isProvided())
+	{
+		mDirection = p.target_params.direction;
+		mTarget = p.target_params.target;
+	}
+	buildFromFile( "panel_hint.xml", NULL, p);
 }
 
 BOOL LLHintPopup::postBuild()
diff --git a/indra/newview/llhudview.cpp b/indra/newview/llhudview.cpp
index beb3b4340a..ae3204e35c 100644
--- a/indra/newview/llhudview.cpp
+++ b/indra/newview/llhudview.cpp
@@ -56,7 +56,7 @@ const S32 HUD_ARROW_SIZE = 32;
 
 LLHUDView::LLHUDView(const LLRect& r)
 {
-	buildPanel(this, "panel_hud.xml");
+	buildFromFile( "panel_hud.xml");
 	setShape(r, true);
 }
 
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 680f937e83..f0fd7e1b7c 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -703,7 +703,7 @@ void LLPanelStandStopFlying::reparent(LLFloaterMove* move_view)
 LLPanelStandStopFlying* LLPanelStandStopFlying::getStandStopFlyingPanel()
 {
 	LLPanelStandStopFlying* panel = new LLPanelStandStopFlying();
-	buildPanel(panel, "panel_stand_stop_flying.xml");
+	panel->buildFromFile("panel_stand_stop_flying.xml");
 
 	panel->setVisible(FALSE);
 	//LLUI::getRootView()->addChild(panel);
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
index e53103237c..32b7a70204 100644
--- a/indra/newview/llnavigationbar.cpp
+++ b/indra/newview/llnavigationbar.cpp
@@ -278,7 +278,7 @@ LLNavigationBar::LLNavigationBar()
 	mPurgeTPHistoryItems(false),
 	mSaveToLocationHistory(false)
 {
-	buildPanel(this, "panel_navigation_bar.xml");
+	buildFromFile( "panel_navigation_bar.xml");
 
 	// set a listener function for LoginComplete event
 	LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLNavigationBar::handleLoginComplete, this));
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index f2207e5c00..d35739d436 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -68,6 +68,29 @@ bool LLOutfitTabNameComparator::compare(const LLAccordionCtrlTab* tab1, const LL
 	return name1 < name2;
 }
 
+const LLAccordionCtrlTab::Params& get_accordion_tab_params()
+{
+	static LLAccordionCtrlTab::Params tab_params;
+	static bool initialized = false;
+	if (!initialized)
+	{
+		initialized = true;
+
+		LLXMLNodePtr xmlNode;
+		if (LLUICtrlFactory::getLayeredXMLNode("outfit_accordion_tab.xml", xmlNode))
+		{
+			LLXUIParser::instance().readXUI(xmlNode, tab_params, "outfit_accordion_tab.xml");
+		}
+		else
+		{
+			llwarns << "Failed to read xml of Outfit's Accordion Tab from outfit_accordion_tab.xml" << llendl;
+		}
+	}
+
+	return tab_params;
+}
+
+
 //////////////////////////////////////////////////////////////////////////
 
 class LLOutfitListGearMenu
@@ -442,8 +465,8 @@ void LLOutfitsList::refreshList(const LLUUID& category_id)
 
 		std::string name = cat->getName();
 
-		static LLXMLNodePtr accordionXmlNode = getAccordionTabXMLNode();
-		LLAccordionCtrlTab* tab = LLUICtrlFactory::defaultBuilder<LLAccordionCtrlTab>(accordionXmlNode, NULL, NULL);
+		LLAccordionCtrlTab::Params tab_params(get_accordion_tab_params());
+		LLAccordionCtrlTab* tab = LLUICtrlFactory::create<LLAccordionCtrlTab>(tab_params);
 
 		tab->setName(name);
 		tab->setTitle(name);
@@ -736,19 +759,6 @@ bool LLOutfitsList::hasItemSelected()
 //////////////////////////////////////////////////////////////////////////
 // Private methods
 //////////////////////////////////////////////////////////////////////////
-LLXMLNodePtr LLOutfitsList::getAccordionTabXMLNode()
-{
-	LLXMLNodePtr xmlNode = NULL;
-	bool success = LLUICtrlFactory::getLayeredXMLNode("outfit_accordion_tab.xml", xmlNode);
-	if (!success)
-	{
-		llwarns << "Failed to read xml of Outfit's Accordion Tab from outfit_accordion_tab.xml" << llendl;
-		return NULL;
-	}
-
-	return xmlNode;
-}
-
 void LLOutfitsList::computeDifference(
 	const LLInventoryModel::cat_array_t& vcats, 
 	uuid_vec_t& vadded, 
diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h
index 206854b232..b3bc35dcda 100644
--- a/indra/newview/lloutfitslist.h
+++ b/indra/newview/lloutfitslist.h
@@ -116,12 +116,6 @@ public:
 	bool hasItemSelected();
 
 private:
-	/**
-	 * Reads xml with accordion tab and Flat list from xml file.
-	 *
-	 * @return LLPointer to XMLNode with accordion tab and flat list.
-	 */
-	LLXMLNodePtr getAccordionTabXMLNode();
 
 	/**
 	 * Wrapper for LLCommonUtils::computeDifference. @see LLCommonUtils::computeDifference
diff --git a/indra/newview/llpanelavatartag.cpp b/indra/newview/llpanelavatartag.cpp
index 0ffb10b18b..489222fb2a 100644
--- a/indra/newview/llpanelavatartag.cpp
+++ b/indra/newview/llpanelavatartag.cpp
@@ -43,7 +43,7 @@ LLPanelAvatarTag::LLPanelAvatarTag(const LLUUID& key, const std::string im_time)
 	, mAvatarId(LLUUID::null)
 //	, mFadeTimer()
 {
-	buildPanel(this, "panel_avatar_tag.xml");
+	buildFromFile( "panel_avatar_tag.xml");
 	setLeftButtonClickCallback(boost::bind(&LLPanelAvatarTag::onClick, this));
 	setAvatarId(key);
 	setTime(im_time);
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp
index 4d3d54ed15..8e0ebfa406 100644
--- a/indra/newview/llpanelclassified.cpp
+++ b/indra/newview/llpanelclassified.cpp
@@ -144,7 +144,7 @@ LLPanelClassifiedInfo::~LLPanelClassifiedInfo()
 LLPanelClassifiedInfo* LLPanelClassifiedInfo::create()
 {
 	LLPanelClassifiedInfo* panel = new LLPanelClassifiedInfo();
-	buildPanel(panel, "panel_classified_info.xml");
+	panel->buildFromFile("panel_classified_info.xml");
 	return panel;
 }
 
@@ -617,7 +617,7 @@ LLPanelClassifiedEdit::~LLPanelClassifiedEdit()
 LLPanelClassifiedEdit* LLPanelClassifiedEdit::create()
 {
 	LLPanelClassifiedEdit* panel = new LLPanelClassifiedEdit();
-	buildPanel(panel, "panel_edit_classified.xml");
+	panel->buildFromFile("panel_edit_classified.xml");
 	return panel;
 }
 
diff --git a/indra/newview/llpanelgenerictip.cpp b/indra/newview/llpanelgenerictip.cpp
index 709ed33ed1..7a05a2b8e7 100644
--- a/indra/newview/llpanelgenerictip.cpp
+++ b/indra/newview/llpanelgenerictip.cpp
@@ -42,7 +42,7 @@ LLPanelGenericTip::LLPanelGenericTip(
 		const LLNotificationPtr& notification) :
 		LLPanelTipToast(notification)
 {
-	buildPanel(this, "panel_generic_tip.xml");
+	buildFromFile( "panel_generic_tip.xml");
 
 	getChild<LLUICtrl>("message")->setValue(notification->getMessage());
 
diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp
index b610fa9899..5d70e8bb30 100644
--- a/indra/newview/llpanelgroupinvite.cpp
+++ b/indra/newview/llpanelgroupinvite.cpp
@@ -375,7 +375,7 @@ LLPanelGroupInvite::LLPanelGroupInvite(const LLUUID& group_id)
 	  mPendingUpdate(FALSE)
 {
 	// Pass on construction of this panel to the control factory.
-	buildPanel(this, "panel_group_invite.xml");
+	buildFromFile( "panel_group_invite.xml");
 }
 
 LLPanelGroupInvite::~LLPanelGroupInvite()
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 9ad39d568c..038944802e 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -202,7 +202,7 @@ LLLandmarksPanel::LLLandmarksPanel()
 	mInventoryObserver = new LLLandmarksPanelObserver(this);
 	gInventory.addObserver(mInventoryObserver);
 
-	buildPanel(this, "panel_landmarks.xml");
+	buildFromFile( "panel_landmarks.xml");
 }
 
 LLLandmarksPanel::~LLLandmarksPanel()
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 6b71e37337..637a4968b0 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -193,7 +193,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
 	// Logo
 	mLogoImage = LLUI::getUIImage("startup_logo");
 
-	buildPanel(this, "panel_login.xml");
+	buildFromFile( "panel_login.xml");
 	
 #if USE_VIEWER_AUTH
 	//leave room for the login menu bar
diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp
index 389fe8edbf..ca62a676ce 100644
--- a/indra/newview/llpanelme.cpp
+++ b/indra/newview/llpanelme.cpp
@@ -168,7 +168,7 @@ void LLPanelMe::onCancelClicked()
 LLPanelMyProfileEdit::LLPanelMyProfileEdit() 
  : LLPanelMyProfile()
 {
-	buildPanel(this, "panel_edit_profile.xml");
+	buildFromFile( "panel_edit_profile.xml");
 
 	setAvatarId(gAgent.getID());
 }
diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp
index 54703d3cdc..b0ee4e92ad 100644
--- a/indra/newview/llpanelmediasettingsgeneral.cpp
+++ b/indra/newview/llpanelmediasettingsgeneral.cpp
@@ -80,7 +80,7 @@ LLPanelMediaSettingsGeneral::LLPanelMediaSettingsGeneral() :
 	mMediaEditable(false)
 {
 	// build dialog from XML
-	buildPanel(this, "panel_media_settings_general.xml");
+	buildFromFile( "panel_media_settings_general.xml");
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llpanelmediasettingspermissions.cpp b/indra/newview/llpanelmediasettingspermissions.cpp
index 389003dc45..eebfd6bc77 100644
--- a/indra/newview/llpanelmediasettingspermissions.cpp
+++ b/indra/newview/llpanelmediasettingspermissions.cpp
@@ -65,7 +65,7 @@ LLPanelMediaSettingsPermissions::LLPanelMediaSettingsPermissions() :
     mPermsWorldControl( 0 )
 {
     // build dialog from XML
-    buildPanel(this, "panel_media_settings_permissions.xml");
+    buildFromFile( "panel_media_settings_permissions.xml");
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llpanelmediasettingssecurity.cpp b/indra/newview/llpanelmediasettingssecurity.cpp
index 502ba179d3..75f29f1002 100644
--- a/indra/newview/llpanelmediasettingssecurity.cpp
+++ b/indra/newview/llpanelmediasettingssecurity.cpp
@@ -59,7 +59,7 @@ LLPanelMediaSettingsSecurity::LLPanelMediaSettingsSecurity() :
 	mCommitCallbackRegistrar.add("Media.whitelistDelete",	boost::bind(&LLPanelMediaSettingsSecurity::onBtnDel, this));	
 
 	// build dialog from XML
-	buildPanel(this, "panel_media_settings_security.xml");
+	buildFromFile( "panel_media_settings_security.xml");
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp
index e477d71712..49567b2ed8 100644
--- a/indra/newview/llpanelnearbymedia.cpp
+++ b/indra/newview/llpanelnearbymedia.cpp
@@ -102,7 +102,7 @@ LLPanelNearByMedia::LLPanelNearByMedia()
 	mCommitCallbackRegistrar.add("SelectedMediaCtrl.Zoom",		boost::bind(&LLPanelNearByMedia::onClickSelectedMediaZoom, this));
 	mCommitCallbackRegistrar.add("SelectedMediaCtrl.Unzoom",	boost::bind(&LLPanelNearByMedia::onClickSelectedMediaUnzoom, this));
 	
-	buildPanel(this, "panel_nearby_media.xml");
+	buildFromFile( "panel_nearby_media.xml");
 }
 
 LLPanelNearByMedia::~LLPanelNearByMedia()
diff --git a/indra/newview/llpanelonlinestatus.cpp b/indra/newview/llpanelonlinestatus.cpp
index 43c3ed782d..e77df757a5 100644
--- a/indra/newview/llpanelonlinestatus.cpp
+++ b/indra/newview/llpanelonlinestatus.cpp
@@ -41,7 +41,7 @@ LLPanelOnlineStatus::LLPanelOnlineStatus(
 	LLPanelTipToast(notification)
 {
 
-	buildPanel(this,
+	buildFromFile(
 			"panel_online_status_toast.xml");
 
 
diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp
index 0417c65f7a..2e87a8eecb 100644
--- a/indra/newview/llpanelpick.cpp
+++ b/indra/newview/llpanelpick.cpp
@@ -80,7 +80,7 @@
 LLPanelPickInfo* LLPanelPickInfo::create()
 {
 	LLPanelPickInfo* panel = new LLPanelPickInfo();
-	buildPanel(panel, XML_PANEL_PICK_INFO);
+	panel->buildFromFile(XML_PANEL_PICK_INFO);
 	return panel;
 }
 
@@ -350,7 +350,7 @@ void LLPanelPickInfo::onClickBack()
 LLPanelPickEdit* LLPanelPickEdit::create()
 {
 	LLPanelPickEdit* panel = new LLPanelPickEdit();
-	buildPanel(panel, XML_PANEL_EDIT_PICK);
+	panel->buildFromFile(XML_PANEL_EDIT_PICK);
 	return panel;
 }
 
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
index 653f3726a9..2efb664f2e 100644
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -1045,7 +1045,7 @@ LLPickItem::LLPickItem()
 , mSnapshotID(LLUUID::null)
 , mNeedData(true)
 {
-	buildPanel(this,"panel_pick_list_item.xml");
+	buildFromFile("panel_pick_list_item.xml");
 }
 
 LLPickItem::~LLPickItem()
@@ -1175,7 +1175,7 @@ LLClassifiedItem::LLClassifiedItem(const LLUUID& avatar_id, const LLUUID& classi
  , mAvatarId(avatar_id)
  , mClassifiedId(classified_id)
 {
-	buildPanel(this,"panel_classifieds_list_item.xml");
+	buildFromFile("panel_classifieds_list_item.xml");
 
 	LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this);
 	LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId());
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp
index 83e674ee92..e7af7e480d 100644
--- a/indra/newview/llpanelplaces.cpp
+++ b/indra/newview/llpanelplaces.cpp
@@ -252,7 +252,7 @@ LLPanelPlaces::LLPanelPlaces()
 	LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(
 			boost::bind(&LLPanelPlaces::updateVerbs, this));
 
-	//buildPanel(this, "panel_places.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
+	//buildFromFile( "panel_places.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
 }
 
 LLPanelPlaces::~LLPanelPlaces()
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index 68522ffac3..6552a296b6 100644
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -119,7 +119,7 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() :
 	mCommitCallbackRegistrar.add("MediaCtrl.SkipBack",		boost::bind(&LLPanelPrimMediaControls::onClickSkipBack, this));
 	mCommitCallbackRegistrar.add("MediaCtrl.SkipForward",	boost::bind(&LLPanelPrimMediaControls::onClickSkipForward, this));
 	
-	buildPanel(this, "panel_prim_media_controls.xml");
+	buildFromFile( "panel_prim_media_controls.xml");
 	mInactivityTimer.reset();
 	mFadeTimer.stop();
 	mCurrentZoom = ZOOM_NONE;
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index b398d75feb..7e0bd2f8e6 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -131,7 +131,7 @@ LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistor
 	mRegionName(region_name),
 	mHighlight(hl)
 {
-	buildPanel(this, "panel_teleport_history_item.xml");
+	buildFromFile( "panel_teleport_history_item.xml");
 }
 
 LLTeleportHistoryFlatItem::~LLTeleportHistoryFlatItem()
@@ -382,7 +382,7 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel()
 		mLastSelectedFlatlList(NULL),
 		mLastSelectedItemIndex(-1)
 {
-	buildPanel(this, "panel_teleport_history.xml");
+	buildFromFile( "panel_teleport_history.xml");
 }
 
 LLTeleportHistoryPanel::~LLTeleportHistoryPanel()
diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp
index 6e69e6d44c..1ee143b42e 100644
--- a/indra/newview/llpaneltopinfobar.cpp
+++ b/indra/newview/llpaneltopinfobar.cpp
@@ -72,7 +72,7 @@ LLPanelTopInfoBar::LLPanelTopInfoBar(): mParcelChangedObserver(0)
 	LLUICtrl::CommitCallbackRegistry::currentRegistrar()
 			.add("TopInfoBar.Action", boost::bind(&LLPanelTopInfoBar::onContextMenuItemClicked, this, _2));
 
-	buildPanel(this, "panel_topinfo_bar.xml");
+	buildFromFile( "panel_topinfo_bar.xml");
 }
 
 LLPanelTopInfoBar::~LLPanelTopInfoBar()
diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp
index a038badb01..9d997f23d7 100644
--- a/indra/newview/llpanelvolumepulldown.cpp
+++ b/indra/newview/llpanelvolumepulldown.cpp
@@ -60,7 +60,7 @@ LLPanelVolumePulldown::LLPanelVolumePulldown()
 
     mCommitCallbackRegistrar.add("Vol.setControlFalse", boost::bind(&LLPanelVolumePulldown::setControlFalse, this, _2));
 	mCommitCallbackRegistrar.add("Vol.GoAudioPrefs", boost::bind(&LLPanelVolumePulldown::onAdvancedButtonClick, this, _2));
-	buildPanel(this, "panel_volume_pulldown.xml");
+	buildFromFile( "panel_volume_pulldown.xml");
 }
 
 BOOL LLPanelVolumePulldown::postBuild()
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index ce465927bb..31ea69a889 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -157,7 +157,7 @@ LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core)
 :	LLFloater(LLSD()),
 	mEditorCore(editor_core)
 {
-	buildFloater(this,"floater_script_search.xml", NULL);
+	buildFromFile("floater_script_search.xml");
 
 	sInstance = this;
 	
@@ -660,7 +660,7 @@ void LLScriptEdCore::onBtnDynamicHelp()
 	if (!live_help_floater)
 	{
 		live_help_floater = new LLFloater(LLSD());
-		LLFloater::buildFloater(live_help_floater, "floater_lsl_guide.xml", NULL);
+		live_help_floater->buildFromFile("floater_lsl_guide.xml", NULL);
 		LLFloater* parent = dynamic_cast<LLFloater*>(getParent());
 		llassert(parent);
 		if (parent)
diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp
index 4c2469909b..3ca6d62d93 100644
--- a/indra/newview/llscrollingpanelparam.cpp
+++ b/indra/newview/llscrollingpanelparam.cpp
@@ -62,7 +62,7 @@ LLScrollingPanelParam::LLScrollingPanelParam( const LLPanel::Params& panel_param
 	  mAllowModify(allow_modify),
 	  mWearable(wearable)
 {
-	buildPanel(this, "panel_scrolling_param.xml");
+	buildFromFile( "panel_scrolling_param.xml");
 
 	// *HACK To avoid hard coding texture position, lets use border's position for texture. 
 	LLViewBorder* left_border = getChild<LLViewBorder>("left_border");
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index aa29f6cb26..cdd2761024 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -56,7 +56,7 @@ LLSidepanelInventory::LLSidepanelInventory()
 		mPanelMainInventory(NULL)
 {
 
-	//buildPanel(this, "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
+	//buildFromFile( "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
 }
 
 LLSidepanelInventory::~LLSidepanelInventory()
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 8d61bb94e1..63e54fdeb2 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -142,7 +142,7 @@ LLStatusBar::LLStatusBar(const LLRect& rect)
 	mBalanceTimer = new LLFrameTimer();
 	mHealthTimer = new LLFrameTimer();
 
-	buildPanel(this,"panel_status_bar.xml");
+	buildFromFile("panel_status_bar.xml");
 }
 
 LLStatusBar::~LLStatusBar()
diff --git a/indra/newview/llsyswellitem.cpp b/indra/newview/llsyswellitem.cpp
index 79b053da24..794d413867 100644
--- a/indra/newview/llsyswellitem.cpp
+++ b/indra/newview/llsyswellitem.cpp
@@ -44,7 +44,7 @@ LLSysWellItem::LLSysWellItem(const Params& p) : LLPanel(p),
 												mTitle(NULL),
 												mCloseBtn(NULL)
 {
-	buildPanel(this, "panel_sys_well_item.xml");
+	buildFromFile( "panel_sys_well_item.xml");
 
 	mTitle = getChild<LLTextBox>("title");
 	mCloseBtn = getChild<LLButton>("close_btn");
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp
index 89fd22a2a0..d971318f21 100644
--- a/indra/newview/llsyswellwindow.cpp
+++ b/indra/newview/llsyswellwindow.cpp
@@ -255,7 +255,7 @@ LLIMWellWindow::RowPanel::RowPanel(const LLSysWellWindow* parent, const LLUUID&
 		S32 chicletCounter, const std::string& name, const LLUUID& otherParticipantId) :
 		LLPanel(LLPanel::Params()), mChiclet(NULL), mParent(parent)
 {
-	buildPanel(this, "panel_activeim_row.xml", NULL);
+	buildFromFile( "panel_activeim_row.xml", NULL);
 
 	// Choose which of the pre-created chiclets (IM/group) to use.
 	// The other one gets hidden.
@@ -352,7 +352,7 @@ LLIMWellWindow::ObjectRowPanel::ObjectRowPanel(const LLUUID& notification_id, bo
  : LLPanel()
  , mChiclet(NULL)
 {
-	buildPanel(this, "panel_active_object_row.xml", NULL);
+	buildFromFile( "panel_active_object_row.xml", NULL);
 
 	initChiclet(notification_id);
 
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index 06c95b5e9c..5fdc6765a8 100644
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -83,7 +83,7 @@ LLToast::LLToast(const LLToast::Params& p)
 {
 	mTimer.reset(new LLToastLifeTimer(this, p.lifetime_secs));
 
-	buildFloater(this, "panel_toast.xml", NULL);
+	buildFromFile("panel_toast.xml", NULL);
 
 	setCanDrag(FALSE);
 
diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp
index 7c2e68f942..f76c9adb78 100644
--- a/indra/newview/lltoastgroupnotifypanel.cpp
+++ b/indra/newview/lltoastgroupnotifypanel.cpp
@@ -60,7 +60,7 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification
 :	LLToastPanel(notification),
 	mInventoryOffer(NULL)
 {
-	buildPanel(this, "panel_group_notify.xml");
+	buildFromFile( "panel_group_notify.xml");
 	const LLSD& payload = notification->getPayload();
 	LLGroupData groupData;
 	if (!gAgent.getGroupData(payload["group_id"].asUUID(),groupData))
diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp
index fc01b7f0d5..ffe6c80f32 100644
--- a/indra/newview/lltoastimpanel.cpp
+++ b/indra/newview/lltoastimpanel.cpp
@@ -51,7 +51,7 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) :	LLToastPanel(p.notif
 								mAvatarIcon(NULL), mAvatarName(NULL),
 								mTime(NULL), mMessage(NULL), mGroupIcon(NULL)
 {
-	buildPanel(this, "panel_instant_message.xml");
+	buildFromFile( "panel_instant_message.xml");
 
 	mGroupIcon = getChild<LLGroupIconCtrl>("group_icon");
 	mAvatarIcon = getChild<LLAvatarIconCtrl>("avatar_icon");
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index 32e12035ee..0f22cb7778 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -67,7 +67,7 @@ mNumButtons(0),
 mAddedDefaultBtn(false),
 mCloseNotificationOnDestroy(true)
 {
-	buildPanel(this, "panel_notification.xml");
+	buildFromFile( "panel_notification.xml");
 	if(rect != LLRect::null)
 	{
 		this->setShape(rect);
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 141d7d6b86..602e641fe8 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -7255,7 +7255,7 @@ void handle_load_from_xml(void*)
 	{
 		std::string filename = picker.getFirstFile();
 		LLFloater* floater = new LLFloater(LLSD());
-		LLFloater::buildFloater(floater, filename, NULL);
+		floater->buildFromFile(filename);
 	}
 }
 
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index c5dee710cb..ac45daf810 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1521,7 +1521,7 @@ void LLViewerWindow::initBase()
 	// (But wait to add it as a child of the root view so that it will be in front of the 
 	// other views.)
 	MainPanel* main_view = new MainPanel();
-	LLPanel::buildPanel(main_view, "main_view.xml");
+	main_view->buildFromFile("main_view.xml");
 	main_view->setShape(full_window);
 	getRootView()->addChild(main_view);
 
-- 
cgit v1.2.3


From 8f82c6a75795b5de746574432571ce468a43d13b Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 20 Aug 2010 14:36:34 -0700
Subject: fixed build

---
 indra/newview/llfloateruipreview.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp
index 19790c8868..9d75900ebf 100644
--- a/indra/newview/llfloateruipreview.cpp
+++ b/indra/newview/llfloateruipreview.cpp
@@ -837,7 +837,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)
 		if (save)
 		{
 			LLXMLNodePtr floater_write = new LLXMLNode();			
-			*floaterp->buildFromFile(path, floater_write);	// just build it
+			(*floaterp)->buildFromFile(path, floater_write);	// just build it
 
 			if (!floater_write->isNull())
 			{
-- 
cgit v1.2.3


From e948c4d9a95633f0b9eda9fbcb6e79ebacda8ef5 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 20 Aug 2010 14:36:46 -0700
Subject: removed unused template function

---
 indra/llui/llsdparam.h | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h
index 71b0a45630..d8af3c9bce 100644
--- a/indra/llui/llsdparam.h
+++ b/indra/llui/llsdparam.h
@@ -56,15 +56,6 @@ public:
 private:
 	void readSDValues(const LLSD& sd, LLInitParam::BaseBlock& block);
 
-	template<typename T>
-	bool readTypedValue(void* val_ptr, boost::function<T(const LLSD&)> parser_func)
-    {
-	    if (!mCurReadSD) return false;
-
-	    *((T*)val_ptr) = parser_func(*mCurReadSD);
-	    return true;
-    }
-
 	template<typename T>
 	bool writeTypedValue(const void* val_ptr, const parser_t::name_stack_t& name_stack)
 	{
-- 
cgit v1.2.3


From c7540c6a039b107a014d89eed6c01c02aaa86335 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 20 Aug 2010 14:36:54 -0700
Subject: fixed spelling error

---
 indra/newview/app_settings/cmd_line.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml
index 5f143431de..00d69f805e 100644
--- a/indra/newview/app_settings/cmd_line.xml
+++ b/indra/newview/app_settings/cmd_line.xml
@@ -296,7 +296,7 @@
     <key>multiple</key>		  
     <map>
       <key>desc</key>
-      <string>Allow multple viewers.</string>
+      <string>Allow multiple viewers.</string>
       <key>map-to</key>
       <string>AllowMultipleViewers</string>
     </map>
-- 
cgit v1.2.3


From 9d64b4adf5e455336cbac0ece1598e14ebe40a48 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 20 Aug 2010 14:48:50 -0700
Subject: DEV-52870 FIX Inventory Notification not given if first Inventory
 Item comes from a user sharing an object or purchase from xstreet

---
 indra/newview/llviewermessage.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 71dff61f41..7bf1031253 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1889,6 +1889,8 @@ void inventory_offer_handler(LLOfferInfo* info)
 		    LLPostponedNotification::add<LLPostponedOfferNotification>(p, info->mFromID, false);
 		}
 	}
+
+	LLFirstUse::newInventory();
 }
 
 bool lure_callback(const LLSD& notification, const LLSD& response)
-- 
cgit v1.2.3


From 2ddeabec91cf14d252e7a0d4687fe2a46eeff8b7 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 20 Aug 2010 16:29:35 -0700
Subject: added llfasttimer_class.h to project

---
 indra/llcommon/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 2a036df06e..858e483036 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -157,6 +157,7 @@ set(llcommon_HEADER_FILES
     lleventemitter.h
     llextendedstatus.h
     llfasttimer.h
+    llfasttimer_class.h
     llfile.h
     llfindlocale.h
     llfixedbuffer.h
-- 
cgit v1.2.3


From 65c9914d23022df6a39db50ce295750f08695893 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Mon, 23 Aug 2010 11:03:19 -0700
Subject: made Params parsers not act as singletons

---
 indra/llui/llfloater.cpp                           |   6 +-
 indra/llui/lllayoutstack.cpp                       |   6 +-
 indra/llui/llpanel.cpp                             |  17 +-
 indra/llui/llrngwriter.cpp                         |   5 +
 indra/llui/llscrolllistctrl.cpp                    |   6 +-
 indra/llui/llsdparam.cpp                           |  28 ++-
 indra/llui/llsdparam.h                             |   7 +-
 indra/llui/llui.cpp                                |   3 +-
 indra/llui/lluicolortable.cpp                      |   6 +-
 indra/llui/lluictrlfactory.cpp                     |   3 +-
 indra/llui/lluictrlfactory.h                       |   6 +-
 indra/llui/llview.cpp                              |   6 +-
 indra/llui/llview.h                                |  12 +-
 indra/llxuixml/llinitparam.h                       |  65 ++++---
 indra/llxuixml/lltrans.cpp                         |   6 +-
 indra/llxuixml/llxuiparser.cpp                     | 202 +++++++++++++--------
 indra/llxuixml/llxuiparser.h                       |  51 +++---
 indra/newview/llfavoritesbar.cpp                   |   3 +-
 indra/newview/llhints.cpp                          |   3 +-
 indra/newview/llnamelistctrl.cpp                   |   3 +-
 indra/newview/lloutfitslist.cpp                    |   3 +-
 indra/newview/llviewertexturelist.cpp              |   3 +-
 indra/newview/skins/default/xui/en/floater_aaa.xml |  61 +++++--
 23 files changed, 305 insertions(+), 206 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 0cd692b4a4..e7d0950846 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -2780,7 +2780,8 @@ LLFastTimer::DeclareTimer POST_BUILD("Floater Post Build");
 bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node)
 {
 	Params params(LLUICtrlFactory::getDefaultParams<LLFloater>());
-	LLXUIParser::instance().readXUI(node, params, filename); // *TODO: Error checking
+	LLXUIParser parser;
+	parser.readXUI(node, params, filename); // *TODO: Error checking
 
 	if (output_node)
 	{
@@ -2788,8 +2789,7 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str
 		setupParamsForExport(output_params, parent);
         Params default_params(LLUICtrlFactory::getDefaultParams<LLFloater>());
 		output_node->setName(node->getName()->mString);
-		LLXUIParser::instance().writeXUI(
-			output_node, output_params, &default_params);
+		parser.writeXUI(output_node, output_params, &default_params);
 	}
 
 	// Default floater position to top-left corner of screen
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 4512091371..2e6e4912bf 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -238,7 +238,8 @@ static void get_attribute_bool_and_write(LLXMLNodePtr node,
 LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node)
 {
 	LLLayoutStack::Params p(LLUICtrlFactory::getDefaultParams<LLLayoutStack>());
-	LLXUIParser::instance().readXUI(node, p, LLUICtrlFactory::getInstance()->getCurFileName());
+	LLXUIParser parser;
+	parser.readXUI(node, p, LLUICtrlFactory::getInstance()->getCurFileName());
 
 	// Export must happen before setupParams() mungles rectangles and before
 	// this item gets added to parent (otherwise screws up last_child_rect
@@ -249,8 +250,7 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o
 		setupParamsForExport(output_params, parent);
 		LLLayoutStack::Params default_params(LLUICtrlFactory::getDefaultParams<LLLayoutStack>());
 		output_node->setName(node->getName()->mString);
-		LLXUIParser::instance().writeXUI(
-			output_node, output_params, &default_params);
+		parser.writeXUI(output_node, output_params, &default_params);
 	}
 
 	p.from_xui = true;
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 51c8f6c743..4471f315c0 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -389,8 +389,7 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_
 
 	LLPanel* panelp = NULL;
 	
-	{
-		LLFastTimer timer(FTM_PANEL_CONSTRUCTION);
+	{	LLFastTimer _(FTM_PANEL_CONSTRUCTION);
 		
 		if(!class_attr.empty())
 		{
@@ -512,6 +511,8 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu
 			setXMLFilename(xml_filename);
 		}
 
+		LLXUIParser parser;
+
 		if (!xml_filename.empty())
 		{
 			LLUICtrlFactory::instance().pushFileName(xml_filename);
@@ -521,12 +522,11 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu
 			{
 				//if we are exporting, we want to export the current xml
 				//not the referenced xml
-				LLXUIParser::instance().readXUI(node, params, LLUICtrlFactory::getInstance()->getCurFileName());
+				parser.readXUI(node, params, LLUICtrlFactory::getInstance()->getCurFileName());
 				Params output_params(params);
 				setupParamsForExport(output_params, parent);
 				output_node->setName(node->getName()->mString);
-				LLXUIParser::instance().writeXUI(
-					output_node, output_params, &default_params);
+				parser.writeXUI(output_node, output_params, &default_params);
 				return TRUE;
 			}
 		
@@ -537,7 +537,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu
 				return FALSE;
 			}
 
-			LLXUIParser::instance().readXUI(referenced_xml, params, LLUICtrlFactory::getInstance()->getCurFileName());
+			parser.readXUI(referenced_xml, params, LLUICtrlFactory::getInstance()->getCurFileName());
 
 			// add children using dimensions from referenced xml for consistent layout
 			setShape(params.rect);
@@ -547,15 +547,14 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu
 		}
 
 		// ask LLUICtrlFactory for filename, since xml_filename might be empty
-		LLXUIParser::instance().readXUI(node, params, LLUICtrlFactory::getInstance()->getCurFileName());
+		parser.readXUI(node, params, LLUICtrlFactory::getInstance()->getCurFileName());
 
 		if (output_node)
 		{
 			Params output_params(params);
 			setupParamsForExport(output_params, parent);
 			output_node->setName(node->getName()->mString);
-			LLXUIParser::instance().writeXUI(
-				output_node, output_params, &default_params);
+			parser.writeXUI(output_node, output_params, &default_params);
 		}
 		
 		params.from_xui = true;
diff --git a/indra/llui/llrngwriter.cpp b/indra/llui/llrngwriter.cpp
index 7e3d4b92d3..718c10d2f8 100644
--- a/indra/llui/llrngwriter.cpp
+++ b/indra/llui/llrngwriter.cpp
@@ -36,10 +36,15 @@
 #include "lluicolor.h"
 #include "lluictrlfactory.h"
 
+static 	LLInitParam::Parser::parser_read_func_map_t sReadFuncs;
+static 	LLInitParam::Parser::parser_write_func_map_t sWriteFuncs;
+static 	LLInitParam::Parser::parser_inspect_func_map_t sInspectFuncs;
+
 //
 // LLRNGWriter - writes Relax NG schema files based on a param block
 //
 LLRNGWriter::LLRNGWriter()
+: Parser(sReadFuncs, sWriteFuncs, sInspectFuncs)
 {
 	// register various callbacks for inspecting the contents of a param block
 	registerInspectFunc<bool>(boost::bind(&LLRNGWriter::writeAttribute, this, "boolean", _1, _2, _3, _4));
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index d356f061f9..844278e41c 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -2568,7 +2568,8 @@ BOOL	LLScrollListCtrl::canDeselect() const
 void LLScrollListCtrl::addColumn(const LLSD& column, EAddPosition pos)
 {
 	LLScrollListColumn::Params p;
-	LLParamSDParser::instance().readSD(column, p);
+	LLParamSDParser parser;
+	parser.readSD(column, p);
 	addColumn(p, pos);
 }
 
@@ -2759,7 +2760,8 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& element, EAddPosition
 {
 	LLFastTimer _(FTM_ADD_SCROLLLIST_ELEMENT);
 	LLScrollListItem::Params item_params;
-	LLParamSDParser::instance().readSD(element, item_params);
+	LLParamSDParser parser;
+	parser.readSD(element, item_params);
 	item_params.userdata = userdata;
 	return addRow(item_params, pos);
 }
diff --git a/indra/llui/llsdparam.cpp b/indra/llui/llsdparam.cpp
index 7d37127584..338569fc58 100644
--- a/indra/llui/llsdparam.cpp
+++ b/indra/llui/llsdparam.cpp
@@ -36,23 +36,31 @@
 // Project includes
 #include "llsdparam.h"
 
+static 	LLInitParam::Parser::parser_read_func_map_t sReadFuncs;
+static 	LLInitParam::Parser::parser_write_func_map_t sWriteFuncs;
+static 	LLInitParam::Parser::parser_inspect_func_map_t sInspectFuncs;
+
 //
 // LLParamSDParser
 //
 LLParamSDParser::LLParamSDParser()
+: Parser(sReadFuncs, sWriteFuncs, sInspectFuncs)
 {
 	using boost::bind;
 
-	registerParserFuncs<S32>(readS32, bind(&LLParamSDParser::writeTypedValue<S32>, this, _1, _2));
-	registerParserFuncs<U32>(readU32, bind(&LLParamSDParser::writeU32Param, this, _1, _2));
-	registerParserFuncs<F32>(readF32, bind(&LLParamSDParser::writeTypedValue<F32>, this, _1, _2));
-	registerParserFuncs<F64>(readF64, bind(&LLParamSDParser::writeTypedValue<F64>, this, _1, _2));
-	registerParserFuncs<bool>(readBool, bind(&LLParamSDParser::writeTypedValue<F32>, this, _1, _2));
-	registerParserFuncs<std::string>(readString, bind(&LLParamSDParser::writeTypedValue<std::string>, this, _1, _2));
-	registerParserFuncs<LLUUID>(readUUID, bind(&LLParamSDParser::writeTypedValue<LLUUID>, this, _1, _2));
-	registerParserFuncs<LLDate>(readDate, bind(&LLParamSDParser::writeTypedValue<LLDate>, this, _1, _2));
-	registerParserFuncs<LLURI>(readURI, bind(&LLParamSDParser::writeTypedValue<LLURI>, this, _1, _2));
-	registerParserFuncs<LLSD>(readSD, bind(&LLParamSDParser::writeTypedValue<LLSD>, this, _1, _2));
+	if (sReadFuncs.empty())
+	{
+		registerParserFuncs<S32>(readS32, bind(&LLParamSDParser::writeTypedValue<S32>, this, _1, _2));
+		registerParserFuncs<U32>(readU32, bind(&LLParamSDParser::writeU32Param, this, _1, _2));
+		registerParserFuncs<F32>(readF32, bind(&LLParamSDParser::writeTypedValue<F32>, this, _1, _2));
+		registerParserFuncs<F64>(readF64, bind(&LLParamSDParser::writeTypedValue<F64>, this, _1, _2));
+		registerParserFuncs<bool>(readBool, bind(&LLParamSDParser::writeTypedValue<F32>, this, _1, _2));
+		registerParserFuncs<std::string>(readString, bind(&LLParamSDParser::writeTypedValue<std::string>, this, _1, _2));
+		registerParserFuncs<LLUUID>(readUUID, bind(&LLParamSDParser::writeTypedValue<LLUUID>, this, _1, _2));
+		registerParserFuncs<LLDate>(readDate, bind(&LLParamSDParser::writeTypedValue<LLDate>, this, _1, _2));
+		registerParserFuncs<LLURI>(readURI, bind(&LLParamSDParser::writeTypedValue<LLURI>, this, _1, _2));
+		registerParserFuncs<LLSD>(readSD, bind(&LLParamSDParser::writeTypedValue<LLSD>, this, _1, _2));
+	}
 }
 
 // special case handling of U32 due to ambiguous LLSD::assign overload
diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h
index d8af3c9bce..e98318fc1e 100644
--- a/indra/llui/llsdparam.h
+++ b/indra/llui/llsdparam.h
@@ -37,17 +37,14 @@
 #include "llinitparam.h"
 
 class LLParamSDParser 
-:	public LLInitParam::Parser, 
-	public LLSingleton<LLParamSDParser>
+:	public LLInitParam::Parser
 {
 LOG_CLASS(LLParamSDParser);
 
 typedef LLInitParam::Parser parser_t;
 
-protected:
-	LLParamSDParser();
-	friend class LLSingleton<LLParamSDParser>;
 public:
+	LLParamSDParser();
 	void readSD(const LLSD& sd, LLInitParam::BaseBlock& block, bool silent = false);
 	void writeSD(LLSD& sd, const LLInitParam::BaseBlock& block);
 
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 5d8b628776..85fdfbb312 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -1802,7 +1802,8 @@ void LLUI::setupPaths()
 	LLXMLNodePtr root;
 	BOOL success  = LLXMLNode::parseFile(filename, root, NULL);
 	Paths paths;
-	LLXUIParser::instance().readXUI(root, paths, filename);
+	LLXUIParser parser;
+	parser.readXUI(root, paths, filename);
 
 	sXUIPaths.clear();
 	
diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp
index 1b64ef3abe..88140f1a49 100644
--- a/indra/llui/lluicolortable.cpp
+++ b/indra/llui/lluicolortable.cpp
@@ -243,7 +243,8 @@ void LLUIColorTable::saveUserSettings() const
 	}
 
 	LLXMLNodePtr output_node = new LLXMLNode("colors", false);
-	LLXUIParser::instance().writeXUI(output_node, params);
+	LLXUIParser parser;
+	parser.writeXUI(output_node, params);
 
 	if(!output_node->isNull())
 	{
@@ -309,7 +310,8 @@ bool LLUIColorTable::loadFromFilename(const std::string& filename, string_color_
 	}
 
 	Params params;
-	LLXUIParser::instance().readXUI(root, params, filename);
+	LLXUIParser parser;
+	parser.readXUI(root, params, filename);
 
 	if(params.validateBlock())
 	{
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index ee700ee6eb..2a2fa21ec0 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -103,7 +103,8 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa
 	if (!full_filename.empty())
 	{
 		LLUICtrlFactory::instance().pushFileName(full_filename);
-		LLSimpleXUIParser::instance().readXUI(full_filename, block);
+		LLSimpleXUIParser parser;
+		parser.readXUI(full_filename, block);
 		LLUICtrlFactory::instance().popFileName();
 	}
 }
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index 82076335d7..165c117088 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -271,7 +271,8 @@ private:
 
 		typename T::Params params(getDefaultParams<T>());
 
-		LLXUIParser::instance().readXUI(node, params, LLUICtrlFactory::getInstance()->getCurFileName());
+		LLXUIParser parser;
+		parser.readXUI(node, params, LLUICtrlFactory::getInstance()->getCurFileName());
 
 		if (output_node)
 		{
@@ -281,8 +282,7 @@ private:
 			// Export only the differences between this any default params
 			typename T::Params default_params(getDefaultParams<T>());
 			copyName(node, output_node);
-			LLXUIParser::instance().writeXUI(
-				output_node, output_params, &default_params);
+			parser.writeXUI(output_node, output_params, &default_params);
 		}
 
 		// Apply layout transformations, usually munging rect
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 3ee4a85de0..48db873b6f 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -111,8 +111,8 @@ LLView::Params::Params()
 	user_resize("user_resize"),
 	auto_resize("auto_resize"),
 	needs_translate("translate"),
-	min_width("min_width"),
-	max_width("max_width"),
+	min_dim("min_width"),
+	max_dim("max_width"),
 	xmlns("xmlns"),
 	xmlns_xsi("xmlns:xsi"),
 	xsi_schemaLocation("xsi:schemaLocation"),
@@ -120,6 +120,8 @@ LLView::Params::Params()
 
 {
 	addSynonym(rect, "");
+	addSynonym(min_dim, "min_height");
+	addSynonym(max_dim, "max_height");
 }
 
 LLView::LLView(const LLView::Params& p)
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 0f796fb408..6736ad9f33 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -145,16 +145,18 @@ public:
 									left_delta;		// from last left to my left
 
 		//FIXME: get parent context involved in parsing traversal
-		Ignored						user_resize,		// nested attribute for LLLayoutPanel
-									auto_resize,		// nested attribute for LLLayoutPanel
-									needs_translate,	// cue for translation tools
-									min_width,			// nested attribute for LLLayoutPanel
-									max_width,			// nested attribute for LLLayoutPanel
+		Ignored						needs_translate;	// cue for translation tools
 									xmlns,				// xml namespace
 									xmlns_xsi,			// xml namespace
 									xsi_schemaLocation,	// xml schema
 									xsi_type;			// xml schema type
 
+		// nested attributes for LLLayoutPanel
+		Optional<S32>				min_dim,
+									max_dim;
+		Optional<bool>				user_resize,		
+									auto_resize;
+
 		Params();
 	};
 
diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index 5461ad9d05..488e20cf9f 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -204,14 +204,14 @@ namespace LLInitParam
 		typedef std::vector<std::string>							possible_values_t;
 
 		typedef bool (*parser_read_func_t)(Parser& parser, void* output);
-		typedef boost::function<bool (const void*, const name_stack_t&)>								parser_write_func_t;
+		typedef bool (*parser_write_func_t)(Parser& parser, const void*, const name_stack_t&);
 		typedef boost::function<void (const name_stack_t&, S32, S32, const possible_values_t*)>	parser_inspect_func_t;
 
 		typedef std::map<const std::type_info*, parser_read_func_t, CompareTypeID>		parser_read_func_map_t;
 		typedef std::map<const std::type_info*, parser_write_func_t, CompareTypeID>		parser_write_func_map_t;
 		typedef std::map<const std::type_info*, parser_inspect_func_t, CompareTypeID>	parser_inspect_func_map_t;
 
-		Parser()
+		Parser(parser_read_func_map_t& read_map, parser_write_func_map_t& write_map, parser_inspect_func_map_t& inspect_map)
 		:	mParseSilently(false),
 			mParseGeneration(0)
 		{}
@@ -219,8 +219,8 @@ namespace LLInitParam
 
 		template <typename T> bool readValue(T& param)
 	    {
-		    parser_read_func_map_t::iterator found_it = mParserReadFuncs.find(&typeid(T));
-		    if (found_it != mParserReadFuncs.end())
+		    parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T));
+		    if (found_it != mParserReadFuncs->end())
 		    {
 			    return found_it->second(*this, (void*)&param);
 		    }
@@ -229,10 +229,10 @@ namespace LLInitParam
 
 		template <typename T> bool writeValue(const T& param, const name_stack_t& name_stack)
 		{
-		    parser_write_func_map_t::iterator found_it = mParserWriteFuncs.find(&typeid(T));
-		    if (found_it != mParserWriteFuncs.end())
+		    parser_write_func_map_t::iterator found_it = mParserWriteFuncs->find(&typeid(T));
+		    if (found_it != mParserWriteFuncs->end())
 		    {
-			    return found_it->second((const void*)&param, name_stack);
+			    return found_it->second(*this, (const void*)&param, name_stack);
 		    }
 		    return false;
 		}
@@ -240,8 +240,8 @@ namespace LLInitParam
 		// dispatch inspection to registered inspection functions, for each parameter in a param block
 		template <typename T> bool inspectValue(const name_stack_t& name_stack, S32 min_count, S32 max_count, const possible_values_t* possible_values)
 		{
-		    parser_inspect_func_map_t::iterator found_it = mParserInspectFuncs.find(&typeid(T));
-		    if (found_it != mParserInspectFuncs.end())
+		    parser_inspect_func_map_t::iterator found_it = mParserInspectFuncs->find(&typeid(T));
+		    if (found_it != mParserInspectFuncs->end())
 		    {
 			    found_it->second(name_stack, min_count, max_count, possible_values);
 				return true;
@@ -253,7 +253,6 @@ namespace LLInitParam
 		virtual void parserWarning(const std::string& message);
 		virtual void parserError(const std::string& message);
 		void setParseSilently(bool silent) { mParseSilently = silent; }
-		bool getParseSilently() { return mParseSilently; }
 
 		S32 getParseGeneration() { return mParseGeneration; }
 		S32 newParseGeneration() { return ++mParseGeneration; }
@@ -261,24 +260,24 @@ namespace LLInitParam
 
 	protected:
 		template <typename T>
-		void registerParserFuncs(parser_read_func_t read_func, parser_write_func_t write_func)
+		void registerParserFuncs(parser_read_func_t read_func, parser_write_func_t write_func = NULL)
 		{
-			mParserReadFuncs.insert(std::make_pair(&typeid(T), read_func));
-			mParserWriteFuncs.insert(std::make_pair(&typeid(T), write_func));
+			mParserReadFuncs->insert(std::make_pair(&typeid(T), read_func));
+			mParserWriteFuncs->insert(std::make_pair(&typeid(T), write_func));
 		}
 
 		template <typename T>
 		void registerInspectFunc(parser_inspect_func_t inspect_func)
 		{
-			mParserInspectFuncs.insert(std::make_pair(&typeid(T), inspect_func));
+			mParserInspectFuncs->insert(std::make_pair(&typeid(T), inspect_func));
 		}
 
 		bool				mParseSilently;
 
 	private:
-		parser_read_func_map_t		mParserReadFuncs;
-		parser_write_func_map_t		mParserWriteFuncs;
-		parser_inspect_func_map_t	mParserInspectFuncs;
+		parser_read_func_map_t*		mParserReadFuncs;
+		parser_write_func_map_t*	mParserWriteFuncs;
+		parser_inspect_func_map_t*	mParserInspectFuncs;
 		S32	mParseGeneration;
 	};
 
@@ -581,7 +580,7 @@ namespace LLInitParam
 			// no further names in stack, attempt to parse value now
 			if (name_stack.first == name_stack.second)
 			{
-				if (parser.readValue<T>(typed_param.mData.mValue))
+				if (parser.readValue(typed_param.mData.mValue))
 				{
 					typed_param.mData.clearKey();
 					typed_param.setProvided(true);
@@ -594,7 +593,7 @@ namespace LLInitParam
 				{
 					// try to parse a known named value
 					std::string name;
-					if (parser.readValue<std::string>(name))
+					if (parser.readValue(name))
 					{
 						// try to parse a per type named value
 						if (NAME_VALUE_LOOKUP::get(name, typed_param.mData.mValue))
@@ -629,7 +628,7 @@ namespace LLInitParam
 			{
 				if (!diff_param || !ParamCompare<std::string>::equals(static_cast<const self_t*>(diff_param)->mData.getKey(), key))
 				{
-					if (!parser.writeValue<std::string>(key, name_stack))
+					if (!parser.writeValue(key, name_stack))
 					{
 						return;
 					}
@@ -637,7 +636,7 @@ namespace LLInitParam
 			}
 			// then try to serialize value directly
 			else if (!diff_param || !ParamCompare<T>::equals(typed_param.get(), static_cast<const self_t*>(diff_param)->get()))					{
-				if (!parser.writeValue<T>(typed_param.mData.mValue, name_stack)) 
+				if (!parser.writeValue(typed_param.mData.mValue, name_stack)) 
 				{
 					return;
 				}
@@ -750,7 +749,7 @@ namespace LLInitParam
 			{
 				// try to parse a known named value
 				std::string name;
-				if (parser.readValue<std::string>(name))
+				if (parser.readValue(name))
 				{
 					// try to parse a per type named value
 					if (NAME_VALUE_LOOKUP::get(name, typed_param))
@@ -777,7 +776,7 @@ namespace LLInitParam
 			std::string key = typed_param.mData.getKey();
 			if (!key.empty() && typed_param.mData.mKeyVersion == typed_param.getLastChangeVersion())
 			{
-				if (!parser.writeValue<std::string>(key, name_stack))
+				if (!parser.writeValue(key, name_stack))
 				{
 					return;
 				}
@@ -924,7 +923,7 @@ namespace LLInitParam
 			if (name_stack.first == name_stack.second)
 			{
 				// attempt to read value directly
-				if (parser.readValue<value_t>(value))
+				if (parser.readValue(value))
 				{
 					typed_param.mValues.push_back(value);
 					// save an empty name/value key as a placeholder
@@ -939,7 +938,7 @@ namespace LLInitParam
 				{
 					// try to parse a known named value
 					std::string name;
-					if (parser.readValue<std::string>(name))
+					if (parser.readValue(name))
 					{
 						// try to parse a per type named value
 						if (NAME_VALUE_LOOKUP::get(name, typed_param.mValues))
@@ -973,13 +972,13 @@ namespace LLInitParam
 
 				if(!key.empty())
 				{
-					if(!parser.writeValue<std::string>(key, name_stack))
+					if(!parser.writeValue(key, name_stack))
 					{
 						return;
 					}
 				}
 				// not parse via name values, write out value directly
-				else if (!parser.writeValue<VALUE_TYPE>(*it, name_stack))
+				else if (!parser.writeValue(*it, name_stack))
 				{
 					return;
 				}
@@ -1126,7 +1125,7 @@ namespace LLInitParam
 			{
 				// try to parse a known named value
 				std::string name;
-				if (parser.readValue<std::string>(name))
+				if (parser.readValue(name))
 				{
 					// try to parse a per type named value
 					if (NAME_VALUE_LOOKUP::get(name, value))
@@ -1159,7 +1158,7 @@ namespace LLInitParam
 				std::string key = key_it->getKey();
 				if (!key.empty() && key_it->mKeyVersion == it->getLastChangeVersion())
 				{
-					if(!parser.writeValue<std::string>(key, name_stack))
+					if(!parser.writeValue(key, name_stack))
 					{
 						return;
 					}
@@ -1624,7 +1623,7 @@ namespace LLInitParam
 			// type to apply parse direct value T
 			if (name_stack.first == name_stack.second)
 			{
-				if(parser.readValue<T>(typed_param.mData.mValue))
+				if(parser.readValue(typed_param.mData.mValue))
 				{
 					typed_param.enclosingBlock().setLastChangedParam(param, true);
 					typed_param.setProvided(true);
@@ -1639,7 +1638,7 @@ namespace LLInitParam
 				{
 					// try to parse a known named value
 					std::string name;
-					if (parser.readValue<std::string>(name))
+					if (parser.readValue(name))
 					{
 						// try to parse a per type named value
 						if (TypeValues<T>::get(name, typed_param.mData.mValue))
@@ -1681,7 +1680,7 @@ namespace LLInitParam
 			{
 				if (!diff_param || !ParamCompare<std::string>::equals(static_cast<const self_t*>(diff_param)->mData.getKey(), key))
 				{
-					if (!parser.writeValue<std::string>(key, name_stack))
+					if (!parser.writeValue(key, name_stack))
 					{
 						return;
 					}
@@ -1691,7 +1690,7 @@ namespace LLInitParam
 			else if (!diff_param || !ParamCompare<T>::equals(typed_param.get(), (static_cast<const self_t*>(diff_param))->get()))	
             {
 				
-				if (parser.writeValue<T>(typed_param.mData.mValue, name_stack)) 
+				if (parser.writeValue(typed_param.mData.mValue, name_stack)) 
 				{
 					return;
 				}
diff --git a/indra/llxuixml/lltrans.cpp b/indra/llxuixml/lltrans.cpp
index d6f17dbb08..bf38e925c6 100644
--- a/indra/llxuixml/lltrans.cpp
+++ b/indra/llxuixml/lltrans.cpp
@@ -72,7 +72,8 @@ bool LLTrans::parseStrings(LLXMLNodePtr &root, const std::set<std::string>& defa
 	}
 
 	StringTable string_table;
-	LLXUIParser::instance().readXUI(root, string_table, xml_filename);
+	LLXUIParser parser;
+	parser.readXUI(root, string_table, xml_filename);
 
 	if (!string_table.validateBlock())
 	{
@@ -115,7 +116,8 @@ bool LLTrans::parseLanguageStrings(LLXMLNodePtr &root)
 	}
 	
 	StringTable string_table;
-	LLXUIParser::instance().readXUI(root, string_table, xml_filename);
+	LLXUIParser parser;
+	parser.readXUI(root, string_table, xml_filename);
 	
 	if (!string_table.validateBlock())
 	{
diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index d856efb008..220171fb79 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -47,10 +47,16 @@ using namespace BOOST_SPIRIT_CLASSIC_NS;
 
 const S32 MAX_STRING_ATTRIBUTE_SIZE = 40;
 
+static 	LLInitParam::Parser::parser_read_func_map_t sXSDReadFuncs;
+static 	LLInitParam::Parser::parser_write_func_map_t sXSDWriteFuncs;
+static 	LLInitParam::Parser::parser_inspect_func_map_t sXSDInspectFuncs;
+
+
 //
 // LLXSDWriter
 //
 LLXSDWriter::LLXSDWriter()
+: Parser(sXSDReadFuncs, sXSDWriteFuncs, sXSDInspectFuncs)
 {
 	registerInspectFunc<bool>(boost::bind(&LLXSDWriter::writeAttribute, this, "xs:boolean", _1, _2, _3, _4));
 	registerInspectFunc<std::string>(boost::bind(&LLXSDWriter::writeAttribute, this, "xs:string", _1, _2, _3, _4));
@@ -368,27 +374,35 @@ void LLXUIXSDWriter::writeXSD(const std::string& type_name, const std::string& p
 	fclose(xsd_file);
 }
 
+static 	LLInitParam::Parser::parser_read_func_map_t sXUIReadFuncs;
+static 	LLInitParam::Parser::parser_write_func_map_t sXUIWriteFuncs;
+static 	LLInitParam::Parser::parser_inspect_func_map_t sXUIInspectFuncs;
+
 //
 // LLXUIParser
 //
 LLXUIParser::LLXUIParser()
-:	mLastWriteGeneration(-1),
+:	Parser(sXUIReadFuncs, sXUIWriteFuncs, sXUIInspectFuncs),
+	mLastWriteGeneration(-1),
 	mCurReadDepth(0)
 {
-	registerParserFuncs<bool>(readBoolValue, boost::bind(&LLXUIParser::writeBoolValue, this, _1, _2));
-	registerParserFuncs<std::string>(readStringValue, boost::bind(&LLXUIParser::writeStringValue, this, _1, _2));
-	registerParserFuncs<U8>(readU8Value, boost::bind(&LLXUIParser::writeU8Value, this, _1, _2));
-	registerParserFuncs<S8>(readS8Value, boost::bind(&LLXUIParser::writeS8Value, this, _1, _2));
-	registerParserFuncs<U16>(readU16Value, boost::bind(&LLXUIParser::writeU16Value, this, _1, _2));
-	registerParserFuncs<S16>(readS16Value, boost::bind(&LLXUIParser::writeS16Value, this, _1, _2));
-	registerParserFuncs<U32>(readU32Value, boost::bind(&LLXUIParser::writeU32Value, this, _1, _2));
-	registerParserFuncs<S32>(readS32Value, boost::bind(&LLXUIParser::writeS32Value, this, _1, _2));
-	registerParserFuncs<F32>(readF32Value, boost::bind(&LLXUIParser::writeF32Value, this, _1, _2));
-	registerParserFuncs<F64>(readF64Value, boost::bind(&LLXUIParser::writeF64Value, this, _1, _2));
-	registerParserFuncs<LLColor4>(readColor4Value, boost::bind(&LLXUIParser::writeColor4Value, this, _1, _2));
-	registerParserFuncs<LLUIColor>(readUIColorValue, boost::bind(&LLXUIParser::writeUIColorValue, this, _1, _2));
-	registerParserFuncs<LLUUID>(readUUIDValue, boost::bind(&LLXUIParser::writeUUIDValue, this, _1, _2));
-	registerParserFuncs<LLSD>(readSDValue, boost::bind(&LLXUIParser::writeSDValue, this, _1, _2));
+	if (sXUIReadFuncs.empty())
+	{
+		registerParserFuncs<bool>(readBoolValue, writeBoolValue);
+		registerParserFuncs<std::string>(readStringValue, writeStringValue);
+		registerParserFuncs<U8>(readU8Value, writeU8Value);
+		registerParserFuncs<S8>(readS8Value, writeS8Value);
+		registerParserFuncs<U16>(readU16Value, writeU16Value);
+		registerParserFuncs<S16>(readS16Value, writeS16Value);
+		registerParserFuncs<U32>(readU32Value, writeU32Value);
+		registerParserFuncs<S32>(readS32Value, writeS32Value);
+		registerParserFuncs<F32>(readF32Value, writeF32Value);
+		registerParserFuncs<F64>(readF64Value, writeF64Value);
+		registerParserFuncs<LLColor4>(readColor4Value, writeColor4Value);
+		registerParserFuncs<LLUIColor>(readUIColorValue, writeUIColorValue);
+		registerParserFuncs<LLUUID>(readUUIDValue, writeUUIDValue);
+		registerParserFuncs<LLSD>(readSDValue, writeSDValue);
+	}
 }
 
 static LLFastTimer::DeclareTimer FTM_PARSE_XUI("XUI Parsing");
@@ -621,9 +635,10 @@ bool LLXUIParser::readBoolValue(Parser& parser, void* val_ptr)
 	return success;
 }
 
-bool LLXUIParser::writeBoolValue(const void* val_ptr, const name_stack_t& stack)
+bool LLXUIParser::writeBoolValue(Parser& parser, const void* val_ptr, const name_stack_t& stack)
 {
-	LLXMLNodePtr node = getNode(stack);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	LLXMLNodePtr node = self.getNode(stack);
 	if (node.notNull())
 	{
 		node->setBoolValue(*((bool*)val_ptr));
@@ -639,9 +654,10 @@ bool LLXUIParser::readStringValue(Parser& parser, void* val_ptr)
 	return true;
 }
 
-bool LLXUIParser::writeStringValue(const void* val_ptr, const name_stack_t& stack)
+bool LLXUIParser::writeStringValue(Parser& parser, const void* val_ptr, const name_stack_t& stack)
 {
-	LLXMLNodePtr node = getNode(stack);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	LLXMLNodePtr node = self.getNode(stack);
 	if (node.notNull())
 	{
 		const std::string* string_val = reinterpret_cast<const std::string*>(val_ptr);
@@ -676,9 +692,10 @@ bool LLXUIParser::readU8Value(Parser& parser, void* val_ptr)
 	return self.mCurReadNode->getByteValue(1, (U8*)val_ptr);
 }
 
-bool LLXUIParser::writeU8Value(const void* val_ptr, const name_stack_t& stack)
+bool LLXUIParser::writeU8Value(Parser& parser, const void* val_ptr, const name_stack_t& stack)
 {
-	LLXMLNodePtr node = getNode(stack);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	LLXMLNodePtr node = self.getNode(stack);
 	if (node.notNull())
 	{
 		node->setUnsignedValue(*((U8*)val_ptr));
@@ -699,9 +716,10 @@ bool LLXUIParser::readS8Value(Parser& parser, void* val_ptr)
 	return false;
 }
 
-bool LLXUIParser::writeS8Value(const void* val_ptr, const name_stack_t& stack)
+bool LLXUIParser::writeS8Value(Parser& parser, const void* val_ptr, const name_stack_t& stack)
 {
-	LLXMLNodePtr node = getNode(stack);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	LLXMLNodePtr node = self.getNode(stack);
 	if (node.notNull())
 	{
 		node->setIntValue(*((S8*)val_ptr));
@@ -722,9 +740,10 @@ bool LLXUIParser::readU16Value(Parser& parser, void* val_ptr)
 	return false;
 }
 
-bool LLXUIParser::writeU16Value(const void* val_ptr, const name_stack_t& stack)
+bool LLXUIParser::writeU16Value(Parser& parser, const void* val_ptr, const name_stack_t& stack)
 {
-	LLXMLNodePtr node = getNode(stack);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	LLXMLNodePtr node = self.getNode(stack);
 	if (node.notNull())
 	{
 		node->setUnsignedValue(*((U16*)val_ptr));
@@ -745,9 +764,10 @@ bool LLXUIParser::readS16Value(Parser& parser, void* val_ptr)
 	return false;
 }
 
-bool LLXUIParser::writeS16Value(const void* val_ptr, const name_stack_t& stack)
+bool LLXUIParser::writeS16Value(Parser& parser, const void* val_ptr, const name_stack_t& stack)
 {
-	LLXMLNodePtr node = getNode(stack);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	LLXMLNodePtr node = self.getNode(stack);
 	if (node.notNull())
 	{
 		node->setIntValue(*((S16*)val_ptr));
@@ -762,9 +782,10 @@ bool LLXUIParser::readU32Value(Parser& parser, void* val_ptr)
 	return self.mCurReadNode->getUnsignedValue(1, (U32*)val_ptr);
 }
 
-bool LLXUIParser::writeU32Value(const void* val_ptr, const name_stack_t& stack)
+bool LLXUIParser::writeU32Value(Parser& parser, const void* val_ptr, const name_stack_t& stack)
 {
-	LLXMLNodePtr node = getNode(stack);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	LLXMLNodePtr node = self.getNode(stack);
 	if (node.notNull())
 	{
 		node->setUnsignedValue(*((U32*)val_ptr));
@@ -779,9 +800,10 @@ bool LLXUIParser::readS32Value(Parser& parser, void* val_ptr)
 	return self.mCurReadNode->getIntValue(1, (S32*)val_ptr);
 }
 
-bool LLXUIParser::writeS32Value(const void* val_ptr, const name_stack_t& stack)
+bool LLXUIParser::writeS32Value(Parser& parser, const void* val_ptr, const name_stack_t& stack)
 {
-	LLXMLNodePtr node = getNode(stack);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	LLXMLNodePtr node = self.getNode(stack);
 	if (node.notNull())
 	{
 		node->setIntValue(*((S32*)val_ptr));
@@ -796,9 +818,10 @@ bool LLXUIParser::readF32Value(Parser& parser, void* val_ptr)
 	return self.mCurReadNode->getFloatValue(1, (F32*)val_ptr);
 }
 
-bool LLXUIParser::writeF32Value(const void* val_ptr, const name_stack_t& stack)
+bool LLXUIParser::writeF32Value(Parser& parser, const void* val_ptr, const name_stack_t& stack)
 {
-	LLXMLNodePtr node = getNode(stack);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	LLXMLNodePtr node = self.getNode(stack);
 	if (node.notNull())
 	{
 		node->setFloatValue(*((F32*)val_ptr));
@@ -813,9 +836,10 @@ bool LLXUIParser::readF64Value(Parser& parser, void* val_ptr)
 	return self.mCurReadNode->getDoubleValue(1, (F64*)val_ptr);
 }
 
-bool LLXUIParser::writeF64Value(const void* val_ptr, const name_stack_t& stack)
+bool LLXUIParser::writeF64Value(Parser& parser, const void* val_ptr, const name_stack_t& stack)
 {
-	LLXMLNodePtr node = getNode(stack);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	LLXMLNodePtr node = self.getNode(stack);
 	if (node.notNull())
 	{
 		node->setDoubleValue(*((F64*)val_ptr));
@@ -836,9 +860,10 @@ bool LLXUIParser::readColor4Value(Parser& parser, void* val_ptr)
 	return false;
 }
 
-bool LLXUIParser::writeColor4Value(const void* val_ptr, const name_stack_t& stack)
+bool LLXUIParser::writeColor4Value(Parser& parser, const void* val_ptr, const name_stack_t& stack)
 {
-	LLXMLNodePtr node = getNode(stack);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	LLXMLNodePtr node = self.getNode(stack);
 	if (node.notNull())
 	{
 		LLColor4 color = *((LLColor4*)val_ptr);
@@ -862,9 +887,10 @@ bool LLXUIParser::readUIColorValue(Parser& parser, void* val_ptr)
 	return false;
 }
 
-bool LLXUIParser::writeUIColorValue(const void* val_ptr, const name_stack_t& stack)
+bool LLXUIParser::writeUIColorValue(Parser& parser, const void* val_ptr, const name_stack_t& stack)
 {
-	LLXMLNodePtr node = getNode(stack);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	LLXMLNodePtr node = self.getNode(stack);
 	if (node.notNull())
 	{
 		LLUIColor color = *((LLUIColor*)val_ptr);
@@ -890,9 +916,10 @@ bool LLXUIParser::readUUIDValue(Parser& parser, void* val_ptr)
 	return false;
 }
 
-bool LLXUIParser::writeUUIDValue(const void* val_ptr, const name_stack_t& stack)
+bool LLXUIParser::writeUUIDValue(Parser& parser, const void* val_ptr, const name_stack_t& stack)
 {
-	LLXMLNodePtr node = getNode(stack);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+	LLXMLNodePtr node = self.getNode(stack);
 	if (node.notNull())
 	{
 		node->setStringValue(((LLUUID*)val_ptr)->asString());
@@ -908,9 +935,11 @@ bool LLXUIParser::readSDValue(Parser& parser, void* val_ptr)
 	return true;
 }
 
-bool LLXUIParser::writeSDValue(const void* val_ptr, const name_stack_t& stack)
+bool LLXUIParser::writeSDValue(Parser& parser, const void* val_ptr, const name_stack_t& stack)
 {
-	LLXMLNodePtr node = getNode(stack);
+	LLXUIParser& self = static_cast<LLXUIParser&>(parser);
+
+	LLXMLNodePtr node = self.getNode(stack);
 	if (node.notNull())
 	{
 		std::string string_val = ((LLSD*)val_ptr)->asString();
@@ -1007,25 +1036,33 @@ struct ScopedFile
 
 	LLFILE* mFile;
 };
+static 	LLInitParam::Parser::parser_read_func_map_t sSimpleXUIReadFuncs;
+static 	LLInitParam::Parser::parser_write_func_map_t sSimpleXUIWriteFuncs;
+static 	LLInitParam::Parser::parser_inspect_func_map_t sSimpleXUIInspectFuncs;
 
-LLSimpleXUIParser::LLSimpleXUIParser()
-:	mLastWriteGeneration(-1),
-	mCurReadDepth(0)
+LLSimpleXUIParser::LLSimpleXUIParser(LLSimpleXUIParser::element_start_callback_t element_cb)
+:	Parser(sSimpleXUIReadFuncs, sSimpleXUIWriteFuncs, sSimpleXUIInspectFuncs),
+	mLastWriteGeneration(-1),
+	mCurReadDepth(0),
+	mElementCB(element_cb)
 {
-	registerParserFuncs<bool>(readBoolValue, NULL);
-	registerParserFuncs<std::string>(readStringValue, NULL);
-	registerParserFuncs<U8>(readU8Value, NULL);
-	registerParserFuncs<S8>(readS8Value, NULL);
-	registerParserFuncs<U16>(readU16Value, NULL);
-	registerParserFuncs<S16>(readS16Value, NULL);
-	registerParserFuncs<U32>(readU32Value, NULL);
-	registerParserFuncs<S32>(readS32Value, NULL);
-	registerParserFuncs<F32>(readF32Value, NULL);
-	registerParserFuncs<F64>(readF64Value, NULL);
-	registerParserFuncs<LLColor4>(readColor4Value, NULL);
-	registerParserFuncs<LLUIColor>(readUIColorValue, NULL);
-	registerParserFuncs<LLUUID>(readUUIDValue, NULL);
-	registerParserFuncs<LLSD>(readSDValue, NULL);
+	if (sSimpleXUIReadFuncs.empty())
+	{
+		registerParserFuncs<bool>(readBoolValue);
+		registerParserFuncs<std::string>(readStringValue);
+		registerParserFuncs<U8>(readU8Value);
+		registerParserFuncs<S8>(readS8Value);
+		registerParserFuncs<U16>(readU16Value);
+		registerParserFuncs<S16>(readS16Value);
+		registerParserFuncs<U32>(readU32Value);
+		registerParserFuncs<S32>(readS32Value);
+		registerParserFuncs<F32>(readF32Value);
+		registerParserFuncs<F64>(readF64Value);
+		registerParserFuncs<LLColor4>(readColor4Value);
+		registerParserFuncs<LLUIColor>(readUIColorValue);
+		registerParserFuncs<LLUUID>(readUUIDValue);
+		registerParserFuncs<LLSD>(readSDValue);
+	}
 }
 
 LLSimpleXUIParser::~LLSimpleXUIParser()
@@ -1042,7 +1079,7 @@ bool LLSimpleXUIParser::readXUI(const std::string& filename, LLInitParam::BaseBl
 	XML_SetElementHandler(			mParser,	startElementHandler, endElementHandler);
 	XML_SetCharacterDataHandler(	mParser,	characterDataHandler);
 
-	mBlock = &block;
+	mOutputStack.push_back(std::make_pair(&block, 0));
 	mNameStack.clear();
 	mCurFileName = filename;
 	mCurReadDepth = 0;
@@ -1108,16 +1145,25 @@ void LLSimpleXUIParser::startElement(const char *name, const char **atts)
 	typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
 	boost::char_separator<char> sep(".");
 
-	mCurReadDepth++;
+	if (mElementCB) 
+	{
+		LLInitParam::BaseBlock* blockp = mElementCB(*this, name);
+		if (blockp)
+		{
+			mOutputStack.push_back(std::make_pair(blockp, 0));
+		}
+	}
+
+	mOutputStack.back().second++;
 	S32 num_tokens_pushed = 0;
 	std::string child_name(name);
 
-	if (mCurReadDepth > 1)
-	{
-		// for non "dotted" child nodes	check to see if child node maps to another widget type
-		// and if not, treat as a child element of the current node
-		// e.g. <button><rect left="10"/></button> will interpret <rect> as "button.rect"
-		// since there is no widget named "rect"
+	if (mOutputStack.back().second == 1)
+	{	// root node for this block
+		mScope.push_back(child_name);
+	}
+	else
+	{	// compound attribute
 		if (child_name.find(".") == std::string::npos) 
 		{
 			mNameStack.push_back(std::make_pair(child_name, newParseGeneration()));
@@ -1153,10 +1199,6 @@ void LLSimpleXUIParser::startElement(const char *name, const char **atts)
 			mScope.push_back(mNameStack.back().first);
 		}
 	}
-	else
-	{
-		mScope.push_back(child_name);
-	}
 
 	mTokenSizeStack.push_back(num_tokens_pushed);
 	readAttributes(atts);
@@ -1183,8 +1225,7 @@ bool LLSimpleXUIParser::readAttributes(const char **atts)
 		}
 
 		// child nodes are not necessarily valid attributes, so don't complain once we've recursed
-		bool silent = mCurReadDepth > 1;
-		any_parsed |= mBlock->submitValue(mNameStack, *this, silent);
+		any_parsed |= mOutputStack.back().first->submitValue(mNameStack, *this, mParseSilently);
 		
 		while(num_tokens_pushed-- > 0)
 		{
@@ -1204,12 +1245,21 @@ void LLSimpleXUIParser::endElement(const char *name)
 		{
 			mNameStack.push_back(std::make_pair(std::string("value"), newParseGeneration()));
 			mCurAttributeValueBegin = mTextContents.c_str();
-			mBlock->submitValue(mNameStack, *this, false);
+			mOutputStack.back().first->submitValue(mNameStack, *this, mParseSilently);
 			mNameStack.pop_back();
 			mTextContents.clear();
 		}
 	}
-	mCurReadDepth--;
+
+	if (--mOutputStack.back().second == 0)
+	{
+		if (mOutputStack.empty())
+		{
+			LL_ERRS("ReadXUI") << "Parameter block output stack popped while empty." << LL_ENDL;
+		}
+		mOutputStack.pop_back();
+	}
+
 	S32 num_tokens_to_pop = mTokenSizeStack.back();
 	mTokenSizeStack.pop_back();
 	while(num_tokens_to_pop-- > 0)
diff --git a/indra/llxuixml/llxuiparser.h b/indra/llxuixml/llxuiparser.h
index eb7147f49e..ee8fcdc369 100644
--- a/indra/llxuixml/llxuiparser.h
+++ b/indra/llxuixml/llxuiparser.h
@@ -102,14 +102,12 @@ public:
 
 
 
-class LLXUIParser : public LLInitParam::Parser, public LLSingleton<LLXUIParser>
+class LLXUIParser : public LLInitParam::Parser
 {
 LOG_CLASS(LLXUIParser);
 
-protected:
-	LLXUIParser();
-	friend class LLSingleton<LLXUIParser>;
 public:
+	LLXUIParser();
 	typedef LLInitParam::Parser::name_stack_t name_stack_t;
 
 	/*virtual*/ std::string getCurrentElementName();
@@ -140,20 +138,20 @@ private:
 	static bool readSDValue(Parser& parser, void* val_ptr);
 
 	//writer helper functions
-	bool writeBoolValue(const void* val_ptr, const name_stack_t&);
-	bool writeStringValue(const void* val_ptr, const name_stack_t&);
-	bool writeU8Value(const void* val_ptr, const name_stack_t&);
-	bool writeS8Value(const void* val_ptr, const name_stack_t&);
-	bool writeU16Value(const void* val_ptr, const name_stack_t&);
-	bool writeS16Value(const void* val_ptr, const name_stack_t&);
-	bool writeU32Value(const void* val_ptr, const name_stack_t&);
-	bool writeS32Value(const void* val_ptr, const name_stack_t&);
-	bool writeF32Value(const void* val_ptr, const name_stack_t&);
-	bool writeF64Value(const void* val_ptr, const name_stack_t&);
-	bool writeColor4Value(const void* val_ptr, const name_stack_t&);
-	bool writeUIColorValue(const void* val_ptr, const name_stack_t&);
-	bool writeUUIDValue(const void* val_ptr, const name_stack_t&);
-	bool writeSDValue(const void* val_ptr, const name_stack_t&);
+	static bool writeBoolValue(Parser& parser, const void* val_ptr, const name_stack_t&);
+	static bool writeStringValue(Parser& parser, const void* val_ptr, const name_stack_t&);
+	static bool writeU8Value(Parser& parser, const void* val_ptr, const name_stack_t&);
+	static bool writeS8Value(Parser& parser, const void* val_ptr, const name_stack_t&);
+	static bool writeU16Value(Parser& parser, const void* val_ptr, const name_stack_t&);
+	static bool writeS16Value(Parser& parser, const void* val_ptr, const name_stack_t&);
+	static bool writeU32Value(Parser& parser, const void* val_ptr, const name_stack_t&);
+	static bool writeS32Value(Parser& parser, const void* val_ptr, const name_stack_t&);
+	static bool writeF32Value(Parser& parser, const void* val_ptr, const name_stack_t&);
+	static bool writeF64Value(Parser& parser, const void* val_ptr, const name_stack_t&);
+	static bool writeColor4Value(Parser& parser, const void* val_ptr, const name_stack_t&);
+	static bool writeUIColorValue(Parser& parser, const void* val_ptr, const name_stack_t&);
+	static bool writeUUIDValue(Parser& parser, const void* val_ptr, const name_stack_t&);
+	static bool writeSDValue(Parser& parser, const void* val_ptr, const name_stack_t&);
 
 	LLXMLNodePtr getNode(const name_stack_t& stack);
 
@@ -182,23 +180,22 @@ private:
 // of coroutines to perform matching of xml nodes during parsing.  Not sure if the overhead
 // of coroutines would offset the gain from SAX parsing
 
-class LLSimpleXUIParser : public LLInitParam::Parser, public LLSingleton<LLSimpleXUIParser>
+class LLSimpleXUIParser : public LLInitParam::Parser
 {
 LOG_CLASS(LLSimpleXUIParser);
-
-protected:
-	LLSimpleXUIParser();
-	virtual ~LLSimpleXUIParser();
-	friend class LLSingleton<LLSimpleXUIParser>;
 public:
 	typedef LLInitParam::Parser::name_stack_t name_stack_t;
+	typedef LLInitParam::BaseBlock* (*element_start_callback_t)(LLSimpleXUIParser&, const char* block_name);
+
+	LLSimpleXUIParser(element_start_callback_t element_cb = NULL);
+	virtual ~LLSimpleXUIParser();
 
 	/*virtual*/ std::string getCurrentElementName();
 	/*virtual*/ void parserWarning(const std::string& message);
 	/*virtual*/ void parserError(const std::string& message);
 
 	bool readXUI(const std::string& filename, LLInitParam::BaseBlock& block, bool silent=false);
-	void setBlock(LLInitParam::BaseBlock* block);
+
 
 private:
 	//reader helper functions
@@ -227,7 +224,6 @@ private:
 	void characterData(const char *s, int len);
 	bool readAttributes(const char **atts);
 
-	LLInitParam::BaseBlock*			mBlock;
 	Parser::name_stack_t			mNameStack;
 	struct XML_ParserStruct*		mParser;
 	S32								mLastWriteGeneration;
@@ -238,6 +234,9 @@ private:
 	const char*						mCurAttributeValueBegin;
 	std::vector<S32>				mTokenSizeStack;
 	std::vector<std::string>		mScope;
+	element_start_callback_t		mElementCB;
+
+	std::vector<std::pair<LLInitParam::BaseBlock*, S32> > mOutputStack;
 };
 
 
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index b8776d0af2..ef596c4457 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -677,7 +677,8 @@ const LLButton::Params& LLFavoritesBarCtrl::getButtonParams()
 		LLXMLNodePtr button_xml_node;
 		if(LLUICtrlFactory::getLayeredXMLNode("favorites_bar_button.xml", button_xml_node))
 		{
-			LLXUIParser::instance().readXUI(button_xml_node, button_params, "favorites_bar_button.xml");
+			LLXUIParser parser;
+			parser.readXUI(button_xml_node, button_params, "favorites_bar_button.xml");
 		}
 		params_initialized = true;
 	}
diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp
index e0ced5caeb..4d7cdc01e5 100644
--- a/indra/newview/llhints.cpp
+++ b/indra/newview/llhints.cpp
@@ -297,7 +297,8 @@ void LLHints::show(LLNotificationPtr hint)
 {
 	LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams<LLHintPopup>());
 
-	LLParamSDParser::instance().readSD(hint->getPayload(), p);
+	LLParamSDParser parser;
+	parser.readSD(hint->getPayload(), p);
 	p.notification = hint;
 
 	if (p.validateBlock())
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index d09f729943..b4c4d4a2ee 100644
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -259,7 +259,8 @@ void LLNameListCtrl::addNameItem(LLNameListCtrl::NameItem& item, EAddPosition po
 LLScrollListItem* LLNameListCtrl::addElement(const LLSD& element, EAddPosition pos, void* userdata)
 {
 	LLNameListCtrl::NameItem item_params;
-	LLParamSDParser::instance().readSD(element, item_params);
+	LLParamSDParser parser;
+	parser.readSD(element, item_params);
 	item_params.userdata = userdata;
 	return addNameItemRow(item_params, pos);
 }
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index d35739d436..7429386871 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -79,7 +79,8 @@ const LLAccordionCtrlTab::Params& get_accordion_tab_params()
 		LLXMLNodePtr xmlNode;
 		if (LLUICtrlFactory::getLayeredXMLNode("outfit_accordion_tab.xml", xmlNode))
 		{
-			LLXUIParser::instance().readXUI(xmlNode, tab_params, "outfit_accordion_tab.xml");
+			LLXUIParser parser;
+			parser.readXUI(xmlNode, tab_params, "outfit_accordion_tab.xml");
 		}
 		else
 		{
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 02097ea06d..181c5b4c81 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -1550,7 +1550,8 @@ bool LLUIImageList::initFromFile()
 	}
 
 	UIImageDeclarations images;
-	LLXUIParser::instance().readXUI(root, images, base_file_path);
+	LLXUIParser parser;
+	parser.readXUI(root, images, base_file_path);
 
 	if (!images.validateBlock()) return false;
 
diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml
index cae6146880..930bbaa8cb 100644
--- a/indra/newview/skins/default/xui/en/floater_aaa.xml
+++ b/indra/newview/skins/default/xui/en/floater_aaa.xml
@@ -20,7 +20,7 @@
   <string name="nudge_parabuild" translate="false">Nudge 1</string>
   <string name="test_the_vlt">This string CHANGE2 is extracted.</string>
   <string name="testing_eli">Just a test. changes.</string>
-  <chat_history
+  <text_editor
    parse_urls="true"
    bg_readonly_color="ChatHistoryBgColor"
    bg_writeable_color="ChatHistoryBgColor" 
@@ -32,26 +32,51 @@
    layout="topleft"
 	 height="260"
    name="chat_history"
+   max_length="200000" 
    parse_highlights="true"
    text_color="ChatHistoryTextColor"
    text_readonly_color="ChatHistoryTextColor"
    translate="false"
+   track_end="true" 
+   wrap="true" 
    width="320">
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-Really long line that is long enough to wrap once with jyg descenders.
-  </chat_history>
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    Really long line that is long enough to wrap once with jyg descenders.
+    </text_editor>
 </floater>
-- 
cgit v1.2.3


From d1294e5aeb78205cbc580b8159f0a15b2102bd26 Mon Sep 17 00:00:00 2001
From: Richard Nelson <richard@lindenlab.com>
Date: Mon, 23 Aug 2010 14:31:39 -0700
Subject: fix for gcc

---
 indra/llui/llmenugl.cpp      | 2 +-
 indra/llui/lluictrlfactory.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 46a7215707..b4d1a5726f 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -9,7 +9,7 @@
  * Second Life Viewer Source Code
  * The source code in this file ("Source Code") is provided by Linden Lab
  * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("GPL"), unless you have obtained a separate licensing agreement	
  * ("Other License"), formally executed by you and Linden Lab.  Terms of
  * the GPL can be found in doc/GPL-license.txt in this distribution, or
  * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index 82076335d7..207f74c89a 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -229,7 +229,9 @@ fail:
 	static bool getLocalizedXMLNode(const std::string &xui_filename, LLXMLNodePtr& root);
 
 private:
+	//NOTE: both friend declarations are necessary to keep both gcc and msvc happy
 	template <typename T> friend class LLChildRegistry;
+	template <typename T> template <typename U> friend class LLChildRegistry<T>::Register;
 
 	static void copyName(LLXMLNodePtr src, LLXMLNodePtr dest);
 
-- 
cgit v1.2.3


From 0daa627db4f1bba2f69ec717426b26593674d14c Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Tue, 24 Aug 2010 11:44:28 -0700
Subject: removed LLLayoutStack::fromXML custom xml parsing

---
 indra/llui/lllayoutstack.cpp                       | 435 +++++++--------------
 indra/llui/lllayoutstack.h                         |  74 +++-
 indra/llui/llsdparam.cpp                           |  27 +-
 indra/llui/llsdparam.h                             |   9 +-
 indra/llui/llview.cpp                              |   6 -
 indra/llui/llview.h                                |   8 +-
 indra/llxuixml/llinitparam.cpp                     |  44 +--
 indra/llxuixml/llinitparam.h                       |   6 +-
 indra/llxuixml/llxuiparser.cpp                     |  17 +-
 indra/llxuixml/llxuiparser.h                       |   3 +-
 indra/newview/llbottomtray.cpp                     |  10 +-
 indra/newview/llchathistory.cpp                    |  16 +-
 indra/newview/llchathistory.h                      |   2 +-
 indra/newview/llfavoritesbar.cpp                   |   7 +-
 indra/newview/llfloaternotificationsconsole.cpp    |  21 +-
 indra/newview/llnearbychatbar.cpp                  |   3 +-
 .../default/xui/da/floater_voice_controls.xml      |  12 +-
 indra/newview/skins/default/xui/da/panel_notes.xml |   8 +-
 .../default/xui/da/panel_prim_media_controls.xml   |   4 +-
 .../default/xui/de/floater_voice_controls.xml      |  12 +-
 .../default/xui/de/panel_notifications_channel.xml |  24 +-
 .../default/xui/de/panel_prim_media_controls.xml   |   4 +-
 .../default/xui/en/floater_voice_controls.xml      |   4 +-
 indra/newview/skins/default/xui/en/main_view.xml   |  40 +-
 .../skins/default/xui/en/panel_bottomtray.xml      |  55 +--
 .../skins/default/xui/en/panel_bottomtray_lite.xml |  35 +-
 .../default/xui/en/panel_notifications_channel.xml |  10 +-
 .../default/xui/en/panel_preferences_graphics1.xml |   2 +-
 .../default/xui/en/panel_prim_media_controls.xml   |   4 +-
 .../skins/default/xui/en/widgets/scroll_bar.xml    |   8 +-
 .../default/xui/en/widgets/simple_text_editor.xml  |   3 -
 .../default/xui/es/floater_voice_controls.xml      |  12 +-
 indra/newview/skins/default/xui/es/panel_notes.xml |   8 +-
 .../default/xui/es/panel_prim_media_controls.xml   |   4 +-
 .../default/xui/fr/floater_voice_controls.xml      |  12 +-
 .../default/xui/fr/panel_notifications_channel.xml |  24 +-
 .../default/xui/fr/panel_prim_media_controls.xml   |   4 +-
 .../default/xui/it/floater_voice_controls.xml      |  12 +-
 indra/newview/skins/default/xui/it/panel_notes.xml |   8 +-
 .../default/xui/it/panel_prim_media_controls.xml   |   4 +-
 .../default/xui/ja/floater_voice_controls.xml      |  12 +-
 .../default/xui/ja/panel_notifications_channel.xml |  24 +-
 .../default/xui/ja/panel_prim_media_controls.xml   |   4 +-
 .../default/xui/pl/floater_voice_controls.xml      |  12 +-
 indra/newview/skins/default/xui/pl/panel_notes.xml |   8 +-
 .../default/xui/pl/panel_prim_media_controls.xml   |   4 +-
 .../default/xui/pt/floater_voice_controls.xml      |  12 +-
 indra/newview/skins/default/xui/pt/panel_notes.xml |   8 +-
 .../default/xui/pt/panel_prim_media_controls.xml   |   4 +-
 49 files changed, 486 insertions(+), 603 deletions(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 2e6e4912bf..92c8416cbc 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -41,92 +41,56 @@
 #include "llresizebar.h"
 #include "llcriticaldamp.h"
 
-static LLDefaultChildRegistry::Register<LLLayoutStack> register_layout_stack("layout_stack", &LLLayoutStack::fromXML);
-
+static LLDefaultChildRegistry::Register<LLLayoutStack> register_layout_stack("layout_stack");
+static LLLayoutStack::LayoutStackRegistry::Register<LLLayoutPanel> register_layout_panel("layout_panel");
 
 //
-// LLLayoutStack
+// LLLayoutPanel
 //
-struct LLLayoutStack::LayoutPanel
+LLLayoutPanel::LLLayoutPanel(const Params& p)	
+:	LLPanel(p),
+ 	mMinDim(p.min_dim), 
+ 	mMaxDim(p.max_dim), 
+ 	mAutoResize(p.auto_resize),
+ 	mUserResize(p.user_resize),
+ 	mCollapsed(FALSE),
+ 	mCollapseAmt(0.f),
+ 	mVisibleAmt(1.f), // default to fully visible
+ 	mResizeBar(NULL) 
 {
-	LayoutPanel(LLPanel* panelp, ELayoutOrientation orientation, S32 min_width, S32 min_height, S32 max_width, S32 max_height, BOOL auto_resize, BOOL user_resize)	:	mPanel(panelp), 
-		mMinWidth(min_width), 
-		mMinHeight(min_height),
-		mMaxWidth(max_width), 
-		mMaxHeight(max_height),
-		mAutoResize(auto_resize),
-		mUserResize(user_resize),
-		mOrientation(orientation),
-		mCollapsed(FALSE),
-		mCollapseAmt(0.f),
-		mVisibleAmt(1.f), // default to fully visible
-		mResizeBar(NULL) 
+	// panels initialized as hidden should not start out partially visible
+	if (!getVisible())
 	{
-		LLResizeBar::Side side = (orientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM;
-		LLRect resize_bar_rect = panelp->getRect();
-
-		S32 min_dim;
-		if (orientation == HORIZONTAL)
-		{
-			min_dim = mMinHeight;
-		}
-		else
-		{
-			min_dim = mMinWidth;
-		}
-		LLResizeBar::Params p;
-		p.name("resize");
-			p.resizing_view(mPanel);
-		p.min_size(min_dim);
-		p.side(side);
-		p.snapping_enabled(false);
-		mResizeBar = LLUICtrlFactory::create<LLResizeBar>(p);
-		// panels initialized as hidden should not start out partially visible
-		if (!mPanel->getVisible())
-		{
-			mVisibleAmt = 0.f;
-		}
+		mVisibleAmt = 0.f;
 	}
+}
 
-	~LayoutPanel()
-	{
-		// probably not necessary, but...
-		delete mResizeBar;
-		mResizeBar = NULL;
-	}
+LLLayoutPanel::~LLLayoutPanel()
+{
+	// probably not necessary, but...
+	delete mResizeBar;
+	mResizeBar = NULL;
+}
 	
-	F32 getCollapseFactor()
+F32 LLLayoutPanel::getCollapseFactor(LLLayoutStack::ELayoutOrientation orientation)
+{
+	if (orientation == LLLayoutStack::HORIZONTAL)
 	{
-		if (mOrientation == HORIZONTAL)
-		{
-			F32 collapse_amt = 
-				clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinWidth / (F32)llmax(1, mPanel->getRect().getWidth()));
-			return mVisibleAmt * collapse_amt;
-		}
-		else
+		F32 collapse_amt = 
+			clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinDim / (F32)llmax(1, getRect().getWidth()));
+		return mVisibleAmt * collapse_amt;
+	}
+	else
 	{
-			F32 collapse_amt = 
-				clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, (F32)mMinHeight / (F32)llmax(1, mPanel->getRect().getHeight())));
-			return mVisibleAmt * collapse_amt;
-		}
+		F32 collapse_amt = 
+			clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, (F32)mMinDim / (F32)llmax(1, getRect().getHeight())));
+		return mVisibleAmt * collapse_amt;
 	}
+}
 
-	LLPanel* mPanel;
-	S32 mMinWidth;
-	S32 mMinHeight;
-
-	// mMaxWidth & mMaxHeight are added to make configurable max width of the nearby chat bar. EXT-5589
-	// they are not processed by LLLayoutStack but they can be if necessary
-	S32 mMaxWidth;
-	S32 mMaxHeight;
-	BOOL mAutoResize;
-	BOOL mUserResize;
-	BOOL mCollapsed;
-	LLResizeBar* mResizeBar;
-	ELayoutOrientation mOrientation;
-	F32 mVisibleAmt;
-	F32 mCollapseAmt;
-};
+//
+// LLLayoutStack
+//
 
 LLLayoutStack::Params::Params()
 :	orientation("orientation", std::string("vertical")),
@@ -163,18 +127,18 @@ void LLLayoutStack::draw()
 	for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
 	{
 		// clip to layout rectangle, not bounding rectangle
-		LLRect clip_rect = (*panel_it)->mPanel->getRect();
+		LLRect clip_rect = (*panel_it)->getRect();
 		// scale clipping rectangle by visible amount
 		if (mOrientation == HORIZONTAL)
 		{
-			clip_rect.mRight = clip_rect.mLeft + llround((F32)clip_rect.getWidth() * (*panel_it)->getCollapseFactor());
+			clip_rect.mRight = clip_rect.mLeft + llround((F32)clip_rect.getWidth() * (*panel_it)->getCollapseFactor(mOrientation));
 		}
 		else
 		{
-			clip_rect.mBottom = clip_rect.mTop - llround((F32)clip_rect.getHeight() * (*panel_it)->getCollapseFactor());
+			clip_rect.mBottom = clip_rect.mTop - llround((F32)clip_rect.getHeight() * (*panel_it)->getCollapseFactor(mOrientation));
 		}
 
-		LLPanel* panelp = (*panel_it)->mPanel;
+		LLPanel* panelp = (*panel_it);
 
 		LLLocalClipRect clip(clip_rect, mClip);
 		// only force drawing invisible children if visible amount is non-zero
@@ -185,7 +149,7 @@ void LLLayoutStack::draw()
 
 void LLLayoutStack::removeChild(LLView* view)
 {
-	LayoutPanel* embedded_panelp = findEmbeddedPanel(dynamic_cast<LLPanel*>(view));
+	LLLayoutPanel* embedded_panelp = findEmbeddedPanel(dynamic_cast<LLPanel*>(view));
 
 	if (embedded_panelp)
 	{
@@ -206,149 +170,16 @@ BOOL LLLayoutStack::postBuild()
 	return TRUE;
 }
 
-static void get_attribute_s32_and_write(LLXMLNodePtr node,
-										const char* name,
-										S32 *value,
-										S32 default_value,
-										LLXMLNodePtr output_child)
-{
-	BOOL has_attr = node->getAttributeS32(name, *value);
-	if (has_attr && *value != default_value && output_child)
-	{
-		// create an attribute child node
-		LLXMLNodePtr child_attr = output_child->createChild(name, TRUE);
-		child_attr->setIntValue(*value);
-	}
-}
-
-static void get_attribute_bool_and_write(LLXMLNodePtr node,
-										const char* name,
-										BOOL *value,
-										BOOL default_value,
-										LLXMLNodePtr output_child)
+bool LLLayoutStack::addChild(LLView* child, S32 tab_group)
 {
-	BOOL has_attr = node->getAttributeBOOL(name, *value);
-	if (has_attr && *value != default_value && output_child)
+	LLLayoutPanel* panelp = dynamic_cast<LLLayoutPanel*>(child);
+	if (panelp)
 	{
-		LLXMLNodePtr child_attr = output_child->createChild(name, TRUE);
-		child_attr->setBoolValue(*value);
+		mPanels.push_back(panelp);
 	}
+	return LLView::addChild(child, tab_group);
 }
-//static 
-LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node)
-{
-	LLLayoutStack::Params p(LLUICtrlFactory::getDefaultParams<LLLayoutStack>());
-	LLXUIParser parser;
-	parser.readXUI(node, p, LLUICtrlFactory::getInstance()->getCurFileName());
-
-	// Export must happen before setupParams() mungles rectangles and before
-	// this item gets added to parent (otherwise screws up last_child_rect
-	// logic). JC
-	if (output_node)
-	{
-		Params output_params(p);
-		setupParamsForExport(output_params, parent);
-		LLLayoutStack::Params default_params(LLUICtrlFactory::getDefaultParams<LLLayoutStack>());
-		output_node->setName(node->getName()->mString);
-		parser.writeXUI(output_node, output_params, &default_params);
-	}
-
-	p.from_xui = true;
-	applyXUILayout(p, parent);
-	LLLayoutStack* layout_stackp = LLUICtrlFactory::create<LLLayoutStack>(p);
-
-	if (parent && layout_stackp)
-	{
-		S32 tab_group = p.tab_group.isProvided() ? p.tab_group() : parent->getLastTabGroup();
-
-		parent->addChild(layout_stackp, tab_group);
-	}
-
-	for (LLXMLNodePtr child_node = node->getFirstChild(); child_node.notNull(); child_node = child_node->getNextSibling())
-	{
-		const S32 DEFAULT_MIN_WIDTH = 0;
-		const S32 DEFAULT_MIN_HEIGHT = 0;
-		const S32 DEFAULT_MAX_WIDTH = S32_MAX;
-		const S32 DEFAULT_MAX_HEIGHT = S32_MAX;
-		const BOOL DEFAULT_AUTO_RESIZE = TRUE;
-
-		S32 min_width = DEFAULT_MIN_WIDTH;
-		S32 min_height = DEFAULT_MIN_HEIGHT;
-		S32 max_width = DEFAULT_MAX_WIDTH;
-		S32 max_height = DEFAULT_MAX_HEIGHT;
-		BOOL auto_resize = DEFAULT_AUTO_RESIZE;
-
-		LLXMLNodePtr output_child;
-		if (output_node) 
-		{
-			output_child = output_node->createChild("", FALSE);
-		}
-
-		// Layout stack allows child nodes to acquire additional attributes,
-		// such as "min_width" in:  <button label="Foo" min_width="100"/>
-		// If these attributes exist and have non-default values, write them
-		// to the output node.
-		get_attribute_s32_and_write(child_node, "min_width", &min_width,
-			DEFAULT_MIN_WIDTH, output_child);
-		get_attribute_s32_and_write(child_node, "min_height", &min_height,
-			DEFAULT_MIN_HEIGHT, output_child);
-		get_attribute_s32_and_write(child_node, "max_width", &max_width,
-			DEFAULT_MAX_WIDTH, output_child);
-		get_attribute_s32_and_write(child_node, "max_height", &max_height,
-			DEFAULT_MAX_HEIGHT, output_child);
-		get_attribute_bool_and_write(child_node, "auto_resize", &auto_resize,
-			DEFAULT_AUTO_RESIZE, output_child);
-
-		if (child_node->hasName("layout_panel"))
-		{
-			BOOL user_resize = TRUE;
-			get_attribute_bool_and_write(child_node, "user_resize", &user_resize,
-				TRUE, output_child);
-			LLPanel* panelp = (LLPanel*)LLPanel::fromXML(child_node, layout_stackp, output_child);
-			if (panelp)
-			{
-				panelp->setFollowsNone();
-				layout_stackp->addPanel(panelp, min_width, min_height, max_width, max_height, auto_resize, user_resize);
-			}
-		}
-		else
-		{
-			BOOL user_resize = FALSE;
-			get_attribute_bool_and_write(child_node, "user_resize", &user_resize,
-				FALSE, output_child);
-
-			LLPanel::Params p;
-			p.mouse_opaque(false);
-			LLPanel* panelp = LLUICtrlFactory::create<LLPanel>(p);
-			LLView* new_child = LLUICtrlFactory::getInstance()->createFromXML(child_node, panelp, LLStringUtil::null, LLPanel::child_registry_t::instance(), output_child);
-			if (new_child)
-			{
-				// put child in new embedded panel
-				layout_stackp->addPanel(panelp, min_width, min_height, max_width, max_height, auto_resize, user_resize);
-				// resize panel to contain widget and move widget to be contained in panel
-				panelp->setRect(new_child->getRect());
-				new_child->setOrigin(0, 0);
-			}
-			else
-			{
-				panelp->die();
-			}
-		}
-		
-		if (output_child && !output_child->mChildren && output_child->mAttributes.empty() && output_child->getValue().empty())
-		{
-			output_node->deleteChild(output_child);
-		}
-	}
-
-	if (!layout_stackp->postBuild())
-	{
-		delete layout_stackp;
-		return NULL;
-	}
 
-	return layout_stackp;
-}
 
 S32 LLLayoutStack::getDefaultHeight(S32 cur_height)
 {
@@ -374,34 +205,14 @@ S32 LLLayoutStack::getDefaultWidth(S32 cur_width)
 	return cur_width;
 }
 
-void LLLayoutStack::addPanel(LLPanel* panel, S32 min_width, S32 min_height, S32 max_width, S32 max_height, BOOL auto_resize, BOOL user_resize, EAnimate animate, S32 index)
+void LLLayoutStack::addPanel(LLLayoutPanel* panel, EAnimate animate)
 {
-	// panel starts off invisible (collapsed)
-	if (animate == ANIMATE)
-	{
-		panel->setVisible(FALSE);
-	}
-	LayoutPanel* embedded_panel = new LayoutPanel(panel, mOrientation, min_width, min_height, max_width, max_height, auto_resize, user_resize);
-	
-	mPanels.insert(mPanels.begin() + llclamp(index, 0, (S32)mPanels.size()), embedded_panel);
-	
-	if (panel->getParent() != this) 
-	{
-		addChild(panel);
-	}
-	addChild(embedded_panel->mResizeBar);
-
-	// bring all resize bars to the front so that they are clickable even over the panels
-	// with a bit of overlap
-	for (e_panel_list_t::iterator panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
-	{
-		LLResizeBar* resize_barp = (*panel_it)->mResizeBar;
-		sendChildToFront(resize_barp);
-	}
+	addChild(panel);
 
-	// start expanding panel animation
+	// panel starts off invisible (collapsed)
 	if (animate == ANIMATE)
 	{
+		panel->mVisibleAmt = 0.f;
 		panel->setVisible(TRUE);
 	}
 }
@@ -413,7 +224,7 @@ void LLLayoutStack::removePanel(LLPanel* panel)
 
 void LLLayoutStack::collapsePanel(LLPanel* panel, BOOL collapsed)
 {
-	LayoutPanel* panel_container = findEmbeddedPanel(panel);
+	LLLayoutPanel* panel_container = findEmbeddedPanel(panel);
 	if (!panel_container) return;
 
 	panel_container->mCollapsed = collapsed;
@@ -421,7 +232,7 @@ void LLLayoutStack::collapsePanel(LLPanel* panel, BOOL collapsed)
 
 void LLLayoutStack::updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize)
 {
-	LayoutPanel* panel = findEmbeddedPanelByName(panel_name);
+	LLLayoutPanel* panel = findEmbeddedPanelByName(panel_name);
 
 	if (panel)
 	{
@@ -431,7 +242,7 @@ void LLLayoutStack::updatePanelAutoResize(const std::string& panel_name, BOOL au
 
 void LLLayoutStack::setPanelUserResize(const std::string& panel_name, BOOL user_resize)
 {
-	LayoutPanel* panel = findEmbeddedPanelByName(panel_name);
+	LLLayoutPanel* panel = findEmbeddedPanelByName(panel_name);
 
 	if (panel)
 	{
@@ -439,27 +250,25 @@ void LLLayoutStack::setPanelUserResize(const std::string& panel_name, BOOL user_
 	}
 }
 
-bool LLLayoutStack::getPanelMinSize(const std::string& panel_name, S32* min_widthp, S32* min_heightp)
+bool LLLayoutStack::getPanelMinSize(const std::string& panel_name, S32* min_dimp)
 {
-	LayoutPanel* panel = findEmbeddedPanelByName(panel_name);
+	LLLayoutPanel* panel = findEmbeddedPanelByName(panel_name);
 
 	if (panel)
 	{
-		if (min_widthp) *min_widthp = panel->mMinWidth;
-		if (min_heightp) *min_heightp = panel->mMinHeight;
+		if (min_dimp) *min_dimp = panel->mMinDim;
 	}
 
 	return NULL != panel;
 }
 
-bool LLLayoutStack::getPanelMaxSize(const std::string& panel_name, S32* max_widthp, S32* max_heightp)
+bool LLLayoutStack::getPanelMaxSize(const std::string& panel_name, S32* max_dimp)
 {
-	LayoutPanel* panel = findEmbeddedPanelByName(panel_name);
+	LLLayoutPanel* panel = findEmbeddedPanelByName(panel_name);
 
 	if (panel)
 	{
-		if (max_widthp) *max_widthp = panel->mMaxWidth;
-		if (max_heightp) *max_heightp = panel->mMaxHeight;
+		if (max_dimp) *max_dimp = panel->mMaxDim;
 	}
 
 	return NULL != panel;
@@ -471,6 +280,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 	LLFastTimer ft(FTM_UPDATE_LAYOUT);
 	static LLUICachedControl<S32> resize_bar_overlap ("UIResizeBarOverlap", 0);
 	calcMinExtents();
+	createResizeBars();
 
 	// calculate current extents
 	S32 total_width = 0;
@@ -482,7 +292,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 	e_panel_list_t::iterator panel_it;
 	for (panel_it = mPanels.begin(); panel_it != mPanels.end();	++panel_it)
 	{
-		LLPanel* panelp = (*panel_it)->mPanel;
+		LLPanel* panelp = (*panel_it);
 		if (panelp->getVisible()) 
 		{
 			if (mAnimate)
@@ -532,11 +342,11 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 		if (mOrientation == HORIZONTAL)
 		{
 			// enforce minimize size constraint by default
-			if (panelp->getRect().getWidth() < (*panel_it)->mMinWidth)
+			if (panelp->getRect().getWidth() < (*panel_it)->mMinDim)
 			{
-				panelp->reshape((*panel_it)->mMinWidth, panelp->getRect().getHeight());
+				panelp->reshape((*panel_it)->mMinDim, panelp->getRect().getHeight());
 			}
-        	total_width += llround(panelp->getRect().getWidth() * (*panel_it)->getCollapseFactor());
+        	total_width += llround(panelp->getRect().getWidth() * (*panel_it)->getCollapseFactor(mOrientation));
         	// want n-1 panel gaps for n panels
 			if (panel_it != mPanels.begin())
 			{
@@ -546,11 +356,11 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 		else //VERTICAL
 		{
 			// enforce minimize size constraint by default
-			if (panelp->getRect().getHeight() < (*panel_it)->mMinHeight)
+			if (panelp->getRect().getHeight() < (*panel_it)->mMinDim)
 			{
-				panelp->reshape(panelp->getRect().getWidth(), (*panel_it)->mMinHeight);
+				panelp->reshape(panelp->getRect().getWidth(), (*panel_it)->mMinDim);
 			}
-			total_height += llround(panelp->getRect().getHeight() * (*panel_it)->getCollapseFactor());
+			total_height += llround(panelp->getRect().getHeight() * (*panel_it)->getCollapseFactor(mOrientation));
 			if (panel_it != mPanels.begin())
 			{
 				total_height += mPanelSpacing;
@@ -564,7 +374,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 	for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
 	{
 		// panels that are not fully visible do not count towards shrink headroom
-		if ((*panel_it)->getCollapseFactor() < 1.f) 
+		if ((*panel_it)->getCollapseFactor(mOrientation) < 1.f) 
 		{
 			continue;
 		}
@@ -577,11 +387,11 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 		{
 			if (mOrientation == HORIZONTAL)
 			{
-				shrink_headroom_total += (*panel_it)->mPanel->getRect().getWidth() - (*panel_it)->mMinWidth;
+				shrink_headroom_total += (*panel_it)->getRect().getWidth() - (*panel_it)->mMinDim;
 			}
 			else //VERTICAL
 			{
-				shrink_headroom_total += (*panel_it)->mPanel->getRect().getHeight() - (*panel_it)->mMinHeight;
+				shrink_headroom_total += (*panel_it)->getRect().getHeight() - (*panel_it)->mMinDim;
 			}
 		}
 		else
@@ -589,13 +399,13 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 			num_resizable_panels++;
 			if (mOrientation == HORIZONTAL)
 			{
-				shrink_headroom_available += (*panel_it)->mPanel->getRect().getWidth() - (*panel_it)->mMinWidth;
-				shrink_headroom_total += (*panel_it)->mPanel->getRect().getWidth() - (*panel_it)->mMinWidth;
+				shrink_headroom_available += (*panel_it)->getRect().getWidth() - (*panel_it)->mMinDim;
+				shrink_headroom_total += (*panel_it)->getRect().getWidth() - (*panel_it)->mMinDim;
 			}
 			else //VERTICAL
 			{
-				shrink_headroom_available += (*panel_it)->mPanel->getRect().getHeight() - (*panel_it)->mMinHeight;
-				shrink_headroom_total += (*panel_it)->mPanel->getRect().getHeight() - (*panel_it)->mMinHeight;
+				shrink_headroom_available += (*panel_it)->getRect().getHeight() - (*panel_it)->mMinDim;
+				shrink_headroom_total += (*panel_it)->getRect().getHeight() - (*panel_it)->mMinDim;
 			}
 		}
 	}
@@ -618,17 +428,25 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 
 	for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
 	{
-		LLPanel* panelp = (*panel_it)->mPanel;
+		LLPanel* panelp = (*panel_it);
 
 		S32 cur_width = panelp->getRect().getWidth();
 		S32 cur_height = panelp->getRect().getHeight();
-		S32 new_width = llmax((*panel_it)->mMinWidth, cur_width);
-		S32 new_height = llmax((*panel_it)->mMinHeight, cur_height); 
+		S32 new_width = cur_width;
+		S32 new_height = cur_height; 
 
+		if (mOrientation == HORIZONTAL)
+		{
+			new_width = llmax((*panel_it)->mMinDim, new_width);
+		}
+		else
+		{
+			new_height = llmax((*panel_it)->mMinDim, new_height);
+		}
 		S32 delta_size = 0;
 
 		// if panel can automatically resize (not animating, and resize flag set)...
-		if ((*panel_it)->getCollapseFactor() == 1.f 
+		if ((*panel_it)->getCollapseFactor(mOrientation) == 1.f 
 			&& (force_resize || (*panel_it)->mAutoResize) 
 			&& !(*panel_it)->mResizeBar->hasMouseCapture()) 
 		{
@@ -639,8 +457,8 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 				{
 					// shrink proportionally to amount over minimum
 					// so we can do this in one pass
-					delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_width - (*panel_it)->mMinWidth) / (F32)shrink_headroom_available)) : 0;
-					shrink_headroom_available -= (cur_width - (*panel_it)->mMinWidth);
+					delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_width - (*panel_it)->mMinDim) / (F32)shrink_headroom_available)) : 0;
+					shrink_headroom_available -= (cur_width - (*panel_it)->mMinDim);
 				}
 				else
 				{
@@ -649,7 +467,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 					num_resizable_panels--;
 				}
 				pixels_to_distribute -= delta_size;
-				new_width = llmax((*panel_it)->mMinWidth, cur_width + delta_size);
+				new_width = llmax((*panel_it)->mMinDim, cur_width + delta_size);
 			}
 			else
 			{
@@ -662,8 +480,8 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 				{
 					// shrink proportionally to amount over minimum
 					// so we can do this in one pass
-					delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_height - (*panel_it)->mMinHeight) / (F32)shrink_headroom_available)) : 0;
-					shrink_headroom_available -= (cur_height - (*panel_it)->mMinHeight);
+					delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_height - (*panel_it)->mMinDim) / (F32)shrink_headroom_available)) : 0;
+					shrink_headroom_available -= (cur_height - (*panel_it)->mMinDim);
 				}
 				else
 				{
@@ -671,7 +489,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 					num_resizable_panels--;
 				}
 				pixels_to_distribute -= delta_size;
-				new_height = llmax((*panel_it)->mMinHeight, cur_height + delta_size);
+				new_height = llmax((*panel_it)->mMinDim, cur_height + delta_size);
 			}
 			else
 			{
@@ -712,11 +530,11 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 
 		if (mOrientation == HORIZONTAL)
 		{
-			cur_x += llround(new_width * (*panel_it)->getCollapseFactor()) + mPanelSpacing;
+			cur_x += llround(new_width * (*panel_it)->getCollapseFactor(mOrientation)) + mPanelSpacing;
 		}
 		else //VERTICAL
 		{
-			cur_y -= llround(new_height * (*panel_it)->getCollapseFactor()) + mPanelSpacing;
+			cur_y -= llround(new_height * (*panel_it)->getCollapseFactor(mOrientation)) + mPanelSpacing;
 		}
 	}
 
@@ -724,19 +542,19 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 	LLResizeBar* last_resize_bar = NULL;
 	for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
 	{
-		LLPanel* panelp = (*panel_it)->mPanel;
+		LLPanel* panelp = (*panel_it);
 
 		if (mOrientation == HORIZONTAL)
 		{
 			(*panel_it)->mResizeBar->setResizeLimits(
-				(*panel_it)->mMinWidth, 
-				(*panel_it)->mMinWidth + shrink_headroom_total);
+				(*panel_it)->mMinDim, 
+				(*panel_it)->mMinDim + shrink_headroom_total);
 		}
 		else //VERTICAL
 		{
 			(*panel_it)->mResizeBar->setResizeLimits(
-				(*panel_it)->mMinHeight, 
-				(*panel_it)->mMinHeight + shrink_headroom_total);
+				(*panel_it)->mMinDim, 
+				(*panel_it)->mMinDim + shrink_headroom_total);
 		}
 
 		// toggle resize bars based on panel visibility, resizability, etc
@@ -772,14 +590,14 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 } // end LLLayoutStack::updateLayout
 
 
-LLLayoutStack::LayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const
+LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const
 {
 	if (!panelp) return NULL;
 
 	e_panel_list_t::const_iterator panel_it;
 	for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
 	{
-		if ((*panel_it)->mPanel == panelp)
+		if ((*panel_it) == panelp)
 		{
 			return *panel_it;
 		}
@@ -787,15 +605,15 @@ LLLayoutStack::LayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) co
 	return NULL;
 }
 
-LLLayoutStack::LayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) const
+LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) const
 {
-	LayoutPanel* result = NULL;
+	LLLayoutPanel* result = NULL;
 
 	for (e_panel_list_t::const_iterator panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
 	{
-		LayoutPanel* p = *panel_it;
+		LLLayoutPanel* p = *panel_it;
 
-		if (p->mPanel->getName() == name)
+		if (p->getName() == name)
 		{
 			result = p;
 			break;
@@ -816,9 +634,7 @@ void LLLayoutStack::calcMinExtents()
 	{
 		if (mOrientation == HORIZONTAL)
 		{
-			mMinHeight = llmax(	mMinHeight, 
-								(*panel_it)->mMinHeight);
-            mMinWidth += (*panel_it)->mMinWidth;
+            mMinWidth += (*panel_it)->mMinDim;
 			if (panel_it != mPanels.begin())
 			{
 				mMinWidth += mPanelSpacing;
@@ -826,9 +642,7 @@ void LLLayoutStack::calcMinExtents()
 		}
 		else //VERTICAL
 		{
-	        mMinWidth = llmax(	mMinWidth, 
-								(*panel_it)->mMinWidth);
-			mMinHeight += (*panel_it)->mMinHeight;
+			mMinHeight += (*panel_it)->mMinDim;
 			if (panel_it != mPanels.begin())
 			{
 				mMinHeight += mPanelSpacing;
@@ -837,6 +651,37 @@ void LLLayoutStack::calcMinExtents()
 	}
 }
 
+void LLLayoutStack::createResizeBars()
+{
+	for (e_panel_list_t::iterator panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
+	{
+		LLLayoutPanel* lp = (*panel_it);
+		if (lp->mResizeBar == NULL)
+		{
+			LLResizeBar::Side side = (mOrientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM;
+			LLRect resize_bar_rect = getRect();
+
+			LLResizeBar::Params resize_params;
+			resize_params.name("resize");
+			resize_params.resizing_view(this);
+			resize_params.min_size(lp->mMinDim);
+			resize_params.side(side);
+			resize_params.snapping_enabled(false);
+			LLResizeBar* resize_bar = LLUICtrlFactory::create<LLResizeBar>(resize_params);
+			lp->mResizeBar = resize_bar;
+			LLView::addChild(resize_bar, 0);
+
+			// bring all resize bars to the front so that they are clickable even over the panels
+			// with a bit of overlap
+			for (e_panel_list_t::iterator panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
+			{
+				LLResizeBar* resize_barp = (*panel_it)->mResizeBar;
+				sendChildToFront(resize_barp);
+			}
+		}
+	}
+}
+
 // update layout stack animations, etc. once per frame
 // NOTE: we use this to size world view based on animating UI, *before* we draw the UI
 // we might still need to call updateLayout during UI draw phase, in case UI elements
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index e454454fe2..cc5bd6cf65 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -34,13 +34,18 @@
 #ifndef LL_LLLAYOUTSTACK_H
 #define LL_LLLAYOUTSTACK_H
 
-#include "llview.h"
+#include "llpanel.h"
 
 class LLPanel;
 
+class LLLayoutPanel;
+
 class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
 {
 public:
+	struct LayoutStackRegistry : public LLChildRegistry<LayoutStackRegistry>
+	{};
+
 	struct Params : public LLInitParam::Block<Params, LLView::Params>
 	{
 		Optional<std::string>	orientation;
@@ -51,6 +56,8 @@ public:
 		Params();
 	};
 
+	typedef LayoutStackRegistry child_registry_t;
+
 	typedef enum e_layout_orientation
 	{
 		HORIZONTAL,
@@ -62,6 +69,7 @@ public:
 	/*virtual*/ void draw();
 	/*virtual*/ void removeChild(LLView*);
 	/*virtual*/ BOOL postBuild();
+	/*virtual*/ bool addChild(LLView* child, S32 tab_group = 0);
 
 	static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL);
 
@@ -74,7 +82,7 @@ public:
 		ANIMATE
 	} EAnimate;
 
-	void addPanel(LLPanel* panel, S32 min_width, S32 min_height, S32 max_width, S32 max_height, BOOL auto_resize, BOOL user_resize, EAnimate animate = NO_ANIMATE, S32 index = S32_MAX);
+	void addPanel(LLLayoutPanel* panel, EAnimate animate = NO_ANIMATE);
 	void removePanel(LLPanel* panel);
 	void collapsePanel(LLPanel* panel, BOOL collapsed = TRUE);
 	S32 getNumPanels() { return mPanels.size(); }
@@ -83,20 +91,18 @@ public:
 	void setPanelUserResize(const std::string& panel_name, BOOL user_resize);
 	
 	/**
-	 * Gets minimal width and/or height of the specified by name panel.
+	 * Gets minimal dimension along layout_stack axis of the specified by name panel.
 	 *
-	 * If it is necessary to get only the one dimension pass NULL for another one.
 	 * @returns true if specified by panel_name internal panel exists, false otherwise.
 	 */
-	bool getPanelMinSize(const std::string& panel_name, S32* min_widthp, S32* min_heightp);
+	bool getPanelMinSize(const std::string& panel_name, S32* min_dimp);
 
 	/**
-	 * Gets maximal width and/or height of the specified by name panel.
+	 * Gets maximal dimension along layout_stack axis of the specified by name panel.
 	 *
-	 * If it is necessary to get only the one dimension pass NULL for another one.
 	 * @returns true if specified by panel_name internal panel exists, false otherwise.
 	 */
-	bool getPanelMaxSize(const std::string& panel_name, S32* max_width, S32* max_height);
+	bool getPanelMaxSize(const std::string& panel_name, S32* max_dim);
 	
 	void updateLayout(BOOL force_resize = FALSE);
 	
@@ -111,19 +117,18 @@ protected:
 	friend class LLUICtrlFactory;
 
 private:
-	struct LayoutPanel;
-
+	void createResizeBars();
 	void calcMinExtents();
 	S32 getDefaultHeight(S32 cur_height);
 	S32 getDefaultWidth(S32 cur_width);
 
 	const ELayoutOrientation mOrientation;
 
-	typedef std::vector<LayoutPanel*> e_panel_list_t;
+	typedef std::vector<LLLayoutPanel*> e_panel_list_t;
 	e_panel_list_t mPanels;
 
-	LayoutPanel* findEmbeddedPanel(LLPanel* panelp) const;
-	LayoutPanel* findEmbeddedPanelByName(const std::string& name) const;
+	LLLayoutPanel* findEmbeddedPanel(LLPanel* panelp) const;
+	LLLayoutPanel* findEmbeddedPanelByName(const std::string& name) const;
 
 	S32 mMinWidth;  // calculated by calcMinExtents
 	S32 mMinHeight;  // calculated by calcMinExtents
@@ -135,4 +140,47 @@ private:
 	bool mClip;
 }; // end class LLLayoutStack
 
+class LLLayoutPanel : public LLPanel
+{
+friend LLLayoutStack;
+friend class LLUICtrlFactory;
+public:
+	struct Params : public LLInitParam::Block<Params, LLPanel::Params>
+	{
+		Optional<S32>			min_dim,
+								max_dim;
+		Optional<bool>			user_resize,
+								auto_resize;
+
+		Params()
+		:	min_dim("min_dim", 0),
+			max_dim("max_dim", 0),
+			user_resize("user_resize", true),
+			auto_resize("auto_resize", true)
+		{
+			addSynonym(min_dim, "min_width");
+			addSynonym(min_dim, "min_height");
+			addSynonym(max_dim, "max_width");
+			addSynonym(max_dim, "max_height");
+		}
+	};
+
+	~LLLayoutPanel();
+protected:
+	LLLayoutPanel(const Params& p)	;
+
+	
+	F32 getCollapseFactor(LLLayoutStack::ELayoutOrientation orientation);
+
+	S32 mMinDim;
+	S32 mMaxDim;
+	BOOL mAutoResize;
+	BOOL mUserResize;
+	BOOL mCollapsed;
+	class LLResizeBar* mResizeBar;
+	F32 mVisibleAmt;
+	F32 mCollapseAmt;
+};
+
+
 #endif
diff --git a/indra/llui/llsdparam.cpp b/indra/llui/llsdparam.cpp
index 338569fc58..69976004e6 100644
--- a/indra/llui/llsdparam.cpp
+++ b/indra/llui/llsdparam.cpp
@@ -50,25 +50,26 @@ LLParamSDParser::LLParamSDParser()
 
 	if (sReadFuncs.empty())
 	{
-		registerParserFuncs<S32>(readS32, bind(&LLParamSDParser::writeTypedValue<S32>, this, _1, _2));
-		registerParserFuncs<U32>(readU32, bind(&LLParamSDParser::writeU32Param, this, _1, _2));
-		registerParserFuncs<F32>(readF32, bind(&LLParamSDParser::writeTypedValue<F32>, this, _1, _2));
-		registerParserFuncs<F64>(readF64, bind(&LLParamSDParser::writeTypedValue<F64>, this, _1, _2));
-		registerParserFuncs<bool>(readBool, bind(&LLParamSDParser::writeTypedValue<F32>, this, _1, _2));
-		registerParserFuncs<std::string>(readString, bind(&LLParamSDParser::writeTypedValue<std::string>, this, _1, _2));
-		registerParserFuncs<LLUUID>(readUUID, bind(&LLParamSDParser::writeTypedValue<LLUUID>, this, _1, _2));
-		registerParserFuncs<LLDate>(readDate, bind(&LLParamSDParser::writeTypedValue<LLDate>, this, _1, _2));
-		registerParserFuncs<LLURI>(readURI, bind(&LLParamSDParser::writeTypedValue<LLURI>, this, _1, _2));
-		registerParserFuncs<LLSD>(readSD, bind(&LLParamSDParser::writeTypedValue<LLSD>, this, _1, _2));
+		registerParserFuncs<S32>(readS32, &LLParamSDParser::writeTypedValue<S32>);
+		registerParserFuncs<U32>(readU32, &LLParamSDParser::writeU32Param);
+		registerParserFuncs<F32>(readF32, &LLParamSDParser::writeTypedValue<F32>);
+		registerParserFuncs<F64>(readF64, &LLParamSDParser::writeTypedValue<F64>);
+		registerParserFuncs<bool>(readBool, &LLParamSDParser::writeTypedValue<F32>);
+		registerParserFuncs<std::string>(readString, &LLParamSDParser::writeTypedValue<std::string>);
+		registerParserFuncs<LLUUID>(readUUID, &LLParamSDParser::writeTypedValue<LLUUID>);
+		registerParserFuncs<LLDate>(readDate, &LLParamSDParser::writeTypedValue<LLDate>);
+		registerParserFuncs<LLURI>(readURI, &LLParamSDParser::writeTypedValue<LLURI>);
+		registerParserFuncs<LLSD>(readSD, &LLParamSDParser::writeTypedValue<LLSD>);
 	}
 }
 
 // special case handling of U32 due to ambiguous LLSD::assign overload
-bool LLParamSDParser::writeU32Param(const void* val_ptr, const parser_t::name_stack_t& name_stack)
+bool LLParamSDParser::writeU32Param(LLParamSDParser::parser_t& parser, const void* val_ptr, const parser_t::name_stack_t& name_stack)
 {
-	if (!mWriteSD) return false;
+	LLParamSDParser& sdparser = static_cast<LLParamSDParser&>(parser);
+	if (!sdparser.mWriteSD) return false;
 	
-	LLSD* sd_to_write = getSDWriteNode(name_stack);
+	LLSD* sd_to_write = sdparser.getSDWriteNode(name_stack);
 	if (!sd_to_write) return false;
 
 	sd_to_write->assign((S32)*((const U32*)val_ptr));
diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h
index e98318fc1e..83c958d67d 100644
--- a/indra/llui/llsdparam.h
+++ b/indra/llui/llsdparam.h
@@ -54,11 +54,12 @@ private:
 	void readSDValues(const LLSD& sd, LLInitParam::BaseBlock& block);
 
 	template<typename T>
-	bool writeTypedValue(const void* val_ptr, const parser_t::name_stack_t& name_stack)
+	static bool writeTypedValue(Parser& parser, const void* val_ptr, const parser_t::name_stack_t& name_stack)
 	{
-		if (!mWriteSD) return false;
+		LLParamSDParser& sdparser = static_cast<LLParamSDParser&>(parser);
+		if (!sdparser.mWriteSD) return false;
 		
-		LLSD* sd_to_write = getSDWriteNode(name_stack);
+		LLSD* sd_to_write = sdparser.getSDWriteNode(name_stack);
 		if (!sd_to_write) return false;
 
 		sd_to_write->assign(*((const T*)val_ptr));
@@ -67,7 +68,7 @@ private:
 
 	LLSD* getSDWriteNode(const parser_t::name_stack_t& name_stack);
 
-	bool writeU32Param(const void* value_ptr, const parser_t::name_stack_t& name_stack);
+	static bool writeU32Param(Parser& parser, const void* value_ptr, const parser_t::name_stack_t& name_stack);
 
 	static bool readS32(Parser& parser, void* val_ptr);
 	static bool readU32(Parser& parser, void* val_ptr);
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 48db873b6f..878def07ae 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -108,11 +108,7 @@ LLView::Params::Params()
 	left_pad("left_pad"),
 	left_delta("left_delta", S32_MAX),
 	from_xui("from_xui", false),
-	user_resize("user_resize"),
-	auto_resize("auto_resize"),
 	needs_translate("translate"),
-	min_dim("min_width"),
-	max_dim("max_width"),
 	xmlns("xmlns"),
 	xmlns_xsi("xmlns:xsi"),
 	xsi_schemaLocation("xsi:schemaLocation"),
@@ -120,8 +116,6 @@ LLView::Params::Params()
 
 {
 	addSynonym(rect, "");
-	addSynonym(min_dim, "min_height");
-	addSynonym(max_dim, "max_height");
 }
 
 LLView::LLView(const LLView::Params& p)
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 6736ad9f33..fa4f4c8ae2 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -145,18 +145,12 @@ public:
 									left_delta;		// from last left to my left
 
 		//FIXME: get parent context involved in parsing traversal
-		Ignored						needs_translate;	// cue for translation tools
+		Ignored						needs_translate,	// cue for translation tools
 									xmlns,				// xml namespace
 									xmlns_xsi,			// xml namespace
 									xsi_schemaLocation,	// xml schema
 									xsi_type;			// xml schema type
 
-		// nested attributes for LLLayoutPanel
-		Optional<S32>				min_dim,
-									max_dim;
-		Optional<bool>				user_resize,		
-									auto_resize;
-
 		Params();
 	};
 
diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp
index 99191d2dbe..922a91b609 100644
--- a/indra/llxuixml/llinitparam.cpp
+++ b/indra/llxuixml/llinitparam.cpp
@@ -74,7 +74,6 @@ namespace LLInitParam
 	void BlockDescriptor::aggregateBlockData(BlockDescriptor& src_block_data) 
 	{
 		mNamedParams.insert(src_block_data.mNamedParams.begin(), src_block_data.mNamedParams.end());
-		mSynonyms.insert(src_block_data.mSynonyms.begin(), src_block_data.mSynonyms.end());
 		std::copy(src_block_data.mUnnamedParams.begin(), src_block_data.mUnnamedParams.end(), std::back_inserter(mUnnamedParams));
 		std::copy(src_block_data.mValidationList.begin(), src_block_data.mValidationList.end(), std::back_inserter(mValidationList));
 		std::copy(src_block_data.mAllParams.begin(), src_block_data.mAllParams.end(), std::back_inserter(mAllParams));
@@ -277,22 +276,6 @@ namespace LLInitParam
 			}
 		}
 
-		for(BlockDescriptor::param_map_t::const_iterator it = block_data.mSynonyms.begin();
-			it != block_data.mSynonyms.end();
-			++it)
-		{
-			param_handle_t param_handle = it->second->mParamHandle;
-			const Param* param = getParamFromHandle(param_handle);
-			ParamDescriptor::inspect_func_t inspect_func = it->second->mInspectFunc;
-			if (inspect_func)
-			{
-				// use existing serial number for param
-				name_stack.push_back(std::make_pair(it->first, it->second->mGeneration));
-				inspect_func(*param, parser, name_stack, it->second->mMinCount, it->second->mMaxCount);
-				name_stack.pop_back();
-			}
-		}
-
 		return true;
 	}
 
@@ -314,22 +297,9 @@ namespace LLInitParam
 				// find pointer to member parameter from offset table
 				paramp = getParamFromHandle(found_it->second->mParamHandle);
 				deserialize_func = found_it->second->mDeserializeFunc;
-			}
-			else
-			{
-				BlockDescriptor::param_map_t::iterator found_it = block_data.mSynonyms.find(top_name);
-				if (found_it != block_data.mSynonyms.end())
-				{
-					// find pointer to member parameter from offset table
-					paramp = getParamFromHandle(found_it->second->mParamHandle);
-					deserialize_func = found_it->second->mDeserializeFunc;
-				}
-			}
 					
-			Parser::name_stack_range_t new_name_stack(name_stack.first, name_stack.second);
-			++new_name_stack.first;
-			if (deserialize_func)
-			{
+				Parser::name_stack_range_t new_name_stack(name_stack.first, name_stack.second);
+				++new_name_stack.first;
 				return deserialize_func(*paramp, p, new_name_stack, name_stack.first == name_stack.second ? -1 : name_stack.first->second);
 			}
 		}
@@ -404,7 +374,7 @@ namespace LLInitParam
 				}
 				else
 				{
-					block_data.mSynonyms[synonym] = param_descriptor;
+					block_data.mNamedParams[synonym] = param_descriptor;
 				}
 			}
 		}
@@ -429,14 +399,6 @@ namespace LLInitParam
 			}
 		}
 
-		for (BlockDescriptor::param_map_t::const_iterator it = block_data.mSynonyms.begin(); it != block_data.mSynonyms.end(); ++it)
-		{
-			if (it->second->mParamHandle == handle)
-			{
-				return it->first;
-			}
-		}
-
 		return LLStringUtil::null;
 	}
 
diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index 488e20cf9f..51dbd99fb1 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -213,7 +213,10 @@ namespace LLInitParam
 
 		Parser(parser_read_func_map_t& read_map, parser_write_func_map_t& write_map, parser_inspect_func_map_t& inspect_map)
 		:	mParseSilently(false),
-			mParseGeneration(0)
+			mParseGeneration(0),
+			mParserReadFuncs(&read_map),
+			mParserWriteFuncs(&write_map),
+			mParserInspectFuncs(&inspect_map)
 		{}
 		virtual ~Parser();
 
@@ -393,7 +396,6 @@ namespace LLInitParam
 		typedef std::vector<std::pair<param_handle_t, ParamDescriptor::validation_func_t> > param_validation_list_t;
 
 		param_map_t						mNamedParams;			// parameters with associated names
-		param_map_t						mSynonyms;				// parameters with alternate names
 		param_list_t					mUnnamedParams;			// parameters with_out_ associated names
 		param_validation_list_t			mValidationList;		// parameters that must be validated
 		all_params_list_t				mAllParams;				// all parameters, owns descriptors
diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index 220171fb79..9bda96713e 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -411,6 +411,7 @@ void LLXUIParser::readXUI(LLXMLNodePtr node, LLInitParam::BaseBlock& block, cons
 {
 	LLFastTimer timer(FTM_PARSE_XUI);
 	mNameStack.clear();
+	mRootNodeName = node->getName()->mString;
 	mCurFileName = filename;
 	mCurReadDepth = 0;
 	setParseSilently(silent);
@@ -421,11 +422,11 @@ void LLXUIParser::readXUI(LLXMLNodePtr node, LLInitParam::BaseBlock& block, cons
 	}
 	else
 	{
-		readXUIImpl(node, std::string(node->getName()->mString), block);
+		readXUIImpl(node, block);
 	}
 }
 
-bool LLXUIParser::readXUIImpl(LLXMLNodePtr nodep, const std::string& scope, LLInitParam::BaseBlock& block)
+bool LLXUIParser::readXUIImpl(LLXMLNodePtr nodep, LLInitParam::BaseBlock& block)
 {
 	typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
 	boost::char_separator<char> sep(".");
@@ -492,7 +493,15 @@ bool LLXUIParser::readXUIImpl(LLXMLNodePtr nodep, const std::string& scope, LLIn
 			}
 
 			// check for proper nesting
-			if(!scope.empty() && *name_token_it != scope)
+			if (mNameStack.empty())
+			{
+				if (*name_token_it != mRootNodeName)
+				{
+					childp = childp->getNextSibling();
+					continue;
+				}
+			}
+			else if(mNameStack.back().first != *name_token_it)
 			{
 				childp = childp->getNextSibling();
 				continue;
@@ -510,7 +519,7 @@ bool LLXUIParser::readXUIImpl(LLXMLNodePtr nodep, const std::string& scope, LLIn
 		}
 
 		// recurse and visit children XML nodes
-		if(readXUIImpl(childp, mNameStack.empty() ? scope : mNameStack.back().first, block))
+		if(readXUIImpl(childp, block))
 		{
 			// child node successfully parsed, remove from DOM
 
diff --git a/indra/llxuixml/llxuiparser.h b/indra/llxuixml/llxuiparser.h
index ee8fcdc369..1a4a7c49d1 100644
--- a/indra/llxuixml/llxuiparser.h
+++ b/indra/llxuixml/llxuiparser.h
@@ -118,7 +118,7 @@ public:
 	void writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock& block, const LLInitParam::BaseBlock* diff_block = NULL);
 
 private:
-	bool readXUIImpl(LLXMLNodePtr node, const std::string& scope, LLInitParam::BaseBlock& block);
+	bool readXUIImpl(LLXMLNodePtr node, LLInitParam::BaseBlock& block);
 	bool readAttributes(LLXMLNodePtr nodep, LLInitParam::BaseBlock& block);
 
 	//reader helper functions
@@ -167,6 +167,7 @@ private:
 	LLXMLNodePtr					mLastWrittenChild;
 	S32								mCurReadDepth;
 	std::string						mCurFileName;
+	std::string						mRootNodeName;
 };
 
 // LLSimpleXUIParser is a streamlined SAX-based XUI parser that does not support localization 
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index c4eda5f107..4377640416 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -76,7 +76,7 @@ namespace
 		llassert(stack);
 		if ( stack && panel && panel->getVisible() )
 		{
-			stack->getPanelMinSize(panel->getName(), &minimal_width, NULL);
+			stack->getPanelMinSize(panel->getName(), &minimal_width);
 		}
 		return minimal_width;
 	}
@@ -87,7 +87,7 @@ namespace
 		llassert(stack);
 		if ( stack && panel && panel->getVisible() )
 		{
-			stack->getPanelMaxSize(panel->getName(), &max_width, NULL);
+			stack->getPanelMaxSize(panel->getName(), &max_width);
 		}
 		return max_width;
 	}
@@ -975,7 +975,7 @@ void LLBottomTray::processShrinkButtons(S32& required_width, S32& buttons_freed_
 
 		S32 panel_min_width = 0;
 		std::string panel_name = mSpeakPanel->getName();
-		bool success = mToolbarStack->getPanelMinSize(panel_name, &panel_min_width, NULL);
+		bool success = mToolbarStack->getPanelMinSize(panel_name, &panel_min_width);
 		if (!success)
 		{
 			lldebugs << "Panel was not found to get its min width: " << panel_name << llendl;
@@ -1021,7 +1021,7 @@ void LLBottomTray::processShrinkButton(EResizeState processed_object_type, S32&
 		S32 panel_width = panel->getRect().getWidth();
 		S32 panel_min_width = 0;
 		std::string panel_name = panel->getName();
-		bool success = mToolbarStack->getPanelMinSize(panel_name, &panel_min_width, NULL);
+		bool success = mToolbarStack->getPanelMinSize(panel_name, &panel_min_width);
 		S32 possible_shrink_width = panel_width - panel_min_width;
 
 		if (!success)
@@ -1330,7 +1330,7 @@ bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible
 
 			// Minimal width of current panel
 			S32 minimal_width = 0;
-			mToolbarStack->getPanelMinSize(cur_panel->getName(), &minimal_width, NULL);
+			mToolbarStack->getPanelMinSize(cur_panel->getName(), &minimal_width);
 
 			if ( (available_width + possible_shrunk_width) >= minimal_width)
 			{
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index e1e425fa8c..162b12cd5e 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -502,12 +502,17 @@ void LLChatHistory::initFromParams(const LLChatHistory::Params& p)
 	
 	const S32 NEW_TEXT_NOTICE_HEIGHT = 20;
 	
-	LLPanel::Params panel_p;
+	LLLayoutPanel::Params panel_p;
 	panel_p.name = "spacer";
 	panel_p.background_visible = false;
 	panel_p.has_border = false;
 	panel_p.mouse_opaque = false;
-	stackp->addPanel(LLUICtrlFactory::create<LLPanel>(panel_p), 0, 30, S32_MAX, S32_MAX, true, false, LLLayoutStack::ANIMATE);
+	panel_p.min_dim = 30;
+	panel_p.max_dim = S32_MAX;
+	panel_p.auto_resize = true;
+	panel_p.user_resize = false;
+
+	stackp->addPanel(LLUICtrlFactory::create<LLLayoutPanel>(panel_p), LLLayoutStack::ANIMATE);
 
 	panel_p.name = "new_text_notice_holder";
 	LLRect new_text_notice_rect = getLocalRect();
@@ -516,7 +521,10 @@ void LLChatHistory::initFromParams(const LLChatHistory::Params& p)
 	panel_p.background_opaque = true;
 	panel_p.background_visible = true;
 	panel_p.visible = false;
-	mMoreChatPanel = LLUICtrlFactory::create<LLPanel>(panel_p);
+	panel_p.min_dim = 0;
+	panel_p.auto_resize = false;
+	panel_p.user_resize = false;
+	mMoreChatPanel = LLUICtrlFactory::create<LLLayoutPanel>(panel_p);
 	
 	LLTextBox::Params text_p(p.more_chat_text);
 	text_p.rect = mMoreChatPanel->getLocalRect();
@@ -525,7 +533,7 @@ void LLChatHistory::initFromParams(const LLChatHistory::Params& p)
 	mMoreChatText = LLUICtrlFactory::create<LLTextBox>(text_p, mMoreChatPanel);
 	mMoreChatText->setClickedCallback(boost::bind(&LLChatHistory::onClickMoreText, this));
 
-	stackp->addPanel(mMoreChatPanel, 0, 0, S32_MAX, S32_MAX, false, false, LLLayoutStack::ANIMATE);
+	stackp->addPanel(mMoreChatPanel, LLLayoutStack::ANIMATE);
 }
 
 
diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h
index fa1f2e04a4..ddc456a5d2 100644
--- a/indra/newview/llchathistory.h
+++ b/indra/newview/llchathistory.h
@@ -144,7 +144,7 @@ class LLChatHistory : public LLUICtrl
 		S32 mTopHeaderPad;
 		S32 mBottomHeaderPad;
 
-		LLPanel*		mMoreChatPanel;
+		class LLLayoutPanel*	mMoreChatPanel;
 		LLTextBox*		mMoreChatText;
 		LLTextEditor*	mEditor;
 		typedef std::set<std::string> unread_chat_source_t;
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 18a6ac031f..751d5b8fcd 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -667,9 +667,10 @@ const LLButton::Params& LLFavoritesBarCtrl::getButtonParams()
 	{
 		LLXMLNodePtr button_xml_node;
 		if(LLUICtrlFactory::getLayeredXMLNode("favorites_bar_button.xml", button_xml_node))
-	{
-			LLXUIParser::instance().readXUI(button_xml_node, button_params, "favorites_bar_button.xml");
-	}
+		{
+			LLXUIParser parser;
+			parser.readXUI(button_xml_node, button_params, "favorites_bar_button.xml");
+		}
 		params_initialized = true;
 	}
 
diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp
index 3d37c878ad..0a4d5b64f3 100644
--- a/indra/newview/llfloaternotificationsconsole.cpp
+++ b/indra/newview/llfloaternotificationsconsole.cpp
@@ -43,10 +43,10 @@
 const S32 NOTIFICATION_PANEL_HEADER_HEIGHT = 20;
 const S32 HEADER_PADDING = 38;
 
-class LLNotificationChannelPanel : public LLPanel
+class LLNotificationChannelPanel : public LLLayoutPanel
 {
 public:
-	LLNotificationChannelPanel(const std::string& channel_name);
+	LLNotificationChannelPanel(const Params& p);
 	BOOL postBuild();
 
 private:
@@ -58,12 +58,12 @@ private:
 	LLNotificationChannelPtr mChannelRejectsPtr;
 };
 
-LLNotificationChannelPanel::LLNotificationChannelPanel(const std::string& channel_name) 
-	: LLPanel()
+LLNotificationChannelPanel::LLNotificationChannelPanel(const LLNotificationChannelPanel::Params& p) 
+:	LLLayoutPanel(p)
 {
-	mChannelPtr = LLNotifications::instance().getChannel(channel_name);
+	mChannelPtr = LLNotifications::instance().getChannel(p.name);
 	mChannelRejectsPtr = LLNotificationChannelPtr(
-		LLNotificationChannel::buildChannel(channel_name + "rejects", mChannelPtr->getParentChannelName(),
+		LLNotificationChannel::buildChannel(p.name() + "rejects", mChannelPtr->getParentChannelName(),
 											!boost::bind(mChannelPtr->getFilter(), _1)));
 	buildFromFile( "panel_notifications_channel.xml");
 }
@@ -207,8 +207,13 @@ BOOL LLFloaterNotificationConsole::postBuild()
 void LLFloaterNotificationConsole::addChannel(const std::string& name, bool open)
 {
 	LLLayoutStack& stack = getChildRef<LLLayoutStack>("notification_channels");
-	LLNotificationChannelPanel* panelp = new LLNotificationChannelPanel(name);
-	stack.addPanel(panelp, 0, NOTIFICATION_PANEL_HEADER_HEIGHT, S32_MAX, S32_MAX, TRUE, TRUE, LLLayoutStack::ANIMATE);
+	LLNotificationChannelPanel::Params p;
+	p.min_dim = NOTIFICATION_PANEL_HEADER_HEIGHT;
+	p.auto_resize = true;
+	p.user_resize = true;
+	p.name = name;
+	LLNotificationChannelPanel* panelp = new LLNotificationChannelPanel(p);
+	stack.addPanel(panelp, LLLayoutStack::ANIMATE);
 
 	LLButton& header_button = panelp->getChildRef<LLButton>("header");
 	header_button.setToggleState(!open);
diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index 41a19a54a8..fa3a627736 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -398,8 +398,7 @@ LLCtrlListInterface* LLGestureComboList::getListInterface()
 }
 
 LLNearbyChatBar::LLNearbyChatBar() 
-	: LLPanel()
-	, mChatBox(NULL)
+:	mChatBox(NULL)
 {
 	mSpeakerMgr = LLLocalSpeakerMgr::getInstance();
 }
diff --git a/indra/newview/skins/default/xui/da/floater_voice_controls.xml b/indra/newview/skins/default/xui/da/floater_voice_controls.xml
index 2e59dfd649..4c956f13a7 100644
--- a/indra/newview/skins/default/xui/da/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/da/floater_voice_controls.xml
@@ -19,10 +19,12 @@
 		<layout_panel name="my_panel">
 			<text name="user_text" value="Min avatar:"/>
 		</layout_panel>
-		<layout_stack name="voice_effect_and_leave_call_stack">
-			<layout_panel name="leave_call_btn_panel">
-				<button label="Forlad opkald" name="leave_call_btn"/>
-			</layout_panel>
-		</layout_stack>
+        <layout_panel name="leave_call_panel">
+			<layout_stack name="voice_effect_and_leave_call_stack">
+				<layout_panel name="leave_call_btn_panel">
+					<button label="Forlad opkald" name="leave_call_btn"/>
+				</layout_panel>
+			</layout_stack>
+		</layout_panel>
 	</layout_stack>
 </floater>
diff --git a/indra/newview/skins/default/xui/da/panel_notes.xml b/indra/newview/skins/default/xui/da/panel_notes.xml
index 5b3a2d0906..00128497ba 100644
--- a/indra/newview/skins/default/xui/da/panel_notes.xml
+++ b/indra/newview/skins/default/xui/da/panel_notes.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel label="Noter &amp; Privatliv" name="panel_notes">
 	<layout_stack name="layout">
-		<panel name="notes_stack">
+		<layout_panel name="notes_stack">
 			<scroll_container name="profile_scroll">
 				<panel name="profile_scroll_panel">
 					<text name="status_message" value="Min private noter:"/>
@@ -11,13 +11,13 @@
 					<check_box label="Editére, slette og tage mine objekter" name="objects_check"/>
 				</panel>
 			</scroll_container>
-		</panel>
-		<panel name="notes_buttons_panel">
+		</layout_panel>
+		<layout_panel name="notes_buttons_panel">
 			<button label="Tilføj ven" name="add_friend" tool_tip="Tilbyd venskab til beboer"/>
 			<button label="IM" name="im" tool_tip="Åben session med personlig besked (IM)"/>
 			<button label="Kald" name="call" tool_tip="Opkald til denne beboer"/>
 			<button label="Kort" name="show_on_map_btn" tool_tip="Vis beboer på kort"/>
 			<button label="Teleport" name="teleport" tool_tip="Tilbyd teleport"/>
-		</panel>
+		</layout_panel>
 	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/da/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/da/panel_prim_media_controls.xml
index d3b3c7e21e..cfb32500c6 100644
--- a/indra/newview/skins/default/xui/da/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/da/panel_prim_media_controls.xml
@@ -13,9 +13,9 @@
 		50
 	</string>
 	<layout_stack name="progress_indicator_area">
-		<panel name="media_progress_indicator">
+		<layout_panel name="media_progress_indicator">
 			<progress_bar name="media_progress_bar" tool_tip="Medie hentes"/>
-		</panel>
+		</layout_panel>
 	</layout_stack>
 	<layout_stack name="media_controls">
 		<layout_panel name="back">
diff --git a/indra/newview/skins/default/xui/de/floater_voice_controls.xml b/indra/newview/skins/default/xui/de/floater_voice_controls.xml
index 07b7689cd0..22f2fd93ab 100644
--- a/indra/newview/skins/default/xui/de/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/de/floater_voice_controls.xml
@@ -19,10 +19,12 @@
 		<layout_panel name="my_panel">
 			<text name="user_text" value="Mein Avatar:"/>
 		</layout_panel>
-		<layout_stack name="voice_effect_and_leave_call_stack">
-			<layout_panel name="leave_call_btn_panel">
-				<button label="Anruf beenden" name="leave_call_btn"/>
-			</layout_panel>
-		</layout_stack>
+        <layout_panel name="leave_call_panel">
+			<layout_stack name="voice_effect_and_leave_call_stack">
+				<layout_panel name="leave_call_btn_panel">
+					<button label="Anruf beenden" name="leave_call_btn"/>
+				</layout_panel>
+			</layout_stack>
+		</layout_panel>
 	</layout_stack>
 </floater>
diff --git a/indra/newview/skins/default/xui/de/panel_notifications_channel.xml b/indra/newview/skins/default/xui/de/panel_notifications_channel.xml
index e2166f7baf..35bd76ce70 100644
--- a/indra/newview/skins/default/xui/de/panel_notifications_channel.xml
+++ b/indra/newview/skins/default/xui/de/panel_notifications_channel.xml
@@ -1,15 +1,19 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="notifications_panel">
 	<layout_stack name="stack1">
-		<scroll_list name="notifications_list">
-			<column label="Name" name="name"/>
-			<column label="Inhalt" name="content"/>
-			<column label="Datum" name="date"/>
-		</scroll_list>
-		<scroll_list name="notification_rejects_list">
-			<column label="Name" name="name"/>
-			<column label="Inhalt" name="content"/>
-			<column label="Datum" name="date"/>
-		</scroll_list>
+	     <layout_panel name="notifications_list_panel" >
+			<scroll_list name="notifications_list">
+				<column label="Name" name="name"/>
+				<column label="Inhalt" name="content"/>
+				<column label="Datum" name="date"/>
+			</scroll_list>
+		</layout_panel>
+	     <layout_panel name="rejects_list_panel" >
+			<scroll_list name="notification_rejects_list">
+				<column label="Name" name="name"/>
+				<column label="Inhalt" name="content"/>
+				<column label="Datum" name="date"/>
+			</scroll_list>
+		</layout_panel>
 	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/de/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/de/panel_prim_media_controls.xml
index 0a19483f8b..c85f2762b1 100644
--- a/indra/newview/skins/default/xui/de/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/de/panel_prim_media_controls.xml
@@ -7,9 +7,9 @@
 		0.2
 	</string>
 	<layout_stack name="progress_indicator_area">
-		<panel name="media_progress_indicator">
+		<layout_panel name="media_progress_indicator">
 			<progress_bar name="media_progress_bar" tool_tip="Medien werden geladen"/>
-		</panel>
+		</layout_panel>
 	</layout_stack>
 	<layout_stack name="media_controls">
 		<layout_panel name="back">
diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
index bf5bd87ad6..a46604c834 100644
--- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml
@@ -86,6 +86,7 @@
              visible="true"
              width="20" />
         </layout_panel>
+        <layout_panel name="leave_call_panel">
         <layout_stack
          clip="true"
          auto_resize="false"
@@ -96,7 +97,7 @@
          name="voice_effect_and_leave_call_stack"
          orientation="horizontal"
          width="262">
-          <panel
+          <layout_panel
            class="panel_voice_effect"
            name="panel_voice_effect"
            visiblity_control="VoiceMorphingEnabled"
@@ -118,6 +119,7 @@
              width="100" />
           </layout_panel>
         </layout_stack>
+          </layout_panel>
       <layout_panel
           follows="all"
           layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml
index 01ee8264e6..c3bbe70609 100644
--- a/indra/newview/skins/default/xui/en/main_view.xml
+++ b/indra/newview/skins/default/xui/en/main_view.xml
@@ -20,6 +20,7 @@
                   mouse_opaque="false"
                   name="nav_bar_container"
                   tab_stop="false"
+                  min_height="10" 
                   width="1024"
                   user_resize="false" 
                   visible="false">
@@ -65,25 +66,24 @@
                         mouse_opaque="false"
                         name="world_stack"
                         orientation="vertical">
-            <panel auto_resize="true"
-                   follows="all"
-                   height="500"
-                   layout="topleft"
-                   tab_stop="false"
-                   mouse_opaque="false"
-                name="hud container"
-                   width="500">
-            <panel auto_resize="false"
-                   follows="left|top"
-                   height="19"
-                   left="0"
-                   mouse_opaque="false"
-                   name="topinfo_bar_container"
-                   tab_stop="false"
-                   top="0"
-                   user_resize="false"
-                   visible="false"
-                   width="1024"/>
+            <layout_panel auto_resize="true"
+                          follows="all"
+                          height="500"
+                          layout="topleft"
+                          tab_stop="false"
+                          mouse_opaque="false"
+                          user_resize="false" 
+                          name="hud container"
+                          width="500">
+              <panel follows="left|top"
+                     height="19"
+                     left="0"
+                     mouse_opaque="false"
+                     name="topinfo_bar_container"
+                     tab_stop="false"
+                     top="0"
+                     visible="false"
+                     width="1024"/>
               <panel follows="right|top|bottom"
                      height="500"
                      mouse_opaque="false"
@@ -101,7 +101,7 @@
                      name="stand_stop_flying_container"
                      visible="false"
                      width="500"/>
-            </panel>
+            </layout_panel>
             <layout_panel auto_resize="false"
                    follows="all"
                    min_height="33"
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
index 4b622691b3..73225ef7d0 100644
--- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml
+++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
@@ -29,31 +29,32 @@
      orientation="horizontal"
      top="0"
      width="1310">
-        <icon
+        <layout_panel
          auto_resize="false"
-         follows="left|right"
-         height="10"
-         image_name="spacer24.tga"
-         layout="topleft"
-         left="0"
+         user_resize="false" 
          min_width="2"
-         top="0"
          width="2" />
         <layout_panel
          auto_resize="false"
-         filename="panel_nearby_chat_bar.xml"
-         follows="left|right"
-         height="28"
          layout="topleft"
-         left="0"
          max_width="320"
          min_height="23"
          min_width="214"
          mouse_opaque="false"
-         name="chat_bar"
-         top="4"
+		 name="chat_bar_layout_panel"
          user_resize="true"
-         width="308" />
+         width="308" >
+          <panel
+            name="chat_bar"
+            filename="panel_nearby_chat_bar.xml"
+            left="0"
+            height="28"
+            width="308"
+            top="4"
+            mouse_opaque="false"
+            follows="left|right"
+          />
+        </layout_panel>
         <!--
         There is resize bar between chatbar and Speak button. It has 2px width (is is set as 2*UIResizeBarOverlap)
         -->
@@ -400,18 +401,10 @@ as for parent layout_panel (chiclet_list_panel) to resize bottom tray properly.
                  width="7" />
             </chiclet_panel>
         </layout_panel>
-        <icon
-         auto_resize="false"
-         color="0 0 0 0"
-         follows="left|right"
-         height="10"
-         image_name="spacer24.tga"
-         layout="topleft"
-         left="0"
-         min_width="4"
-         name="DUMMY"
-         top="0"
-         width="4" />
+        <layout_panel auto_resize="false"
+                      user_resize="false" 
+                      width="4"
+                      min_width="4"/>
         <layout_panel
          auto_resize="false"
          follows="right"
@@ -503,17 +496,11 @@ image_pressed_selected  "Lit" + "Selected" - there are new messages and the Well
                 </button>
             </chiclet_notification>
         </layout_panel>
-      <icon
+      <layout_panel
          auto_resize="false"
-         color="0 0 0 0"
-         follows="left|right"
-         height="10"
-         image_name="spacer24.tga"
-         layout="topleft"
-         left="0"
+         user_resize="false" 
          min_width="4"
          name="DUMMY2"
-         top="0"
          width="8" />
     </layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml b/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
index 6e9476f814..0734ca9a4b 100644
--- a/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
+++ b/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
@@ -28,30 +28,29 @@
      orientation="horizontal"
      top="0"
      width="1000">
-        <icon
+        <layout_panel
          auto_resize="false"
-         follows="left|right"
-         height="10"
-         image_name="spacer24.tga"
-         layout="topleft"
+         user_resize="false" 
          min_width="2"
-         left="0"
-         top="0"
          width="2" />
         <layout_panel
          mouse_opaque="false"
          auto_resize="true"
-         follows="left|right"
          height="28"
          layout="topleft"
-         left="0"
          min_height="23"
          width="310"
-         top="4"
          min_width="188"
-         name="chat_bar"
-         user_resize="false"
-         filename="panel_nearby_chat_bar.xml" />
+         user_resize="false">
+          <panel
+            left="0"
+            filename="panel_nearby_chat_bar.xml"
+            follows="left|right"
+            top="4"
+            width="310"
+            name="chat_bar"
+            mouse_opaque="false"/>
+        </layout_panel>
         <layout_panel
          mouse_opaque="false"
          auto_resize="false"
@@ -79,17 +78,11 @@
                  use_ellipses="true" />
             </gesture_combo_list>
         </layout_panel>
-        <icon
+        <layout_panel
          auto_resize="false"
-         color="0 0 0 0"
-         follows="left|right"
-         height="10"
-         image_name="spacer24.tga"
-         layout="topleft"
-         left="0"
+         user_resize="false" 
          min_width="3"
          name="after_gesture_panel"
-         top="0"
          width="3"/>
     </layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_notifications_channel.xml b/indra/newview/skins/default/xui/en/panel_notifications_channel.xml
index 3143b0a40c..c3dc588ba2 100644
--- a/indra/newview/skins/default/xui/en/panel_notifications_channel.xml
+++ b/indra/newview/skins/default/xui/en/panel_notifications_channel.xml
@@ -14,6 +14,9 @@
      orientation="horizontal"
      top="20"
      width="100">
+      <layout_panel name="notifications_list_panel" 
+                    width="100"
+                    user_resize="true">
         <scroll_list
          draw_heading="true"
          follows="left|right|top|bottom"
@@ -24,7 +27,6 @@
          sort_ascending="false"
          sort_column="2"
          top="0"
-         user_resize="true"
          width="100">
             <scroll_list.columns
              label="Name"
@@ -39,6 +41,10 @@
              name="date"
              width="150" />
         </scroll_list>
+      </layout_panel>
+      <layout_panel name="rejects_list_panel"
+                    width="100"
+                    user_resize="true">
         <scroll_list
          draw_heading="true"
          follows="left|right|top|bottom"
@@ -49,7 +55,6 @@
          sort_ascending="false"
          sort_column="2"
          top="0"
-         user_resize="true"
          width="100">
             <scroll_list.columns
              label="Name"
@@ -64,6 +69,7 @@
              name="date"
              width="150" />
         </scroll_list>
+      </layout_panel>
     </layout_stack>
     <button
      follows="left|right|top"
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
index 113d5fb6dc..7ae717d0e3 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
@@ -291,7 +291,7 @@
       control_name="RenderReflectionDetail"
       height="23"
       layout="topleft"
-      left_="10"
+      left_delta="10"
       top_pad ="0"
       name="Reflections"
       width="150">
diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
index 6bf00373ea..edf4b52773 100644
--- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
@@ -33,7 +33,7 @@
 		mouse_opaque="false"
 		layout="topleft"
 		user_resize="false" />
-	<panel
+	<layout_panel
 		name="media_progress_indicator"
 		mouse_opaque="false"
 		follows="left|right|top"
@@ -55,7 +55,7 @@
 		  top="0"
 		  left="0"
 		  tool_tip="Media is Loading"/>
-	</panel>
+	</layout_panel>
 	<layout_panel
 		name="right_bookend_bottom"
 		width="0"
diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml b/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml
index 48bc021e6d..830ea12e41 100644
--- a/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml
+++ b/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml
@@ -8,18 +8,18 @@
             thickness="15">
   <up_button image_unselected="ScrollArrow_Up"
              image_selected="ScrollArrow_Up"
-             scale_image="true" thickness="15"
+             scale_image="true"
              hover_glow_amount="0.35"/>
   <down_button image_unselected="ScrollArrow_Down"
                image_selected="ScrollArrow_Down"
-               scale_image="true" thickness="15"
+               scale_image="true"
                hover_glow_amount="0.35"/>
   <left_button image_unselected="ScrollArrow_Left"
                image_selected="ScrollArrow_Left"
-               scale_image="true" thickness="15"
+               scale_image="true"
                hover_glow_amount="0.35"/>
   <right_button image_unselected="ScrollArrow_Right"
                image_selected="ScrollArrow_Right"
-               scale_image="true" thickness="15"
+               scale_image="true"
                hover_glow_amount="0.35"/>
 </scroll_bar>
diff --git a/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml b/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml
index 3878c7a144..a120b1aec8 100644
--- a/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml
+++ b/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml
@@ -23,7 +23,4 @@
   bg_writeable_color="TextBgWriteableColor"
   bg_selected_color="EmphasisColor"
   bg_focus_color="TextBgFocusColor">
-  <simple_text_editor.border
-    bevel_style="in"
-    follows="all" />
 </simple_text_editor>
diff --git a/indra/newview/skins/default/xui/es/floater_voice_controls.xml b/indra/newview/skins/default/xui/es/floater_voice_controls.xml
index 51adeb4dff..6f4782417d 100644
--- a/indra/newview/skins/default/xui/es/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/es/floater_voice_controls.xml
@@ -19,10 +19,12 @@
 		<layout_panel name="my_panel">
 			<text name="user_text" value="Mi avatar:"/>
 		</layout_panel>
-		<layout_stack name="voice_effect_and_leave_call_stack">
-			<layout_panel name="leave_call_btn_panel">
-				<button label="Colgar" name="leave_call_btn"/>
-			</layout_panel>
-		</layout_stack>
+        <layout_panel name="leave_call_panel">
+			<layout_stack name="voice_effect_and_leave_call_stack">
+				<layout_panel name="leave_call_btn_panel">
+					<button label="Colgar" name="leave_call_btn"/>
+				</layout_panel>
+			</layout_stack>
+		</layout_panel>
 	</layout_stack>
 </floater>
diff --git a/indra/newview/skins/default/xui/es/panel_notes.xml b/indra/newview/skins/default/xui/es/panel_notes.xml
index 8de2afa767..da98e1b15e 100644
--- a/indra/newview/skins/default/xui/es/panel_notes.xml
+++ b/indra/newview/skins/default/xui/es/panel_notes.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel label="Notas y Privacidad" name="panel_notes">
 	<layout_stack name="layout">
-		<panel name="notes_stack">
+		<layout_panel name="notes_stack">
 			<scroll_container name="profile_scroll">
 				<panel name="profile_scroll_panel">
 					<text name="status_message" value="Mis notas privadas:"/>
@@ -11,13 +11,13 @@
 					<check_box label="Edite, borre o coja mis objetos" name="objects_check"/>
 				</panel>
 			</scroll_container>
-		</panel>
-		<panel name="notes_buttons_panel">
+		</layout_panel>
+		<layout_panel name="notes_buttons_panel">
 			<button label="Añadir como amigo" name="add_friend" tool_tip="Ofrecer amistad a este Residente"/>
 			<button label="MI" name="im" tool_tip="Abrir un mensaje instantáneo"/>
 			<button label="Llamar" name="call" tool_tip="Llamar a este Residente"/>
 			<button label="Mapa" name="show_on_map_btn" tool_tip="Mostrar al Residente en el mapa"/>
 			<button label="Teleportar" name="teleport" tool_tip="Ofrecer teleporte"/>
-		</panel>
+		</layout_panel>
 	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/es/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/es/panel_prim_media_controls.xml
index 174922e28e..90b9e475e7 100644
--- a/indra/newview/skins/default/xui/es/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/es/panel_prim_media_controls.xml
@@ -13,9 +13,9 @@
 		50
 	</string>
 	<layout_stack name="progress_indicator_area">
-		<panel name="media_progress_indicator">
+		<layout_panel name="media_progress_indicator">
 			<progress_bar name="media_progress_bar" tool_tip="Los media se están cargando"/>
-		</panel>
+		</layout_panel>
 	</layout_stack>
 	<layout_stack name="media_controls">
 		<layout_panel name="back">
diff --git a/indra/newview/skins/default/xui/fr/floater_voice_controls.xml b/indra/newview/skins/default/xui/fr/floater_voice_controls.xml
index 5c26527ed6..8397dc4263 100644
--- a/indra/newview/skins/default/xui/fr/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/fr/floater_voice_controls.xml
@@ -19,10 +19,12 @@
 		<layout_panel name="my_panel">
 			<text name="user_text" value="Mon avatar :"/>
 		</layout_panel>
-		<layout_stack name="voice_effect_and_leave_call_stack">
-			<layout_panel name="leave_call_btn_panel">
-				<button label="Quitter l&apos;appel" name="leave_call_btn"/>
-			</layout_panel>
-		</layout_stack>
+        <layout_panel name="leave_call_panel">
+			<layout_stack name="voice_effect_and_leave_call_stack">
+				<layout_panel name="leave_call_btn_panel">
+					<button label="Quitter l&apos;appel" name="leave_call_btn"/>
+				</layout_panel>
+			</layout_stack>
+		</layout_panel>
 	</layout_stack>
 </floater>
diff --git a/indra/newview/skins/default/xui/fr/panel_notifications_channel.xml b/indra/newview/skins/default/xui/fr/panel_notifications_channel.xml
index 5beb71981c..110e017050 100644
--- a/indra/newview/skins/default/xui/fr/panel_notifications_channel.xml
+++ b/indra/newview/skins/default/xui/fr/panel_notifications_channel.xml
@@ -1,15 +1,19 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="notifications_panel">
 	<layout_stack name="stack1">
-		<scroll_list name="notifications_list">
-			<column label="Nom" name="name"/>
-			<column label="Contenu" name="content"/>
-			<column label="Date" name="date"/>
-		</scroll_list>
-		<scroll_list name="notification_rejects_list">
-			<column label="Nom" name="name"/>
-			<column label="Contenu" name="content"/>
-			<column label="Date" name="date"/>
-		</scroll_list>
+	     <layout_panel name="notifications_list_panel" >
+			<scroll_list name="notifications_list">
+				<column label="Nom" name="name"/>
+				<column label="Contenu" name="content"/>
+				<column label="Date" name="date"/>
+			</scroll_list>
+		</layout_panel>
+	     <layout_panel name="rejects_list_panel" >
+			<scroll_list name="notification_rejects_list">
+				<column label="Nom" name="name"/>
+				<column label="Contenu" name="content"/>
+				<column label="Date" name="date"/>
+			</scroll_list>
+		</layout_panel>
 	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/fr/panel_prim_media_controls.xml
index f6b9bdcb81..f16fcebd02 100644
--- a/indra/newview/skins/default/xui/fr/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/fr/panel_prim_media_controls.xml
@@ -7,9 +7,9 @@
 		0.2
 	</string>
 	<layout_stack name="progress_indicator_area">
-		<panel name="media_progress_indicator">
+		<layout_panel name="media_progress_indicator">
 			<progress_bar name="media_progress_bar" tool_tip="Le média est en cours de chargement"/>
-		</panel>
+		</layout_panel>
 	</layout_stack>
 	<layout_stack name="media_controls">
 		<layout_panel name="back">
diff --git a/indra/newview/skins/default/xui/it/floater_voice_controls.xml b/indra/newview/skins/default/xui/it/floater_voice_controls.xml
index d2fd462062..4741d8d32f 100644
--- a/indra/newview/skins/default/xui/it/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/it/floater_voice_controls.xml
@@ -19,10 +19,12 @@
 		<layout_panel name="my_panel">
 			<text name="user_text" value="Il mio avatar:"/>
 		</layout_panel>
-		<layout_stack name="voice_effect_and_leave_call_stack">
-			<layout_panel name="leave_call_btn_panel">
-				<button label="Abbandona chiamata" name="leave_call_btn"/>
-			</layout_panel>
-		</layout_stack>
+        <layout_panel name="leave_call_panel">
+				<layout_stack name="voice_effect_and_leave_call_stack">
+				<layout_panel name="leave_call_btn_panel">
+					<button label="Abbandona chiamata" name="leave_call_btn"/>
+				</layout_panel>
+			</layout_stack>
+        </layout_panel>
 	</layout_stack>
 </floater>
diff --git a/indra/newview/skins/default/xui/it/panel_notes.xml b/indra/newview/skins/default/xui/it/panel_notes.xml
index 9ce6b47a32..945bff1603 100644
--- a/indra/newview/skins/default/xui/it/panel_notes.xml
+++ b/indra/newview/skins/default/xui/it/panel_notes.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel label="Note e Privacy" name="panel_notes">
 	<layout_stack name="layout">
-		<panel name="notes_stack">
+		<layout_panel name="notes_stack">
 			<scroll_container name="profile_scroll">
 				<panel name="profile_scroll_panel">
 					<text name="status_message" value="Le mie note private:"/>
@@ -11,13 +11,13 @@
 					<check_box label="Modificare, eliminare o prendere i miei oggetti" name="objects_check"/>
 				</panel>
 			</scroll_container>
-		</panel>
-		<panel name="notes_buttons_panel">
+		</layout_panel>
+		<layout_panel name="notes_buttons_panel">
 			<button label="Aggiungi amico" name="add_friend" tool_tip="Offri amicizia a questo residente"/>
 			<button label="IM" name="im" tool_tip="Apri una sessione messaggio istantaneo"/>
 			<button label="Chiama" name="call" tool_tip="Chiama questo residente"/>
 			<button label="Mappa" name="show_on_map_btn" tool_tip="Mostra il residente sulla mappa"/>
 			<button label="Teleport" name="teleport" tool_tip="Offri teleport"/>
-		</panel>
+		</layout_panel>
 	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/it/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/it/panel_prim_media_controls.xml
index ef7aaf2e8c..4620d72977 100644
--- a/indra/newview/skins/default/xui/it/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/it/panel_prim_media_controls.xml
@@ -13,9 +13,9 @@
 		50
 	</string>
 	<layout_stack name="progress_indicator_area">
-		<panel name="media_progress_indicator">
+		<layout_panel name="media_progress_indicator">
 			<progress_bar name="media_progress_bar" tool_tip="L&apos;elemento multimediale è in caricamento"/>
-		</panel>
+		</layout_panel>
 	</layout_stack>
 	<layout_stack name="media_controls">
 		<layout_panel name="back">
diff --git a/indra/newview/skins/default/xui/ja/floater_voice_controls.xml b/indra/newview/skins/default/xui/ja/floater_voice_controls.xml
index 4b95aa544f..0caca22bc1 100644
--- a/indra/newview/skins/default/xui/ja/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/ja/floater_voice_controls.xml
@@ -19,10 +19,12 @@
 		<layout_panel name="my_panel">
 			<text name="user_text" value="マイ アバター:"/>
 		</layout_panel>
-		<layout_stack name="voice_effect_and_leave_call_stack">
-			<layout_panel name="leave_call_btn_panel">
-				<button label="コール終了" name="leave_call_btn"/>
-			</layout_panel>
-		</layout_stack>
+        <layout_panel name="leave_call_panel">
+			<layout_stack name="voice_effect_and_leave_call_stack">
+				<layout_panel name="leave_call_btn_panel">
+					<button label="コール終了" name="leave_call_btn"/>
+				</layout_panel>
+			</layout_stack>
+		</layout_panel>
 	</layout_stack>
 </floater>
diff --git a/indra/newview/skins/default/xui/ja/panel_notifications_channel.xml b/indra/newview/skins/default/xui/ja/panel_notifications_channel.xml
index 5723535fd2..aff427ed49 100644
--- a/indra/newview/skins/default/xui/ja/panel_notifications_channel.xml
+++ b/indra/newview/skins/default/xui/ja/panel_notifications_channel.xml
@@ -1,15 +1,19 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel name="notifications_panel">
 	<layout_stack name="stack1">
-		<scroll_list name="notifications_list">
-			<column label="名前" name="name"/>
-			<column label="コンテンツ" name="content"/>
-			<column label="日付" name="date"/>
-		</scroll_list>
-		<scroll_list name="notification_rejects_list">
-			<column label="名前" name="name"/>
-			<column label="コンテンツ" name="content"/>
-			<column label="日付" name="date"/>
-		</scroll_list>
+		<layout_panel name="notifications_list_panel">
+			<scroll_list name="notifications_list">
+				<column label="名前" name="name"/>
+				<column label="コンテンツ" name="content"/>
+				<column label="日付" name="date"/>
+			</scroll_list>
+		</layout_panel>
+		<layout_panel name="rejects_list_panel">
+			<scroll_list name="notification_rejects_list">
+				<column label="名前" name="name"/>
+				<column label="コンテンツ" name="content"/>
+				<column label="日付" name="date"/>
+			</scroll_list>
+		</layout_panel>
 	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/ja/panel_prim_media_controls.xml
index a9897c7ae4..5506373eb0 100644
--- a/indra/newview/skins/default/xui/ja/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/ja/panel_prim_media_controls.xml
@@ -7,9 +7,9 @@
 		0.2
 	</string>
 	<layout_stack name="progress_indicator_area">
-		<panel name="media_progress_indicator">
+		<layout_panel name="media_progress_indicator">
 			<progress_bar name="media_progress_bar" tool_tip="ローディング"/>
-		</panel>
+		</layout_panel>
 	</layout_stack>
 	<layout_stack name="media_controls">
 		<layout_panel name="back">
diff --git a/indra/newview/skins/default/xui/pl/floater_voice_controls.xml b/indra/newview/skins/default/xui/pl/floater_voice_controls.xml
index c222e4edbb..80200cfb21 100644
--- a/indra/newview/skins/default/xui/pl/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/pl/floater_voice_controls.xml
@@ -19,10 +19,12 @@
 		<layout_panel name="my_panel">
 			<text name="user_text" value="Mój awatar:"/>
 		</layout_panel>
-		<layout_stack name="voice_effect_and_leave_call_stack">
-			<layout_panel name="leave_call_btn_panel">
-				<button label="Zakończ rozmowę" name="leave_call_btn"/>
-			</layout_panel>
-		</layout_stack>
+        <layout_panel name="leave_call_panel">
+			<layout_stack name="voice_effect_and_leave_call_stack">
+				<layout_panel name="leave_call_btn_panel">
+					<button label="Zakończ rozmowę" name="leave_call_btn"/>
+				</layout_panel>
+			</layout_stack>
+		</layout_panel>
 	</layout_stack>
 </floater>
diff --git a/indra/newview/skins/default/xui/pl/panel_notes.xml b/indra/newview/skins/default/xui/pl/panel_notes.xml
index 35cb7e1bce..ec6008065f 100644
--- a/indra/newview/skins/default/xui/pl/panel_notes.xml
+++ b/indra/newview/skins/default/xui/pl/panel_notes.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel label="Notatki &amp; Prywatność" name="panel_notes">
 	<layout_stack name="layout">
-		<panel name="notes_stack">
+		<layout_panel name="notes_stack">
 			<scroll_container name="profile_scroll">
 				<panel name="profile_scroll_panel">
 					<text name="status_message" value="Notatki:"/>
@@ -11,13 +11,13 @@
 					<check_box label="Edytowanie, kasowanie lub zabieranie moich obiektów" name="objects_check"/>
 				</panel>
 			</scroll_container>
-		</panel>
-		<panel name="notes_buttons_panel">
+		</layout_panel>
+		<layout_panel name="notes_buttons_panel">
 			<button label="Dodaj do znajomych" name="add_friend" tool_tip="Zaoferuj znajomość Rezydentowi"/>
 			<button label="IM" name="im" tool_tip="Otwórz wiadomości IM"/>
 			<button label="Dzwoń" name="call" tool_tip="Zadzwoń do Rezydenta"/>
 			<button label="Mapa" name="show_on_map_btn" tool_tip="Pokaż Rezydenta na mapie"/>
 			<button label="Teleportuj" name="teleport" tool_tip="Teleportuj"/>
-		</panel>
+		</layout_panel>
 	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/pl/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/pl/panel_prim_media_controls.xml
index f10ce5ea4d..7f66ac5d93 100644
--- a/indra/newview/skins/default/xui/pl/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/pl/panel_prim_media_controls.xml
@@ -13,9 +13,9 @@
 		50
 	</string>
 	<layout_stack name="progress_indicator_area">
-		<panel name="media_progress_indicator">
+		<layout_panel name="media_progress_indicator">
 			<progress_bar name="media_progress_bar" tool_tip="Wczytywanie mediów"/>
-		</panel>
+		</layout_panel>
 	</layout_stack>
 	<layout_stack name="media_controls">
 		<layout_panel name="back">
diff --git a/indra/newview/skins/default/xui/pt/floater_voice_controls.xml b/indra/newview/skins/default/xui/pt/floater_voice_controls.xml
index 44f08b76b5..2337ee3074 100644
--- a/indra/newview/skins/default/xui/pt/floater_voice_controls.xml
+++ b/indra/newview/skins/default/xui/pt/floater_voice_controls.xml
@@ -19,10 +19,12 @@
 		<layout_panel name="my_panel">
 			<text name="user_text" value="Meu avatar:"/>
 		</layout_panel>
-		<layout_stack name="voice_effect_and_leave_call_stack">
-			<layout_panel name="leave_call_btn_panel">
-				<button label="Desligar" name="leave_call_btn"/>
-			</layout_panel>
-		</layout_stack>
+        <layout_panel name="leave_call_panel">
+			<layout_stack name="voice_effect_and_leave_call_stack">
+				<layout_panel name="leave_call_btn_panel">
+					<button label="Desligar" name="leave_call_btn"/>
+				</layout_panel>
+			</layout_stack>
+		</layout_panel>
 	</layout_stack>
 </floater>
diff --git a/indra/newview/skins/default/xui/pt/panel_notes.xml b/indra/newview/skins/default/xui/pt/panel_notes.xml
index 9aa842d9a5..6fb614a8c4 100644
--- a/indra/newview/skins/default/xui/pt/panel_notes.xml
+++ b/indra/newview/skins/default/xui/pt/panel_notes.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel label="Anotações e Privacidade" name="panel_notes">
 	<layout_stack name="layout">
-		<panel name="notes_stack">
+		<layout_panel name="notes_stack">
 			<scroll_container name="profile_scroll">
 				<panel name="profile_scroll_panel">
 					<text name="status_message" value="Minhas anotações privadas:"/>
@@ -11,13 +11,13 @@
 					<check_box label="Pegar, editar ou excluir objetos meus" name="objects_check"/>
 				</panel>
 			</scroll_container>
-		</panel>
-		<panel name="notes_buttons_panel">
+		</layout_panel>
+		<layout_panel name="notes_buttons_panel">
 			<button label="Adicionar amigo" name="add_friend" tool_tip="Oferecer amizade ao residente"/>
 			<button label="MI" name="im" tool_tip="Abrir sessão de mensagem instantânea"/>
 			<button label="Ligar" name="call" tool_tip="Ligar para este residente"/>
 			<button label="Mapa" name="show_on_map_btn" tool_tip="Exibir o residente no mapa"/>
 			<button label="Teletransportar" name="teleport" tool_tip="Oferecer teletransporte"/>
-		</panel>
+		</layout_panel>
 	</layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/pt/panel_prim_media_controls.xml
index a1254b4da0..9e07b6772f 100644
--- a/indra/newview/skins/default/xui/pt/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/pt/panel_prim_media_controls.xml
@@ -13,9 +13,9 @@
 		50
 	</string>
 	<layout_stack name="progress_indicator_area">
-		<panel name="media_progress_indicator">
+		<layout_panel name="media_progress_indicator">
 			<progress_bar name="media_progress_bar" tool_tip="Carregando mídia"/>
-		</panel>
+		</layout_panel>
 	</layout_stack>
 	<layout_stack name="media_controls">
 		<layout_panel name="back">
-- 
cgit v1.2.3


From 8641cba93b05936b1af0da749df5ed3b1b86f8e3 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 25 Aug 2010 14:39:03 -0700
Subject: fix for line editor history not moving cursor to end

---
 indra/llui/lllineeditor.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index c93ca1af88..e6a07b02cc 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -1277,7 +1277,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
 			if( mCurrentHistoryLine > mLineHistory.begin() )
 			{
 				mText.assign( *(--mCurrentHistoryLine) );
-				setCursor(llmin((S32)mText.length(), getCursor()));
+				setCursorToEnd();
 			}
 			else
 			{
@@ -1294,7 +1294,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
 			if( !mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.end() - 1 )
 			{
 				mText.assign( *(++mCurrentHistoryLine) );
-				setCursor(llmin((S32)mText.length(), getCursor()));
+				setCursorToEnd();
 			}
 			else
 			{
-- 
cgit v1.2.3


From c1405887c982f5a7396892017e4ea426ede9af23 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Wed, 25 Aug 2010 15:23:27 -0700
Subject: Force the value for the home page URL in the viewer sidebar to be
 persistant It's not loaded each time the side bar is opened - only at login -
 when it did not persist, the change to the URL that was lost after a restart.

---
 indra/newview/app_settings/settings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 12fb8741ca..3d7ab71c90 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3782,7 +3782,7 @@
       <key>Comment</key>
       <string>URL for the web page to display in the Home side panel</string>
       <key>Persist</key>
-      <integer>0</integer>
+      <integer>1</integer>
       <key>Type</key>
       <string>String</string>
       <key>Value</key>
-- 
cgit v1.2.3


From 92db224e8624c22eb9e8516662685c68cb819e69 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 25 Aug 2010 16:46:37 -0700
Subject: fixed regressions from changing layout panel to be a derived widget
 class

---
 indra/llui/llaccordionctrltab.h                    | 10 ++--
 indra/llui/lllayoutstack.cpp                       |  9 +++-
 indra/llui/lllayoutstack.h                         |  2 +
 indra/newview/llbottomtray.cpp                     | 57 ++++++++++++----------
 indra/newview/llbottomtray.h                       |  8 ++-
 indra/newview/llimfloater.cpp                      | 14 +++---
 .../skins/default/xui/da/floater_im_session.xml    |  1 -
 .../skins/default/xui/de/floater_im_session.xml    |  1 -
 .../skins/default/xui/en/favorites_bar_button.xml  |  2 +-
 .../skins/default/xui/en/floater_im_session.xml    | 17 +++++--
 indra/newview/skins/default/xui/en/main_view.xml   |  4 +-
 .../skins/default/xui/en/panel_bottomtray.xml      |  4 +-
 .../skins/default/xui/en/panel_bottomtray_lite.xml |  1 -
 .../default/xui/en/panel_im_control_panel.xml      | 40 +++++++--------
 .../default/xui/en/panel_prim_media_controls.xml   |  1 -
 .../skins/default/xui/es/floater_im_session.xml    |  1 -
 .../skins/default/xui/fr/floater_im_session.xml    |  1 -
 .../skins/default/xui/it/floater_im_session.xml    |  1 -
 .../skins/default/xui/ja/floater_im_session.xml    |  1 -
 .../skins/default/xui/pl/floater_im_session.xml    |  1 -
 .../skins/default/xui/pt/floater_im_session.xml    |  1 -
 21 files changed, 93 insertions(+), 84 deletions(-)

diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h
index 00fb276f19..f87534fa76 100644
--- a/indra/llui/llaccordionctrltab.h
+++ b/indra/llui/llaccordionctrltab.h
@@ -91,10 +91,10 @@ public:
 
 		Optional<bool>			selection_enabled;
 
-		Optional<S32>			padding_left;
-		Optional<S32>			padding_right;
-		Optional<S32>			padding_top;
-		Optional<S32>			padding_bottom;
+		Optional<S32>			padding_left,
+								padding_right,
+								padding_top,
+								padding_bottom;
 
 		Params();
 	};
@@ -176,7 +176,7 @@ public:
 	virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks );
 
 
-	virtual bool addChild(LLView* child, S32 tab_group);
+	virtual bool addChild(LLView* child, S32 tab_group = 0 );
 
 	bool isExpanded() const { return mDisplayChildren; }
 
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 92c8416cbc..15a0369eb9 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -65,6 +65,13 @@ LLLayoutPanel::LLLayoutPanel(const Params& p)
 	}
 }
 
+void LLLayoutPanel::initFromParams(const Params& p)
+{
+	LLPanel::initFromParams(p);
+	setFollowsNone();
+}
+
+
 LLLayoutPanel::~LLLayoutPanel()
 {
 	// probably not necessary, but...
@@ -663,7 +670,7 @@ void LLLayoutStack::createResizeBars()
 
 			LLResizeBar::Params resize_params;
 			resize_params.name("resize");
-			resize_params.resizing_view(this);
+			resize_params.resizing_view(lp);
 			resize_params.min_size(lp->mMinDim);
 			resize_params.side(side);
 			resize_params.snapping_enabled(false);
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index cc5bd6cf65..9bcfa2c957 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -166,6 +166,8 @@ public:
 	};
 
 	~LLLayoutPanel();
+
+	void initFromParams(const Params& p);
 protected:
 	LLLayoutPanel(const Params& p)	;
 
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 4377640416..07c711644d 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -108,8 +108,9 @@ class LLBottomTrayLite
 {
 public:
 	LLBottomTrayLite()
-		: mNearbyChatBar(NULL),
-		  mGesturePanel(NULL)
+	:	mNearbyChatBar(NULL),
+		mChatBarContainer(NULL),
+		mGesturePanel(NULL)
 	{
 		mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL);
 		buildFromFile("panel_bottomtray_lite.xml");
@@ -120,6 +121,7 @@ public:
 	BOOL postBuild()
 	{
 		mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar");
+		mChatBarContainer = getChild<LLLayoutPanel>("chat_bar_layout_panel");
 		mGesturePanel = getChild<LLPanel>("gesture_panel");
 
 		// Hide "show_nearby_chat" button 
@@ -141,6 +143,7 @@ public:
 	}
 
 	LLNearbyChatBar*	mNearbyChatBar;
+	LLLayoutPanel*		mChatBarContainer;
 	LLPanel*			mGesturePanel;
 };
 
@@ -149,13 +152,14 @@ LLBottomTray::LLBottomTray(const LLSD&)
 	mSpeakPanel(NULL),
 	mSpeakBtn(NULL),
 	mNearbyChatBar(NULL),
-	mToolbarStack(NULL)
-,	mMovementButton(NULL)
-,	mResizeState(RS_NORESIZE)
-,	mBottomTrayContextMenu(NULL)
-,	mCamButton(NULL)
-,	mBottomTrayLite(NULL)
-,	mIsInLiteMode(false)
+	mChatBarContainer(NULL),
+	mToolbarStack(NULL),
+	mMovementButton(NULL),
+	mResizeState(RS_NORESIZE),
+	mBottomTrayContextMenu(NULL),
+	mCamButton(NULL),
+	mBottomTrayLite(NULL),
+	mIsInLiteMode(false)
 {
 	// Firstly add ourself to IMSession observers, so we catch session events
 	// before chiclets do that.
@@ -192,7 +196,7 @@ LLBottomTray::~LLBottomTray()
 	if (mNearbyChatBar)
 	{
 		// store custom width of chatbar panel.
-		S32 custom_width = mNearbyChatBar->getRect().getWidth();
+		S32 custom_width = mChatBarContainer->getRect().getWidth();
 		gSavedSettings.setS32("ChatBarCustomWidth", custom_width);
 	}
 
@@ -387,7 +391,7 @@ S32 LLBottomTray::notifyParent(const LLSD& info)
 		const std::string& name = info["view_name"];
 
 		// expected only resize of nearby chatbar
-		if (mNearbyChatBar->getName() != name) return LLPanel::notifyParent(info);
+		if (mChatBarContainer->getName() != name) return LLPanel::notifyParent(info);
 
 		const S32 new_width = info["new_width"];
 
@@ -417,8 +421,8 @@ void LLBottomTray::updateContextMenu(S32 x, S32 y, MASK mask)
 {
 	LLUICtrl* edit_box = mNearbyChatBar->getChild<LLUICtrl>("chat_box");
 
-	S32 local_x = x - mNearbyChatBar->getRect().mLeft - edit_box->getRect().mLeft;
-	S32 local_y = y - mNearbyChatBar->getRect().mBottom - edit_box->getRect().mBottom;
+	S32 local_x = x - mChatBarContainer->getRect().mLeft - edit_box->getRect().mLeft;
+	S32 local_y = y - mChatBarContainer->getRect().mBottom - edit_box->getRect().mBottom;
 
 	bool in_edit_box = edit_box->pointInView(local_x, local_y);
 
@@ -472,6 +476,7 @@ BOOL LLBottomTray::postBuild()
 	gMenuHolder->addChild(mBottomTrayContextMenu);
 
 	mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar");
+	mChatBarContainer = getChild<LLLayoutPanel>("chat_bar_layout_panel");
 
 	mToolbarStack = getChild<LLLayoutStack>("toolbar_stack");
 	mMovementButton = getChild<LLButton>("movement_btn");
@@ -677,14 +682,14 @@ void LLBottomTray::reshape(S32 width, S32 height, BOOL called_from_parent)
 	// we can not to do this from postBuild because reshape is called from parent view on startup
 	// creation after it and reset width according to resize logic.
 	static bool needs_restore_custom_state = true;
-	if (mNearbyChatBar && needs_restore_custom_state)
+	if (mChatBarContainer && needs_restore_custom_state)
 	{
 		// restore custom width of chatbar panel.
 		S32 new_width = gSavedSettings.getS32("ChatBarCustomWidth");
 		if (new_width > 0)
 		{
 			processChatbarCustomization(new_width);
-			mNearbyChatBar->reshape(new_width, mNearbyChatBar->getRect().getHeight());
+			mChatBarContainer->reshape(new_width, mChatBarContainer->getRect().getHeight());
 		}
 		needs_restore_custom_state = false;
 	}
@@ -723,7 +728,7 @@ S32 LLBottomTray::processWidthDecreased(S32 delta_width)
 			<< llendl;
 	}
 
-	const S32 chatbar_panel_width = mNearbyChatBar->getRect().getWidth();
+	const S32 chatbar_panel_width = mChatBarContainer->getRect().getWidth();
 	const S32 chatbar_panel_min_width = get_panel_min_width(mToolbarStack, mNearbyChatBar);
 	if (still_should_be_processed && chatbar_panel_width > chatbar_panel_min_width)
 	{
@@ -737,7 +742,7 @@ S32 LLBottomTray::processWidthDecreased(S32 delta_width)
 
 		still_should_be_processed = delta_width < 0;
 
-		mNearbyChatBar->reshape(mNearbyChatBar->getRect().getWidth() - delta_panel, mNearbyChatBar->getRect().getHeight());
+		mChatBarContainer->reshape(mChatBarContainer->getRect().getWidth() - delta_panel, mChatBarContainer->getRect().getHeight());
 
 		log(mNearbyChatBar, "after processing panel decreasing via nearby chatbar panel");
 
@@ -765,7 +770,7 @@ S32 LLBottomTray::processWidthDecreased(S32 delta_width)
 		if (buttons_freed_width > 0)
 		{
 			log(mNearbyChatBar, "before applying compensative width");
-			mNearbyChatBar->reshape(mNearbyChatBar->getRect().getWidth() + buttons_freed_width, mNearbyChatBar->getRect().getHeight() );
+			mChatBarContainer->reshape(mChatBarContainer->getRect().getWidth() + buttons_freed_width, mChatBarContainer->getRect().getHeight() );
 			log(mNearbyChatBar, "after applying compensative width");
 			lldebugs << buttons_freed_width << llendl;
 		}
@@ -781,9 +786,9 @@ void LLBottomTray::processWidthIncreased(S32 delta_width)
 	const S32 chiclet_panel_width = mChicletPanel->getParent()->getRect().getWidth();
 	static const S32 chiclet_panel_min_width = mChicletPanel->getMinWidth();
 
-	const S32 chatbar_panel_width = mNearbyChatBar->getRect().getWidth();
-	static const S32 chatbar_panel_min_width = get_panel_min_width(mToolbarStack, mNearbyChatBar);
-	static const S32 chatbar_panel_max_width = get_panel_max_width(mToolbarStack, mNearbyChatBar);
+	const S32 chatbar_panel_width = mChatBarContainer->getRect().getWidth();
+	static const S32 chatbar_panel_min_width = get_panel_min_width(mToolbarStack, mChatBarContainer);
+	static const S32 chatbar_panel_max_width = get_panel_max_width(mToolbarStack, mChatBarContainer);
 
 	const S32 chatbar_available_shrink_width = chatbar_panel_width - chatbar_panel_min_width;
 	const S32 available_width_chiclet = chiclet_panel_width - chiclet_panel_min_width;
@@ -821,7 +826,7 @@ void LLBottomTray::processWidthIncreased(S32 delta_width)
 		}
 
 		log(mNearbyChatBar, "increase width: before applying compensative width");
-		mNearbyChatBar->reshape(mNearbyChatBar->getRect().getWidth() - chatbar_shrink_width, mNearbyChatBar->getRect().getHeight() );
+		mChatBarContainer->reshape(mChatBarContainer->getRect().getWidth() - chatbar_shrink_width, mChatBarContainer->getRect().getHeight() );
 		if (mNearbyChatBar)			log(mNearbyChatBar, "after applying compensative width");
 		lldebugs << chatbar_shrink_width << llendl;
 
@@ -842,7 +847,7 @@ void LLBottomTray::processWidthIncreased(S32 delta_width)
 
 
 	// how many space can nearby chatbar take?
-	S32 chatbar_panel_width_ = mNearbyChatBar->getRect().getWidth();
+	S32 chatbar_panel_width_ = mChatBarContainer->getRect().getWidth();
 	if (delta_width > 0 && chatbar_panel_width_ < chatbar_panel_max_width)
 	{
 		S32 delta_panel_max = chatbar_panel_max_width - chatbar_panel_width_;
@@ -853,7 +858,7 @@ void LLBottomTray::processWidthIncreased(S32 delta_width)
 			<< llendl;
 
 		delta_width -= delta_panel_max;
-		mNearbyChatBar->reshape(chatbar_panel_width_ + delta_panel, mNearbyChatBar->getRect().getHeight());
+		mChatBarContainer->reshape(chatbar_panel_width_ + delta_panel, mChatBarContainer->getRect().getHeight());
 		log(mNearbyChatBar, "applied unprocessed delta width");
 	}
 }
@@ -1310,7 +1315,7 @@ bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible
 		{
 			// Calculate the possible shrunk width as difference between current and minimal widths
 			const S32 chatbar_shrunk_width =
-				mNearbyChatBar->getRect().getWidth() - get_panel_min_width(mToolbarStack, mNearbyChatBar);
+				mChatBarContainer->getRect().getWidth() - get_panel_min_width(mToolbarStack, mChatBarContainer);
 
 			S32 sum_of_min_widths = get_panel_min_width(mToolbarStack, mSpeakPanel);
 			S32 sum_of_curr_widths = get_curr_width(mSpeakPanel);
@@ -1407,7 +1412,7 @@ void LLBottomTray::processChatbarCustomization(S32 new_width)
 {
 	if (NULL == mNearbyChatBar) return;
 
-	const S32 delta_width = mNearbyChatBar->getRect().getWidth() - new_width;
+	const S32 delta_width = mChatBarContainer->getRect().getWidth() - new_width;
 
 	if (delta_width == 0) return;
 
diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h
index 05fed53936..792355600b 100644
--- a/indra/newview/llbottomtray.h
+++ b/indra/newview/llbottomtray.h
@@ -33,20 +33,17 @@
 #ifndef LL_LLBOTTOMPANEL_H
 #define LL_LLBOTTOMPANEL_H
 
-#include "llmenugl.h"
-
 #include "llpanel.h"
 #include "llimview.h"
-#include "llcombobox.h"
 
 class LLChicletPanel;
-class LLLineEditor;
 class LLLayoutStack;
-class LLNotificationChiclet;
 class LLSpeakButton;
 class LLNearbyChatBar;
 class LLIMChiclet;
 class LLBottomTrayLite;
+class LLLayoutPanel;
+class LLMenuGL;
 
 // Build time optimization, generate once in .cpp file
 #ifndef LLBOTTOMTRAY_CPP
@@ -381,6 +378,7 @@ protected:
 	LLPanel*			mSpeakPanel;
 	LLSpeakButton* 		mSpeakBtn;
 	LLNearbyChatBar*	mNearbyChatBar;
+	LLLayoutPanel*		mChatBarContainer;
 	LLLayoutStack*		mToolbarStack;
 	LLMenuGL*			mBottomTrayContextMenu;
 	LLButton*			mCamButton;
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 967f38bfd2..a7a348f072 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -257,14 +257,14 @@ BOOL LLIMFloater::postBuild()
 	}
 
 	mControlPanel->setSessionId(mSessionID);
-	mControlPanel->setVisible(gSavedSettings.getBOOL("IMShowControlPanel"));
+	mControlPanel->getParent()->setVisible(gSavedSettings.getBOOL("IMShowControlPanel"));
 
 	LLButton* slide_left = getChild<LLButton>("slide_left_btn");
-	slide_left->setVisible(mControlPanel->getVisible());
+	slide_left->setVisible(mControlPanel->getParent()->getVisible());
 	slide_left->setClickedCallback(boost::bind(&LLIMFloater::onSlide, this));
 
 	LLButton* slide_right = getChild<LLButton>("slide_right_btn");
-	slide_right->setVisible(!mControlPanel->getVisible());
+	slide_right->setVisible(!mControlPanel->getParent()->getVisible());
 	slide_right->setClickedCallback(boost::bind(&LLIMFloater::onSlide, this));
 
 	mInputEditor = getChild<LLLineEditor>("chat_editor");
@@ -363,12 +363,12 @@ void* LLIMFloater::createPanelAdHocControl(void* userdata)
 
 void LLIMFloater::onSlide()
 {
-	mControlPanel->setVisible(!mControlPanel->getVisible());
+	mControlPanel->getParent()->setVisible(!mControlPanel->getParent()->getVisible());
 
-	gSavedSettings.setBOOL("IMShowControlPanel", mControlPanel->getVisible());
+	gSavedSettings.setBOOL("IMShowControlPanel", mControlPanel->getParent()->getVisible());
 
-	getChild<LLButton>("slide_left_btn")->setVisible(mControlPanel->getVisible());
-	getChild<LLButton>("slide_right_btn")->setVisible(!mControlPanel->getVisible());
+	getChild<LLButton>("slide_left_btn")->setVisible(mControlPanel->getParent()->getVisible());
+	getChild<LLButton>("slide_right_btn")->setVisible(!mControlPanel->getParent()->getVisible());
 
 	LLLayoutStack* stack = getChild<LLLayoutStack>("im_panels");
 	if (stack) stack->setAnimate(true);
diff --git a/indra/newview/skins/default/xui/da/floater_im_session.xml b/indra/newview/skins/default/xui/da/floater_im_session.xml
index aa7df6ad2b..16df7e4b03 100644
--- a/indra/newview/skins/default/xui/da/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/da/floater_im_session.xml
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="panel_im">
 	<layout_stack name="im_panels">
-		<layout_panel label="IM kontrol panel" name="panel_im_control_panel"/>
 		<layout_panel>
 			<line_editor label="Til" name="chat_editor"/>
 		</layout_panel>
diff --git a/indra/newview/skins/default/xui/de/floater_im_session.xml b/indra/newview/skins/default/xui/de/floater_im_session.xml
index c69bb600ea..abaf275651 100644
--- a/indra/newview/skins/default/xui/de/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/de/floater_im_session.xml
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="panel_im">
 	<layout_stack name="im_panels">
-		<layout_panel label="IM Steuerkonsole" name="panel_im_control_panel"/>
 		<layout_panel>
 			<line_editor label="An" name="chat_editor"/>
 		</layout_panel>
diff --git a/indra/newview/skins/default/xui/en/favorites_bar_button.xml b/indra/newview/skins/default/xui/en/favorites_bar_button.xml
index b365040c20..e7dd62eb64 100644
--- a/indra/newview/skins/default/xui/en/favorites_bar_button.xml
+++ b/indra/newview/skins/default/xui/en/favorites_bar_button.xml
@@ -22,6 +22,6 @@
  pad_right="9"
  scale_image="true"
  tab_stop="false"
- top="0"
+ bottom="0"
  use_ellipses="true"
  width="140" />
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index 6c1214f152..a371e98322 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -30,12 +30,19 @@
   top="20"
   left="0">
     <layout_panel
-      name="panel_im_control_panel"
-      layout="topleft"
-      follows="left"
-      min_width="115" 
+      name="im_control_panel_holder"
+      min_width="115"
+      width="150" 
+      height="320" 
       auto_resize="false"
-      user_resize="true" />
+      user_resize="false">
+      <panel
+        name="panel_im_control_panel"
+        layout="topleft"
+        height="320"
+        width="150" 
+        follows="all"/>
+      </layout_panel>
     <layout_panel
        default_tab_group="3"
        left="0"
diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml
index c3bbe70609..8d9ebf6e06 100644
--- a/indra/newview/skins/default/xui/en/main_view.xml
+++ b/indra/newview/skins/default/xui/en/main_view.xml
@@ -103,8 +103,8 @@
                      width="500"/>
             </layout_panel>
             <layout_panel auto_resize="false"
-                   follows="all"
                    min_height="33"
+                   height="33" 
                    mouse_opaque="false"
                    name="bottom_tray_container"
                    visible="false"/>
@@ -112,7 +112,7 @@
         </layout_panel>
         <!-- side tray -->
         <layout_panel auto_resize="false"
-                      follows="all"
+                      follows="top|bottom"
                       height="500"
                       min_width="333"
                       mouse_opaque="false"
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
index 73225ef7d0..b06a72f584 100644
--- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml
+++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
@@ -38,8 +38,8 @@
          auto_resize="false"
          layout="topleft"
          max_width="320"
-         min_height="23"
          min_width="214"
+         height="28" 
          mouse_opaque="false"
 		 name="chat_bar_layout_panel"
          user_resize="true"
@@ -50,7 +50,7 @@
             left="0"
             height="28"
             width="308"
-            top="4"
+            top="0"
             mouse_opaque="false"
             follows="left|right"
           />
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml b/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
index 0734ca9a4b..efb1da4c05 100644
--- a/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
+++ b/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
@@ -38,7 +38,6 @@
          auto_resize="true"
          height="28"
          layout="topleft"
-         min_height="23"
          width="310"
          min_width="188"
          user_resize="false">
diff --git a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
index 33a5e01e4c..aa0edbfb8a 100644
--- a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
+++ b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
@@ -3,11 +3,11 @@
  border="false"
  height="300"
  name="panel_im_control_panel"
- width="119">
+ width="150">
     <avatar_icon
      follows="left|top"
      height="105"
-     left_delta="5"
+     left_delta="20"
      name="avatar_icon"
      top="-5"
      width="114"/>
@@ -22,7 +22,7 @@
      name="button_stack"
      orientation="vertical"
      top_pad="5"
-     width="114">
+     width="145">
         <layout_panel
          mouse_opaque="false"
          auto_resize="true"
@@ -31,7 +31,7 @@
          layout="topleft"
          left="2"
          min_height="0"
-         width="109"
+         width="140"
          top="0"
          name="spacer"
          user_resize="false" />
@@ -41,7 +41,7 @@
          height="20"
          layout="topleft"
          min_height="20"
-         width="109"
+         width="140"
          name="view_profile_btn_panel"
          user_resize="false">
             <button
@@ -50,7 +50,7 @@
              label="Profile"
              name="view_profile_btn"
              top="0"
-             width="109" />
+             width="140" />
         </layout_panel>
         <layout_panel
          auto_resize="false"
@@ -58,7 +58,7 @@
          height="25"
          layout="topleft"
          min_height="25"
-         width="109"
+         width="140"
          name="add_friend_btn_panel"
          user_resize="false">
             <button
@@ -67,7 +67,7 @@
              label="Add Friend"
              name="add_friend_btn"
              top="5"
-             width="109" />
+             width="140" />
         </layout_panel>
         <layout_panel
          auto_resize="false"
@@ -75,7 +75,7 @@
          height="25"
          layout="topleft"
          min_height="25"
-         width="109"
+         width="140"
          name="teleport_btn_panel"
          user_resize="false">
         <button
@@ -85,7 +85,7 @@
              label="Teleport"
              name="teleport_btn"
              tool_tip = "Offer to teleport this person"
-             width="109" />
+             width="140" />
         </layout_panel>
         <layout_panel
          auto_resize="false"
@@ -93,7 +93,7 @@
          height="25"
          layout="topleft"
          min_height="25"
-         width="109"
+         width="140"
          name="share_btn_panel"
          user_resize="false">
            <button
@@ -102,7 +102,7 @@
              height="23"
              label="Share"
              name="share_btn"
-             width="109" />
+             width="140" />
         </layout_panel>
         <layout_panel
          auto_resize="false"
@@ -110,7 +110,7 @@
          height="25"
          layout="topleft"
          min_height="25"
-         width="109"
+         width="140"
          name="pay_btn_panel"
          user_resize="false">
            <button
@@ -119,7 +119,7 @@
              height="23"
              label="Pay"
              name="pay_btn"
-             width="109" />
+             width="140" />
         </layout_panel>
         <layout_panel
          auto_resize="false"
@@ -127,7 +127,7 @@
          height="25"
          layout="topleft"
          min_height="25"
-         width="109"
+         width="140"
          name="call_btn_panel"
          user_resize="false">
             <button
@@ -135,7 +135,7 @@
              height="23"
              label="Call"
              name="call_btn"
-             width="109" />
+             width="140" />
         </layout_panel>
         <layout_panel
          auto_resize="false"
@@ -143,7 +143,7 @@
          height="25"
          layout="topleft"
          min_height="25"
-         width="109"
+         width="140"
          name="end_call_btn_panel"
          user_resize="false"
          visible="false">
@@ -152,7 +152,7 @@
              height="23"
              label="End Call"
              name="end_call_btn"
-             width="109" />
+             width="140" />
         </layout_panel>
         <layout_panel
          auto_resize="false"
@@ -160,7 +160,7 @@
          height="25"
          layout="topleft"
          min_height="25"
-         width="109"
+         width="140"
          name="voice_ctrls_btn_panel"
          user_resize="false"
          visible="false">
@@ -169,7 +169,7 @@
              height="23"
              label="Voice Controls"
              name="voice_ctrls_btn"
-             width="109" />
+             width="140" />
         </layout_panel>
     </layout_stack>
 </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
index edf4b52773..b25fd695c9 100644
--- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
+++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml
@@ -36,7 +36,6 @@
 	<layout_panel
 		name="media_progress_indicator"
 		mouse_opaque="false"
-		follows="left|right|top"
 		height="8"
 		layout="topleft"
 		left="0"
diff --git a/indra/newview/skins/default/xui/es/floater_im_session.xml b/indra/newview/skins/default/xui/es/floater_im_session.xml
index c7312e609b..3d9d17fc81 100644
--- a/indra/newview/skins/default/xui/es/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/es/floater_im_session.xml
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="panel_im">
 	<layout_stack name="im_panels">
-		<layout_panel label="Panel de control de MI" name="panel_im_control_panel"/>
 		<layout_panel>
 			<line_editor label="A" name="chat_editor"/>
 		</layout_panel>
diff --git a/indra/newview/skins/default/xui/fr/floater_im_session.xml b/indra/newview/skins/default/xui/fr/floater_im_session.xml
index c3df4a869c..516eb41362 100644
--- a/indra/newview/skins/default/xui/fr/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/fr/floater_im_session.xml
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="panel_im">
 	<layout_stack name="im_panels">
-		<layout_panel label="Panneau de contrôle IM" name="panel_im_control_panel"/>
 		<layout_panel>
 			<line_editor label="À" name="chat_editor"/>
 		</layout_panel>
diff --git a/indra/newview/skins/default/xui/it/floater_im_session.xml b/indra/newview/skins/default/xui/it/floater_im_session.xml
index 8d395ea04b..3d9d17fc81 100644
--- a/indra/newview/skins/default/xui/it/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/it/floater_im_session.xml
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="panel_im">
 	<layout_stack name="im_panels">
-		<layout_panel label="Pannello di controllo IM" name="panel_im_control_panel"/>
 		<layout_panel>
 			<line_editor label="A" name="chat_editor"/>
 		</layout_panel>
diff --git a/indra/newview/skins/default/xui/ja/floater_im_session.xml b/indra/newview/skins/default/xui/ja/floater_im_session.xml
index 6646cc0b25..dfa1c85ca2 100644
--- a/indra/newview/skins/default/xui/ja/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/ja/floater_im_session.xml
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="panel_im">
 	<layout_stack name="im_panels">
-		<layout_panel label="IM コントロールパネル" name="panel_im_control_panel"/>
 		<layout_panel>
 			<line_editor label="宛先" name="chat_editor"/>
 		</layout_panel>
diff --git a/indra/newview/skins/default/xui/pl/floater_im_session.xml b/indra/newview/skins/default/xui/pl/floater_im_session.xml
index db513f787c..9041ff7416 100644
--- a/indra/newview/skins/default/xui/pl/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/pl/floater_im_session.xml
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="panel_im">
 	<layout_stack name="im_panels">
-		<layout_panel label="Panel kontroli wiadomości prywatnej (IM)" name="panel_im_control_panel"/>
 		<layout_panel>
 			<line_editor label="Do" name="chat_editor"/>
 		</layout_panel>
diff --git a/indra/newview/skins/default/xui/pt/floater_im_session.xml b/indra/newview/skins/default/xui/pt/floater_im_session.xml
index 39dde3408b..5543ffa41d 100644
--- a/indra/newview/skins/default/xui/pt/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/pt/floater_im_session.xml
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <floater name="panel_im">
 	<layout_stack name="im_panels">
-		<layout_panel label="Painel de controle de MI" name="panel_im_control_panel"/>
 		<layout_panel>
 			<line_editor label="Para" name="chat_editor"/>
 		</layout_panel>
-- 
cgit v1.2.3


From a0b15c827ee7704c1557c9c882ec236d5d67f948 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 25 Aug 2010 16:46:52 -0700
Subject: outfits accordions now have proper contents

---
 indra/newview/lloutfitslist.cpp | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index 7429386871..8a2073e661 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -68,9 +68,18 @@ bool LLOutfitTabNameComparator::compare(const LLAccordionCtrlTab* tab1, const LL
 	return name1 < name2;
 }
 
-const LLAccordionCtrlTab::Params& get_accordion_tab_params()
+struct outfit_accordion_tab_params : public LLInitParam::Block<outfit_accordion_tab_params, LLAccordionCtrlTab::Params>
 {
-	static LLAccordionCtrlTab::Params tab_params;
+	Mandatory<LLWearableItemsList::Params> wearable_list;
+
+	outfit_accordion_tab_params()
+	:	wearable_list("wearable_items_list")
+	{}
+};
+
+const outfit_accordion_tab_params& get_accordion_tab_params()
+{
+	static outfit_accordion_tab_params tab_params;
 	static bool initialized = false;
 	if (!initialized)
 	{
@@ -466,8 +475,11 @@ void LLOutfitsList::refreshList(const LLUUID& category_id)
 
 		std::string name = cat->getName();
 
-		LLAccordionCtrlTab::Params tab_params(get_accordion_tab_params());
+		outfit_accordion_tab_params tab_params(get_accordion_tab_params());
 		LLAccordionCtrlTab* tab = LLUICtrlFactory::create<LLAccordionCtrlTab>(tab_params);
+		LLWearableItemsList* wearable_list = LLUICtrlFactory::create<LLWearableItemsList>(tab_params.wearable_list);
+		wearable_list->setShape(tab->getLocalRect());
+		tab->addChild(wearable_list);
 
 		tab->setName(name);
 		tab->setTitle(name);
-- 
cgit v1.2.3


From 2f0d1f98834a37063c1ebde2c518bf20854381e2 Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Thu, 26 Aug 2010 11:19:43 -0700
Subject: Fix for a mac build error.

---
 indra/llui/lllayoutstack.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index 9bcfa2c957..e62c9776cb 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -142,7 +142,7 @@ private:
 
 class LLLayoutPanel : public LLPanel
 {
-friend LLLayoutStack;
+friend class LLLayoutStack;
 friend class LLUICtrlFactory;
 public:
 	struct Params : public LLInitParam::Block<Params, LLPanel::Params>
-- 
cgit v1.2.3


From 904e43e664583b6e567a32becf182957b2006dff Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Thu, 26 Aug 2010 11:23:46 -0700
Subject: Fix another mac build error.

---
 indra/llui/llsdparam.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h
index 83c958d67d..c42358178a 100644
--- a/indra/llui/llsdparam.h
+++ b/indra/llui/llsdparam.h
@@ -93,7 +93,8 @@ class LLSDParamAdapter : public T
 		LLSDParamAdapter() {}
 		LLSDParamAdapter(const LLSD& sd)
 		{
-			LLParamSDParser::instance().readSD(sd, *this);
+			LLParamSDParser parser;
+			parser.readSD(sd, *this);
 		}
 		
 		LLSDParamAdapter(const T& val)
-- 
cgit v1.2.3


From 6cd9103dcf6eb9992ac50b209ae4d99a22603554 Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Thu, 26 Aug 2010 12:17:07 -0700
Subject: Fix for a link error.

---
 indra/integration_tests/llui_libtest/llwidgetreg.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/indra/integration_tests/llui_libtest/llwidgetreg.cpp b/indra/integration_tests/llui_libtest/llwidgetreg.cpp
index 57c39243fb..489eebe6fa 100644
--- a/indra/integration_tests/llui_libtest/llwidgetreg.cpp
+++ b/indra/integration_tests/llui_libtest/llwidgetreg.cpp
@@ -84,7 +84,7 @@ void LLWidgetReg::initClass(bool register_widgets)
 		LLDefaultChildRegistry::Register<LLMultiSlider> multi_slider_bar("multi_slider_bar");
 		LLDefaultChildRegistry::Register<LLMultiSliderCtrl> multi_slider("multi_slider");
 		LLDefaultChildRegistry::Register<LLPanel> panel("panel", &LLPanel::fromXML);
-		LLDefaultChildRegistry::Register<LLLayoutStack> layout_stack("layout_stack", &LLLayoutStack::fromXML);
+		LLDefaultChildRegistry::Register<LLLayoutStack> layout_stack("layout_stack");
 		LLDefaultChildRegistry::Register<LLProgressBar> progress_bar("progress_bar");
 		LLDefaultChildRegistry::Register<LLRadioGroup> radio_group("radio_group");
 		LLDefaultChildRegistry::Register<LLSearchEditor> search_editor("search_editor");
-- 
cgit v1.2.3


From 74d4bbfa0a50df83a4fe419294609b6ef2af7a80 Mon Sep 17 00:00:00 2001
From: Monroe Linden <monroe@lindenlab.com>
Date: Thu, 26 Aug 2010 12:26:31 -0700
Subject: Added the MediaEnablePopups setting as a global on/off switch for
 media popups.

---
 indra/newview/app_settings/settings.xml | 11 +++++++++++
 indra/newview/llviewermedia.cpp         |  7 +++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 3d7ab71c90..e6d6032fef 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5164,6 +5164,17 @@
     <key>Value</key>
     <real>3.0</real>
   </map>
+  <key>MediaEnablePopups</key>
+  <map>
+    <key>Comment</key>
+    <string>If true, enable targeted links and javascript in media to open new media browser windows.</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>0</integer>
+  </map>
   <key>MediaOnAPrimUI</key>
   <map>
     <key>Comment</key>
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index d89ee13b95..6f824b84e3 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -2835,8 +2835,11 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
 				// ignore this click and let media plugin handle it
 				break;
 			default:
-				// loadURL now handles distinguishing between _blank, _external, and other named targets.
-				LLWeb::loadURL(url, target);
+				if(gSavedSettings.getBOOL("MediaEnablePopups"))
+				{
+					// loadURL now handles distinguishing between _blank, _external, and other named targets.
+					LLWeb::loadURL(url, target);
+				}
 				break;
 			}
 		};
-- 
cgit v1.2.3


From c1e71b0ee1f43486b79bf34305d5212afd8541a9 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 26 Aug 2010 12:32:14 -0700
Subject: added images for popup notification

---
 .../skins/default/textures/icons/pop_up_caution.png      | Bin 0 -> 3158 bytes
 indra/newview/skins/default/textures/textures.xml        |   2 ++
 .../skins/default/textures/windows/yellow_gradient.png   | Bin 0 -> 3634 bytes
 3 files changed, 2 insertions(+)
 create mode 100644 indra/newview/skins/default/textures/icons/pop_up_caution.png
 create mode 100644 indra/newview/skins/default/textures/windows/yellow_gradient.png

diff --git a/indra/newview/skins/default/textures/icons/pop_up_caution.png b/indra/newview/skins/default/textures/icons/pop_up_caution.png
new file mode 100644
index 0000000000..78b681cb33
Binary files /dev/null and b/indra/newview/skins/default/textures/icons/pop_up_caution.png differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 9fbbfb1d2b..8d6a564687 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -652,4 +652,6 @@ with the same filename but different name
   <texture name="hint_arrow_up" file_name="windows/hint_arrow_up.png" preload="false"/>
   <texture name="hint_arrow_down" file_name="windows/hint_arrow_down.png" preload="false"/>
 
+  <texture name="Yellow_Gradient" file_name="windows/yellow_gradient.png"/>
+  <texture name="Popup_Caution" file_name="icons/pop_up_caution.png"/>
 </textures>
diff --git a/indra/newview/skins/default/textures/windows/yellow_gradient.png b/indra/newview/skins/default/textures/windows/yellow_gradient.png
new file mode 100644
index 0000000000..5fd847aaef
Binary files /dev/null and b/indra/newview/skins/default/textures/windows/yellow_gradient.png differ
-- 
cgit v1.2.3


From ead46208b02f31c8ed06242a016501d57c90abfb Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 26 Aug 2010 12:33:31 -0700
Subject: made layoutstack orientation mandatory

---
 indra/llui/lllayoutstack.cpp                       |  2 +-
 indra/llui/lllayoutstack.h                         |  2 +-
 .../skins/default/xui/en/floater_help_browser.xml  |  1 +
 .../skins/default/xui/en/floater_media_browser.xml | 71 ++++++++++++++++++++++
 .../xui/en/floater_notifications_console.xml       |  1 +
 .../skins/default/xui/en/panel_outfit_edit.xml     |  1 +
 .../skins/default/xui/en/panel_progress.xml        |  1 +
 .../default/xui/en/panel_sidetray_home_tab.xml     |  1 +
 8 files changed, 78 insertions(+), 2 deletions(-)

diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 15a0369eb9..309f710cbb 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -100,7 +100,7 @@ F32 LLLayoutPanel::getCollapseFactor(LLLayoutStack::ELayoutOrientation orientati
 //
 
 LLLayoutStack::Params::Params()
-:	orientation("orientation", std::string("vertical")),
+:	orientation("orientation"),
 	animate("animate", true),
 	clip("clip", true),
 	border_size("border_size", LLCachedControl<S32>(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0))
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index 9bcfa2c957..c7e27b6866 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -48,7 +48,7 @@ public:
 
 	struct Params : public LLInitParam::Block<Params, LLView::Params>
 	{
-		Optional<std::string>	orientation;
+		Mandatory<std::string>	orientation;
 		Optional<S32>			border_size;
 		Optional<bool>			animate,
 								clip;
diff --git a/indra/newview/skins/default/xui/en/floater_help_browser.xml b/indra/newview/skins/default/xui/en/floater_help_browser.xml
index 214fb6ce54..13017cc803 100644
--- a/indra/newview/skins/default/xui/en/floater_help_browser.xml
+++ b/indra/newview/skins/default/xui/en/floater_help_browser.xml
@@ -24,6 +24,7 @@
      follows="left|right|top|bottom"
      layout="topleft"
      left="5"
+     orientation="vertical" 
      name="stack1"
      top="20"
      width="640">
diff --git a/indra/newview/skins/default/xui/en/floater_media_browser.xml b/indra/newview/skins/default/xui/en/floater_media_browser.xml
index 18f3b9ab06..3b78da2a79 100644
--- a/indra/newview/skins/default/xui/en/floater_media_browser.xml
+++ b/indra/newview/skins/default/xui/en/floater_media_browser.xml
@@ -26,6 +26,7 @@
      layout="topleft"
      left="10"
      name="stack1"
+     orientation="vertical" 
      top="20"
      width="800">
         <layout_panel
@@ -181,6 +182,76 @@
 				function="MediaBrowser.Assign" />
 			</button>
         </layout_panel>
+      <layout_panel
+       height="30"
+       layout="topleft"
+       name="notification_area"
+       visible="false" 
+       user_resize="false"
+       background_visible="true" 
+       bg_alpha_image="Yellow_Gradient" 
+       auto_resize="false" 
+       width="800">
+        <layout_stack
+              top="0"
+              height="30"
+              width="800"
+              left="0"
+              follows="all" 
+              orientation="horizontal"
+              >
+          <layout_panel
+            height="30">
+            <icon value="Popup_Caution"
+                  left="5"
+                  top="7"
+                  width="16"
+                  height="15"/>
+            <text left_pad="8"
+                  top="10"
+                  height="25"
+                  width="400"
+                  text_color="black"
+                  font="SansSerifSmall"
+                  font.style="BOLD"
+                  name="notification_text"
+                  value="Notification text here"
+                  />
+          </layout_panel>
+          <layout_panel
+            height="30"
+            width="270"
+            auto_resize="false"
+            name="form_elements">
+            <check_box name="enable_check"
+                      left="5"
+                      top="5"
+                      height="20"
+                      width="120"
+                      label="Enable all popups"
+                       text_enabled_color="black"
+                      />
+            <button left_pad="5"
+                    width="140"
+                    top="4"
+                    label="Open pop-up window"/>
+          </layout_panel>
+          <layout_panel
+            height="30"
+            width="25"
+            auto_resize="false"
+            name="close_panel">
+            <button left="5"
+                    name="close" 
+                    width="16"
+                    height="16" 
+                    top="8"
+                    image_color="DkGray_66" 
+                    image_unselected="Icon_Close_Foreground"
+                    image_selected="Icon_Close_Press"/>
+          </layout_panel>
+        </layout_stack>
+      </layout_panel>
         <layout_panel
          height="40"
          layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_notifications_console.xml b/indra/newview/skins/default/xui/en/floater_notifications_console.xml
index ca81b9bcf0..e243ccd2f9 100644
--- a/indra/newview/skins/default/xui/en/floater_notifications_console.xml
+++ b/indra/newview/skins/default/xui/en/floater_notifications_console.xml
@@ -36,6 +36,7 @@
      follows="left|right|top|bottom"
      layout="topleft"
      left="5"
+     orientation="vertical" 
      name="notification_channels"
      right="-5"
      top="42" />
diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
index cf174da2f0..f5df177b68 100644
--- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
@@ -183,6 +183,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap
              follows="all"
              height="185"
              width="313"
+             orientation="vertical" 
              layout="topleft"
              name="filter_panels"
              top="0"
diff --git a/indra/newview/skins/default/xui/en/panel_progress.xml b/indra/newview/skins/default/xui/en/panel_progress.xml
index 727c5fb7b2..2868d91cc7 100644
--- a/indra/newview/skins/default/xui/en/panel_progress.xml
+++ b/indra/newview/skins/default/xui/en/panel_progress.xml
@@ -34,6 +34,7 @@
              height="768"
              layout="topleft"
              left="0"
+             orientation="vertical" 
              name="stack2"
              top="0"
              width="640">
diff --git a/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml b/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml
index ab3cc036d5..e261d6d555 100644
--- a/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml
+++ b/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml
@@ -23,6 +23,7 @@
      layout="topleft"
      left_delta="0"
      name="browser_layout"
+     orientation="vertical" 
      top_delta="0"
      width="313">
       <web_browser
-- 
cgit v1.2.3


From 51311875b6e23fa9475c42b6d15637aa668729c5 Mon Sep 17 00:00:00 2001
From: convert-repo <none@none>
Date: Sat, 28 Aug 2010 07:56:29 +0000
Subject: update tags

---
 .hgtags | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 .hgtags

diff --git a/.hgtags b/.hgtags
new file mode 100644
index 0000000000..d3172eb75a
--- /dev/null
+++ b/.hgtags
@@ -0,0 +1,24 @@
+003dd9461bfa479049afcc34545ab3431b147c7c v2start
+08398e650c222336bb2b6de0cd3bba944aef11b4 2-1rn1
+0962101bfa7df0643a6e625786025fe7f8a6dc97 2-1-beta-2
+12769e547e30067d494a6c01479a18107366ce2f beta-5
+17fc2908e9a1ef34a9f53a41a393caf5c3cac390 beta-3-5
+19547b909b404552593be5ec7c18241e062a6d65 2-1-1-beta-1
+1e2b517adc2ecb342cd3c865f2a6ccf82a3cf8d7 2-1-beta-3
+3469d90a115b900f8f250e137bbd9b684130f5d2 beta-4
+3e4b947f79d88c385e8218cbc0731cef0e42cfc4 2-1-beta-1
+46002088d9a4489e323b8d56131c680eaa21258c viewer-2-1-0-start
+4f777ffb99fefdc6497c61385c22688ff149c659 viewer-2-0-0
+52d96ad3d39be29147c5b2181b3bb46af6164f0e alpha-3
+668851b2ef0f8cf8df07a0fba429e4a6c1e70abb viewer-2-0-1
+6e3b2e13906ba8ff22d3c8490b02d518adb2c907 2-1-1-beta-2
+7f16e79826d377f5f9f5b33dc721ab56d0d7dc8f alpha-4
+7f16e79826d377f5f9f5b33dc721ab56d0d7dc8f fork to viewer-20qa
+80bc6cff515118a36108967af49d3f8105c95bc9 viewer-2-0-2-start
+b03065d018b8a2e28b7de85b293a4c992cb4c12d 2-1-release
+b8419565906e4feb434426d8d9b17dd1458e24b2 alpha-6
+bb38ff1a763738609e1b3cada6d15fa61e5e84b9 2-1-1-release
+c6969fe44e58c542bfc6f1bd6c0be2fa860929ac 2-1-beta-4
+d2382d374139850efa5bb6adfb229e3e656cfc40 howard-demo
+d40ac9dd949cba6dab1cc386da6a2027690c2519 alpha-5
+d6781e22543acd7e21b967209f3c6e7003d380e3 fork to viewer-2-0
-- 
cgit v1.2.3