Commits

VirLinden committed 74ff11e Merge

merge

  • Participants
  • Parent commits e08d784, 1bc0a35

Comments (0)

Files changed (403)

 9bcc2b7176634254e501e3fb4c5b56c1f637852e 3.2.0-beta2
 2a13d30ee50ccfed50268238e36bb90d738ccc9e DRTVWR-98_3.2.0-beta3
 2a13d30ee50ccfed50268238e36bb90d738ccc9e 3.2.0-beta3
+3150219d229d628f0c15e58e8a51511cbd97e58d DRTVWR-94_3.2.0-release
+3150219d229d628f0c15e58e8a51511cbd97e58d 3.2.0-release
 c4911ec8cd81e676dfd2af438b3e065407a94a7a 3.2.1-start
+3150219d229d628f0c15e58e8a51511cbd97e58d DRTVWR-94_3.2.0-release
+3150219d229d628f0c15e58e8a51511cbd97e58d 3.2.0-release
+40b46edba007d15d0059c80864b708b99c1da368 3.2.2-start
+3150219d229d628f0c15e58e8a51511cbd97e58d DRTVWR-94_3.2.0-release
+3150219d229d628f0c15e58e8a51511cbd97e58d 3.2.0-release
+9e390d76807fa70d356b8716fb83b8ce42a629ef DRTVWR-100_3.2.1-beta1
+9e390d76807fa70d356b8716fb83b8ce42a629ef 3.2.1-beta1
+523df3e67378541498d516d52af4402176a26bac DRTVWR-102_3.2.2-beta1
+523df3e67378541498d516d52af4402176a26bac 3.2.2-beta1
+80f3e30d8aa4d8f674a48bd742aaa6d8e9eae0b5 3.2.3-start
+a8c7030d6845186fac7c188be4323a0e887b4184 DRTVWR-99_3.2.1-release
+a8c7030d6845186fac7c188be4323a0e887b4184 3.2.1-release
 viewer-mesh.viewer_grid = aditi
 viewer-mesh.email = shining@lists.lindenlab.com
 
-
-# ========================================
-# CG
-# ========================================
-
-cg_viewer-development_lenny.show_changes_since = 4b140ce7839d
-cg_viewer-development_lenny.email = cg@lindenlab.com
-
 # ================
 # oz
 # ================
 oz_viewer-devreview.build_debug_release_separately = true
 oz_viewer-devreview.codeticket_add_context = false
 oz_viewer-devreview.build_enforce_coding_policy = true
+oz_viewer-devreview.email = oz@lindenlab.com
 
 oz_project-1.build_debug_release_separately = true
 oz_project-1.codeticket_add_context = false
+oz_project-1.email = oz@lindenlab.com
 oz_project-2.build_debug_release_separately = true
 oz_project-2.codeticket_add_context = false
+oz_project-2.email = oz@lindenlab.com
 oz_project-3.build_debug_release_separately = true
 oz_project-3.codeticket_add_context = false
+oz_project-3.email = oz@lindenlab.com
 oz_project-4.build_debug_release_separately = true
 oz_project-4.codeticket_add_context = false
+oz_project-4.email = oz@lindenlab.com
+oz_project-5.build_debug_release_separately = true
+oz_project-5.codeticket_add_context = false
+oz_project-5.email = oz@lindenlab.com
 
 oz_viewer-beta-review.build_debug_release_separately = true
 oz_viewer-beta-review.codeticket_add_context = false
 oz_viewer-beta-review.viewer_channel = "Second Life Beta Viewer"
 oz_viewer-beta-review.login_channel = "Second Life Beta Viewer"
+oz_viewer-beta-review.email = oz@lindenlab.com
 
 # =================================================================
 # asset delivery 2010 projects

File autobuild.xml

             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>1b92a69f5eba7cd8b017180659076db5</string>
+              <string>7108c2443dbcf4c032305814ce65ebb7</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/roxie_3p-llqtwebkit/rev/242182/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20111003.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/244065/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20111028.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>1e7f24b69b0fc751c7e86efe7c621882</string>
+              <string>24048a31d7b852774dc3117acbd4a86a</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/roxie_3p-llqtwebkit/rev/242182/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20111003.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/244065/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20111028.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>

File doc/contributions.txt

 	STORM-1101
 	VWR-25480
 	VWR-26150
+	STORM-1685
 Aralara Rajal
 Ardy Lay
 	STORM-859
 	STORM-1639
 	STORM-910
 	STORM-1642
+	STORM-1105
+	STORM-1679
+	STORM-1222
+	STORM-1659
+	STORM-1674
+	STORM-1685
 Kadah Coba
 	STORM-1060
 Jondan Lundquist
 	STORM-546
 	VWR-24509
 	SH-2477
+	STORM-1684
 Tony Kembia
 Torben Trautman
 TouchaHoney Perhaps

File indra/CMakeLists.txt

-
 # -*- cmake -*-
 
 # cmake_minimum_required should appear before any
   add_subdirectory(${LIBS_OPEN_PREFIX}llxuixml)
   add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components)
 
+  # Legacy C++ tests. Build always, run if LL_TESTS is true.
+  add_subdirectory(${VIEWER_PREFIX}test)
+
   # viewer media plugins
   add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)
 

File indra/llcommon/llmemory.cpp

 //class LLPrivateMemoryPoolManager
 //--------------------------------------------------------------------
 LLPrivateMemoryPoolManager* LLPrivateMemoryPoolManager::sInstance = NULL ;
+BOOL LLPrivateMemoryPoolManager::sPrivatePoolEnabled = FALSE ;
 std::vector<LLPrivateMemoryPool*> LLPrivateMemoryPoolManager::sDanglingPoolList ;
 
 LLPrivateMemoryPoolManager::LLPrivateMemoryPoolManager(BOOL enabled, U32 max_pool_size) 
 		mPoolList[i] = NULL ;
 	}
 
