Commits

Scott Lawrence committed 39dbb65 Merge

merge changes for storm-1557

  • Participants
  • Parent commits 1f37bd6, fe75b07

Comments (0)

Files changed (37)

File indra/llcommon/llsdserialize.cpp

 LLSDParser::~LLSDParser()
 { }
 
+LLFastTimer::DeclareTimer FTM_SD_PARSE("LLSD Parsing");
 S32 LLSDParser::parse(std::istream& istr, LLSD& data, S32 max_bytes)
 {
+	LLFastTimer _(FTM_SD_PARSE);
 	mCheckLimits = (LLSDSerialize::SIZE_UNLIMITED == max_bytes) ? false : true;
 	mMaxBytesLeft = max_bytes;
 	return doParse(istr, data);

File indra/llcommon/llsdserialize_xml.cpp

 	return count;
 }
 
+LLFastTimer::DeclareTimer FTM_SD_PARSE_READ_STREAM("LLSD Read Stream");
 S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data)
 {
 	XML_Status status;
 		{
 			break;
 		}
-		count = get_till_eol(input, (char *)buffer, BUFFER_SIZE);
-		if (!count)
-		{
-			break;
+		{ LLFastTimer _(FTM_SD_PARSE_READ_STREAM);
+		
+			count = get_till_eol(input, (char *)buffer, BUFFER_SIZE);
+			if (!count)
+			{
+				break;
+			}
 		}
 		status = XML_ParseBuffer(mParser, count, false);
 

File indra/llcommon/llsys.cpp

 #	include <sys/utsname.h>
 #	include <stdint.h>
 #	include <Carbon/Carbon.h>
-#   include <sys/wait.h>
-#   include <string.h>
 #   include <stdexcept>
+#	include <mach/host_info.h>
+#	include <mach/mach_host.h>
+#	include <mach/task.h>
+#	include <mach/task_info.h>
 #elif LL_LINUX
 #	include <errno.h>
 #	include <sys/utsname.h>
 	stats.add("PrivateUsage KB",               pmem.PrivateUsage/1024);
 
 #elif LL_DARWIN
-	uint64_t phys = 0;
 
-	size_t len = sizeof(phys);	
+	const vm_size_t pagekb(vm_page_size / 1024);
 	
-	if (sysctlbyname("hw.memsize", &phys, &len, NULL, 0) == 0)
+	//
+	// Collect the vm_stat's
+	//
+	
 	{
-		stats.add("Total Physical KB", phys/1024);
+		vm_statistics_data_t vmstat;
+		mach_msg_type_number_t vmstatCount = HOST_VM_INFO_COUNT;
+
+		if (host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t) &vmstat, &vmstatCount) != KERN_SUCCESS)
+	{
+			LL_WARNS("LLMemoryInfo") << "Unable to collect memory information" << LL_ENDL;
+		}
+		else
+		{
+			stats.add("Pages free KB",		pagekb * vmstat.free_count);
+			stats.add("Pages active KB",	pagekb * vmstat.active_count);
+			stats.add("Pages inactive KB",	pagekb * vmstat.inactive_count);
+			stats.add("Pages wired KB",		pagekb * vmstat.wire_count);
+
+			stats.add("Pages zero fill",		vmstat.zero_fill_count);
+			stats.add("Page reactivations",		vmstat.reactivations);
+			stats.add("Page-ins",				vmstat.pageins);
+			stats.add("Page-outs",				vmstat.pageouts);
+			
+			stats.add("Faults",					vmstat.faults);
+			stats.add("Faults copy-on-write",	vmstat.cow_faults);
+			
+			stats.add("Cache lookups",			vmstat.lookups);
+			stats.add("Cache hits",				vmstat.hits);
+			
+			stats.add("Page purgeable count",	vmstat.purgeable_count);
+			stats.add("Page purges",			vmstat.purges);
+			
+			stats.add("Page speculative reads",	vmstat.speculative_count);
+		}
 	}
-	else
-	{
-		LL_WARNS("LLMemoryInfo") << "Unable to collect hw.memsize memory information" << LL_ENDL;
+
+	//
+	// Collect the misc task info
+	//
+
+		{
+		task_events_info_data_t taskinfo;
+		unsigned taskinfoSize = sizeof(taskinfo);
+		
+		if (task_info(mach_task_self(), TASK_EVENTS_INFO, (task_info_t) &taskinfo, &taskinfoSize) != KERN_SUCCESS)
+					{
+			LL_WARNS("LLMemoryInfo") << "Unable to collect task information" << LL_ENDL;
+			}
+			else
+			{
+			stats.add("Task page-ins",					taskinfo.pageins);
+			stats.add("Task copy-on-write faults",		taskinfo.cow_faults);
+			stats.add("Task messages sent",				taskinfo.messages_sent);
+			stats.add("Task messages received",			taskinfo.messages_received);
+			stats.add("Task mach system call count",	taskinfo.syscalls_mach);
+			stats.add("Task unix system call count",	taskinfo.syscalls_unix);
+			stats.add("Task context switch count",		taskinfo.csw);
+			}
+	}	
+	
+	//
+	// Collect the basic task info
+	//
+
+		{
+		task_basic_info_64_data_t taskinfo;
+		unsigned taskinfoSize = sizeof(taskinfo);
+		
+		if (task_info(mach_task_self(), TASK_BASIC_INFO_64, (task_info_t) &taskinfo, &taskinfoSize) != KERN_SUCCESS)
+			{
+			LL_WARNS("LLMemoryInfo") << "Unable to collect task information" << LL_ENDL;
+				}
+				else
+				{
+			stats.add("Basic suspend count",					taskinfo.suspend_count);
+			stats.add("Basic virtual memory KB",				taskinfo.virtual_size / 1024);
+			stats.add("Basic resident memory KB",				taskinfo.resident_size / 1024);
+			stats.add("Basic new thread policy",				taskinfo.policy);
+		}
 	}
 
 #elif LL_SOLARIS

File indra/llinventory/llinventory.cpp

 	sd[INV_CREATION_DATE_LABEL] = (S32) mCreationDate;
 }
 
