Commits

Scott Lawrence committed 70de2f6 Merge

merge changes for STORM-1661

  • Participants
  • Parent commits e98b61d, 78b8f57

Comments (0)

Files changed (68)

indra/llcommon/llinstancetracker.h

 	}
 
 protected:
-	LLInstanceTracker(KEY key) { add_(key); }
+	LLInstanceTracker(KEY key) 
+	{ 
+		// make sure static data outlives all instances
+		getStatic();
+		add_(key); 
+	}
 	virtual ~LLInstanceTracker() 
 	{ 
 		// it's unsafe to delete instances of this type while all instances are being iterated over.
 protected:
 	LLInstanceTracker()
 	{
-		// it's safe but unpredictable to create instances of this type while all instances are being iterated over.  I hate unpredictable.	 This assert will probably be turned on early in the next development cycle.
+		// make sure static data outlives all instances
+		getStatic();
 		getSet_().insert(static_cast<T*>(this));
 	}
 	virtual ~LLInstanceTracker()

indra/llui/llcommandmanager.cpp

 // LLCommandId class
 //
 
-const LLCommandId LLCommandId::null = LLCommandId();
+const LLCommandId LLCommandId::null = LLCommandId("null command");
 
 //
 // LLCommand class
 }
 
 LLCommand::LLCommand(const LLCommand::Params& p)
-	: mAvailableInToybox(p.available_in_toybox)
+	: mIdentifier(p.name)
+	, mAvailableInToybox(p.available_in_toybox)
 	, mIcon(p.icon)
-	, mIdentifier(p.name)
 	, mLabelRef(p.label_ref)
+	, mName(p.name)
 	, mTooltipRef(p.tooltip_ref)
 	, mExecuteFunction(p.execute_function)
 	, mExecuteParameters(p.execute_parameters)
 	mCommandIndices[command_id.uuid()] = mCommands.size();
 	mCommands.push_back(command);
 
-	lldebugs << "Successfully added command: " << command->id().name() << llendl;
+	lldebugs << "Successfully added command: " << command->name() << llendl;
 }
 
 //static

indra/llui/llcommandmanager.h

 		{}
 	};
 
-	LLCommandId()
-		: mName("null command")
-	{
-		mUUID = LLUUID::generateNewID(mName);
-	}
-	
 	LLCommandId(const std::string& name)
-		: mName(name)
 	{
 		mUUID = LLUUID::generateNewID(name);
 	}
 
 	LLCommandId(const Params& p)
-	:	mName(p.name)
 	{
 		mUUID = LLUUID::generateNewID(p.name);
 	}
 
 	LLCommandId(const LLUUID& uuid)
-	:	mName(""),
-		mUUID(uuid)
-	{
-	}
+	:	mUUID(uuid)
+	{}
 	
-	const std::string& name() const { return mName; }
 	const LLUUID& uuid() const { return mUUID; }
 
 	bool operator!=(const LLCommandId& command) const
 		return (mUUID == command.mUUID);
 	}
 
-	bool operator<(const LLCommandId& command) const
-	{
-		return (mName < command.mName);
-	}
-
 	static const LLCommandId null;
 
 private:
-	std::string mName;
 	LLUUID		mUUID;
 };
 
 	const std::string& icon() const { return mIcon; }
 	const LLCommandId& id() const { return mIdentifier; }
 	const std::string& labelRef() const { return mLabelRef; }
+	const std::string& name() const { return mName; }
 	const std::string& tooltipRef() const { return mTooltipRef; }
 
 	const std::string& executeFunctionName() const { return mExecuteFunction; }
 	bool        mAvailableInToybox;
 	std::string mIcon;
 	std::string mLabelRef;
+	std::string mName;
 	std::string mTooltipRef;
 
 	std::string mExecuteFunction;

indra/llui/lldockablefloater.cpp

 
 void LLDockableFloater::setMinimized(BOOL minimize)
 {
-	if(minimize)
+	if(minimize && isDocked())
 	{
+		// minimizing a docked floater just hides it
 		setVisible(FALSE);
 	}
+	else
+	{
+		LLFloater::setMinimized(minimize);
+	}
 }
 
 LLView * LLDockableFloater::getDockWidget()

indra/llui/llfloater.cpp

 :	title("title"),
 	short_title("short_title"),
 	single_instance("single_instance", false),
+	reuse_instance("reuse_instance", false),
 	can_resize("can_resize", false),
 	can_minimize("can_minimize", true),
 	can_close("can_close", true),
 	save_rect("save_rect", false),
 	save_visibility("save_visibility", false),
 	can_dock("can_dock", false),
+	show_title("show_title", true),
 	open_positioning("open_positioning", LLFloaterEnums::OPEN_POSITIONING_NONE),
 	specified_left("specified_left"),
 	specified_bottom("specified_bottom"),
 	mTitle(p.title),
 	mShortTitle(p.short_title),
 	mSingleInstance(p.single_instance),
+	mReuseInstance(p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance), // reuse single-instance floaters by default
 	mKey(key),
 	mCanTearOff(p.can_tear_off),
 	mCanMinimize(p.can_minimize),
 		delete mResizeHandle[i];
 	}
 
-	storeRectControl();
 	setVisible(false); // We're not visible if we're destroyed
 	storeVisibilityControl();
 	storeDockStateControl();
 	}
 	else
 	{
-		applyControlsAndPosition(LLFloaterReg::getLastFloaterCascading());
+		LLFloater* floater_to_stack = LLFloaterReg::getLastFloaterInGroup(mInstanceName);
+		if (!floater_to_stack)
+		{
+			floater_to_stack = LLFloaterReg::getLastFloaterCascading();
+		}
+		applyControlsAndPosition(floater_to_stack);
 		setMinimized(FALSE);
 		setVisibleAndFrontmost(mAutoFocus);
 	}
 			else
 			{
 				setVisible(FALSE);
+				if (!mReuseInstance)
+				{
+					destroy();
+				}
 			}
 		}
 		else
 		{
 			setVisible(FALSE); // hide before destroying (so handleVisibilityChange() gets called)
-			destroy();
+			if (!mReuseInstance)
+			{
+				destroy();
+			}
 		}
 	}
 }
 {
 	bool saved_rect = false;
 
-	// If we have a saved rect, use it
-	if (mRectControl.size() > 1)
+	LLFloater* last_in_group = LLFloaterReg::getLastFloaterInGroup(mInstanceName);
+	if (last_in_group && last_in_group != this)
 	{
+		// other floaters in our group, position ourselves relative to them and don't save the rect
+		mRectControl.clear();
+		mOpenPositioning = LLFloaterEnums::OPEN_POSITIONING_CASCADE_GROUP;
+	}
+	else if (mRectControl.size() > 1)
+	{
+		// If we have a saved rect, use it
 		const LLRect& rect = getControlGroup()->getRect(mRectControl);
 		saved_rect = rect.notEmpty();
 		if (saved_rect)
 		}
 		break;
 
+	case LLFloaterEnums::OPEN_POSITIONING_CASCADE_GROUP:
 	case LLFloaterEnums::OPEN_POSITIONING_CASCADING:
 		if (other != NULL)
 		{
 	if (by_user)
 	{
 		storeRectControl();
+		mOpenPositioning = LLFloaterEnums::OPEN_POSITIONING_NONE;
 	}
 
 	// if not minimized, adjust all snapped dependents to new shape
 			mButtonsEnabled[BUTTON_RESTORE] = TRUE;
 		}
 
-		if (mDragHandle)
-		{
-			mDragHandle->setVisible(TRUE);
-		}
 		setBorderVisible(TRUE);
 
 		for(handle_set_iter_t dependent_it = mDependents.begin();
 		mButtons[BUTTON_CLOSE]->setToolTip(LLStringExplicit(getButtonTooltip(Params(), BUTTON_CLOSE, is_chrome)));
 	}
 	
-	// no titles displayed on "chrome" floaters
-	if (mDragHandle)
-		mDragHandle->setTitleVisible(!is_chrome);
-	
 	LLPanel::setIsChrome(is_chrome);
 }
 