-	mPrivatePoolEnabled = enabled ;
+	sPrivatePoolEnabled = enabled ;
 
 	const U32 MAX_POOL_SIZE = 256 * 1024 * 1024 ; //256 MB
 	mMaxPrivatePoolSize = llmax(max_pool_size, MAX_POOL_SIZE) ;
 
 LLPrivateMemoryPool* LLPrivateMemoryPoolManager::newPool(S32 type) 
 {
-	if(!mPrivatePoolEnabled)
+	if(!sPrivatePoolEnabled)
 	{
 		return NULL ;
 	}
 	}
 	else
 	{
-		if(!sInstance) //the private memory manager is destroyed, try the dangling list
+		if(!sPrivatePoolEnabled)
+		{
+			free(addr) ; //private pool is disabled.
+		}
+		else if(!sInstance) //the private memory manager is destroyed, try the dangling list
 		{
 			for(S32 i = 0 ; i < sDanglingPoolList.size(); i++)
 			{
 					addr = NULL ;
 					break ;
 				}
-			}
+			}		
+			llassert_always(!addr) ; //addr should be release before hitting here!
 		}
-
-		llassert_always(!addr) ; //addr should be release before hitting here!
-
-		free(addr) ;
+		else
+		{
+			llerrs << "private pool is used before initialized.!" << llendl ;
+		}
 	}	
 }
 

File indra/llcommon/llmemory.h

 	LLPrivateMemoryPool* newPool(S32 type) ;
 	void deletePool(LLPrivateMemoryPool* pool) ;
 
-private:
-	static LLPrivateMemoryPoolManager* sInstance ;
-	std::vector<LLPrivateMemoryPool*> mPoolList ;
-	BOOL mPrivatePoolEnabled;
+private:	
+	std::vector<LLPrivateMemoryPool*> mPoolList ;	
 	U32  mMaxPrivatePoolSize;
 
+	static LLPrivateMemoryPoolManager* sInstance ;
+	static BOOL sPrivatePoolEnabled;
 	static std::vector<LLPrivateMemoryPool*> sDanglingPoolList ;
 public:
 	//debug and statistics info.

File indra/llcommon/llthread.h

File contents unchanged.

File indra/llcommon/llversionviewer.h

 
 const S32 LL_VERSION_MAJOR = 3;
 const S32 LL_VERSION_MINOR = 2;
-const S32 LL_VERSION_PATCH = 2;
+const S32 LL_VERSION_PATCH = 4;
 const S32 LL_VERSION_BUILD = 0;
 
 const char * const LL_CHANNEL = "Second Life Developer";

File indra/llinventory/lleconomy.cpp

 LLGlobalEconomy::~LLGlobalEconomy()
 { }
 
+void LLGlobalEconomy::addObserver(LLEconomyObserver* observer)
+{
+	mObservers.push_back(observer);
+}
+
+void LLGlobalEconomy::removeObserver(LLEconomyObserver* observer)
+{
+	std::list<LLEconomyObserver*>::iterator it =
+		std::find(mObservers.begin(), mObservers.end(), observer);
+	if (it != mObservers.end())
+	{
+		mObservers.erase(it);
+	}
+}
+
+void LLGlobalEconomy::notifyObservers()
+{
+	for (std::list<LLEconomyObserver*>::iterator it = mObservers.begin();
+		it != mObservers.end();
+		++it)
+	{
+		(*it)->onEconomyDataChange();
+	}
+}
+
 // static
 void LLGlobalEconomy::processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data)
 {
 	econ_data->setTeleportPriceExponent(f);
 	msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceGroupCreate, i);
 	econ_data->setPriceGroupCreate(i);
+
+	econ_data->notifyObservers();
 }
 
 S32	LLGlobalEconomy::calculateTeleportCost(F32 distance) const

File indra/llinventory/lleconomy.h

 class LLMessageSystem;
 class LLVector3;
 
+/**
+ * Register an observer to be notified of economy data updates coming from server.
+ */
+class LLEconomyObserver
+{
+public:
+	virtual ~LLEconomyObserver() {}
+	virtual void onEconomyDataChange() = 0;
+};
+
 class LLGlobalEconomy
 {
 public:
 
 	virtual void print();
 
+	void	addObserver(LLEconomyObserver* observer);
+	void	removeObserver(LLEconomyObserver* observer);
+	void	notifyObservers();
+
 	static void processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data);
 
 	S32		calculateTeleportCost(F32 distance) const;
 	S32		mTeleportMinPrice;
 	F32		mTeleportPriceExponent;
 	S32     mPriceGroupCreate;
+
+	std::list<LLEconomyObserver*> mObservers;
 };
 
 

File indra/llmessage/lliosocket.cpp

File contents unchanged.

File indra/llmessage/lliosocket.h

File contents unchanged.

File indra/llplugin/llpluginclassmedia.cpp

 	sendMessage(message);
 }
 
+void LLPluginClassMedia::set_page_zoom_factor( double factor )
+{
+	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "set_page_zoom_factor");
+
+	message.setValueReal("factor", factor);
+	sendMessage(message);
+}
+
 void LLPluginClassMedia::clear_cache()
 {
 	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "clear_cache");

File indra/llplugin/llpluginclassmedia.h

 	bool pluginSupportsMediaBrowser(void);
 	
 	void focus(bool focused);
+	void set_page_zoom_factor( double factor );
 	void clear_cache();
 	void clear_cookies();
 	void set_cookies(const std::string &cookies);

File indra/llui/lldockablefloater.cpp

 		mForceDocking = true;
 	}
 