+LLFastTimer::DeclareTimer FTM_INVENTORY_SD_DESERIALIZE("Inventory SD Deserialize");
+
 bool LLInventoryItem::fromLLSD(const LLSD& sd)
 {
+	LLFastTimer _(FTM_INVENTORY_SD_DESERIALIZE);
 	mInventoryType = LLInventoryType::IT_NONE;
 	mAssetUUID.setNull();
 	std::string w;

File indra/llplugin/llpluginprocesschild.cpp

 			}
 			else if(message_name == "sleep_time")
 			{
-				mSleepTime = parsed.getValueReal("time");
+				mSleepTime = llmax(parsed.getValueReal("time"), 1.0 / 100.0); // clamp to maximum of 100Hz
 			}
 			else if(message_name == "crash")
 			{

File indra/llplugin/llpluginprocessparent.cpp

 				}
 				
 				// Send initial sleep time
+				llassert_always(mSleepTime != 0.f);
 				setSleepTime(mSleepTime, true);			
 
 				setState(STATE_RUNNING);

File indra/llui/llmenubutton.cpp

 
 static LLDefaultChildRegistry::Register<LLMenuButton> r("menu_button");
 
+void LLMenuButton::MenuPositions::declareValues()
+{
+	declare("topleft", MP_TOP_LEFT);
+	declare("topright", MP_TOP_RIGHT);
+	declare("bottomleft", MP_BOTTOM_LEFT);
+}
 
 LLMenuButton::Params::Params()
-:	menu_filename("menu_filename")
+:	menu_filename("menu_filename"),
+	position("position", MP_BOTTOM_LEFT)
 {
 }
 
 LLMenuButton::LLMenuButton(const LLMenuButton::Params& p)
 :	LLButton(p),
 	mIsMenuShown(false),
-	mMenuPosition(MP_BOTTOM_LEFT)
+	mMenuPosition(p.position)
 {
 	std::string menu_filename = p.menu_filename;
 

File indra/llui/llmenubutton.h

 : public LLButton
 {
 public:
-	struct Params 
-	:	public LLInitParam::Block<Params, LLButton::Params>
-	{
-		// filename for it's toggleable menu
-		Optional<std::string>	menu_filename;
-	
-		Params();
-	};
-
 	typedef enum e_menu_position
 	{
 		MP_TOP_LEFT,
 		MP_TOP_RIGHT,
 		MP_BOTTOM_LEFT
 	} EMenuPosition;
+
+	struct MenuPositions
+		:	public LLInitParam::TypeValuesHelper<EMenuPosition, MenuPositions>
+	{
+		static void declareValues();
+	};
+
+	struct Params 
+	:	public LLInitParam::Block<Params, LLButton::Params>
+	{
+		// filename for it's toggleable menu
+		Optional<std::string>	menu_filename;
+		Optional<EMenuPosition>	position;
+	
+		Params();
+	};
+
+
 	
 	boost::signals2::connection setMouseDownCallback( const mouse_signal_t::slot_type& cb );
 

File indra/llui/llview.cpp

 
 BOOL LLView::childHasKeyboardFocus( const std::string& childname ) const
 {
-	LLView *child = findChildView(childname, TRUE);
-	if (child)
+	LLView *focus = dynamic_cast<LLView *>(gFocusMgr.getKeyboardFocus());
+	
+	while (focus != NULL)
 	{
-		return gFocusMgr.childHasKeyboardFocus(child);
+		if (focus->getName() == childname)
+		{
+			return TRUE;
+		}
+		
+		focus = focus->getParent();
 	}
-	else
-	{
-		return FALSE;
-	}
+	
+	return FALSE;
 }
 
 //-----------------------------------------------------------------------------

File indra/newview/llavataractions.cpp

 	if (inventory_selected_uuids.empty())
 	{
 		LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory");
-		LLInventoryPanel * inbox = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_inbox");
-		if (inbox)
-		{
-			inventory_selected_uuids = inbox->getRootFolder()->getSelectionList();
-		}
 
+		inventory_selected_uuids = sidepanel_inventory->getInboxOrOutboxSelectionList();
 	}
 
 	return inventory_selected_uuids;

File indra/newview/llfeaturemanager.cpp

 		return mFeatures[name].mAvailable;
 	}
 
-	LL_WARNS("RenderInit") << "Feature " << name << " not on feature list!" << LL_ENDL;
+	LL_WARNS_ONCE("RenderInit") << "Feature " << name << " not on feature list!" << LL_ENDL;
 	
 	// changing this to TRUE so you have to explicitly disable 
 	// something for it to be disabled
 		return mFeatures[name].mRecommendedLevel;
 	}
 