-void LLFloater::setTitleVisible(bool visible)
-{
-	if (mDragHandle)
-		mDragHandle->setTitleVisible(visible);
-}
-
 // Change the draw style to account for the foreground state.
 void LLFloater::setForeground(BOOL front)
 {
 
 BOOL LLFloater::isFrontmost()
 {
-	return gFloaterView && gFloaterView->getFrontmost() == this && getVisible();
+	LLFloaterView* floater_view = getParentByType<LLFloaterView>();
+	return getVisible()
+			&& (floater_view 
+				&& floater_view->getFrontmost() == this);
 }
 
 void LLFloater::addDependentFloater(LLFloater* floaterp, BOOL reposition)
 		if(offerClickToButton(x, y, mask, BUTTON_CLOSE)) return TRUE;
 		if(offerClickToButton(x, y, mask, BUTTON_RESTORE)) return TRUE;
 		if(offerClickToButton(x, y, mask, BUTTON_TEAR_OFF)) return TRUE;
+		if(offerClickToButton(x, y, mask, BUTTON_DOCK)) return TRUE;
 
 		// Otherwise pass to drag handle for movement
 		return mDragHandle->handleMouseDown(x, y, mask);
 	{
 		mDocked = docked;
 		mButtonsEnabled[BUTTON_DOCK] = !mDocked;
+
+		if (mDocked)
+		{
+			setMinimized(FALSE);
+			mOpenPositioning = LLFloaterEnums::OPEN_POSITIONING_NONE;
+		}
+
 		updateTitleButtons();
 
 		storeDockStateControl();
 		{
 			drawChild(mButtons[i]);
 		}
-		drawChild(mDragHandle);
+		drawChild(mDragHandle, 0, 0, TRUE);
 	}
 	else
 	{
 	mHeaderHeight = p.header_height;
 	mLegacyHeaderHeight = p.legacy_header_height;
 	mSingleInstance = p.single_instance;
+	mReuseInstance = p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance;
 
 	mOpenPositioning = p.open_positioning;
 	mSpecifiedLeft = p.specified_left;
 	{
 		setCloseCallback(initCommitCallback(p.close_callback));
 	}
+
+	if (mDragHandle)
+	{
+		mDragHandle->setTitleVisible(p.show_title);
+	}
 }
 
 boost::signals2::connection LLFloater::setMinimizeCallback( const commit_signal_t::slot_type& cb ) 
 
 	next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, getRect().getWidth(), getRect().getHeight());
 	
-	mRectControl.clear(); // don't save rect of stacked floaters
 	setShape(next_rect);
 }
 

indra/llui/llfloater.h

 	{
 		OPEN_POSITIONING_NONE,
 		OPEN_POSITIONING_CASCADING,
+		OPEN_POSITIONING_CASCADE_GROUP,
 		OPEN_POSITIONING_CENTERED,
 		OPEN_POSITIONING_SPECIFIED,
-
 		OPEN_POSITIONING_COUNT
 	};
 }
 								short_title;
 		
 		Optional<bool>			single_instance,
+								reuse_instance,
 								can_resize,
 								can_minimize,
 								can_close,
 								save_rect,
 								save_visibility,
 								save_dock_state,
-								can_dock;
+								can_dock,
+								show_title;
 		
 		Optional<LLFloaterEnums::EOpenPositioning>	open_positioning;
 		Optional<S32>								specified_left;
 	std::string		getTitle() const;
 	void			setShortTitle( const std::string& short_title );
 	std::string		getShortTitle() const;
-	void			setTitleVisible(bool visible);
 	virtual void	setMinimized(BOOL b);
 	void			moveResizeHandlesToFront();
 	void			addDependentFloater(LLFloater* dependent, BOOL reposition = TRUE);
 	LLUIString		mShortTitle;
 	
 	BOOL			mSingleInstance;	// TRUE if there is only ever one instance of the floater
+	bool			mReuseInstance;		// true if we want to hide the floater when we close it instead of destroying it
 	std::string		mInstanceName;		// Store the instance name so we can remove ourselves from the list
 	
 	BOOL			mCanTearOff;

indra/llui/llfloaterreg.cpp

 				res->setInstanceName(name);
 
 				LLFloater *last_floater = (list.empty() ? NULL : list.back());
+
 				res->applyControlsAndPosition(last_floater);
 
 				gFloaterView->adjustToFitScreen(res, false);
 	else if (instance->isMinimized())
 	{
 		instance->setMinimized(FALSE);
-		instance->setFocus(TRUE);
+		instance->setVisibleAndFrontmost();
 	}
 	else if (!instance->isShown())
 	{
 		instance->openFloater(key);
-		instance->setFocus(TRUE);
+		instance->setVisibleAndFrontmost();
 	}
-	else if (!instance->hasFocus() && !instance->getIsChrome())
+	else if (!instance->isFrontmost())
 	{
-		instance->setFocus(TRUE);
+		instance->setVisibleAndFrontmost();
 	}
 	else
 	{

indra/llui/lllayoutstack.cpp

 //
 // LLLayoutPanel
 //
+LLLayoutPanel::Params::Params()	
+:	expanded_min_dim("expanded_min_dim", 0),
+	min_dim("min_dim", 0),
+	max_dim("max_dim", S32_MAX),
+	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::LLLayoutPanel(const Params& p)	
 :	LLPanel(p),
 	mExpandedMinDimSpecified(false),
 	// not enough room to fit existing contents
 	if (force_resize == FALSE
 		// layout did not complete by reaching target position
-		&& ((mOrientation == VERTICAL && cur_y != -mPanelSpacing)
-			|| (mOrientation == HORIZONTAL && cur_x != getRect().getWidth() + mPanelSpacing)))
+		&& ((mOrientation == VERTICAL && llround(cur_y) != -mPanelSpacing)
+			|| (mOrientation == HORIZONTAL && llround(cur_x) != getRect().getWidth() + mPanelSpacing)))
 	{
 		// do another layout pass with all stacked elements contributing
 		// even those that don't usually resize

indra/llui/lllayoutstack.h

 		Optional<bool>			user_resize,
 								auto_resize;
 
-		Params()
-		:	expanded_min_dim("expanded_min_dim", 0),
-			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");
-		}
+		Params();
 	};
 
 	~LLLayoutPanel();

indra/llui/lltabcontainer.cpp

 	}
 
 	S32 tab_count = getTabCount();