-	mDockTongue = LLUI::getUIImage("windows/Flyout_Pointer.png");
+	mDockTongue = LLUI::getUIImage("Flyout_Pointer");
 	LLFloater::setDocked(true);
 	return LLView::postBuild();
 }
 	switch(dock_side)
 	{
 	case LLDockControl::LEFT:
-		mDockTongue = LLUI::getUIImage("windows/Flyout_Left.png");
+		mDockTongue = LLUI::getUIImage("Flyout_Left");
 		break;
 	case LLDockControl::RIGHT:
-		mDockTongue = LLUI::getUIImage("windows/Flyout_Right.png");
+		mDockTongue = LLUI::getUIImage("Flyout_Right");
 		break;
 	default:
-		mDockTongue = LLUI::getUIImage("windows/Flyout_Pointer.png");
+		mDockTongue = LLUI::getUIImage("Flyout_Pointer");
 		break;
 	}
 

File indra/llui/llkeywords.h

 	 * - TWO_SIDED_DELIMITER are for delimiters that end with a different delimiter than they open with.
 	 * - DOUBLE_QUOTATION_MARKS are for delimiting areas using the same delimiter to open and close.
 	 */
-	typedef enum TOKEN_TYPE
+	enum TOKEN_TYPE
 	{
 		WORD,
 		LINE,

File indra/llui/llmenugl.cpp

 	mSpilloverMenu(NULL),
 	mJumpKey(p.jump_key),
 	mCreateJumpKeys(p.create_jump_keys),
-	mNeedsArrange(FALSE), 
+	mNeedsArrange(FALSE),
+	mResetScrollPositionOnShow(true),
 	mShortcutPad(p.shortcut_pad)
 {
 	typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
 	S32 mouse_x, mouse_y;
 
 	// Resetting scrolling position
-	if (menu->isScrollable())
+	if (menu->isScrollable() && menu->isScrollPositionOnShowReset())
 	{
 		menu->mFirstVisibleItem = NULL;
 	}

File indra/llui/llmenugl.h

 
 	static class LLMenuHolderGL* sMenuContainer;
 	
+	void resetScrollPositionOnShow(bool reset_scroll_pos) { mResetScrollPositionOnShow = reset_scroll_pos; }
+	bool isScrollPositionOnShowReset() { return mResetScrollPositionOnShow; }
+
 protected:
 	void createSpilloverBranch();
 	void cleanupSpilloverBranch();
 	KEY				mJumpKey;
 	BOOL			mCreateJumpKeys;
 	S32				mShortcutPad;
+	bool			mResetScrollPositionOnShow;
 }; // end class LLMenuGL
 
 

File indra/llui/llsdparam.cpp

 static 	LLInitParam::Parser::parser_inspect_func_map_t sInspectFuncs;
 static const LLSD NO_VALUE_MARKER;
 
+LLFastTimer::DeclareTimer FTM_SD_PARAM_ADAPTOR("LLSD to LLInitParam conversion");
+
 //
 // LLParamSDParser
 //

File indra/llui/llsdparam.h

 	LLSD*					mCurWriteSD;
 };
 
+
+extern LLFastTimer::DeclareTimer FTM_SD_PARAM_ADAPTOR;
 template<typename T>
 class LLSDParamAdapter : public T
 {
 	LLSDParamAdapter() {}
 	LLSDParamAdapter(const LLSD& sd)
 	{
+		LLFastTimer _(FTM_SD_PARAM_ADAPTOR);
 		LLParamSDParser parser;
-		parser.readSD(sd, *this);
+		// don't spam for implicit parsing of LLSD, as we want to allow arbitrary freeform data and ignore most of it
+		bool parse_silently = true;
+		parser.readSD(sd, *this, parse_silently);
 	}
 
 	operator LLSD() const

File indra/llui/lltoolbar.cpp

 	mPadBetween(p.pad_between),
 	mMinGirth(p.min_girth),
 	mPopupMenuHandle(),
+	mRightMouseTargetButton(NULL),
 	mStartDragItemCallback(NULL),
 	mHandleDragItemCallback(NULL),
 	mHandleDropCallback(NULL),
 
 		LLUICtrl::CommitCallbackRegistry::ScopedRegistrar commit_reg;
 		commit_reg.add("Toolbars.EnableSetting", boost::bind(&LLToolBar::onSettingEnable, this, _2));
+		commit_reg.add("Toolbars.RemoveSelectedCommand", boost::bind(&LLToolBar::onRemoveSelectedCommand, this));
 
 		LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_reg;
 		enable_reg.add("Toolbars.CheckSetting", boost::bind(&LLToolBar::isSettingChecked, this, _2));
 
 	if (handle_it_here)
 	{
+		// Determine which button the mouse was over during the click in case the context menu action
+		// is intended to affect the button.
+		BOOST_FOREACH(LLToolBarButton* button, mButtons)
+		{
+			LLRect button_rect;
+			button->localRectToOtherView(button->getLocalRect(), &button_rect, this);
+
+			if (button_rect.pointInRect(x, y))
+			{
+				mRightMouseTargetButton = button;
+				break;
+			}
+		}
+
 		createContextMenu();
 
 		LLContextMenu * menu = (LLContextMenu *) mPopupMenuHandle.get();
 	}
 }
 
