Commits

leyla_linden committed 0b1d423 Merge

merge

  • Participants
  • Parent commits 990f519, a635aa3

Comments (0)

Files changed (26)

File 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

File 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;

File 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()

File 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),
 	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),
 	}
 	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_CASCADING;
+	}
+	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)
 	if (by_user)
 	{
 		storeRectControl();
+		mOpenPositioning = LLFloaterEnums::OPEN_POSITIONING_NONE;
 	}
 
 	// if not minimized, adjust all snapped dependents to new shape
 
 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();
 	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;
 
 	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);
 }
 

File indra/llui/llfloater.h

 								short_title;
 		
 		Optional<bool>			single_instance,
+								reuse_instance,
 								can_resize,
 								can_minimize,
 								can_close,
 	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;

File indra/llui/llfloaterreg.cpp

 				res->setInstanceName(name);
 
 				LLFloater *last_floater = (list.empty() ? NULL : list.back());
+
 				res->applyControlsAndPosition(last_floater);
 
 				gFloaterView->adjustToFitScreen(res, false);

File 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);
 	}
 
 	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

File 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;
 

File 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;

File 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"

File indra/newview/llagent.cpp

 	}
 	else if (param == "speak")
 	{
-		if ( gAgent.isVoiceConnected() )
+		if ( gAgent.isVoiceConnected() && 
+			LLViewerParcelMgr::getInstance()->allowAgentVoice() &&
+				! LLVoiceClient::getInstance()->inTuningMode() )
 		{
 			retval = true;
 		}

File 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();
+}

File indra/newview/lldebugview.h

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

File 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);

File indra/newview/llfloatertoybox.h

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

File indra/newview/llnearbychatbar.cpp

 bool LLNearbyChatBar::applyRectControl()
 {
 	bool rect_controlled = LLFloater::applyRectControl();
-	
-	if (getRect().getHeight() > COLLAPSED_HEIGHT)
+
+	LLView* nearby_chat = getChildView("nearby_chat");	
+	if (!nearby_chat->getVisible())
 	{
-		getChildView("nearby_chat")->setVisible(true);
-		mExpandedHeight = getRect().getHeight();
+		reshape(getRect().getWidth(), getMinHeight());
+		enableResizeCtrls(true, true, false);
+	}
+	else
+	{
 		enableResizeCtrls(true);
 		setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT);
 	}
-
+	
 	return rect_controlled;
 }
 

File indra/newview/lltoolbarview.cpp

 :	LLUICtrl(p),
 	mToolbarLeft(NULL),
 	mToolbarRight(NULL),
-	mToolbarBottom(NULL)
+	mToolbarBottom(NULL),
+	mDragStarted(false),
+	mDragToolbarButton(NULL)
 {
 }
 
 	}
 	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 );
 }
 
 			gToolBarView->mToolbarLeft->stopCommandInProgress(command_id);
 			gToolBarView->mToolbarRight->stopCommandInProgress(command_id);
 			gToolBarView->mToolbarBottom->stopCommandInProgress(command_id);
-			
-			// 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));
-			}
-			 */
 
 			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)

File 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;

File 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()

File indra/newview/llviewerwindow.cpp

 		//gMenuBarView->setItemVisible("BuildTools", gFloaterTools->getVisible());
 	}
 
-	LLFloaterBuildOptions* build_options_floater = LLFloaterReg::getTypedInstance<LLFloaterBuildOptions>("build_options");
+	LLFloaterBuildOptions* build_options_floater = LLFloaterReg::findTypedInstance<LLFloaterBuildOptions>("build_options");
 	if (build_options_floater && build_options_floater->getVisible())
 	{
 		build_options_floater->updateGridMode();

File indra/newview/skins/default/xui/en/floater_my_appearance.xml

   help_topic="appearance"
   save_rect="true"
   single_instance="true"
+  reuse_instance="true"
   title="APPEARANCE"
   min_height="260"
   min_width="333"

File indra/newview/skins/default/xui/en/floater_my_inventory.xml

  name="floater_my_inventory"
  save_rect="true"
  save_visibility="true"
+ reuse_instance="false"
  title="INVENTORY"
  width="333" >
    <panel

File indra/newview/skins/default/xui/en/floater_people.xml

   name="floater_people"
   save_rect="true"
   single_instance="true"
+  reuse_instance="true"
   title="PEOPLE"
   width="333">
     <panel_container

File indra/newview/skins/default/xui/en/floater_picks.xml

  name="floater_picks"
  save_rect="true"
  save_visibility="true"
+ reuse_instance="true"
  title="Picks"
  width="333" >
    <panel

File indra/newview/skins/default/xui/en/floater_places.xml

   name="floater_places"
   help_topic="floater_places"
   save_rect="true"
+  reuse_instance="true"
   title="PLACES"
   min_height="230"
   min_width="333"

File indra/newview/skins/default/xui/en/strings.xml

   <string name="Command_Snapshot_Label">Snapshot</string>
   <string name="Command_Speak_Label">Speak</string>
   <string name="Command_View_Label">View</string>
-  <string name="Command_Voice_Label">Nearby voice</string>
+  <string name="Command_Voice_Label">Voice settings</string>
 
   <string name="Command_AboutLand_Tooltip">Information about the land you're visiting</string>
   <string name="Command_Appearance_Tooltip">Change your avatar</string>
   <string name="Command_Snapshot_Tooltip">Take a picture</string>
   <string name="Command_Speak_Tooltip">Speak with people nearby using your microphone</string>
   <string name="Command_View_Tooltip">Changing camera angle</string>
-  <string name="Command_Voice_Tooltip">People nearby with voice capability</string>
+  <string name="Command_Voice_Tooltip">Volume controls for calls and people near you in world</string>
 
  <!-- Mesh UI terms -->
   <string name="Retain%">Retain%</string>