diff options
| -rw-r--r-- | indra/llui/lllayoutstack.cpp | 38 | ||||
| -rw-r--r-- | indra/llui/lllayoutstack.h | 8 | ||||
| -rw-r--r-- | indra/newview/llchicletbar.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llimfloater.cpp | 6 | ||||
| -rw-r--r-- | indra/newview/llinventorybridge.cpp | 299 | ||||
| -rw-r--r-- | indra/newview/llinventorybridge.h | 5 | ||||
| -rw-r--r-- | indra/newview/llinventorymodelbackgroundfetch.cpp | 328 | ||||
| -rw-r--r-- | indra/newview/llinventorymodelbackgroundfetch.h | 16 | ||||
| -rw-r--r-- | indra/newview/llsidepanelinventory.cpp | 6 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/menu_inventory.xml | 8 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_chiclet_bar.xml | 1 | 
11 files changed, 262 insertions, 455 deletions
| diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 073592b6ec..2f1c2a47c9 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -63,7 +63,7 @@ LLLayoutPanel::Params::Params()  LLLayoutPanel::LLLayoutPanel(const Params& p)	  :	LLPanel(p), -	mExpandedMinDim(p.min_dim), +	mExpandedMinDim(p.expanded_min_dim.isProvided() ? p.expanded_min_dim : p.min_dim),   	mMinDim(p.min_dim),    	mAutoResize(p.auto_resize),   	mUserResize(p.user_resize), @@ -76,12 +76,6 @@ LLLayoutPanel::LLLayoutPanel(const Params& p)  	mIgnoreReshape(false),  	mOrientation(LLLayoutStack::HORIZONTAL)  { -	// Set the expanded min dim if it is provided, otherwise it gets the p.min_dim value -	if (p.expanded_min_dim.isProvided()) -	{ -		mExpandedMinDim = p.expanded_min_dim(); -	} -	  	// panels initialized as hidden should not start out partially visible  	if (!getVisible())  	{ @@ -155,7 +149,7 @@ void LLLayoutPanel::reshape( S32 width, S32 height, BOOL called_from_parent /*=  {  	if (width == getRect().getWidth() && height == getRect().getHeight()) return; -	if (!mIgnoreReshape && !mAutoResize) +	if (!mIgnoreReshape && mAutoResize == false)  	{  		mTargetDim = (mOrientation == LLLayoutStack::HORIZONTAL) ? width : height;  		LLLayoutStack* stackp = dynamic_cast<LLLayoutStack*>(getParent()); @@ -302,32 +296,6 @@ void LLLayoutStack::collapsePanel(LLPanel* panel, BOOL collapsed)  	mNeedsLayout = true;  } -void LLLayoutStack::updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize) -{ -	LLLayoutPanel* panel = findEmbeddedPanelByName(panel_name); -	 -	if (panel) -	{ -		panel->mAutoResize = auto_resize; -	} - -	mNeedsLayout = true; -} - -void LLLayoutStack::setPanelUserResize(const std::string& panel_name, BOOL user_resize) -{ -	LLLayoutPanel* panel = findEmbeddedPanelByName(panel_name); - -	if (panel) -	{ -		panel->mUserResize = user_resize; -	} - -	mNeedsLayout = true; -	updateFractionalSizes(); -} - -  static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks");  void LLLayoutStack::updateLayout() @@ -369,7 +337,7 @@ void LLLayoutStack::updateLayout()  	{	// give space proportionally to visible auto resize panels  		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)  		{ -			if (panelp->mAutoResize == TRUE) +			if (panelp->mAutoResize)  			{  				F32 fraction_to_distribute = (panelp->mFractionalSize * panelp->getAutoResizeFactor()) / (total_visible_fraction);  				S32 delta = llround((F32)space_to_distribute * fraction_to_distribute); diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index da63593f7f..efe93f6def 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -88,9 +88,6 @@ public:  	void collapsePanel(LLPanel* panel, BOOL collapsed = TRUE);  	S32 getNumPanels() { return mPanels.size(); } -	void updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize); -	void setPanelUserResize(const std::string& panel_name, BOOL user_resize); -	  	void updateLayout();  	S32 getPanelSpacing() const { return mPanelSpacing; } @@ -187,10 +184,11 @@ public:  protected:  	LLLayoutPanel(const Params& p); +	const bool	mAutoResize; +	const bool	mUserResize; +  	S32		mExpandedMinDim;  	S32		mMinDim; -	bool	mAutoResize; -	bool	mUserResize;  	bool	mCollapsed;  	F32		mVisibleAmt;  	F32		mCollapseAmt; diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp index a32fd307f1..f1bc51fbe7 100644 --- a/indra/newview/llchicletbar.cpp +++ b/indra/newview/llchicletbar.cpp @@ -212,8 +212,6 @@ void LLChicletBar::reshape(S32 width, S32 height, BOOL called_from_parent)  	{  		// Firstly, update layout stack to ensure we deal with correct panel sizes.  		{ -			// Set chiclet panel to be autoresized by default. -			mToolbarStack->updatePanelAutoResize(PANEL_CHICLET_NAME, TRUE);  			// Force the updating of layout to reset panels collapse factor.  			mToolbarStack->updateLayout();  		} diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 228260c41a..f67464078b 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -234,12 +234,6 @@ LLIMFloater::~LLIMFloater()  //virtual  BOOL LLIMFloater::postBuild()  { -	// User-resizable control panels in P2P sessions look ugly (EXT-3470). -	if (mDialog == IM_NOTHING_SPECIAL || mDialog == IM_SESSION_P2P_INVITE) -	{ -		getChild<LLLayoutStack>("im_panels")->setPanelUserResize("panel_im_control_panel", FALSE); -	} -  	const LLUUID& other_party_id = LLIMModel::getInstance()->getOtherParticipantID(mSessionID);  	if (other_party_id.notNull())  	{ diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 12322b2921..c0065a94e6 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -519,6 +519,7 @@ void hide_context_entries(LLMenuGL& menu,  			{  				menu_item->setVisible(FALSE);  			} +  			menu_item->setEnabled(FALSE);  		}  		else @@ -528,14 +529,10 @@ void hide_context_entries(LLMenuGL& menu,  			// so that some other UI element from multi-select doesn't later set this invisible.  			menu_item->pushVisible(TRUE); -			BOOL enabled = menu_item->getEnabled(); -			for (itor2 = disabled_entries.begin(); itor2 != disabled_entries.end(); ++itor2) +			bool enabled = (menu_item->getEnabled() == TRUE); +			for (itor2 = disabled_entries.begin(); enabled && (itor2 != disabled_entries.end()); ++itor2)  			{ -				if (*itor2 == name) -				{ -					enabled = FALSE; -					break; -				} +				enabled &= (*itor2 != name);  			}  			menu_item->setEnabled(enabled); @@ -606,19 +603,10 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,  			{  				items.push_back(std::string("Marketplace Separator")); -				bool copyable = true; -				LLViewerInventoryItem* inv_item = gInventory.getItem(mUUID); -				if (inv_item) -				{ -					copyable = inv_item->getPermissions().allowCopyBy(gAgent.getID()); -				} - -				const std::string merchant_action = ((copyable == true) ? "Merchant Copy" : "Merchant Move"); -				items.push_back(merchant_action); - +				items.push_back(std::string("Merchant Copy"));  				if (!canListOnMarketplaceNow())  				{ -					disabled_items.push_back(merchant_action); +					disabled_items.push_back(std::string("Merchant Copy"));  				}  			}  		} @@ -1145,12 +1133,6 @@ bool LLInvFVBridge::canListOnMarketplace() const  		return false;  	} -	const LLUUID & outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); -	if (outbox_id.isNull()) -	{ -		return false; -	} -  	LLViewerInventoryItem * item = model->getItem(mUUID);  	if (item)  	{ @@ -1342,7 +1324,8 @@ void LLItemBridge::selectItem()  	LLViewerInventoryItem* item = static_cast<LLViewerInventoryItem*>(getItem());  	if(item && !item->isFinished())  	{ -		LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false); +		item->fetchFromServer(); +		//LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false);  	}  } @@ -1672,11 +1655,7 @@ BOOL LLItemBridge::isItemCopyable() const  			return FALSE;  		} -		// All items can be copied in god mode since you can -		// at least paste-as-link the item, though you  -		// still may not be able paste the item. -		return TRUE; -		// return (item->getPermissions().allowCopyBy(gAgent.getID())); +		return item->getPermissions().allowCopyBy(gAgent.getID()) || gSavedSettings.getBOOL("InventoryLinking");  	}  	return FALSE;  } @@ -1789,12 +1768,8 @@ BOOL LLFolderBridge::isUpToDate() const  BOOL LLFolderBridge::isItemCopyable() const  { -	if (gSavedSettings.getBOOL("InventoryLinking")) -	{ -		// Can copy folders to paste-as-link, but not for straight paste. -		return TRUE; -	} -	return FALSE; +	// Can copy folders to paste-as-link, but not for straight paste. +	return gSavedSettings.getBOOL("InventoryLinking");  }  BOOL LLFolderBridge::copyToClipboard() const @@ -2422,7 +2397,6 @@ public:  		delete this;  	} -  protected:  	LLUUID mCatID;  	bool mCopyItems; @@ -2950,103 +2924,10 @@ void LLFolderBridge::pasteLinkFromClipboard()  void LLFolderBridge::staticFolderOptionsMenu()  {  	LLFolderBridge* selfp = sSelf.get(); -	if (selfp) -	{ -		selfp->folderOptionsMenu(); -	} -} - -void LLFolderBridge::folderOptionsMenu() -{ -	LLInventoryModel* model = getInventoryModel(); -	if(!model) return; -	const LLInventoryCategory* category = model->getCategory(mUUID); -	if(!category) return; - -	const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); -	if (trash_id == mUUID) return; -	if (isItemInTrash()) return; -	if (!isAgentInventory()) return; -	if (isOutboxFolder()) return; - -	LLFolderType::EType type = category->getPreferredType(); -	const bool is_system_folder = LLFolderType::lookupIsProtectedType(type); -	// BAP change once we're no longer treating regular categories as ensembles. -	const bool is_ensemble = (type == LLFolderType::FT_NONE || -							  LLFolderType::lookupIsEnsembleType(type)); - -	// Only enable calling-card related options for non-system folders. -	if (!is_system_folder) -	{ -		LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); -		if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard)) -		{ -			mItems.push_back(std::string("Calling Card Separator")); -			mItems.push_back(std::string("Conference Chat Folder")); -			mItems.push_back(std::string("IM All Contacts In Folder")); -		} -	} - -	if (!isItemRemovable()) +	if (selfp && selfp->mRoot)  	{ -		mDisabledItems.push_back(std::string("Delete")); -	} - -#ifndef LL_RELEASE_FOR_DOWNLOAD -	if (LLFolderType::lookupIsProtectedType(type)) -	{ -		mItems.push_back(std::string("Delete System Folder")); -	} -#endif - -	// wearables related functionality for folders. -	//is_wearable -	LLFindWearables is_wearable; -	LLIsType is_object( LLAssetType::AT_OBJECT ); -	LLIsType is_gesture( LLAssetType::AT_GESTURE ); - -	if (mWearables || -		checkFolderForContentsOfType(model, is_wearable)  || -		checkFolderForContentsOfType(model, is_object) || -		checkFolderForContentsOfType(model, is_gesture) ) -	{ -		mItems.push_back(std::string("Folder Wearables Separator")); - -		// Only enable add/replace outfit for non-system folders. -		if (!is_system_folder) -		{ -			// Adding an outfit onto another (versus replacing) doesn't make sense. -			if (type != LLFolderType::FT_OUTFIT) -			{ -				mItems.push_back(std::string("Add To Outfit")); -			} - -			mItems.push_back(std::string("Replace Outfit")); -		} -		if (is_ensemble) -		{ -			mItems.push_back(std::string("Wear As Ensemble")); -		} -		mItems.push_back(std::string("Remove From Outfit")); -		if (!LLAppearanceMgr::getCanRemoveFromCOF(mUUID)) -		{ -			mDisabledItems.push_back(std::string("Remove From Outfit")); -		} -		if (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID)) -		{ -			mDisabledItems.push_back(std::string("Replace Outfit")); -		} -		mItems.push_back(std::string("Outfit Separator")); -	} -	LLMenuGL* menup = dynamic_cast<LLMenuGL*>(mMenu.get()); -	if (menup) -	{ -		hide_context_entries(*menup, mItems, mDisabledItems); - -		// Reposition the menu, in case we're adding items to an existing menu. -		menup->needsArrange(); -		menup->arrangeAndClear(); +		selfp->mRoot->updateMenu();  	}  } @@ -3062,17 +2943,11 @@ BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInv  	return ((item_array.count() > 0) ? TRUE : FALSE );  } -// Flags unused -void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +void LLFolderBridge::buildContextMenuBaseOptions(U32 flags)  { -	mItems.clear(); -	mDisabledItems.clear(); - -	lldebugs << "LLFolderBridge::buildContextMenu()" << llendl; - -//	menuentry_vec_t disabled_items;  	LLInventoryModel* model = getInventoryModel(); -	if(!model) return; +	llassert(model != NULL); +  	const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);  	const LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); @@ -3089,10 +2964,6 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)  		mDisabledItems.push_back(std::string("New Body Parts"));  	} -	// clear out old menu and folder pointers -	mMenu.markDead(); -	sSelf.markDead(); -  	if(trash_id == mUUID)  	{  		// This is the trash. @@ -3193,34 +3064,138 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)  			mDisabledItems.push_back(std::string("Share"));  		}  	} +} -	hide_context_entries(menu, mItems, mDisabledItems); +void LLFolderBridge::buildContextMenuFolderOptions(U32 flags) +{ +	// Build folder specific options back up +	LLInventoryModel* model = getInventoryModel(); +	if(!model) return; -	// Add menu items that are dependent on the contents of the folder. -	uuid_vec_t folders; -	LLViewerInventoryCategory* category = (LLViewerInventoryCategory*)model->getCategory(mUUID); -	if (category) +	const LLInventoryCategory* category = model->getCategory(mUUID); +	if(!category) return; + +	const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); +	if (trash_id == mUUID) return; +	if (isItemInTrash()) return; +	if (!isAgentInventory()) return; +	if (isOutboxFolder()) return; + +	LLFolderType::EType type = category->getPreferredType(); +	const bool is_system_folder = LLFolderType::lookupIsProtectedType(type); +	// BAP change once we're no longer treating regular categories as ensembles. +	const bool is_ensemble = (type == LLFolderType::FT_NONE || +		LLFolderType::lookupIsEnsembleType(type)); + +	// Only enable calling-card related options for non-system folders. +	if (!is_system_folder)  	{ -		folders.push_back(category->getUUID()); +		LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); +		if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard)) +		{ +			mItems.push_back(std::string("Calling Card Separator")); +			mItems.push_back(std::string("Conference Chat Folder")); +			mItems.push_back(std::string("IM All Contacts In Folder")); +		}  	} -	mMenu = menu.getHandle(); -	sSelf = getHandle(); -	LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(folders, FALSE); -	fetch->startFetch(); -	inc_busy_count(); -	if(fetch->isFinished()) +	if (!isItemRemovable())  	{ -		// everything is already here - call done. -		fetch->done(); +		mDisabledItems.push_back(std::string("Delete"));  	} -	else + +#ifndef LL_RELEASE_FOR_DOWNLOAD +	if (LLFolderType::lookupIsProtectedType(type)) +	{ +		mItems.push_back(std::string("Delete System Folder")); +	} +#endif + +	// wearables related functionality for folders. +	//is_wearable +	LLFindWearables is_wearable; +	LLIsType is_object( LLAssetType::AT_OBJECT ); +	LLIsType is_gesture( LLAssetType::AT_GESTURE ); + +	if (mWearables || +		checkFolderForContentsOfType(model, is_wearable)  || +		checkFolderForContentsOfType(model, is_object) || +		checkFolderForContentsOfType(model, is_gesture) )  	{ -		// it's all on its way - add an observer, and the inventory will call done for us when everything is here. -		gInventory.addObserver(fetch); +		mItems.push_back(std::string("Folder Wearables Separator")); + +		// Only enable add/replace outfit for non-system folders. +		if (!is_system_folder) +		{ +			// Adding an outfit onto another (versus replacing) doesn't make sense. +			if (type != LLFolderType::FT_OUTFIT) +			{ +				mItems.push_back(std::string("Add To Outfit")); +			} + +			mItems.push_back(std::string("Replace Outfit")); +		} +		if (is_ensemble) +		{ +			mItems.push_back(std::string("Wear As Ensemble")); +		} +		mItems.push_back(std::string("Remove From Outfit")); +		if (!LLAppearanceMgr::getCanRemoveFromCOF(mUUID)) +		{ +			mDisabledItems.push_back(std::string("Remove From Outfit")); +		} +		if (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID)) +		{ +			mDisabledItems.push_back(std::string("Replace Outfit")); +		} +		mItems.push_back(std::string("Outfit Separator"));  	}  } +// Flags unused +void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ +	sSelf.markDead(); + +	mItems.clear(); +	mDisabledItems.clear(); + +	lldebugs << "LLFolderBridge::buildContextMenu()" << llendl; + +	LLInventoryModel* model = getInventoryModel(); +	if(!model) return; + +	buildContextMenuBaseOptions(flags); + +	// Add menu items that are dependent on the contents of the folder. +	LLViewerInventoryCategory* category = (LLViewerInventoryCategory *) model->getCategory(mUUID); +	if (category) +	{ +		uuid_vec_t folders; +		folders.push_back(category->getUUID()); + +		sSelf = getHandle(); +		LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(folders, FALSE); +		fetch->startFetch(); +		inc_busy_count(); +		if (fetch->isFinished()) +		{ +			buildContextMenuFolderOptions(flags); +		} +		else +		{ +			// it's all on its way - add an observer, and the inventory will call done for us when everything is here. +			gInventory.addObserver(fetch); +		} +	} + +	hide_context_entries(menu, mItems, mDisabledItems); + +	// Reposition the menu, in case we're adding items to an existing menu. +	menu.needsArrange(); +	menu.arrangeAndClear(); +} +  BOOL LLFolderBridge::hasChildren() const  {  	LLInventoryModel* model = getInventoryModel(); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index cb378b7d7a..871657a58a 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -282,6 +282,9 @@ public:  	LLHandle<LLFolderBridge> getHandle() { mHandle.bind(this); return mHandle; }  protected: +	void buildContextMenuBaseOptions(U32 flags); +	void buildContextMenuFolderOptions(U32 flags); +  	//--------------------------------------------------------------------  	// Menu callbacks  	//-------------------------------------------------------------------- @@ -317,12 +320,10 @@ protected:  public:  	static LLHandle<LLFolderBridge> sSelf;  	static void staticFolderOptionsMenu(); -	void folderOptionsMenu();  private:  	BOOL				mCallingCards;  	BOOL				mWearables; -	LLHandle<LLView>	mMenu;  	menuentry_vec_t		mItems;  	menuentry_vec_t		mDisabledItems;  	LLRootHandle<LLFolderBridge> mHandle; diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 5f0c744192..91fdd67806 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -50,7 +50,7 @@ LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch() :  	mMinTimeBetweenFetches(0.3f),  	mMaxTimeBetweenFetches(10.f),  	mTimelyFetchPending(FALSE), -	mFetchCount(0) +	mBulkFetchCount(0)  {  } @@ -60,7 +60,7 @@ LLInventoryModelBackgroundFetch::~LLInventoryModelBackgroundFetch()  bool LLInventoryModelBackgroundFetch::isBulkFetchProcessingComplete() const  { -	return mFetchQueue.empty() && mFetchCount<=0; +	return mFetchQueue.empty() && mBulkFetchCount<=0;  }  bool LLInventoryModelBackgroundFetch::libraryFetchStarted() const @@ -103,60 +103,44 @@ BOOL LLInventoryModelBackgroundFetch::backgroundFetchActive() const  	return mBackgroundFetchActive;  } -void LLInventoryModelBackgroundFetch::start(const LLUUID& id, BOOL recursive) +void LLInventoryModelBackgroundFetch::start(const LLUUID& cat_id, BOOL recursive)  { -	if (id.isNull()) return; +	if (!mAllFoldersFetched || cat_id.notNull()) +	{ +		LL_DEBUGS("InventoryFetch") << "Start fetching category: " << cat_id << ", recursive: " << recursive << LL_ENDL; -	LLViewerInventoryCategory* cat = gInventory.getCategory(id); -	if (cat) -	{	// it's a folder, do a bulk fetch -		if (!mAllFoldersFetched) +		mBackgroundFetchActive = TRUE; +		if (cat_id.isNull())  		{ -			LL_DEBUGS("InventoryFetch") << "Start fetching category: " << id << ", recursive: " << recursive << LL_ENDL; - -			mBackgroundFetchActive = TRUE; -			if (id.isNull()) +			if (!mRecursiveInventoryFetchStarted)  			{ -				if (!mRecursiveInventoryFetchStarted) -				{ -					mRecursiveInventoryFetchStarted |= recursive; -					mFetchQueue.push_back(FetchQueueInfo(gInventory.getRootFolderID(), recursive)); -					gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); -				} -				if (!mRecursiveLibraryFetchStarted) -				{ -					mRecursiveLibraryFetchStarted |= recursive; -					mFetchQueue.push_back(FetchQueueInfo(gInventory.getLibraryRootFolderID(), recursive)); -					gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); -				} +				mRecursiveInventoryFetchStarted |= recursive; +				mFetchQueue.push_back(FetchQueueInfo(gInventory.getRootFolderID(), recursive)); +				gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);  			} -			else +			if (!mRecursiveLibraryFetchStarted)  			{ -				// Specific folder requests go to front of queue. -				if (mFetchQueue.empty() || mFetchQueue.front().mUUID != id) -				{ -					mFetchQueue.push_front(FetchQueueInfo(id, recursive)); -					gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); -				} -				if (id == gInventory.getLibraryRootFolderID()) -				{ -					mRecursiveLibraryFetchStarted |= recursive; -				} -				if (id == gInventory.getRootFolderID()) -				{ -					mRecursiveInventoryFetchStarted |= recursive; -				} +				mRecursiveLibraryFetchStarted |= recursive; +				mFetchQueue.push_back(FetchQueueInfo(gInventory.getLibraryRootFolderID(), recursive)); +				gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);  			}  		} -	} -	else if (LLViewerInventoryItem* itemp = gInventory.getItem(id)) -	{ -		if (!itemp->mIsComplete && (mFetchQueue.empty() || mFetchQueue.front().mUUID != id)) +		else  		{ -			mBackgroundFetchActive = TRUE; - -			mFetchQueue.push_front(FetchQueueInfo(id, false, false)); -			gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); +			// Specific folder requests go to front of queue. +			if (mFetchQueue.empty() || mFetchQueue.front().mCatUUID != cat_id) +			{ +				mFetchQueue.push_front(FetchQueueInfo(cat_id, recursive)); +				gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); +			} +			if (cat_id == gInventory.getLibraryRootFolderID()) +			{ +				mRecursiveLibraryFetchStarted |= recursive; +			} +			if (cat_id == gInventory.getRootFolderID()) +			{ +				mRecursiveInventoryFetchStarted |= recursive; +			}  		}  	}  } @@ -174,7 +158,7 @@ void LLInventoryModelBackgroundFetch::stopBackgroundFetch()  	{  		mBackgroundFetchActive = FALSE;  		gIdleCallbacks.deleteFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); -		mFetchCount=0; +		mBulkFetchCount=0;  		mMinTimeBetweenFetches=0.0f;  	}  } @@ -199,9 +183,10 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()  	if (mBackgroundFetchActive && gAgent.getRegion())  	{  		// If we'll be using the capability, we'll be sending batches and the background thing isn't as important. -		if (gSavedSettings.getBOOL("UseHTTPInventory"))  +		std::string url = gAgent.getRegion()->getCapability("FetchInventoryDescendents2");    +		if (gSavedSettings.getBOOL("UseHTTPInventory") && !url.empty())   		{ -			bulkFetch(); +			bulkFetch(url);  			return;  		} @@ -245,7 +230,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()  			}  			const FetchQueueInfo info = mFetchQueue.front(); -			LLViewerInventoryCategory* cat = gInventory.getCategory(info.mUUID); +			LLViewerInventoryCategory* cat = gInventory.getCategory(info.mCatUUID);  			// Category has been deleted, remove from queue.  			if (!cat) @@ -273,7 +258,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()  				}  			}  			// Do I have all my children? -			else if (gInventory.isCategoryComplete(info.mUUID)) +			else if (gInventory.isCategoryComplete(info.mCatUUID))  			{  				// Finished with this category, remove from queue.  				mFetchQueue.pop_front(); @@ -328,35 +313,15 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()  	}  } -void LLInventoryModelBackgroundFetch::incrFetchCount(S16 fetching)  +void LLInventoryModelBackgroundFetch::incrBulkFetch(S16 fetching)   {   -	mFetchCount += fetching;  -	if (mFetchCount < 0) +	mBulkFetchCount += fetching;  +	if (mBulkFetchCount < 0)  	{ -		mFetchCount = 0;  +		mBulkFetchCount = 0;   	}  } -class LLInventoryModelFetchItemResponder : public LLInventoryModel::fetchInventoryResponder -{ -public: -	LLInventoryModelFetchItemResponder(const LLSD& request_sd) : LLInventoryModel::fetchInventoryResponder(request_sd) {}; -	void result(const LLSD& content);			 -	void error(U32 status, const std::string& reason); -}; - -void LLInventoryModelFetchItemResponder::result( const LLSD& content ) -{ -	LLInventoryModel::fetchInventoryResponder::result(content); -	LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1); -} - -void LLInventoryModelFetchItemResponder::error( U32 status, const std::string& reason ) -{ -	LLInventoryModel::fetchInventoryResponder::error(status, reason); -	LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1); -} -  class LLInventoryModelFetchDescendentsResponder: public LLHTTPClient::Responder  { @@ -493,7 +458,7 @@ void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content)  		}  	} -	fetcher->incrFetchCount(-1); +	fetcher->incrBulkFetch(-1);  	if (fetcher->isBulkFetchProcessingComplete())  	{ @@ -512,7 +477,7 @@ void LLInventoryModelFetchDescendentsResponder::error(U32 status, const std::str  	llinfos << "LLInventoryModelFetchDescendentsResponder::error "  		<< status << ": " << reason << llendl; -	fetcher->incrFetchCount(-1); +	fetcher->incrBulkFetch(-1);  	if (status==499) // timed out  	{ @@ -543,14 +508,12 @@ BOOL LLInventoryModelFetchDescendentsResponder::getIsRecursive(const LLUUID& cat  // Bundle up a bunch of requests to send all at once.  // static    -void LLInventoryModelBackgroundFetch::bulkFetch() +void LLInventoryModelBackgroundFetch::bulkFetch(std::string url)  {  	//Background fetch is called from gIdleCallbacks in a loop until background fetch is stopped.  	//If there are items in mFetchQueue, we want to check the time since the last bulkFetch was   	//sent.  If it exceeds our retry time, go ahead and fire off another batch.    	//Stopbackgroundfetch will be run from the Responder instead of here.   -	LLViewerRegion* region = gAgent.getRegion(); -	if (!region) return;  	S16 max_concurrent_fetches=8;  	F32 new_min_time = 0.5f;			//HACK!  Clean this up when old code goes away entirely. @@ -560,13 +523,12 @@ void LLInventoryModelBackgroundFetch::bulkFetch()  	}  	if (gDisconnected || -		(mFetchCount > max_concurrent_fetches) || +		(mBulkFetchCount > max_concurrent_fetches) ||  		(mFetchTimer.getElapsedTimeF32() < mMinTimeBetweenFetches))  	{  		return; // just bail if we are disconnected  	}	 -	U32 item_count=0;  	U32 folder_count=0;  	U32 max_batch_size=5; @@ -574,159 +536,83 @@ void LLInventoryModelBackgroundFetch::bulkFetch()  	uuid_vec_t recursive_cats; -	LLSD folder_request_body; -	LLSD folder_request_body_lib; -	LLSD item_request_body; -	LLSD item_request_body_lib; +	LLSD body; +	LLSD body_lib; -	while (!(mFetchQueue.empty()) && ((item_count + folder_count) < max_batch_size)) +	while (!(mFetchQueue.empty()) && (folder_count < max_batch_size))  	{  		const FetchQueueInfo& fetch_info = mFetchQueue.front(); -		if (fetch_info.mIsCategory) -		{ - -			const LLUUID &cat_id = fetch_info.mUUID; -			if (cat_id.isNull()) //DEV-17797 -			{ -				LLSD folder_sd; -				folder_sd["folder_id"]		= LLUUID::null.asString(); -				folder_sd["owner_id"]		= gAgent.getID(); -				folder_sd["sort_order"]		= (LLSD::Integer)sort_order; -				folder_sd["fetch_folders"]	= (LLSD::Boolean)FALSE; -				folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE; -				folder_request_body["folders"].append(folder_sd); -				folder_count++; -			} -			else -			{ -				const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); +		const LLUUID &cat_id = fetch_info.mCatUUID; +        if (cat_id.isNull()) //DEV-17797 +        { +			LLSD folder_sd; +			folder_sd["folder_id"]		= LLUUID::null.asString(); +			folder_sd["owner_id"]		= gAgent.getID(); +			folder_sd["sort_order"]		= (LLSD::Integer)sort_order; +			folder_sd["fetch_folders"]	= (LLSD::Boolean)FALSE; +			folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE; +			body["folders"].append(folder_sd); +            folder_count++; +        } +        else +        { +		    const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); -				if (cat) -				{ -					if (LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion()) -					{ -						LLSD folder_sd; -						folder_sd["folder_id"]		= cat->getUUID(); -						folder_sd["owner_id"]		= cat->getOwnerID(); -						folder_sd["sort_order"]		= (LLSD::Integer)sort_order; -						folder_sd["fetch_folders"]	= TRUE; //(LLSD::Boolean)sFullFetchStarted; -						folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE; +		    if (cat) +		    { +			    if (LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion()) +			    { +				    LLSD folder_sd; +				    folder_sd["folder_id"]		= cat->getUUID(); +				    folder_sd["owner_id"]		= cat->getOwnerID(); +				    folder_sd["sort_order"]		= (LLSD::Integer)sort_order; +				    folder_sd["fetch_folders"]	= TRUE; //(LLSD::Boolean)sFullFetchStarted; +				    folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE; -						if (ALEXANDRIA_LINDEN_ID == cat->getOwnerID()) -							folder_request_body_lib["folders"].append(folder_sd); -						else -							folder_request_body["folders"].append(folder_sd); -						folder_count++; -					} -					// May already have this folder, but append child folders to list. -					if (fetch_info.mRecursive) -					{	 -						LLInventoryModel::cat_array_t* categories; -						LLInventoryModel::item_array_t* items; -						gInventory.getDirectDescendentsOf(cat->getUUID(), categories, items); -						for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); -							 it != categories->end(); -							 ++it) -						{ -							mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(), fetch_info.mRecursive)); -						} -					} -				} -			} -			if (fetch_info.mRecursive) -				recursive_cats.push_back(cat_id); -		} -		else -		{ -			LLViewerInventoryItem* itemp = gInventory.getItem(fetch_info.mUUID); -			if (itemp) -			{ -				LLSD item_sd; -				item_sd["owner_id"] = itemp->getPermissions().getOwner(); -				item_sd["item_id"] = itemp->getUUID(); -				if (itemp->getPermissions().getOwner() == gAgent.getID()) -				{ -					item_request_body.append(item_sd); -				} -				else -				{ -					item_request_body_lib.append(item_sd); -				} -				//itemp->fetchFromServer(); -				item_count++; -			} -		} +				    if (ALEXANDRIA_LINDEN_ID == cat->getOwnerID()) +					    body_lib["folders"].append(folder_sd); +				    else +					    body["folders"].append(folder_sd); +				    folder_count++; +			    } +				// May already have this folder, but append child folders to list. +			    if (fetch_info.mRecursive) +			    {	 +					LLInventoryModel::cat_array_t* categories; +					LLInventoryModel::item_array_t* items; +					gInventory.getDirectDescendentsOf(cat->getUUID(), categories, items); +					for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); +						 it != categories->end(); +						 ++it) +					{ +						mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(), fetch_info.mRecursive)); +				    } +			    } +		    } +        } +		if (fetch_info.mRecursive) +			recursive_cats.push_back(cat_id);  		mFetchQueue.pop_front();  	} -	if (item_count + folder_count > 0) +	if (folder_count > 0)  	{ -		if (folder_count) +		mBulkFetchCount++; +		if (body["folders"].size())  		{ -			std::string url = region->getCapability("FetchInventoryDescendents2");    -			mFetchCount++; -			if (folder_request_body["folders"].size()) -			{ -				LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body, recursive_cats); -				LLHTTPClient::post(url, folder_request_body, fetcher, 300.0); -			} -			if (folder_request_body_lib["folders"].size()) -			{ -				std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2"); - -				LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body_lib, recursive_cats); -				LLHTTPClient::post(url_lib, folder_request_body_lib, fetcher, 300.0); -			} +			LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(body, recursive_cats); +			LLHTTPClient::post(url, body, fetcher, 300.0);  		} -		if (item_count) +		if (body_lib["folders"].size())  		{ -			std::string url; - -			if (item_request_body.size()) -			{ -				mFetchCount++; -				url = region->getCapability("FetchInventory2"); -				if (!url.empty()) -				{ -					LLSD body; -					body["agent_id"]	= gAgent.getID(); -					body["items"] = item_request_body; - -					LLHTTPClient::post(url, body, new LLInventoryModelFetchItemResponder(body)); -				} -				//else -				//{ -				//	LLMessageSystem* msg = gMessageSystem; -				//	msg->newMessage("FetchInventory"); -				//	msg->nextBlock("AgentData"); -				//	msg->addUUID("AgentID", gAgent.getID()); -				//	msg->addUUID("SessionID", gAgent.getSessionID()); -				//	msg->nextBlock("InventoryData"); -				//	msg->addUUID("OwnerID", mPermissions.getOwner()); -				//	msg->addUUID("ItemID", mUUID); -				//	gAgent.sendReliableMessage(); -				//} -			} - -			if (item_request_body_lib.size()) -			{ -				mFetchCount++; - -				url = region->getCapability("FetchLib2"); -				if (!url.empty()) -				{ -					LLSD body; -					body["agent_id"]	= gAgent.getID(); -					body["items"] = item_request_body_lib; - -					LLHTTPClient::post(url, body, new LLInventoryModelFetchItemResponder(body)); -				} -			} +			std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2"); +			 +			LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(body_lib, recursive_cats); +			LLHTTPClient::post(url_lib, body_lib, fetcher, 300.0);  		}  		mFetchTimer.reset();  	} -  	else if (isBulkFetchProcessingComplete())  	{  		setAllFoldersFetched(); @@ -738,7 +624,7 @@ bool LLInventoryModelBackgroundFetch::fetchQueueContainsNoDescendentsOf(const LL  	for (fetch_queue_t::const_iterator it = mFetchQueue.begin();  		 it != mFetchQueue.end(); ++it)  	{ -		const LLUUID& fetch_id = (*it).mUUID; +		const LLUUID& fetch_id = (*it).mCatUUID;  		if (gInventory.isObjectDescendentOf(fetch_id, cat_id))  			return false;  	} diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h index 0745407a8c..c35c785ceb 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.h +++ b/indra/newview/llinventorymodelbackgroundfetch.h @@ -60,10 +60,10 @@ public:  	bool inventoryFetchInProgress() const;      void findLostItems();	 -	void incrFetchCount(S16 fetching);  protected: +	void incrBulkFetch(S16 fetching);  	bool isBulkFetchProcessingComplete() const; -	void bulkFetch(); +	void bulkFetch(std::string url);  	void backgroundFetch();  	static void backgroundFetchCB(void*); // background fetch idle function @@ -77,7 +77,7 @@ private:  	BOOL mAllFoldersFetched;  	BOOL mBackgroundFetchActive; -	S16 mFetchCount; +	S16 mBulkFetchCount;  	BOOL mTimelyFetchPending;  	S32 mNumFetchRetries; @@ -87,11 +87,11 @@ private:  	struct FetchQueueInfo  	{ -		FetchQueueInfo(const LLUUID& id, BOOL recursive, bool is_category = true) : -			mUUID(id), mRecursive(recursive), mIsCategory(is_category) -		{} -		LLUUID mUUID; -		bool mIsCategory; +		FetchQueueInfo(const LLUUID& id, BOOL recursive) : +			mCatUUID(id), mRecursive(recursive) +		{ +		} +		LLUUID mCatUUID;  		BOOL mRecursive;  	};  	typedef std::deque<FetchQueueInfo> fetch_queue_t; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index b337eaf6be..c8b67cc9ec 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -217,9 +217,6 @@ BOOL LLSidepanelInventory::postBuild()  	{  		LLLayoutStack* inv_stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME); -		// Disable user_resize on main inventory panel by default -		inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, false); -  		// Set up button states and callbacks  		LLButton * inbox_button = getChild<LLButton>(INBOX_BUTTON_NAME); @@ -370,9 +367,6 @@ void LLSidepanelInventory::onToggleInboxBtn()  	const bool inbox_expanded = inboxButton->getToggleState(); -	// Enable user_resize on main inventory panel only when inbox is expanded -	//inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, inbox_expanded); -	  	// Expand/collapse the indicated panel  	inv_stack->collapsePanel(inboxPanel, !inbox_expanded); diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 31dcdfffbb..ef4a1bc061 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -686,14 +686,6 @@  		 parameter="copy_to_outbox" />  	</menu_item_call>  	<menu_item_call -	 label="Move to Merchant Outbox" -	 layout="topleft" -	 name="Merchant Move"> -		<menu_item_call.on_click -		 function="Inventory.DoToSelected" -		 parameter="move_to_outbox" /> -	</menu_item_call> -	<menu_item_call  	 label="Send to Marketplace"  	 layout="topleft"  	 name="Marketplace Send"> diff --git a/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml b/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml index 6d4008a4ed..ff0146490b 100644 --- a/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml @@ -27,6 +27,7 @@           min_width="95"           mouse_opaque="false"           name="chiclet_list_panel" +         auto_resize="true"           top="0"           width="189">        <chiclet_panel | 