+void LLToolBar::onRemoveSelectedCommand()
+{
+	llassert(!mReadOnly);
+
+	if (mRightMouseTargetButton)
+	{
+		removeCommand(mRightMouseTargetButton->getCommandId());
+
+		mRightMouseTargetButton = NULL;
+	}
+}
+
 void LLToolBar::setButtonType(LLToolBarEnums::ButtonType button_type)
 {
 	bool regenerate_buttons = (mButtonType != button_type);
 			S32 mid_point = (button_rect.mRight + button_rect.mLeft) / 2;
 			if (button_panel_x < mid_point)
 			{
-		mDragx = button_rect.mLeft - mPadLeft;
-		mDragy = button_rect.mTop + mPadTop;
-	}
-	else
-	{
+				mDragx = button_rect.mLeft - mPadLeft;
+				mDragy = button_rect.mTop + mPadTop;
+			}
+			else
+			{
 				rank++;
 				mDragx = button_rect.mRight + mPadRight - 1;
 				mDragy = button_rect.mTop + mPadTop;
 	{
 		// We hit passed the end of the list so put the insertion point at the end
 		if (orientation == LLLayoutStack::HORIZONTAL)
-	{
+		{
 			mDragx = button_rect.mRight + mPadRight;
 			mDragy = button_rect.mTop + mPadTop;
-	}
-	else
-	{
+		}
+		else
+		{
 			mDragx = button_rect.mLeft - mPadLeft;
 			mDragy = button_rect.mBottom - mPadBottom;
 		}
 	}
 	mButtons.clear();
 	mButtonMap.clear();
+	mRightMouseTargetButton = NULL;
 	
 	BOOST_FOREACH(LLCommandId& command_id, mButtonCommands)
 	{

File indra/llui/lltoolbar.h

 
 	BOOL handleMouseDown(S32 x, S32 y, MASK mask);
 	BOOL handleHover(S32 x, S32 y, MASK mask);
+
 	void reshape(S32 width, S32 height, BOOL called_from_parent = true);
 	void setEnabled(BOOL enabled);
 	void setCommandId(const LLCommandId& id) { mId = id; }
+	LLCommandId getCommandId() { return mId; }
 
 	void setStartDragCallback(tool_startdrag_callback_t cb)   { mStartDragItemCallback  = cb; }
 	void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; }
 												pad_bottom,
 												pad_between,
 												min_girth;
-		// get rid of this
+
+		// default command set
 		Multiple<LLCommandId::Params>			commands;
 
 		Optional<LLPanel::Params>				button_panel;
 	// virtuals
 	void draw();
 	void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
-	int  getRankFromPosition(S32 x, S32 y);	
-	int  getRankFromPosition(const LLCommandId& id);	
 	BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
 	virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 								   EDragAndDropType cargo_type,
 								   std::string& tooltip_msg);
 	
 	static const int RANK_NONE = -1;
-	
 	bool addCommand(const LLCommandId& commandId, int rank = RANK_NONE);
 	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);
-	bool flashCommand(const LLCommandId& commandId, bool flash);
+	bool hasCommand(const LLCommandId& commandId) const;	// is this command bound to a button in this toolbar
+	bool enableCommand(const LLCommandId& commandId, bool enabled);	// enable/disable button bound to the specified command, if it exists in this toolbar
+	bool stopCommandInProgress(const LLCommandId& commandId);	// stop command if it is currently active
+	bool flashCommand(const LLCommandId& commandId, bool flash); // flash button associated with given command, if in this toolbar
 
-	void setStartDragCallback(tool_startdrag_callback_t cb)   { mStartDragItemCallback  = cb; }
+	void setStartDragCallback(tool_startdrag_callback_t cb)   { mStartDragItemCallback  = cb; } // connects drag and drop behavior to external logic
 	void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; }
 	void setHandleDropCallback(tool_handledrop_callback_t cb) { mHandleDropCallback     = cb; }
 	bool isReadOnly() const { return mReadOnly; }
 	boost::signals2::connection setButtonLeaveCallback(const button_signal_t::slot_type& cb);
 	boost::signals2::connection setButtonRemoveCallback(const button_signal_t::slot_type& cb);
 
-	void setTooltipButtonSuffix(const std::string& suffix) { mButtonTooltipSuffix = suffix; }
+	// append the specified string to end of tooltip
+	void setTooltipButtonSuffix(const std::string& suffix) { mButtonTooltipSuffix = suffix; } 
 
 	LLToolBarEnums::SideType getSideType() const { return mSideType; }
 	bool hasButtons() const { return !mButtons.empty(); }
 	bool isModified() const { return mModified; }
 
-protected:
+	int  getRankFromPosition(S32 x, S32 y);	
+	int  getRankFromPosition(const LLCommandId& id);	
+
+	// Methods used in loading and saving toolbar settings
+	void setButtonType(LLToolBarEnums::ButtonType button_type);
+	LLToolBarEnums::ButtonType getButtonType() { return mButtonType; }
+	command_id_list_t& getCommandsList() { return mButtonCommands; }
+	void clearCommandsList();
+
+private:
 	friend class LLUICtrlFactory;
 	LLToolBar(const Params&);
 	~LLToolBar();
 
 	void initFromParams(const Params&);
+	void createContextMenu();
+	void updateLayoutAsNeeded();
+	void createButtons();
+	void resizeButtonsInRow(std::vector<LLToolBarButton*>& buttons_in_row, S32 max_row_girth);
+	BOOL isSettingChecked(const LLSD& userdata);
+	void onSettingEnable(const LLSD& userdata);
+	void onRemoveSelectedCommand();
+
+private:
+	// static layout state
+	const bool						mReadOnly;
+	const LLToolBarEnums::SideType	mSideType;
+	const bool						mWrap;
+	const S32						mPadLeft,
+									mPadRight,
+									mPadTop,
+									mPadBottom,
+									mPadBetween,
+									mMinGirth;
+
+	// drag and drop state
 	tool_startdrag_callback_t		mStartDragItemCallback;
 	tool_handledrag_callback_t		mHandleDragItemCallback;
 	tool_handledrop_callback_t		mHandleDropCallback;
 									mDragy,
 									mDragGirth;
 
-public:
-	// Methods used in loading and saving toolbar settings
-	void setButtonType(LLToolBarEnums::ButtonType button_type);
-	LLToolBarEnums::ButtonType getButtonType() { return mButtonType; }
-	command_id_list_t& getCommandsList() { return mButtonCommands; }
-	void clearCommandsList();
-					   
-private:
-	void createContextMenu();
-	void updateLayoutAsNeeded();
-	void createButtons();
-	void resizeButtonsInRow(std::vector<LLToolBarButton*>& buttons_in_row, S32 max_row_girth);
-	BOOL isSettingChecked(const LLSD& userdata);
-	void onSettingEnable(const LLSD& userdata);
-
-	const bool						mReadOnly;
-
 	typedef std::list<LLToolBarButton*> toolbar_button_list;