-	if (tab_count > 0)
+	if (tab_count > 0 && !getTabsHidden())
 	{
 		LLTabTuple* firsttuple = getTab(0);
 		LLRect tab_rect;
 		if (mIsVertical)
 		{
 			tab_rect = LLRect(firsttuple->mButton->getRect().mLeft,
-							  has_scroll_arrows ? mPrevArrowBtn->getRect().mBottom - tabcntrv_pad : mPrevArrowBtn->getRect().mTop,
-							  firsttuple->mButton->getRect().mRight,
-							  has_scroll_arrows ? mNextArrowBtn->getRect().mTop + tabcntrv_pad : mNextArrowBtn->getRect().mBottom );
+								has_scroll_arrows ? mPrevArrowBtn->getRect().mBottom - tabcntrv_pad : mPrevArrowBtn->getRect().mTop,
+								firsttuple->mButton->getRect().mRight,
+								has_scroll_arrows ? mNextArrowBtn->getRect().mTop + tabcntrv_pad : mNextArrowBtn->getRect().mBottom );
 		}
 		else
 		{
 			tab_rect = LLRect(has_scroll_arrows ? mPrevArrowBtn->getRect().mRight : mJumpPrevArrowBtn->getRect().mLeft,
-							  firsttuple->mButton->getRect().mTop,
-							  has_scroll_arrows ? mNextArrowBtn->getRect().mLeft : mJumpNextArrowBtn->getRect().mRight,
-							  firsttuple->mButton->getRect().mBottom );
+								firsttuple->mButton->getRect().mTop,
+								has_scroll_arrows ? mNextArrowBtn->getRect().mLeft : mJumpNextArrowBtn->getRect().mRight,
+								firsttuple->mButton->getRect().mBottom );
 		}
 		if( tab_rect.pointInRect( x, y ) )
 		{
 {
 	static LLUICachedControl<S32> tabcntrv_pad ("UITabCntrvPad", 0);
 	BOOL handled = LLPanel::handleToolTip( x, y, mask);
-	if (!handled && getTabCount() > 0) 
+	if (!handled && getTabCount() > 0 && !getTabsHidden()) 
 	{
 		LLTabTuple* firsttuple = getTab(0);
 
 {
 	BOOL has_scroll_arrows = (getMaxScrollPos() > 0);
 
-	if( mDragAndDropDelayTimer.getStarted() && mDragAndDropDelayTimer.getElapsedTimeF32() > SCROLL_DELAY_TIME )
+	if( !getTabsHidden()
+		&& mDragAndDropDelayTimer.getStarted() 
+		&& mDragAndDropDelayTimer.getElapsedTimeF32() > SCROLL_DELAY_TIME )
 	{
 		if (has_scroll_arrows)
 		{

indra/llui/lltoolbar.cpp

 	if ((rank >= mButtonCommands.size()) || (rank == RANK_NONE))
 	{
 		// In that case, back load
-		mButtonCommands.push_back(commandId);
+		mButtonCommands.push_back(command->id());
 		mButtons.push_back(button);
 	}
 	else 
 			rank--;
 		}
 		// ...then insert
-		mButtonCommands.insert(it_command,commandId);
+		mButtonCommands.insert(it_command, command->id());
 		mButtons.insert(it_button,button);
 	}
 
 		command_id_map::iterator it = mButtonMap.find(commandId.uuid());
 		if (it != mButtonMap.end())
 		{
-			it->second->setEnabled(enabled);
+			command_button = it->second;
+			command_button->setEnabled(enabled);
+		}
+	}
+
+	return (command_button != NULL);
+}
+
+bool LLToolBar::stopCommandInProgress(const LLCommandId& commandId)
+{
+	//
+	// Note from Leslie:
+	//
+	// This implementation was largely put in place to handle EXP-1348 which is related to
+	// dragging and dropping the "speak" button.  The "speak" button can be in one of two
+	// modes, i.e., either a toggle action or a push-to-talk action.  Because of this it
+	// responds to mouse down and mouse up in different ways, based on which behavior the
+	// button is currently set to obey.  This was the simplest way of getting the button
+	// to turn off the microphone for both behaviors without risking duplicate state.
+	//
+
+	LLToolBarButton * command_button = NULL;
+
+	if (commandId != LLCommandId::null)
+	{
+		LLCommand* command = LLCommandManager::instance().getCommand(commandId);
+		llassert(command);
+
+		// If this command has an explicit function for execution stop
+		if (command->executeStopFunctionName().length() > 0)
+		{
+			command_id_map::iterator it = mButtonMap.find(commandId.uuid());
+			if (it != mButtonMap.end())
+			{
+				command_button = it->second;
+				llassert(command_button->mIsRunningSignal);
+
+				// Check to see if it is running
+				if ((*command_button->mIsRunningSignal)(command_button, command->isRunningParameters()))
+				{
+					// Trigger an additional button commit, which calls mouse down, mouse up and commit
+					command_button->onCommit();
+				}
+			}
 		}
 	}
 
 	if (!commandp) return NULL;
 
 	LLToolBarButton::Params button_p;
-	button_p.name = id.name();
+	button_p.name = commandp->name();
 	button_p.label = LLTrans::getString(commandp->labelRef());
 	button_p.tool_tip = LLTrans::getString(commandp->tooltipRef());
 	button_p.image_overlay = LLUI::getUIImage(commandp->icon());
 	{
 		if (!mIsDragged)
 		{
-			mStartDragItemCallback(x,y,mId.uuid());
+			mStartDragItemCallback(x, y, this);
 			mIsDragged = true;
 			handled = TRUE;
 		}
 		else 
 		{
-			handled = mHandleDragItemCallback(x,y,mId.uuid(),LLAssetType::AT_WIDGET);
+			handled = mHandleDragItemCallback(x, y, mId.uuid(), LLAssetType::AT_WIDGET);
 		}
 	}
 	else

indra/llui/lltoolbar.h

 #include "llassettype.h"
 
 class LLToolBar;
+class LLToolBarButton;
 
-typedef boost::function<void (S32 x, S32 y, const LLUUID& uuid)> tool_startdrag_callback_t;
+typedef boost::function<void (S32 x, S32 y, LLToolBarButton* button)> tool_startdrag_callback_t;
 typedef boost::function<BOOL (S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type)> tool_handledrag_callback_t;
 typedef boost::function<BOOL (void* data, S32 x, S32 y, LLToolBar* toolbar)> tool_handledrop_callback_t;
 
 	int  removeCommand(const LLCommandId& commandId);		// Returns the rank the removed command was at, RANK_NONE if not found
 	bool hasCommand(const LLCommandId& commandId) const;
 	bool enableCommand(const LLCommandId& commandId, bool enabled);
+	bool stopCommandInProgress(const LLCommandId& commandId);
 
 	void setStartDragCallback(tool_startdrag_callback_t cb)   { mStartDragItemCallback  = cb; }
 	void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; }

indra/llui/llview.cpp

 
 // XDATA might be MASK, or S32 clicks
 template <typename METHOD, typename XDATA>
-LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra)
+LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra, bool allow_mouse_block)
 {
 	BOOST_FOREACH(LLView* viewp, mChildList)
 	{
 		}
 
 		if ((viewp->*method)( local_x, local_y, extra )
-			|| viewp->blockMouseEvent( local_x, local_y ))
+			|| (allow_mouse_block && viewp->blockMouseEvent( local_x, local_y )))
 		{
 			viewp->logMouseEvent();
 			return viewp;
 
 LLView* LLView::childrenHandleScrollWheel(S32 x, S32 y, S32 clicks)
 {
-	return childrenHandleMouseEvent(&LLView::handleScrollWheel, x, y, clicks);
+	return childrenHandleMouseEvent(&LLView::handleScrollWheel, x, y, clicks, false);
 }
 
 // Called during downward traversal

indra/llui/llview.h

 private:
 
 	template <typename METHOD, typename XDATA>
-	LLView* childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra);
+	LLView* childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra, bool allow_mouse_block = true);
 
 	template <typename METHOD, typename CHARTYPE>
 	LLView* childrenHandleCharEvent(const std::string& desc, const METHOD& method,

indra/llxuixml/llinitparam.h

 					if (parser.readValue(name))
 					{
 						// try to parse a per type named value
-						if (name_value_lookup_t::getValueFromName(name, typed_param.mValues))
+						if (name_value_lookup_t::getValueFromName(name, value))
 						{
 							typed_param.add(value);
 							typed_param.mValues.back().setValueName(name);
 					bool value_written = parser.writeValue(*it, name_stack);
 					if (!value_written)
 					{
-						std::string calculated_key = typed_param.calcValueName(typed_param.getValue());
+						std::string calculated_key = it->calcValueName(key);
 						if (!parser.writeValue(calculated_key, name_stack))
 						{
 							break;

indra/llxuixml/llxuiparser.cpp

 static 	LLInitParam::Parser::parser_write_func_map_t sXSDWriteFuncs;
 static 	LLInitParam::Parser::parser_inspect_func_map_t sXSDInspectFuncs;
 
+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;
+
+const char* NO_VALUE_MARKER = "no_value";
+
+const S32 LINE_NUMBER_HERE = 0;
+
 struct MaxOccur : public LLInitParam::ChoiceBlock<MaxOccur>
 {
 	Alternative<int> count;
 
 	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;
-
-const char* NO_VALUE_MARKER = "no_value";
-
 LLSimpleXUIParser::LLSimpleXUIParser(LLSimpleXUIParser::element_start_callback_t element_cb)
 :	Parser(sSimpleXUIReadFuncs, sSimpleXUIWriteFuncs, sSimpleXUIInspectFuncs),
 	mCurReadDepth(0),
 	self->characterData(s, len);
 }
 
+void LLSimpleXUIParser::characterData(const char *s, int len)
+{
+	mTextContents += std::string(s, len);
+}
+
 void LLSimpleXUIParser::startElement(const char *name, const char **atts)
 {
 	processText();
 
 }
 
+void LLSimpleXUIParser::endElement(const char *name)
+{
+	bool has_text = processText();
+
+	// no text, attributes, or children
+	if (!has_text && mEmptyLeafNode.back())
+	{
+		// submit this as a valueless name (even though there might be text contents we haven't seen yet)
+		mCurAttributeValueBegin = NO_VALUE_MARKER;
+		mOutputStack.back().first->submitValue(mNameStack, *this, mParseSilently);
+	}
+
+	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)
+	{
+		mNameStack.pop_back();
+	}
+	mScope.pop_back();
+	mEmptyLeafNode.pop_back();
+}
+
 bool LLSimpleXUIParser::readAttributes(const char **atts)
 {
 	typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
 	return false;
 }
 
-void LLSimpleXUIParser::endElement(const char *name)
-{
-	bool has_text = processText();
-
-	// no text, attributes, or children
-	if (!has_text && mEmptyLeafNode.back())
-	{
-		// submit this as a valueless name (even though there might be text contents we haven't seen yet)
-		mCurAttributeValueBegin = NO_VALUE_MARKER;
-		mOutputStack.back().first->submitValue(mNameStack, *this, mParseSilently);
-	}
-
-	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)
-	{
-		mNameStack.pop_back();
-	}
-	mScope.pop_back();
-	mEmptyLeafNode.pop_back();
-}
-
-void LLSimpleXUIParser::characterData(const char *s, int len)
-{
-	mTextContents += std::string(s, len);
-}
-
-
 /*virtual*/ std::string LLSimpleXUIParser::getCurrentElementName()
 {
 	std::string full_name;
 	return full_name;
 }
 
-const S32 LINE_NUMBER_HERE = 0;
-
 void LLSimpleXUIParser::parserWarning(const std::string& message)
 {
 #ifdef LL_WINDOWS

indra/newview/app_settings/commands.xml

            is_running_function="Floater.IsOpen"
            is_running_parameters="about_land"
            />
-  <command name="appearance"
+  <command name="appearance"  
            available_in_toybox="true"
            icon="Command_Appearance_Icon"
            label_ref="Command_Appearance_Label"

indra/newview/app_settings/settings.xml

     <key>Type</key>
     <string>Boolean</string>
     <key>Value</key>
-    <integer>0</integer>
+    <integer>1</integer>
   </map>
     <key>Cursor3D</key>
     <map>

indra/newview/llagent.cpp

 	}
 	else if (param == "speak")
 	{
-		if ( gAgent.isVoiceConnected() )
+		if ( gAgent.isVoiceConnected() && 
+			LLViewerParcelMgr::getInstance()->allowAgentVoice() &&
+				! LLVoiceClient::getInstance()->inTuningMode() )
 		{
 			retval = true;
 		}
 	mListener.reset(new LLAgentListener(*this));
 
 	mMoveTimer.stop();
-
-	LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLAgent::parcelChangedCallback));
-
-	LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsActionAllowed", boost::bind(&LLAgent::isActionAllowed, _2));
-	LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.PressMicrophone", boost::bind(&LLAgent::pressMicrophone, _2));
-	LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.ReleaseMicrophone", boost::bind(&LLAgent::releaseMicrophone, _2));
-	LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsMicrophoneOn", boost::bind(&LLAgent::isMicrophoneOn, _2));
 }
 
 // Requires gSavedSettings to be initialized.
 
 	gSavedSettings.getControl("PreferredMaturity")->getValidateSignal()->connect(boost::bind(&LLAgent::validateMaturity, this, _2));
 	gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLAgent::handleMaturity, this, _2));