-	LL_WARNS("RenderInit") << "Feature " << name << " not on feature list or not available!" << LL_ENDL;
+	LL_WARNS_ONCE("RenderInit") << "Feature " << name << " not on feature list or not available!" << LL_ENDL;
 	return 0;
 }
 

File indra/newview/llfloaterworldmap.cpp

 
 LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key)
 :	LLFloater(key),
-mInventory(NULL),
-mInventoryObserver(NULL),
-mFriendObserver(NULL),
-mCompletingRegionName(),
-mCompletingRegionPos(),
-mWaitingForTracker(FALSE),
-mIsClosing(FALSE),
-mSetToUserPosition(TRUE),
-mTrackedLocation(0,0,0),
-mTrackedStatus(LLTracker::TRACKING_NOTHING)
+	mInventory(NULL),
+	mInventoryObserver(NULL),
+	mFriendObserver(NULL),
+	mCompletingRegionName(),
+	mCompletingRegionPos(),
+	mWaitingForTracker(FALSE),
+	mIsClosing(FALSE),
+	mSetToUserPosition(TRUE),
+	mTrackedLocation(0,0,0),
+	mTrackedStatus(LLTracker::TRACKING_NOTHING),
+	mListFriendCombo(NULL),
+	mListLandmarkCombo(NULL),
+	mListSearchResults(NULL)
 {
 	gFloaterWorldMap = this;
 	
 	avatar_combo->selectFirstItem();
 	avatar_combo->setPrearrangeCallback( boost::bind(&LLFloaterWorldMap::onAvatarComboPrearrange, this) );
 	avatar_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) );
+	mListFriendCombo = dynamic_cast<LLCtrlListInterface *>(avatar_combo);
 	
 	LLSearchEditor *location_editor = getChild<LLSearchEditor>("location");
 	location_editor->setFocusChangedCallback(boost::bind(&LLFloaterWorldMap::onLocationFocusChanged, this, _1));
 	location_editor->setKeystrokeCallback( boost::bind(&LLFloaterWorldMap::onSearchTextEntry, this));
 	
 	getChild<LLScrollListCtrl>("search_results")->setDoubleClickCallback( boost::bind(&LLFloaterWorldMap::onClickTeleportBtn, this));
+	mListSearchResults = childGetListInterface("search_results");
 	
 	LLComboBox *landmark_combo = getChild<LLComboBox>( "landmark combo");
 	landmark_combo->selectFirstItem();
 	landmark_combo->setPrearrangeCallback( boost::bind(&LLFloaterWorldMap::onLandmarkComboPrearrange, this) );
 	landmark_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) );