+	typedef std::map<LLUUID, LLToolBarButton*> command_id_map;
 	toolbar_button_list				mButtons;
 	command_id_list_t				mButtonCommands;
-	typedef std::map<LLUUID, LLToolBarButton*> command_id_map;
 	command_id_map					mButtonMap;
 
 	LLToolBarEnums::ButtonType		mButtonType;
+	LLToolBarButton::Params			mButtonParams[LLToolBarEnums::BTNTYPE_COUNT];
+
+	// related widgets
 	LLLayoutStack*					mCenteringStack;
-	LLLayoutStack*					mWrapStack;
 	LLPanel*						mButtonPanel;
-	LLToolBarEnums::SideType		mSideType;
-	
-	bool							mWrap;
+	LLHandle<class LLContextMenu>	mPopupMenuHandle;
+
+	LLToolBarButton*				mRightMouseTargetButton;
+
 	bool							mNeedsLayout;
 	bool							mModified;
-	S32								mPadLeft,
-									mPadRight,
-									mPadTop,
-									mPadBottom,
-									mPadBetween,
-									mMinGirth;
-
-	LLToolBarButton::Params			mButtonParams[LLToolBarEnums::BTNTYPE_COUNT];
-
-	LLHandle<class LLContextMenu>	mPopupMenuHandle;
 
 	button_signal_t*				mButtonAddSignal;
 	button_signal_t*				mButtonEnterSignal;

File indra/llui/lluictrlfactory.h

File contents unchanged.

File indra/llui/llurlaction.cpp

 #include "llurlregistry.h"
 
 // global state for the callback functions
-void (*LLUrlAction::sOpenURLCallback) (const std::string& url) = NULL;
-void (*LLUrlAction::sOpenURLInternalCallback) (const std::string& url) = NULL;
-void (*LLUrlAction::sOpenURLExternalCallback) (const std::string& url) = NULL;
-bool (*LLUrlAction::sExecuteSLURLCallback) (const std::string& url) = NULL;
+LLUrlAction::url_callback_t 		LLUrlAction::sOpenURLCallback;
+LLUrlAction::url_callback_t 		LLUrlAction::sOpenURLInternalCallback;
+LLUrlAction::url_callback_t 		LLUrlAction::sOpenURLExternalCallback;
+LLUrlAction::execute_url_callback_t LLUrlAction::sExecuteSLURLCallback;
 
 
-void LLUrlAction::setOpenURLCallback(void (*cb) (const std::string& url))
+void LLUrlAction::setOpenURLCallback(url_callback_t cb)
 {
 	sOpenURLCallback = cb;
 }
 
-void LLUrlAction::setOpenURLInternalCallback(void (*cb) (const std::string& url))
+void LLUrlAction::setOpenURLInternalCallback(url_callback_t cb)
 {
 	sOpenURLInternalCallback = cb;
 }
 
-void LLUrlAction::setOpenURLExternalCallback(void (*cb) (const std::string& url))
+void LLUrlAction::setOpenURLExternalCallback(url_callback_t cb)
 {
 	sOpenURLExternalCallback = cb;
 }
 
-void LLUrlAction::setExecuteSLURLCallback(bool (*cb) (const std::string& url))
+void LLUrlAction::setExecuteSLURLCallback(execute_url_callback_t cb)
 {
 	sExecuteSLURLCallback = cb;
 }
 {
 	if (sOpenURLCallback)
 	{
-		(*sOpenURLCallback)(url);
+		sOpenURLCallback(url);
 	}
 }
 
 {
 	if (sOpenURLInternalCallback)
 	{
-		(*sOpenURLInternalCallback)(url);
+		sOpenURLInternalCallback(url);
 	}
 }
 
 {
 	if (sOpenURLExternalCallback)
 	{
-		(*sOpenURLExternalCallback)(url);
+		sOpenURLExternalCallback(url);
 	}
 }
 
 {
 	if (sExecuteSLURLCallback)
 	{
-		(*sExecuteSLURLCallback)(url);
+		sExecuteSLURLCallback(url);
 	}
 }
 
 void LLUrlAction::clickAction(std::string url)
 {
 	// Try to handle as SLURL first, then http Url
-	if ( (sExecuteSLURLCallback) && !(*sExecuteSLURLCallback)(url) )
+	if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url) )
 	{
 		if (sOpenURLCallback)
 		{
-			(*sOpenURLCallback)(url);
+			sOpenURLCallback(url);
 		}
 	}
 }

File indra/llui/llurlaction.h

 #define LL_LLURLACTION_H
 
 #include <string>
+#include <boost/function.hpp>
 
 ///
 /// The LLUrlAction class provides a number of static functions that
 	static void showProfile(std::string url);
 
 	/// specify the callbacks to enable this class's functionality
-	static void	setOpenURLCallback(void (*cb) (const std::string& url));
-	static void	setOpenURLInternalCallback(void (*cb) (const std::string& url));
-	static void	setOpenURLExternalCallback(void (*cb) (const std::string& url));
-	static void	setExecuteSLURLCallback(bool (*cb) (const std::string& url));
+	typedef boost::function<void (const std::string&)> url_callback_t;
+	typedef boost::function<bool(const std::string& url)> execute_url_callback_t;
+
+	static void	setOpenURLCallback(url_callback_t cb);
+	static void	setOpenURLInternalCallback(url_callback_t cb);
+	static void	setOpenURLExternalCallback(url_callback_t cb);
+	static void	setExecuteSLURLCallback(execute_url_callback_t cb);
 
 private:
 	// callbacks for operations we can perform on Urls