+
+	LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLAgent::parcelChangedCallback));
+
+	LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsActionAllowed", boost::bind(&LLAgent::isActionAllowed, _2));
+	LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.PressMicrophone", boost::bind(&LLAgent::pressMicrophone, _2));
+	LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.ReleaseMicrophone", boost::bind(&LLAgent::releaseMicrophone, _2));
+	LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsMicrophoneOn", boost::bind(&LLAgent::isMicrophoneOn, _2));
+
 	
 	mInitialized = TRUE;
 }

indra/newview/llappviewer.cpp

 #include "llweb.h"
 #include "llsecondlifeurls.h"
 #include "llupdaterservice.h"
+#include "llcallfloater.h"
 
 // Linden library includes
 #include "llavatarnamecache.h"
 #include <boost/foreach.hpp>
 
 
+
 #if LL_WINDOWS
 #	include <share.h> // For _SH_DENYWR in initMarkerFile
 #else
 
 	LLVoiceChannel::initClass();
 	LLVoiceClient::getInstance()->init(gServicePump);
+	LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLCallFloater::sOnCurrentChannelChanged, _1), true);
 	LLTimer frameTimer,idleTimer;
 	LLTimer debugTime;
 	LLViewerJoystick* joystick(LLViewerJoystick::getInstance());

indra/newview/llcallfloater.cpp

 #include "llparticipantlist.h"
 #include "llspeakers.h"
 #include "lltextutil.h"
+#include "lltransientfloatermgr.h"
 #include "llviewercontrol.h"
 #include "llviewerdisplayname.h"
 #include "llviewerwindow.h"
 LLVoiceChannel* LLCallFloater::sCurrentVoiceChannel = NULL;
 
 LLCallFloater::LLCallFloater(const LLSD& key)
-: LLFloater(key)
+: LLTransientDockableFloater(NULL, false, key)
 , mSpeakerManager(NULL)
 , mParticipants(NULL)
 , mAvatarList(NULL)
 
 	mFactoryMap["non_avatar_caller"] = LLCallbackMap(create_non_avatar_caller, NULL);
 	LLVoiceClient::instance().addObserver(this);
+	LLTransientFloaterMgr::getInstance()->addControlView(this);
 
 	// update the agent's name if display name setting change
 	LLAvatarNameCache::addUseDisplayNamesCallback(boost::bind(&LLCallFloater::updateAgentModeratorState, this));
 	{
 		LLVoiceClient::getInstance()->removeObserver(this);
 	}
+	LLTransientFloaterMgr::getInstance()->removeControlView(this);
 }
 
 // virtual
 
 	connectToChannel(LLVoiceChannel::getCurrentVoiceChannel());
 
-	setIsChrome(true);
-	//chrome="true" hides floater caption 
-	if (mDragHandle)
-		mDragHandle->setTitleVisible(TRUE);
 	updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730)
 	
 	updateSession();