+	mListLandmarkCombo = dynamic_cast<LLCtrlListInterface *>(landmark_combo);
 	
 	mCurZoomVal = log(LLWorldMapView::sMapScale)/log(2.f);
 	getChild<LLUICtrl>("zoom slider")->setValue(LLWorldMapView::sMapScale);
 // No longer really builds a list.  Instead, just updates mAvatarCombo.
 void LLFloaterWorldMap::buildAvatarIDList()
 {
-	LLCtrlListInterface *list = childGetListInterface("friend combo");
+	LLCtrlListInterface *list = mListFriendCombo;
 	if (!list) return;
 	
     // Delete all but the "None" entry
 
 void LLFloaterWorldMap::buildLandmarkIDLists()
 {
-	LLCtrlListInterface *list = childGetListInterface("landmark combo");
+	LLCtrlListInterface *list = mListLandmarkCombo;
 	if (!list) return;
 	
     // Delete all but the "None" entry
 
 void LLFloaterWorldMap::clearLocationSelection(BOOL clear_ui)
 {
-	LLCtrlListInterface *list = childGetListInterface("search_results");
+	LLCtrlListInterface *list = mListSearchResults;
 	if (list)
 	{
 		list->operateOnAll(LLCtrlListInterface::OP_DELETE);
 {
 	if (clear_ui || !childHasKeyboardFocus("landmark combo"))
 	{
-		LLCtrlListInterface *list = childGetListInterface("landmark combo");
+		LLCtrlListInterface *list = mListLandmarkCombo;
 		if (list)
 		{
 			list->selectByValue( "None" );
 	if (clear_ui || !childHasKeyboardFocus("friend combo"))
 	{
 		mTrackedStatus = LLTracker::TRACKING_NOTHING;
-		LLCtrlListInterface *list = childGetListInterface("friend combo");
+		LLCtrlListInterface *list = mListFriendCombo;
 		if (list)
 		{
 			list->selectByValue( "None" );
 		return;
 	}
 	
-	LLCtrlListInterface *list = childGetListInterface("landmark combo");
+	LLCtrlListInterface *list = mListLandmarkCombo;
 	if (!list) return;
 	
 	LLUUID current_choice = list->getCurrentID();
 		return;
 	}
 	
-	LLCtrlListInterface *list = childGetListInterface("landmark combo");
+	LLCtrlListInterface *list = mListLandmarkCombo;
 	if (!list) return;
 	
 	LLUUID asset_id;
 		return;
 	}
 	
-	LLCtrlListInterface *list = childGetListInterface("friend combo");
+	LLCtrlListInterface *list = mListFriendCombo;
 	if (!list) return;
 	
 	LLUUID current_choice;
 		return;
 	}
 	
-	LLCtrlListInterface *list = childGetListInterface("friend combo");
+	LLCtrlListInterface *list = mListFriendCombo;
 	if (!list) return;
 	
 	const LLUUID& new_avatar_id = list->getCurrentID();
 
 void LLFloaterWorldMap::onCommitSearchResult()
 {
-	LLCtrlListInterface *list = childGetListInterface("search_results");
+	LLCtrlListInterface *list = mListSearchResults;
 	if (!list) return;
 	
 	LLSD selected_value = list->getSelectedValue();

File indra/newview/llfloaterworldmap.h

 #include "lltracker.h"
 #include "llslurl.h"
 
+class LLCtrlListInterface;
 class LLFriendObserver;
 class LLInventoryModel;
 class LLInventoryObserver;
 	std::string				mTrackedSimName;
 	std::string				mTrackedAvatarName;
 	LLSLURL  				mSLURL;
+
+	LLCtrlListInterface *	mListFriendCombo;
+	LLCtrlListInterface *	mListLandmarkCombo;
+	LLCtrlListInterface *	mListSearchResults;
 };
 
 extern LLFloaterWorldMap* gFloaterWorldMap;

File indra/newview/llfolderview.cpp

 	arrangeAll();
 }
 
-void LLFolderView::openFolder(const std::string& foldername)
-{
-	LLFolderViewFolder* inv = findChild<LLFolderViewFolder>(foldername);
-	if (inv)
-	{
-		setSelection(inv, FALSE, FALSE);
-		inv->setOpen(TRUE);
-	}
-}
-
 void LLFolderView::openTopLevelFolders()
 {
 	for (folders_t::iterator iter = mFolders.begin();
 	mSignalSelectCallback = SIGNAL_KEYBOARD_FOCUS;
 }
 
+static LLFastTimer::DeclareTimer FTM_SANITIZE_SELECTION("Sanitize Selection");
 void LLFolderView::sanitizeSelection()
 {
+	LLFastTimer _(FTM_SANITIZE_SELECTION);
 	// store off current item in case it is automatically deselected
 	// and we want to preserve context
 	LLFolderViewItem* original_selected_item = getCurSelectedItem();
 		}
 		else
 		{
-		handled = mFolders.front()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg);
-	}
+			handled = mFolders.front()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg);
+		}
 	}
 
 	if (handled)
 	mItemMap.erase(id);
 }
 
+LLFastTimer::DeclareTimer FTM_GET_ITEM_BY_ID("Get FolderViewItem by ID");
 LLFolderViewItem* LLFolderView::getItemByID(const LLUUID& id)
 {
+	LLFastTimer _(FTM_GET_ITEM_BY_ID);
 	if (id == getListener()->getUUID())
 	{
 		return this;

File indra/newview/llfolderview.h

 
 	// Close all folders in the view
 	void closeAllFolders();
-	void openFolder(const std::string& foldername);
 	void openTopLevelFolders();
 
 	virtual void toggleOpen() {};

File indra/newview/llfolderviewitem.h

 	virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask );
 	virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
 
+	virtual LLView* findChildView(const std::string& name, BOOL recurse) const { return NULL; }
+
 	//	virtual void handleDropped();
 	virtual void draw();
 	virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,

File indra/newview/llinventorypanel.cpp

 			&& fchild->getListener()
 				&& fchild->getListener()->getUUID() == gInventory.getRootFolderID())
 		{
-			const std::string& child_name = child->getName();
-			mFolderRoot->openFolder(child_name);
-			mFolderRoot->clearSelection();	// No need to keep it selected though!
+			fchild->setOpen(TRUE);
 			break;
 		}
 	}

File indra/newview/lllogininstance.cpp

 	else
 	{
 		requested_options.append("basic-mode");
+		requested_options.append("inventory-basic");
 	}
 
 #endif

File indra/newview/llpanellogin.cpp

 	}
 	updateLocationCombo(false);
 
-	LLUICtrl& mode_combo = getChildRef<LLUICtrl>("mode_combo");
-	mode_combo.setValue(gSavedSettings.getString("SessionSettingsFile"));
-	mode_combo.setCommitCallback(boost::bind(&LLPanelLogin::onModeChange, this, getChild<LLUICtrl>("mode_combo")->getValue(), _2));
-
 	LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo");
 	server_choice_combo->setCommitCallback(onSelectServer, NULL);
 	server_choice_combo->setFocusLostCallback(boost::bind(onServerComboLostFocus, _1));
 	sInstance->getChildView("forgot_password_text")->setVisible( system_grid);
 }
 