-	static void (*sOpenURLCallback) (const std::string& url);
-	static void (*sOpenURLInternalCallback) (const std::string& url);
-	static void (*sOpenURLExternalCallback) (const std::string& url);
-	static bool (*sExecuteSLURLCallback) (const std::string& url);
+	static url_callback_t sOpenURLCallback;
+	static url_callback_t sOpenURLInternalCallback;
+	static url_callback_t sOpenURLExternalCallback;
+
+	static execute_url_callback_t sExecuteSLURLCallback;
 };
 
 #endif

File indra/llwindow/llwindowmacosx.cpp

 			{
 				// This is where we would constrain move/resize to a particular screen
 
-				const S32 MIN_WIDTH  = 320;
-				const S32 MIN_HEIGHT = 240;
+				const S32 MIN_WIDTH  = 1024;
+				const S32 MIN_HEIGHT = 768;
 				
 				Rect currentBounds;
 				Rect previousBounds;

File indra/llwindow/llwindowsdl.cpp

 
 const S32 MAX_NUM_RESOLUTIONS = 200;
 
+const S32 MIN_WINDOW_WIDTH = 1024;
+const S32 MIN_WINDOW_HEIGHT = 768;
+
 // static variable for ATI mouse cursor crash work-around:
 static bool ATIbug = false; 
 
                 break;
 
             case SDL_VIDEORESIZE:  // *FIX: handle this?
+            {
 		llinfos << "Handling a resize event: " << event.resize.w <<
 			"x" << event.resize.h << llendl;
 
+		S32 width = llmax(event.resize.w, MIN_WINDOW_WIDTH);
+		S32 height = llmax(event.resize.h, MIN_WINDOW_HEIGHT);
+
 		// *FIX: I'm not sure this is necessary!
-		mWindow = SDL_SetVideoMode(event.resize.w, event.resize.h, 32, mSDLFlags);
+		mWindow = SDL_SetVideoMode(width, height, 32, mSDLFlags);
 		if (!mWindow)
 		{
 			// *FIX: More informative dialog?
                 break;
 		}
 		
-		mCallbacks->handleResize(this, event.resize.w, event.resize.h );
+		mCallbacks->handleResize(this, width, height);
                 break;
-
+            }
             case SDL_ACTIVEEVENT:
                 if (event.active.state & SDL_APPINPUTFOCUS)
                 {

File indra/llwindow/llwindowwin32.cpp

 		mhInstance,
 		NULL);
 
+	LL_INFOS("Window") << "window is created." << llendl ;
+
 	//-----------------------------------------------------------------------
 	// Create GL drawing context
 	//-----------------------------------------------------------------------
 		return FALSE;
 	}
 
+	LL_INFOS("Window") << "Drawing context is created." << llendl ;
+
 	gGLManager.initWGL();
 	
 	if (wglChoosePixelFormatARB)
 			LL_INFOS("Window") << "Choosing pixel formats: " << num_formats << " pixel formats returned" << LL_ENDL;
 		}
 
-		
+		LL_INFOS("Window") << "pixel formats done." << llendl ;
 
 		S32 swap_method = 0;
 		S32 cur_format = num_formats-1;
 			mhInstance,
 			NULL);
 
+		LL_INFOS("Window") << "recreate window done." << llendl ;
+
 		if (!(mhDC = GetDC(mWindowHandle)))
 		{
 			close();
 				return 0;
 			}
 
+		case WM_GETMINMAXINFO:
+			{
+				LPMINMAXINFO min_max = (LPMINMAXINFO)l_param;
+				min_max->ptMinTrackSize.x = 1024;
+				min_max->ptMinTrackSize.y = 768;
+				return 0;
+			}
+
 		case WM_SIZE:
 			{
 				window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_SIZE");

File indra/llxuixml/llinitparam.h

File contents unchanged.

File indra/media_plugins/webkit/media_plugin_webkit.cpp

  * $/LicenseInfo$
  * @endcond
  */
-
 #include "llqtwebkit.h"
-
 #include "linden_common.h"
 #include "indra_constants.h" // for indra keyboard codes
 
+#include "lltimer.h"
 #include "llgl.h"
 
 #include "llplugininstance.h"
 	F32 mBackgroundG;
 	F32 mBackgroundB;
 	std::string mTarget;
-	
+	LLTimer mElapsedTime;
+		
 	VolumeCatcher mVolumeCatcher;
 
 	void postDebugMessage( const std::string& msg )
 	{
 		if ( mEnableMediaPluginDebugging )
 		{
+			std::stringstream str;
+			str << "@Media Msg> " << "[" << (double)mElapsedTime.getElapsedTimeF32()  << "] -- " << msg;
+
 			LLPluginMessage debug_message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "debug_message");
-			debug_message.setValue("message_text", "Media> " + msg);
+			debug_message.setValue("message_text", str.str());
 			debug_message.setValue("message_level", "info");
 			sendMessage(debug_message);
 		}
 		LLQtWebKit::getInstance()->enablePlugins( mPluginsEnabled );
 
 		// turn on/off Javascript based on what host app tells us
+#if LLQTWEBKIT_API_VERSION >= 11
+		LLQtWebKit::getInstance()->enableJavaScript( mJavascriptEnabled );
+#else
 		LLQtWebKit::getInstance()->enableJavascript( mJavascriptEnabled );
+#endif
 
 		std::stringstream str;
 		str << "Cookies enabled = " << mCookiesEnabled << ", plugins enabled = " << mPluginsEnabled << ", Javascript enabled = " << mJavascriptEnabled;
 		// append details to agent string
 		LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent );
 		postDebugMessage( "Updating user agent with " + mUserAgent );