indra/newview/llcallfloater.h

 #ifndef LL_LLCALLFLOATER_H
 #define LL_LLCALLFLOATER_H
 
-#include "llfloater.h"
+#include "lltransientdockablefloater.h"
 #include "llvoicechannel.h"
 #include "llvoiceclient.h"
 
  * When the Resident is engaged in any chat except Nearby Chat, the Voice Control Panel
  * also provides a 'Leave Call' button to allow the Resident to leave that voice channel.
  */
-class LLCallFloater : public LLFloater, LLVoiceClientParticipantObserver
+class LLCallFloater : public LLTransientDockableFloater, LLVoiceClientParticipantObserver
 {
 public:
 
 	 */
 	static LLVoiceChannel* sCurrentVoiceChannel;
 
+	/* virtual */
+	LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::IM; }
+
 	boost::signals2::connection mVoiceChannelStateChangeConnection;
 };
 

indra/newview/lldebugview.cpp

 	gTextureCategoryView = NULL;
 }
 
+void LLDebugView::draw()
+{
+	LLView* floater_snap_region = getRootView()->getChildView("floater_snap_region");
+	LLRect debug_rect;
+	floater_snap_region->localRectToOtherView(floater_snap_region->getLocalRect(), &debug_rect, getParent());
+
+	setShape(debug_rect);
+	LLView::draw();
+}

indra/newview/lldebugview.h

 	~LLDebugView();
 
 	void init();
+	void draw();
 
 	void setStatsVisible(BOOL visible);
 	

indra/newview/llfloatercamera.cpp

 	mPrevMode(CAMERA_CTRL_MODE_PAN)
 {
 	LLHints::registerHintTarget("view_popup", LLView::getHandle());
+	mCommitCallbackRegistrar.add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraItem, _2));
 }
 
 // virtual
 BOOL LLFloaterCamera::postBuild()
 {
-	setIsChrome(TRUE);
-	setTitleVisible(TRUE); // restore title visibility after chrome applying
 	updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730)
 
 	mRotate = getChild<LLJoystickCameraRotate>(ORBIT);

indra/newview/llfloaterhud.cpp

 		return;
 	}
 	
-	// Don't grab the focus as it will impede performing in-world actions
-	// while using the HUD
-	setIsChrome(TRUE);
-
-	// Chrome doesn't show the window title by default, but here we
-	// want to show it.
-	setTitleVisible(true);
-	
 	// Opaque background since we never get the focus
 	setBackgroundOpaque(TRUE);
 }

indra/newview/llfloaterinventory.cpp

 {
 	//LLFirstUse::useInventory();
 }
+
+void LLFloaterInventory::onClose(bool app_quitting)
+{
+	LLFloater::onClose(app_quitting);
+	if (mKey.asInteger() > 1)
+	{
+		destroy();
+	}
+}

indra/newview/llfloaterinventory.h

 
 	// Inherited functionality
 	/*virtual*/ void onOpen(const LLSD& key);
+	/*virtual*/ void onClose(bool app_quitting);
 
 	LLInventoryPanel* getPanel();
 	LLPanelMainInventory* getMainInventoryPanel() { return mPanelMainInventory;}

indra/newview/llfloatermap.cpp

 	// Get the drag handle all the way in back
 	sendChildToBack(getDragHandle());
 
-	//setIsChrome(TRUE);
-	//getDragHandle()->setTitleVisible(TRUE);
-	
 	// keep onscreen
 	gFloaterView->adjustToFitScreen(this, FALSE);
 

indra/newview/llfloatersounddevices.cpp

 {
 	LLTransientDockableFloater::postBuild();
 
-	setIsChrome(TRUE);
-	if (mDragHandle)
-		mDragHandle->setTitleVisible(TRUE);
 	updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730)
 
 	LLPanelVoiceDeviceSettings* panel = findChild<LLPanelVoiceDeviceSettings>("device_settings_panel");

indra/newview/llfloatertoybox.cpp

 
 LLFloaterToybox::LLFloaterToybox(const LLSD& key)
 	: LLFloater(key)
-	, mBtnRestoreDefaults(NULL)
 	, mToolBar(NULL)
 {
 	mCommitCallbackRegistrar.add("Toybox.RestoreDefaults", boost::bind(&LLFloaterToybox::onBtnRestoreDefaults, this));
 
 BOOL LLFloaterToybox::postBuild()
 {	
-	mBtnRestoreDefaults = getChild<LLButton>("btn_restore_defaults");
 	mToolBar = getChild<LLToolBar>("toybox_toolbar");
+
 	mToolBar->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3));
 	mToolBar->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4));
 	mToolBar->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4));
 	
-	LLCommandManager& cmdMgr = LLCommandManager::instance();
-
 	//
 	// Sort commands by localized labels so they will appear alphabetized in all languages
 	//
 
 	std::list<LLCommand *> alphabetized_commands;
 
+	LLCommandManager& cmdMgr = LLCommandManager::instance();
 	for (U32 i = 0; i < cmdMgr.commandCount(); i++)
 	{
 		LLCommand * command = cmdMgr.getCommand(i);

indra/newview/llfloatertoybox.h

 	void onBtnRestoreDefaults();
 
 public:
-	LLButton *	mBtnRestoreDefaults;
 	LLToolBar *	mToolBar;
 };
 

indra/newview/llhudeffectblob.cpp

 {
 }
 
+void LLHUDEffectBlob::markDead()
+{
+	mImage = NULL;
+
+	LLHUDEffect::markDead();
+}
+
 void LLHUDEffectBlob::render()
 {
 	F32 time = mTimer.getElapsedTimeF32();
 	if (mDuration < time)
 	{
 		markDead();
+		return;
 	}
 
 	LLVector3 pos_agent = gAgent.getPosAgentFromGlobal(mPositionGlobal);

indra/newview/llhudeffectblob.h

 public:
 	friend class LLHUDObject;
 
+	void markDead();
+
 	void setPixelSize(S32 pixels) { mPixelSize = pixels; }
 
 protected:

indra/newview/llnearbychat.cpp

 //static 
 void LLNearbyChat::processChatHistoryStyleUpdate(const LLSD& newvalue)
 {
-	//LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
-	//if(nearby_chat)
-	//	nearby_chat->updateChatHistoryStyle();
+	LLFloater* chat_bar = LLFloaterReg::getInstance("chat_bar");
+	LLNearbyChat* nearby_chat = chat_bar->findChild<LLNearbyChat>("nearby_chat");
+	if(nearby_chat)
+		nearby_chat->updateChatHistoryStyle();
 }
 
 bool isWordsName(const std::string& name)

indra/newview/llnearbychatbar.cpp

 S32 LLNearbyChatBar::sLastSpecialChatChannel = 0;
 
 const S32 EXPANDED_HEIGHT = 300;
+const S32 COLLAPSED_HEIGHT = 60;
+const S32 EXPANDED_MIN_HEIGHT = 150;
 
 // legacy callback glue
 void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel);
 	// Register for font change notifications
 	LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChatBar::onChatFontChange, this, _1));
 
-	mExpandedHeight = getMinHeight() + EXPANDED_HEIGHT;
+	mExpandedHeight = COLLAPSED_HEIGHT + EXPANDED_HEIGHT;
 
 	enableResizeCtrls(true, true, false);
 
 bool LLNearbyChatBar::applyRectControl()
 {
 	bool rect_controlled = LLFloater::applyRectControl();
+
+	LLView* nearby_chat = getChildView("nearby_chat");	
+	if (!nearby_chat->getVisible())
+	{
+		reshape(getRect().getWidth(), getMinHeight());
+		enableResizeCtrls(true, true, false);
+	}
+	else
+	{
+		enableResizeCtrls(true);
+		setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT);
+	}
 	