-void LLPanelLogin::onModeChange(const LLSD& original_value, const LLSD& new_value)
-{
-	if (original_value.asString() != new_value.asString())
-	{
-		LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(&LLPanelLogin::onModeChangeConfirm, this, original_value, new_value, _1, _2));
-	}
-}
-
-void LLPanelLogin::onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response)
-{
-	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
-	switch (option)
-	{
-	case 0:
-		gSavedSettings.getControl("SessionSettingsFile")->set(new_value);
-		LLAppViewer::instance()->forceQuit();
-		break;
-	case 1:
-		// revert to original value
-		getChild<LLUICtrl>("mode_combo")->setValue(original_value);
-		break;
-	default:
-		break;
-	}
-}
-
 std::string canonicalize_username(const std::string& name)
 {
 	std::string cname = name;

File indra/newview/llpanellogin.h

 	static void onServerComboLostFocus(LLFocusableElement*);
 	static void updateServerCombo();
 	static void updateStartSLURL();
-	void onModeChange(const LLSD& original_value, const LLSD& new_value);
-	void onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response);
 	
 	static void updateLoginPanelLinks();
 

File indra/newview/llpanelmaininventory.cpp

 	{
 		text = getString("ItemcountUnknown");
 	}
+	
+	// *TODO: Cache the LLUICtrl* for the ItemcountText control
 	getChild<LLUICtrl>("ItemcountText")->setValue(text);
 }
 
 void LLPanelMainInventory::onFocusReceived()
 {
 	LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory");
-
-	LLInventoryPanel * inbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_inbox");
-
-	if (inbox_panel)
-	{
-		inbox_panel->clearSelection();
-	}
-
-	LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_outbox");
-
-	if (outbox_panel)
-	{
-		outbox_panel->clearSelection();
-	}
-
-	sidepanel_inventory->updateVerbs();
+	
+	sidepanel_inventory->clearSelections(false, true, true);
 }
 
 void LLPanelMainInventory::setFilterTextFromFilter() 

File indra/newview/llpanelmarketplaceinbox.cpp

 	LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this);
 }
 
-void LLPanelMarketplaceInbox::setupInventoryPanel()
+LLInventoryPanel * LLPanelMarketplaceInbox::setupInventoryPanel()
 {
 	LLView * inbox_inventory_placeholder = getChild<LLView>("inbox_inventory_placeholder");
 	LLView * inbox_inventory_parent = inbox_inventory_placeholder->getParent();
 	
 	// Hide the placeholder text
 	inbox_inventory_placeholder->setVisible(FALSE);
+	
+	return mInventoryPanel;
 }
 
 void LLPanelMarketplaceInbox::onFocusReceived()
 {
 	LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory");
 
-	if (sidepanel_inventory)
-	{
-		LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel();
-
-		if (inv_panel)
-		{
-			inv_panel->clearSelection();
-		}
-	
-		LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_outbox");
-
-		if (outbox_panel)
-		{
-			outbox_panel->clearSelection();
-		}
-		
-		sidepanel_inventory->updateVerbs();
-	}
+	sidepanel_inventory->clearSelections(true, false, true);
 }
 
 BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg)

File indra/newview/llpanelmarketplaceinbox.h

 
 	/*virtual*/ void draw();
 	
-	void setupInventoryPanel();
+	LLInventoryPanel * setupInventoryPanel();
 
 	U32 getFreshItemCount() const;
 	U32 getTotalItemCount() const;

File indra/newview/llpanelmarketplaceoutbox.cpp

 void LLPanelMarketplaceOutbox::onFocusReceived()
 {
 	LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory");
-
-	if (sidepanel_inventory)
-	{
-		LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel();
-
-		if (inv_panel)
-		{
-			inv_panel->clearSelection();
-		}
-
-		LLInventoryPanel * inbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_inbox");
-
-		if (inbox_panel)
-		{
-			inbox_panel->clearSelection();
-		}
-		
-		sidepanel_inventory->updateVerbs();
-	}
+	
+	sidepanel_inventory->clearSelections(true, true, false);
 }
 
 void LLPanelMarketplaceOutbox::onSelectionChange()
 	sidepanel_inventory->updateVerbs();
 }
 
-void LLPanelMarketplaceOutbox::setupInventoryPanel()
+LLInventoryPanel * LLPanelMarketplaceOutbox::setupInventoryPanel()
 {
 	LLView * outbox_inventory_placeholder = getChild<LLView>("outbox_inventory_placeholder");
 	LLView * outbox_inventory_parent = outbox_inventory_placeholder->getParent();
 	
 	// Hide the placeholder text
 	outbox_inventory_placeholder->setVisible(FALSE);
+	
+	return mInventoryPanel;
 }
 
 bool LLPanelMarketplaceOutbox::isOutboxEmpty() const

File indra/newview/llpanelmarketplaceoutbox.h

 
 	/*virtual*/ BOOL postBuild();
 
-	void setupInventoryPanel();
+	LLInventoryPanel * setupInventoryPanel();
 
 	bool isOutboxEmpty() const;
 	bool isSyncInProgress() const;

File indra/newview/llsidepanelinventory.cpp

 LLSidepanelInventory::LLSidepanelInventory()
 	: LLPanel()
 	, mItemPanel(NULL)
+	, mInventoryPanelInbox(NULL)
+	, mInventoryPanelOutbox(NULL)
 	, mPanelMainInventory(NULL)
 	, mInboxEnabled(false)
 	, mOutboxEnabled(false)
 	//
 	
 	LLPanelMarketplaceInbox * inbox = getChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL);