-		
+
 #if !LL_QTWEBKIT_USES_PIXMAPS
 		// don't flip bitmap
 		LLQtWebKit::getInstance()->flipWindow( mBrowserWindowId, true );
 		url << "%22%3E%3C/body%3E%3C/html%3E";
 		
 		//lldebugs << "data url is: " << url.str() << llendl;
-					
+
+		// loading overlay debug screen follows media debugging flag from client for now.
+#if LLQTWEBKIT_API_VERSION >= 16
+		LLQtWebKit::getInstance()->enableLoadingOverlay(mBrowserWindowId, mEnableMediaPluginDebugging);
+#else
+		llwarns << "Ignoring enableLoadingOverlay() call (llqtwebkit version is too old)." << llendl;
+#endif
+		str.clear();
+		str << "Loading overlay enabled = " << mEnableMediaPluginDebugging << " for mBrowserWindowId = " << mBrowserWindowId;
+		postDebugMessage( str.str() );
+
 		LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, url.str() );
 //		LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, "about:blank" );
 
 		// These could be passed through as well, but aren't really needed.
 //		message.setValue("uri", event.getEventUri());
 //		message.setValueBoolean("dead", (event.getIntValue() != 0))
+
+		// debug spam
+		postDebugMessage( "Sending cookie_set message from plugin: " + event.getStringValue() );
+
 		sendMessage(message);
 	}
 
 	mPluginsEnabled = true;		// default to on
 	mEnableMediaPluginDebugging = false;
 	mUserAgent = "LLPluginMedia Web Browser";
+
+	mElapsedTime.reset();
 }
 
 MediaPluginWebKit::~MediaPluginWebKit()
 			{
 				mEnableMediaPluginDebugging = message_in.getValueBoolean( "enable" );
 			}
-
 			else
 			if(message_name == "js_enable_object")
 			{
 					mFirstFocus = false;
 				}
 			}