-	if (getRect().getHeight() > getMinHeight())
-	{
-		getChildView("nearby_chat")->setVisible(true);
-		mExpandedHeight = getRect().getHeight();
-		enableResizeCtrls(true);
-	}
-
 	return rect_controlled;
 }
 
 	if (nearby_chat->getVisible())
 	{
 		mExpandedHeight = getRect().getHeight();
+		setResizeLimits(getMinWidth(), COLLAPSED_HEIGHT);
 		nearby_chat->setVisible(FALSE);
-		reshape(getRect().getWidth(), getMinHeight());
+		reshape(getRect().getWidth(), COLLAPSED_HEIGHT);
 		enableResizeCtrls(true, true, false);
+		storeRectControl();
 	}
 	else
 	{
 		nearby_chat->setVisible(TRUE);
+		setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT);
 		reshape(getRect().getWidth(), mExpandedHeight);
 		enableResizeCtrls(true);
+		storeRectControl();
 	}
 }
 

indra/newview/llpanelteleporthistory.cpp

 {
 	LLTeleportHistoryFlatItemStorage::instance().purge();
 	delete mGearMenuHandle.get();
+	mTeleportHistoryChangedConnection.disconnect();
 }
 
 BOOL LLTeleportHistoryPanel::postBuild()
 			// tab_boundary_date would be earliest possible date for this tab
 			S32 tab_idx = 0;
 			getNextTab(date, tab_idx, tab_boundary_date);