-	inbox->setupInventoryPanel();
+	mInventoryPanelInbox = inbox->setupInventoryPanel();
 }
 
 
 	//
 	
 	LLPanelMarketplaceOutbox * outbox = getChild<LLPanelMarketplaceOutbox>(MARKETPLACE_OUTBOX_PANEL);
-	outbox->setupInventoryPanel();
+	mInventoryPanelOutbox = outbox->setupInventoryPanel();
 }
 
 void LLSidepanelInventory::enableInbox(bool enabled)
 
 void LLSidepanelInventory::performActionOnSelection(const std::string &action)
 {
-	LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
-	LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem();
+	LLFolderViewItem* current_item = mPanelMainInventory->getActivePanel()->getRootFolder()->getCurSelectedItem();
 	if (!current_item)
 	{
-		LLInventoryPanel* inbox = findChild<LLInventoryPanel>("inventory_inbox");
-		if (inbox)
+		if (mInventoryPanelInbox)
 		{
-			current_item = inbox->getRootFolder()->getCurSelectedItem();
+			current_item = mInventoryPanelInbox->getRootFolder()->getCurSelectedItem();
 		}
 
 		if (!current_item)
 		}
 	}
 
-	current_item->getListener()->performAction(panel_main_inventory->getActivePanel()->getModel(), action);
+	current_item->getListener()->performAction(mPanelMainInventory->getActivePanel()->getModel(), action);
 }
 
 void LLSidepanelInventory::onWearButtonClicked()
 
 bool LLSidepanelInventory::canShare()
 {
-	LLPanelMainInventory* panel_main_inventory =
-		mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
-
-	LLInventoryPanel* inbox = findChild<LLInventoryPanel>("inventory_inbox");
+	LLInventoryPanel* inbox = mInventoryPanelInbox;
 
 	// Avoid flicker in the Recent tab while inventory is being loaded.
 	if ( (!inbox || inbox->getRootFolder()->getSelectionList().empty())
-		&& (panel_main_inventory && !panel_main_inventory->getActivePanel()->getRootFolder()->hasVisibleChildren()) )
+		&& (mPanelMainInventory && !mPanelMainInventory->getActivePanel()->getRootFolder()->hasVisibleChildren()) )
 	{
 		return false;
 	}
 