+			else if(message_name == "set_page_zoom_factor")
+			{
+#if LLQTWEBKIT_API_VERSION >= 15
+				F32 factor = message_in.getValueReal("factor");
+				LLQtWebKit::getInstance()->setPageZoomFactor(factor);
+#else
+				llwarns << "Ignoring setPageZoomFactor message (llqtwebkit version is too old)." << llendl;
+#endif
+			}
 			else if(message_name == "clear_cache")
 			{
 				LLQtWebKit::getInstance()->clearCache();
 			else if(message_name == "set_cookies")
 			{
 				LLQtWebKit::getInstance()->setCookies(message_in.getValue("cookies"));
+
+				// debug spam
+				postDebugMessage( "Plugin setting cookie: " + message_in.getValue("cookies") );
 			}
 			else if(message_name == "proxy_setup")
 			{

File indra/newview/CMakeLists.txt

     llfloaterland.cpp
     llfloaterlandholdings.cpp
     llfloatermap.cpp
-    llfloatermediabrowser.cpp
     llfloatermediasettings.cpp
     llfloatermemleak.cpp
     llfloatermodelpreview.cpp
     llfloateropenobject.cpp
     llfloaterpay.cpp
     llfloaterperms.cpp
-    llfloaterpostcard.cpp
     llfloaterpostprocess.cpp
     llfloaterpreference.cpp
     llfloaterproperties.cpp
     llpanelprimmediacontrols.cpp
     llpanelprofile.cpp
     llpanelprofileview.cpp
+    llpanelsnapshot.cpp
+    llpanelsnapshotinventory.cpp
+    llpanelsnapshotlocal.cpp
+    llpanelsnapshotoptions.cpp
+    llpanelsnapshotpostcard.cpp
+    llpanelsnapshotprofile.cpp
     llpanelteleporthistory.cpp
     llpaneltiptoast.cpp
     llpanelvoiceeffect.cpp
     llpopupview.cpp
     llpolymesh.cpp
     llpolymorph.cpp
+    llpostcard.cpp
     llpreview.cpp
     llpreviewanim.cpp
     llpreviewgesture.cpp
     llwearablelist.cpp
     llwearabletype.cpp
     llweb.cpp
+    llwebprofile.cpp
     llwebsharing.cpp
     llwind.cpp
     llwindowlistener.cpp
     llfloaterland.h
     llfloaterlandholdings.h
     llfloatermap.h
-    llfloatermediabrowser.h
     llfloatermediasettings.h
     llfloatermemleak.h
     llfloatermodelpreview.h
     llfloateropenobject.h
     llfloaterpay.h
     llfloaterperms.h
-    llfloaterpostcard.h
     llfloaterpostprocess.h
     llfloaterpreference.h
     llfloaterproperties.h
     llpanelprimmediacontrols.h
     llpanelprofile.h
     llpanelprofileview.h
+    llpanelsnapshot.h
     llpanelteleporthistory.h
     llpaneltiptoast.h
     llpanelvoicedevicesettings.h
     llpolymesh.h
     llpolymorph.h
     llpopupview.h
+    llpostcard.h
     llpreview.h
     llpreviewanim.h
     llpreviewgesture.h
     llwearablelist.h
     llwearabletype.h
     llweb.h
+    llwebprofile.h
     llwebsharing.h
     llwind.h
     llwindowlistener.h

File indra/newview/app_settings/settings.xml

       <key>Value</key>
       <integer>0</integer>
     </map>
-    <key>CloseSnapshotOnKeep</key>
-    <map>
-      <key>Comment</key>
-      <string>Close snapshot window after saving snapshot</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
     <key>CmdLineDisableVoice</key>
     <map>
       <key>Comment</key>
       <key>Value</key>
       <integer>-1</integer>
     </map>
-    <key>DebugToolbarFUI</key>
-    <map>
-      <key>Comment</key>
-      <string>Turn on the FUI Toolbars</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
     <key>DebugViews</key>
     <map>
       <key>Comment</key>
       <string>0.0.0</string>
     </map>
   
+    <key>LastSnapshotToProfileHeight</key>
+    <map>
+      <key>Comment</key>
+      <string>The height of the last profile snapshot, in px</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>S32</string>
+      <key>Value</key>
+      <integer>768</integer>
+    </map>
     <key>LastSnapshotToEmailHeight</key>
     <map>
       <key>Comment</key>
       <key>Value</key>
       <integer>768</integer>
     </map>
+    <key>LastSnapshotToProfileWidth</key>
+    <map>
+      <key>Comment</key>
+      <string>The width of the last profile snapshot, in px</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>S32</string>
+      <key>Value</key>
+      <integer>1024</integer>
+    </map>
     <key>LastSnapshotToEmailWidth</key>
     <map>
       <key>Comment</key>
       <key>Value</key>
       <integer>512</integer>
     </map>
-    <key>LastSnapshotType</key>
-    <map>
-      <key>Comment</key>
-      <string>Select this as next type of snapshot to take (0 = postcard, 1 = texture, 2 = local image)</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>S32</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
     <key>LeftClickShowMenu</key>
     <map>
       <key>Comment</key>
       <key>Value</key>
       <integer>0</integer>
     </map>
+    <key>SnapshotProfileLastResolution</key>
+    <map>
+      <key>Comment</key>
+      <string>Take next profile snapshot at this resolution</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>S32</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
     <key>SnapshotPostcardLastResolution</key>
     <map>
       <key>Comment</key>

File indra/newview/app_settings/settings_per_account.xml

     <key>DisplayDestinationsOnInitialRun</key>
         <map>
         <key>Comment</key>
-          <string>Display the destinations guide when a user first launches FUI.</string>
+          <string>Display the destinations guide when a user first launches Second Life.</string>
         <key>Persist</key>
           <integer>1</integer>
         <key>Type</key>

File indra/newview/installers/windows/installer_template.nsi

 Var SHORTCUT_LANG_PARAM ; "--set InstallLanguage de", passes language to viewer
 Var SKIP_DIALOGS        ; set from command line in  .onInit. autoinstall 
                         ; GUI and the defaults.
+Var DO_UNINSTALL_V2     ; If non-null, path to a previous Viewer 2 installation that will be uninstalled.
 
 ;;; Function definitions should go before file includes, because calls to
 ;;; DLLs like LangDLL trigger an implicit file include, so if that call is at
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Function CheckWillUninstallV2               
+;
+; If we are being called through auto-update, we need to uninstall any
+; existing V2 installation. Otherwise, we wind up with
+; SecondLifeViewer2 and SecondLifeViewer installations existing side
+; by side no indication which to use.
+; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Function CheckWillUninstallV2
+
+  StrCpy $DO_UNINSTALL_V2 ""
+
+  StrCmp $SKIP_DIALOGS "true" 0 CHECKV2_DONE
+  StrCmp $INSTDIR "$PROGRAMFILES\SecondLifeViewer2" CHECKV2_DONE ; don't uninstall our own install dir.
+  IfFileExists "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" CHECKV2_FOUND CHECKV2_DONE
+
+CHECKV2_FOUND:
+  StrCpy $DO_UNINSTALL_V2 "true"
+
+CHECKV2_DONE:
+
+FunctionEnd
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; Save user files to temp location
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 Function PreserveUserFiles
     ExpandEnvStrings $2 $2
 
     CreateDirectory "$TEMP\SecondLifeSettingsBackup\$0"
-    CopyFiles  "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\$0"
+    CopyFiles /SILENT "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\$0"
 
   CONTINUE:
     IntOp $0 $0 + 1
     ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
     StrCmp $0 "" +2
     CreateDirectory "$TEMP\SecondLifeSettingsBackup\AllUsers\"
-    CopyFiles "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\AllUsers\"
+    CopyFiles /SILENT "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\AllUsers\"
 Pop $0
 
 FunctionEnd
     ExpandEnvStrings $2 $2
 
     CreateDirectory "$2\Application Data\SecondLife\"
-    CopyFiles "$TEMP\SecondLifeSettingsBackup\$0\*" "$2\Application Data\SecondLife\" 
+    CopyFiles /SILENT "$TEMP\SecondLifeSettingsBackup\$0\*" "$2\Application Data\SecondLife\" 
 
   CONTINUE:
     IntOp $0 $0 + 1
     ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
     StrCmp $0 "" +2
     CreateDirectory "$2\Application Data\SecondLife\"
-    CopyFiles "$TEMP\SecondLifeSettingsBackup\AllUsers\*" "$2\Application Data\SecondLife\" 
+    CopyFiles /SILENT "$TEMP\SecondLifeSettingsBackup\AllUsers\*" "$2\Application Data\SecondLife\" 
 Pop $0
 
 FunctionEnd
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Remove temp dirs
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Function RemoveTempUserFiles
+
+Push $0
+Push $1
+Push $2
+
+    StrCpy $0 0 ; Index number used to iterate via EnumRegKey
+
+  LOOP:
+    EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
+    StrCmp $1 "" DONE               ; no more users
+
+    ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath" 
+    StrCmp $2 "" CONTINUE 0         ; "ProfileImagePath" value is missing
+
+    ; Required since ProfileImagePath is of type REG_EXPAND_SZ
+    ExpandEnvStrings $2 $2
+
+    RMDir /r "$TEMP\SecondLifeSettingsBackup\$0\*"
+
+  CONTINUE:
+    IntOp $0 $0 + 1
+    Goto LOOP
+  DONE:
+
+Pop $2
+Pop $1
+Pop $0
+
+; Copy files in Documents and Settings\All Users\SecondLife
+Push $0
+    ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
+    StrCmp $0 "" +2
+    RMDir /r "$TEMP\SecondLifeSettingsBackup\AllUsers\*"
+Pop $0
+
+FunctionEnd
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; Clobber user files - TEST ONLY
 ; This is here for testing, generally not desirable to call it.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;