+			tab_idx = mItemContainers.size() - 1 - tab_idx;
+			if (tab_idx >= 0)
+			{
+				LLAccordionCtrlTab* tab = mItemContainers.get(tab_idx);
+				tab->setVisible(true);
 
-			LLAccordionCtrlTab* tab = mItemContainers.get(mItemContainers.size() - 1 - tab_idx);
-			tab->setVisible(true);
+				// Expand all accordion tabs when filtering
+				if(!sFilterSubString.empty())
+				{
+					//store accordion tab state when filter is not empty
+					tab->notifyChildren(LLSD().with("action","store_state"));
+				
+					tab->setDisplayChildren(true);
+				}
+				// Restore each tab's expand state when not filtering
+				else
+				{
+					bool collapsed = isAccordionCollapsedByUser(tab);
+					tab->setDisplayChildren(!collapsed);
+			
+					//restore accordion state after all those accodrion tabmanipulations
+					tab->notifyChildren(LLSD().with("action","restore_state"));
+				}
 
-			// Expand all accordion tabs when filtering
-			if(!sFilterSubString.empty())
-			{
-				//store accordion tab state when filter is not empty
-				tab->notifyChildren(LLSD().with("action","store_state"));
-				
-				tab->setDisplayChildren(true);
+				curr_flat_view = getFlatListViewFromTab(tab);
 			}
-			// Restore each tab's expand state when not filtering
-			else
-			{
-				bool collapsed = isAccordionCollapsedByUser(tab);
-				tab->setDisplayChildren(!collapsed);
-				
-				//restore accordion state after all those accodrion tabmanipulations
-				tab->notifyChildren(LLSD().with("action","restore_state"));
-			}
-
-			curr_flat_view = getFlatListViewFromTab(tab);
 		}
 
 		if (curr_flat_view)
 void LLTeleportHistoryPanel::replaceItem(S32 removed_index)
 {
 	// Flat list for 'Today' (mItemContainers keeps accordion tabs in reverse order)
-	LLFlatListView* fv = getFlatListViewFromTab(mItemContainers[mItemContainers.size() - 1]);
+	LLFlatListView* fv = NULL;
+	
+	if (mItemContainers.size() > 0)
+	{
+		fv = getFlatListViewFromTab(mItemContainers[mItemContainers.size() - 1]);
+	}
 
 	// Empty flat list for 'Today' means that other flat lists are empty as well,
 	// so all items from teleport history should be added.
 
 	// Starting to add items from last one, in reverse order,
 	// since TeleportHistory keeps most recent item at the end
+	if (!mTeleportHistory)
+	{
+		mTeleportHistory = LLTeleportHistoryStorage::getInstance();
+	}
+
 	mCurrentItem = mTeleportHistory->getItems().size() - 1;
 
 	for (S32 n = mItemContainers.size() - 1; n >= 0; --n)
 	{
 		LLAccordionCtrlTab* tab = mItemContainers.get(n);
-		tab->setVisible(false);
+		if (tab)
+		{
+			tab->setVisible(false);
 
-		LLFlatListView* fv = getFlatListViewFromTab(tab);
-		if (fv)
-		{
-			// Detached panels are managed by LLTeleportHistoryFlatItemStorage
-			std::vector<LLPanel*> detached_items;
-			fv->detachItems(detached_items);
+			LLFlatListView* fv = getFlatListViewFromTab(tab);
+			if (fv)
+			{
+				// Detached panels are managed by LLTeleportHistoryFlatItemStorage
+				std::vector<LLPanel*> detached_items;
+				fv->detachItems(detached_items);
+			}
 		}
 	}
 }

indra/newview/llteleporthistory.cpp

 LLTeleportHistory::LLTeleportHistory():
 	mCurrentItem(-1),
 	mRequestedItem(-1),
-	mGotInitialUpdate(false)
+	mGotInitialUpdate(false),
+	mTeleportHistoryStorage(NULL)
 {
 	mTeleportFinishedConn = LLViewerParcelMgr::getInstance()->
 		setTeleportFinishedCallback(boost::bind(&LLTeleportHistory::updateCurrentLocation, this, _1));
 
 void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
 {
+	if (!mTeleportHistoryStorage)
+	{
+		mTeleportHistoryStorage = LLTeleportHistoryStorage::getInstance();
+	}
 	if (mRequestedItem != -1) // teleport within the history in progress?
 	{
 		mCurrentItem = mRequestedItem;
 		if (mCurrentItem < 0 || mCurrentItem >= (int) mItems.size()) // sanity check
 		{
 			llwarns << "Invalid current item. (this should not happen)" << llendl;
-			llassert(!"Invalid current teleport histiry item");
+			llassert(!"Invalid current teleport history item");
 			return;
 		}
 		LLVector3 new_pos_local = gAgent.getPosAgentFromGlobal(new_pos);

indra/newview/llteleporthistory.h

 #include <string>
 #include <boost/function.hpp>
 #include <boost/signals2.hpp>
+#include "llteleporthistorystorage.h"
 
 
 /**
 	 */
 	bool					mGotInitialUpdate;
 	
+	LLTeleportHistoryStorage*	mTeleportHistoryStorage;
+
 	/**
 	 * Signal emitted when the history gets changed.
 	 * 

indra/newview/llteleporthistorystorage.cpp

 LLTeleportHistoryStorage::LLTeleportHistoryStorage() :
 	mFilename("teleport_history.txt")
 {
+	mItems.clear();
 	LLTeleportHistory *th = LLTeleportHistory::getInstance();
 	if (th)
 		th->setHistoryChangedCallback(boost::bind(&LLTeleportHistoryStorage::onTeleportHistoryChange, this));	

indra/newview/llteleporthistorystorage.h

 	void removeItem(S32 idx);
 
 	void save();
-	void load();
-
-	void dump() const;
 
 	/**
 	 * Set a callback to be called upon history changes.
 
 private:
 
+	void load();
+	void dump() const;
+	
 	void onTeleportHistoryChange();
 	bool compareByTitleAndGlobalPos(const LLTeleportHistoryPersistentItem& a, const LLTeleportHistoryPersistentItem& b);
 

indra/newview/lltoastnotifypanel.cpp

 		sFont = LLFontGL::getFontSansSerif();
 		sFontSmall = LLFontGL::getFontSansSerifSmall();
 	}
-	// clicking on a button does not steal current focus
-	setIsChrome(TRUE);
 	// initialize
 	setFocusRoot(!mIsTip);
 	// get a form for the notification

indra/newview/lltoolbarview.cpp

 
 #include "lltoolbarview.h"
 
+#include "llappviewer.h"
 #include "lldir.h"
 #include "llxmlnode.h"
 #include "lltoolbar.h"
 #include "lltooldraganddrop.h"
 #include "llclipboard.h"
 
+#include "llagent.h"  // HACK for destinations guide on startup
+#include "llfloaterreg.h"  // HACK for destinations guide on startup
+#include "llviewercontrol.h"  // HACK for destinations guide on startup
+
 #include <boost/foreach.hpp>
 
 LLToolBarView* gToolBarView = NULL;
 
 static LLDefaultChildRegistry::Register<LLToolBarView> r("toolbar_view");
 
+void handleLoginToolbarSetup();
+
 bool isToolDragged()
 {
 	return (LLToolDragAndDrop::getInstance()->getSource() == LLToolDragAndDrop::SOURCE_VIEWER);
 :	LLUICtrl(p),
 	mToolbarLeft(NULL),
 	mToolbarRight(NULL),
-	mToolbarBottom(NULL)
+	mToolbarBottom(NULL),
+	mDragStarted(false),
+	mDragToolbarButton(NULL)
 {
 }
 
 	mToolbarBottom->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3));
 	mToolbarBottom->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4));
 	mToolbarBottom->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4));
+
+	LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&handleLoginToolbarSetup));
 	
 	return TRUE;
 }
 	}
 	else 
 	{
-		llwarns	<< "Toolbars creation : the command " << command.name() << " cannot be found in the command manager" << llendl;
+		llwarns	<< "Toolbars creation : the command with id " << command.uuid().asString() << " cannot be found in the command manager" << llendl;
 		return false;
 	}
 	return true;
 			LLToolBarEnums::ButtonType button_type = toolbar_set.left_toolbar.button_display_mode;
 			mToolbarLeft->setButtonType(button_type);
 		}
-		BOOST_FOREACH(LLCommandId::Params& command, toolbar_set.left_toolbar.commands)
+		BOOST_FOREACH(const LLCommandId::Params& command_name_param, toolbar_set.left_toolbar.commands)
 		{
-			addCommand(LLCommandId(command),mToolbarLeft);
+			if (addCommand(LLCommandId(command_name_param), mToolbarLeft) == false)
+			{
+				llwarns << "Error adding command '" << command_name_param.name() << "' to left toolbar." << llendl;
+			}
 		}
 	}
 	if (toolbar_set.right_toolbar.isProvided() && mToolbarRight)
 			LLToolBarEnums::ButtonType button_type = toolbar_set.right_toolbar.button_display_mode;
 			mToolbarRight->setButtonType(button_type);
 		}
-		BOOST_FOREACH(LLCommandId::Params& command, toolbar_set.right_toolbar.commands)
+		BOOST_FOREACH(const LLCommandId::Params& command_name_param, toolbar_set.right_toolbar.commands)
 		{
-			addCommand(LLCommandId(command),mToolbarRight);
+			if (addCommand(LLCommandId(command_name_param), mToolbarRight) == false)
+			{
+				llwarns << "Error adding command '" << command_name_param.name() << "' to right toolbar." << llendl;
+			}
 		}
 	}
 	if (toolbar_set.bottom_toolbar.isProvided() && mToolbarBottom)
 			LLToolBarEnums::ButtonType button_type = toolbar_set.bottom_toolbar.button_display_mode;
 			mToolbarBottom->setButtonType(button_type);
 		}
-		BOOST_FOREACH(LLCommandId::Params& command, toolbar_set.bottom_toolbar.commands)
+		BOOST_FOREACH(const LLCommandId::Params& command_name_param, toolbar_set.bottom_toolbar.commands)
 		{
-			addCommand(LLCommandId(command),mToolbarBottom);
+			if (addCommand(LLCommandId(command_name_param), mToolbarBottom) == false)
+			{
+				llwarns << "Error adding command '" << command_name_param.name() << "' to bottom toolbar." << llendl;
+			}
 		}
 	}
 	return true;
 // Enumerate the commands in command_list and add them as Params to the toolbar
 void LLToolBarView::addToToolset(command_id_list_t& command_list, Toolbar& toolbar) const
 {
+	LLCommandManager& mgr = LLCommandManager::instance();
+
 	for (command_id_list_t::const_iterator it = command_list.begin();
 		 it != command_list.end();
 		 ++it)
 	{
-		LLCommandId::Params command;
-		command.name = it->name();		
-		toolbar.commands.add(command);
+		LLCommand* command = mgr.getCommand(*it);
+		if (command)
+		{
+			LLCommandId::Params command_name_param;
+			command_name_param.name = command->name();
+			toolbar.commands.add(command_name_param);
+		}
 	}
 }
 
 // ----------------------------------------
 
 
-void LLToolBarView::startDragTool( S32 x, S32 y, const LLUUID& uuid)
+void LLToolBarView::startDragTool(S32 x, S32 y, LLToolBarButton* button)
 {
+	resetDragTool(button);
+
 	// Flag the tool dragging but don't start it yet
-	gToolBarView->mDragStarted = false;
-	gToolBarView->mDragCommand = LLCommandId::null;
-	gToolBarView->mDragRank = LLToolBar::RANK_NONE;
-	gToolBarView->mDragToolbar = NULL;
 	LLToolDragAndDrop::getInstance()->setDragStart( x, y );
 }
 
 			LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_VIEWER;
 			LLUUID srcID;
 			LLToolDragAndDrop::getInstance()->beginMultiDrag(types, cargo_ids, src, srcID);
-			
-			// Second, check if the command is present in one of the 3 toolbars
-			// If it is, store the command, the toolbar and the rank in the toolbar and
-			// set a callback on end drag so that we reinsert the command if no drop happened
-			/*
-			gToolBarView->mDragCommand = LLCommandId(uuid);
-			if ((gToolBarView->mDragRank = gToolBarView->mToolbarLeft->removeCommand(gToolBarView->mDragCommand)) != LLToolBar::RANK_NONE)
-			{
-				gToolBarView->mDragToolbar = gToolBarView->mToolbarLeft;
-			}
-			else if ((gToolBarView->mDragRank = gToolBarView->mToolbarRight->removeCommand(gToolBarView->mDragCommand)) != LLToolBar::RANK_NONE)
-			{
-				gToolBarView->mDragToolbar = gToolBarView->mToolbarRight;
-			}
-			else if ((gToolBarView->mDragRank = gToolBarView->mToolbarBottom->removeCommand(gToolBarView->mDragCommand)) != LLToolBar::RANK_NONE)
-			{
-				gToolBarView->mDragToolbar = gToolBarView->mToolbarBottom;
-			}
-			if (gToolBarView->mDragRank != LLToolBar::RANK_NONE)
-			{
-				llinfos << "Merov debug: rank of dragged tool = " << gToolBarView->mDragRank << llendl;
-				LLToolDragAndDrop::getInstance()->setEndDragCallback(boost::bind(&LLToolBarView::onEndDrag, gToolBarView));
-			}
-			 */
+
+			// Second, stop the command if it is in progress and requires stopping!
+			LLCommandId command_id = LLCommandId(uuid);
+			gToolBarView->mToolbarLeft->stopCommandInProgress(command_id);
+			gToolBarView->mToolbarRight->stopCommandInProgress(command_id);
+			gToolBarView->mToolbarBottom->stopCommandInProgress(command_id);
 
 			gToolBarView->mDragStarted = true;
 			return TRUE;
 		LLCommand* command = mgr.getCommand(command_id);
 		if (command)
 		{
+			// Suppress the command from the toolbars (including the one it's dropped in, 
+			// this will handle move position).
+			bool command_present = gToolBarView->hasCommand(command_id);
+			LLToolBar* old_toolbar = NULL;
+
+			if (command_present)
+			{
+				llassert(gToolBarView->mDragToolbarButton);
+				old_toolbar = gToolBarView->mDragToolbarButton->getParentByType<LLToolBar>();
+				if (old_toolbar->isReadOnly() && toolbar->isReadOnly())
+				{
+					// do nothing
+				}
+				else
+				{
+					gToolBarView->mToolbarBottom->removeCommand(command_id);
+					gToolBarView->mToolbarLeft->removeCommand(command_id);
+					gToolBarView->mToolbarRight->removeCommand(command_id);
+				}
+			}
+
 			// Convert the (x,y) position in rank in toolbar
-			int new_rank = LLToolBar::RANK_NONE;
 			if (!toolbar->isReadOnly())
 			{
-				new_rank = toolbar->getRankFromPosition(x,y);
-			}
-			// Suppress the command from the toolbars (including the one it's dropped in, 
-			// this will handle move position).
-			int old_rank = LLToolBar::RANK_NONE;
-			LLToolBar* old_toolbar = NULL;
-			int rank;
-			if ((rank = gToolBarView->mToolbarLeft->removeCommand(command_id)) != LLToolBar::RANK_NONE)
-			{
-				old_rank = rank;
-				old_toolbar = gToolBarView->mToolbarLeft;
-			}
-			if ((rank = gToolBarView->mToolbarRight->removeCommand(command_id)) != LLToolBar::RANK_NONE)
-			{
-				old_rank = rank;
-				old_toolbar = gToolBarView->mToolbarRight;
-			}
-			if ((rank = gToolBarView->mToolbarBottom->removeCommand(command_id)) != LLToolBar::RANK_NONE)
-			{
-				old_rank = rank;
-				old_toolbar = gToolBarView->mToolbarBottom;
-			}
-			// Now insert it in the toolbar at the detected rank
-			if (!toolbar->isReadOnly())
-			{
-				if ((old_toolbar == toolbar) && (old_rank != LLToolBar::RANK_NONE) && (old_rank < new_rank))
-				{
-					// If we just removed the command from the same toolbar, we need to consider that it might
-					// change the target rank.
-					new_rank -= 1;
-				}
-				toolbar->addCommand(command->id(),new_rank);
+				int new_rank = toolbar->getRankFromPosition(x,y);
+				toolbar->addCommand(command_id, new_rank);
 			}
 		}
 		else
 			llwarns << "Command couldn't be found in command manager" << llendl;
 		}
 	}
-	stopDragTool();
+
+	resetDragTool(NULL);
 	return handled;
 }
 
-void LLToolBarView::stopDragTool()
+void LLToolBarView::resetDragTool(LLToolBarButton* button)
 {
 	// Clear the saved command, toolbar and rank
 	gToolBarView->mDragStarted = false;
-	gToolBarView->mDragCommand = LLCommandId::null;
-	gToolBarView->mDragRank = LLToolBar::RANK_NONE;
-	gToolBarView->mDragToolbar = NULL;
-}
-
-void LLToolBarView::onEndDrag()
-{
-	// If there's a saved command, reinsert it in the saved toolbar
-	if (gToolBarView->mDragRank != LLToolBar::RANK_NONE)
-	{
-		gToolBarView->mDragToolbar->addCommand(gToolBarView->mDragCommand,gToolBarView->mDragRank);
-	}
-	stopDragTool();
+	gToolBarView->mDragToolbarButton = button;
 }
 
 void LLToolBarView::setToolBarsVisible(bool visible)
 
 	return modified;
 }