-	return ( (panel_main_inventory ? LLAvatarActions::canShareSelectedItems(panel_main_inventory->getActivePanel()) : false)
+	return ( (mPanelMainInventory ? LLAvatarActions::canShareSelectedItems(mPanelMainInventory->getActivePanel()) : false)
 			|| (inbox ? LLAvatarActions::canShareSelectedItems(inbox) : false) );
 }
 
 
 LLInventoryItem *LLSidepanelInventory::getSelectedItem()
 {
-	LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
-	LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem();
+	LLFolderViewItem* current_item = mPanelMainInventory->getActivePanel()->getRootFolder()->getCurSelectedItem();
+	
 	if (!current_item)
 	{
-		LLInventoryPanel* inbox = findChild<LLInventoryPanel>("inventory_inbox");
-		if (inbox)
+		if (mInventoryPanelInbox)
 		{
-			current_item = inbox->getRootFolder()->getCurSelectedItem();
+			current_item = mInventoryPanelInbox->getRootFolder()->getCurSelectedItem();
 		}
 
 		if (!current_item)
 {
 	int count = 0;
 
-	LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
-	std::set<LLUUID> selection_list = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList();
+	std::set<LLUUID> selection_list = mPanelMainInventory->getActivePanel()->getRootFolder()->getSelectionList();
 	count += selection_list.size();
 
-	LLInventoryPanel* inbox = findChild<LLInventoryPanel>("inventory_inbox");
-	if (inbox)
+	if ((count == 0) && mInboxEnabled && (mInventoryPanelInbox != NULL))
 	{
-		selection_list = inbox->getRootFolder()->getSelectionList();
+		selection_list = mInventoryPanelInbox->getRootFolder()->getSelectionList();
+
+	count += selection_list.size();
+	}
+
+	if ((count == 0) && mOutboxEnabled && (mInventoryPanelOutbox != NULL))
+	{
+		selection_list = mInventoryPanelOutbox->getRootFolder()->getSelectionList();
+		
 		count += selection_list.size();
 	}
 
 {
 	return mInventoryPanel->getVisible();
 }
+
+void LLSidepanelInventory::clearSelections(bool clearMain, bool clearInbox, bool clearOutbox)
+{
+	if (clearMain)
+	{
+		LLInventoryPanel * inv_panel = getActivePanel();
+		
+		if (inv_panel)
+		{
+			inv_panel->clearSelection();
+		}
+	}
+	
+	if (clearInbox && mInboxEnabled && (mInventoryPanelInbox != NULL))
+	{
+		mInventoryPanelInbox->clearSelection();
+	}
+	
+	if (clearOutbox && mOutboxEnabled && (mInventoryPanelOutbox != NULL))
+	{
+		mInventoryPanelOutbox->clearSelection();
+	}
+	
+	updateVerbs();
+}
+
+std::set<LLUUID> LLSidepanelInventory::getInboxOrOutboxSelectionList()
+{
+	std::set<LLUUID> inventory_selected_uuids;
+	
+	if (mInboxEnabled && (mInventoryPanelInbox != NULL))
+	{
+		inventory_selected_uuids = mInventoryPanelInbox->getRootFolder()->getSelectionList();
+	}
+	
+	if (inventory_selected_uuids.empty() && mOutboxEnabled && (mInventoryPanelOutbox != NULL))
+	{
+		inventory_selected_uuids = mInventoryPanelOutbox->getRootFolder()->getSelectionList();
+	}
+	
+	return inventory_selected_uuids;
+}

File indra/newview/llsidepanelinventory.h

 	LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any.
 	LLPanelMainInventory* getMainInventoryPanel() const { return mPanelMainInventory; }
 	BOOL isMainInventoryPanelActive() const;
+	
+	void clearSelections(bool clearMain, bool clearInbox, bool clearOutbox);
+	std::set<LLUUID> getInboxOrOutboxSelectionList();
 
 	void showItemInfoPanel();
 	void showTaskInfoPanel();
 	//
 private:
 	LLPanel*					mInventoryPanel; // Main inventory view
+	LLInventoryPanel*			mInventoryPanelInbox;
+	LLInventoryPanel*			mInventoryPanelOutbox;
 	LLSidepanelItemInfo*		mItemPanel; // Individual item view
 	LLSidepanelTaskInfo*		mTaskPanel; // Individual in-world object view
 	LLPanelMainInventory*		mPanelMainInventory;

File indra/newview/llstartup.cpp

 
 		timeout_count = 0;
 
+		// Login screen needs menus for preferences, but we can enter
+		// this startup phase more than once.
+		if (gLoginMenuBarView == NULL)
+		{
 		initialize_edit_menu();
+			init_menus();
+		}
 
 		if (show_connect_box)
 		{
 			LLStartUp::setStartupState( STATE_LOGIN_CLEANUP );
 		}
 
-		// *NOTE: This is where LLViewerParcelMgr::getInstance() used to get allocated before becoming LLViewerParcelMgr::getInstance().
-
-		// *NOTE: This is where gHUDManager used to bet allocated before becoming LLHUDManager::getInstance().
-
-		// *NOTE: This is where gMuteList used to get allocated before becoming LLMuteList::getInstance().
-
-		// Login screen needs menus for preferences, but we can enter
-		// this startup phase more than once.
-		if (gLoginMenuBarView == NULL)
-		{
-			init_menus();
-		}
-		
 		gViewerWindow->setNormalControlsVisible( FALSE );	
 		gLoginMenuBarView->setVisible( TRUE );
 		gLoginMenuBarView->setEnabled( TRUE );
  			}
  		}
 
+		LLSD inv_basic = response["inventory-basic"];
+ 		if(inv_basic.isDefined())
+ 		{
+			llinfos << "Basic inventory root folder id is " << inv_basic["folder_id"] << llendl;
+ 		}
+
 		LLSD buddy_list = response["buddy-list"];
  		if(buddy_list.isDefined())
  		{

File indra/newview/llviewermenu.cpp

 };
 
 
-class LLAdvancedToggleFeature : public view_listener_t{
+class LLAdvancedToggleFeature : public view_listener_t
+{
 	bool handleEvent(const LLSD& userdata)
 	{
 		U32 feature = feature_from_string( userdata.asString() );
 };
 
 class LLAdvancedCheckFeature : public view_listener_t
-{bool handleEvent(const LLSD& userdata)
+{
+	bool handleEvent(const LLSD& userdata)
 {
 	U32 feature = feature_from_string( userdata.asString() );
 	bool new_value = false;
 	}
 };
 
+class LLCheckSessionsSettings : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		std::string expected = userdata.asString();
+		return gSavedSettings.getString("SessionSettingsFile") == expected;
+	}
+};
+
+class LLChangeMode : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		std::string mode = userdata.asString();
+		if (mode == "basic")
+		{
+			if (gSavedSettings.getString("SessionSettingsFile") != "settings_minimal.xml")
+			{
+				LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(onModeChangeConfirm, "settings_minimal.xml", _1, _2));
+			}
+			return true;
+		}
+		else if (mode == "advanced")
+		{
+			if (gSavedSettings.getString("SessionSettingsFile") != "")
+			{
+				LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(onModeChangeConfirm, "", _1, _2));
+			}
+			return true;
+		}
+		return false;
+	}	
+	
+	static void onModeChangeConfirm(const std::string& new_session_settings_file, const LLSD& notification, const LLSD& response)
+	{
+		S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+		switch (option)
+		{
+		case 0:
+			gSavedSettings.getControl("SessionSettingsFile")->set(new_session_settings_file);
+			LLAppViewer::instance()->forceQuit();
+			break;
+		case 1:
+		default:
+			break;
+		}
+	}
+};
+
 void LLUploadCostCalculator::calculateCost()
 {
 	S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
 	view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono");
 
 	view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints");
+	view_listener_t::addMenu(new LLCheckSessionsSettings(), "CheckSessionSettings");
+	view_listener_t::addMenu(new LLChangeMode(), "ChangeMode");
 
 	commit.add("Destination.show", boost::bind(&toggle_destination_and_avatar_picker, 0));
 	commit.add("Avatar.show", boost::bind(&toggle_destination_and_avatar_picker, 1));

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

 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater
   legacy_header_height="18"
-  can_resize="true"
+ can_resize="true"
   height="775"
-  layout="topleft"
-  min_height="400"
+ layout="topleft"
+ min_height="400"
   min_width="500"
   name="floater_web_content"
   help_topic="floater_web_content"
-  save_rect="true"
+ save_rect="true"
   auto_tile="true"
-  save_visibility="true"
+ save_visibility="true"
   title=""
   initial_mime_type="text/html"
   width="780"
-  tab_stop="true"
+             tab_stop="true"
   filename="floater_web_content.xml"/>

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

+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<toggleable_menu
+ name="Mode Change">
+  <menu_item_check
+   label="Basic"
+   name="BasicMode">
+    <on_check
+         function="CheckSessionSettings"
+         parameter="settings_minimal.xml" />
+    <on_click
+      function="ChangeMode"
+      parameter="basic"/>
+  </menu_item_check>
+    <menu_item_check
+     label="Advanced"
+     name="AdvancedMode">
+    <on_check
+     function="CheckSessionSettings"
+     parameter="" />
+    <on_click
+      function="ChangeMode"
+      parameter="advanced"/>
+    </menu_item_check>
+  </toggleable_menu>

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

   name="connect_btn"
   top="35"
   width="90" />
- <text
-  follows="left|bottom"
-  font="SansSerifSmall"
-  height="15"
-  left_pad="10"
-  name="mode_selection_text"
-  top="20"
-  width="130">
-       Mode:
- </text>
-<combo_box
-  follows="left|bottom"
+  <menu_button
+  left_pad="5"
+  top="35"
+  width="80"
   height="23"
-  max_chars="128"
+  label="Mode ▲"
+  name="mode_menu"  
   tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
-  top_pad="0"
-  name="mode_combo"
-  width="110">
-<combo_box.item
-  label="Basic"
-  name="Basic"
-  value="settings_minimal.xml" />
-<combo_box.item
-  label="Advanced"
-  name="Advanced"
-  value="" />
-</combo_box>
+  menu_filename="menu_mode_change.xml"
+    />
   <text
   follows="left|bottom"
   font="SansSerifSmall"

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

      top="0"
      width="55" />
   </panel>
+  <menu_button
+     follows="right|top"    
+    image_color="0 0 0 0"
+    hover_glow_amount="0"
+    left_pad="2"
+    top="0"
+    width="55"
+    height="18"
+    label="Mode ▼"
+    tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
+    menu_filename="menu_mode_change.xml"
+    />
     <text
      type="string"
      font="SansSerifSmall"
      left_pad="0"
      name="TimeText"
      tool_tip="Current time (Pacific)"
-     width="145">
+     width="70">
         24:00 AM PST
     </text>
     <button

File indra/newview/skins/minimal/xui/en/main_view.xml

        name="status_bar_container"
        tab_stop="false"
        height="30"
-       left="-70"
+       left="-120"
        top="0"
-       width="70"
+       width="120"
        visible="false"/>
   <panel follows="top|bottom"
          height="500"

File indra/newview/skins/minimal/xui/en/panel_login.xml

   name="connect_btn"
   top="35"
   width="90" />
-  <text
-  follows="left|bottom"
-  font="SansSerifSmall"
-  height="15"
-  left_pad="10"
-  name="mode_selection_text"
-top="20"
-  width="130">
-       Mode:
- </text>
-<combo_box
-  follows="left|bottom"
-  height="23"
-  max_chars="128"
-  top_pad="0"
-  tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
-  name="mode_combo"
-  width="120">
-<combo_box.item
-  label="Basic"
-  name="Basic"
-  value="settings_minimal.xml" />
-<combo_box.item
-  label="Advanced"
-  name="Advanced"
-  value="" />
-</combo_box>
+  <menu_button
+left_pad="10"
+top="35"
+width="80"
+height="23"
+label="Mode ▲"
+name="mode_menu"
+tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
+menu_filename="menu_mode_change.xml"
+    />
 </layout_panel>
 <layout_panel
 tab_stop="false"

File indra/newview/skins/minimal/xui/en/panel_navigation_bar.xml

      mouse_opaque="false"
      name="location_combo"
      top_delta="0"
-     width="440">
+     width="390">
     </location_input>
     <icon follows="right"
           height="20"

File indra/newview/skins/minimal/xui/en/panel_status_bar.xml

  name="status"
  top="19"
  tab_stop="false"
- width="70">
+ width="120">
     <panel.string
      name="packet_loss_tooltip">
         Packet Loss
      name="buycurrencylabel">
         L$ [AMT]
     </panel.string>
+  <menu_button
+     follows="right|top"    
+    image_color="0 0 0 0"
+    hover_glow_amount="0"
+    left="2"
+    top="7"
+    width="50"  
+    height="18"
+    label="Mode ▼"
+    tool_tip="Select your mode. Choose Basic for fast, easy exploration and chat. Choose Advanced to access more features."
+    menu_filename="menu_mode_change.xml"
+    />
      <button
      follows="right|top"
      height="16"
      image_pressed="Pause_Press"
      image_pressed_selected="Play_Press"
      is_toggle="true"
-     left="15"
+     left="65"
      top="7"
      name="media_toggle_btn"
      tool_tip="Start/Stop All Media (Music, Video, Web pages)"