+
+
+//
+// HACK to bring up destinations guide at startup
+//
+
+void handleLoginToolbarSetup()
+{
+	// Open the destinations guide by default on first login, per Rhett
+	if (gSavedSettings.getBOOL("FirstLoginThisInstall") || gAgent.isFirstLogin())
+	{
+		LLFloaterReg::showInstance("destinations");
+	}
+}
+

indra/newview/lltoolbarview.h

 
 	static bool loadDefaultToolbars();
 	
-	static void startDragTool( S32 x, S32 y, const LLUUID& uuid);
-	static BOOL handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type);
-	static BOOL handleDropTool(	void* cargo_data, S32 x, S32 y, LLToolBar* toolbar);
-	static void stopDragTool();
-	void onEndDrag();
+	static void startDragTool(S32 x, S32 y, LLToolBarButton* button);
+	static BOOL handleDragTool(S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type);
+	static BOOL handleDropTool(void* cargo_data, S32 x, S32 y, LLToolBar* toolbar);
+	static void resetDragTool(LLToolBarButton* button);
 
 	bool isModified() const;
 	
 	LLToolBar*	mToolbarRight;
 	LLToolBar*	mToolbarBottom;
 	
-	LLCommandId mDragCommand;
-	int			mDragRank;
-	LLToolBar*	mDragToolbar;
-	bool		mDragStarted;
+	bool				mDragStarted;
+	LLToolBarButton*	mDragToolbarButton;
 };
 
 extern LLToolBarView* gToolBarView;

indra/newview/lltoolmgr.cpp

 
 void LLToolMgr::toggleBuildMode()
 {
-	if (inBuildMode())
-	{
-		if (gSavedSettings.getBOOL("EditCameraMovement"))
-		{
-			// just reset the view, will pull us out of edit mode
-			handle_reset_view();
-		}
-		else
-		{
-			// manually disable edit mode, but do not affect the camera
-			gAgentCamera.resetView(false);
-			LLFloaterReg::hideInstance("build");
-			gViewerWindow->showCursor();			
-		}
-		// avoid spurious avatar movements pulling out of edit mode
-		LLViewerJoystick::getInstance()->setNeedsReset();
-	}
-	else
+	LLFloaterReg::toggleInstanceOrBringToFront("build");
+
+	bool build_visible = LLFloaterReg::instanceVisible("build");
+	if (build_visible)
 	{
 		ECameraMode camMode = gAgentCamera.getCameraMode();
 		if (CAMERA_MODE_MOUSELOOK == camMode ||	CAMERA_MODE_CUSTOMIZE_AVATAR == camMode)
 			}
 		}
 
-		
+
 		setCurrentToolset(gBasicToolset);
 		getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() );
 
 		LLViewerJoystick::getInstance()->setNeedsReset();
 
 	}
+	else
+	{
+		if (gSavedSettings.getBOOL("EditCameraMovement"))
+		{
+			// just reset the view, will pull us out of edit mode
+			handle_reset_view();
+		}
+		else
+		{
+			// manually disable edit mode, but do not affect the camera
+			gAgentCamera.resetView(false);
+			LLFloaterReg::hideInstance("build");
+			gViewerWindow->showCursor();			
+		}
+		// avoid spurious avatar movements pulling out of edit mode
+		LLViewerJoystick::getInstance()->setNeedsReset();
+	}
+
 }
 
 bool LLToolMgr::inBuildMode()

indra/newview/lltracker.cpp

 #include "llinventorymodel.h"
 #include "llinventoryobserver.h"
 #include "lllandmarklist.h"
+#include "llprogressview.h"
 #include "llsky.h"
 #include "llui.h"
 #include "llviewercamera.h"
 #include "llviewerinventory.h"
+#include "llviewerwindow.h"
 #include "llworld.h"
 #include "llworldmapview.h"
 #include "llviewercontrol.h"
 {
 	if (!gSavedSettings.getBOOL("RenderTrackerBeacon")) return;
 
+	if (gViewerWindow->getProgressView()