diff options
| -rw-r--r-- | indra/newview/llavataractions.cpp | 29 | ||||
| -rw-r--r-- | indra/newview/llavataractions.h | 3 | ||||
| -rw-r--r-- | indra/newview/llfloaterpreviewtrash.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llinventorybridge.cpp | 10 | ||||
| -rw-r--r-- | indra/newview/llinventorypanel.cpp | 31 | ||||
| -rw-r--r-- | indra/newview/llinventorypanel.h | 2 | ||||
| -rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/menu_inventory.xml | 3 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 3 | 
9 files changed, 39 insertions, 45 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 0d0861efcc..219d9da01f 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -929,17 +929,6 @@ void LLAvatarActions::shareWithAvatars(LLView * panel)  	LLNotificationsUtil::add("ShareNotification");  } - -//static -void LLAvatarActions::purgeSelectedItems() -{ -	const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); -	if (inventory_selected_uuids.empty()) return; -	LLSD args; -	args["COUNT"] = (S32)inventory_selected_uuids.size(); -	LLNotificationsUtil::add("PurgeSelectedItems", args, LLSD(), &callbackPurgeSelectedItems); -} -  // static  bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NULL*/)  { @@ -1180,24 +1169,6 @@ bool LLAvatarActions::callbackAddFriendWithMessage(const LLSD& notification, con  	return false;  } -bool LLAvatarActions::callbackPurgeSelectedItems(const LLSD& notification, const LLSD& response) -{ -	S32 option = LLNotificationsUtil::getSelectedOption(notification, response); -	if (option == 0) -	{ -		const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); -		if (inventory_selected_uuids.empty()) return false; - -		std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin(); -		const std::set<LLUUID>::const_iterator it_end = inventory_selected_uuids.end(); -		for (; it != it_end; ++it) -		{ -			remove_inventory_object(*it, NULL); -		} -	} -	return false; -} -  // static  bool LLAvatarActions::handleKick(const LLSD& notification, const LLSD& response)  { diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 8ff1ef073d..256d44d820 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -125,8 +125,6 @@ public:  	 */  	static void shareWithAvatars(LLView * panel); -	static void purgeSelectedItems(); -  	/**  	 * Block/unblock the avatar.  	 */ @@ -245,7 +243,6 @@ public:  private:  	static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response); -	static bool callbackPurgeSelectedItems(const LLSD& notification, const LLSD& response);  	static bool handleRemove(const LLSD& notification, const LLSD& response);  	static bool handlePay(const LLSD& notification, const LLSD& response, LLUUID avatar_id);  	static bool handleFreezeAvatar(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llfloaterpreviewtrash.cpp b/indra/newview/llfloaterpreviewtrash.cpp index 717d0ddcad..cf4e3f04e6 100644 --- a/indra/newview/llfloaterpreviewtrash.cpp +++ b/indra/newview/llfloaterpreviewtrash.cpp @@ -72,7 +72,7 @@ bool LLFloaterPreviewTrash::isVisible()  void LLFloaterPreviewTrash::onClickEmpty()  { -	gInventory.emptyFolderType("", LLFolderType::FT_TRASH); +	gInventory.emptyFolderType("PurgeSelectedItems", LLFolderType::FT_TRASH);  	closeFloater();  } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index bf4a2301ae..1b32fc9dfe 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -391,6 +391,7 @@ void LLInvFVBridge::removeBatch(std::vector<LLFolderViewModelItem*>& batch)  		}  	}  	removeBatchNoCheck(batch); +	model->checkTrashOverflow();  }  void  LLInvFVBridge::removeBatchNoCheck(std::vector<LLFolderViewModelItem*>&  batch) @@ -3870,6 +3871,13 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t&   items      }  	if(trash_id == mUUID)  	{ +		bool is_recent_panel = false; +		LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); +		if (active_panel && (active_panel->getName() == "Recent Items")) +		{ +			is_recent_panel = true; +		} +  		// This is the trash.  		items.push_back(std::string("Empty Trash")); @@ -3877,7 +3885,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t&   items  		LLInventoryModel::item_array_t* item_array;  		gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array);  		// Enable Empty menu item only when there is something to act upon. -		if (0 == cat_array->size() && 0 == item_array->size()) +		if ((0 == cat_array->size() && 0 == item_array->size()) || is_recent_panel)  		{  			disabled_items.push_back(std::string("Empty Trash"));  		} diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index a00dcf02ab..4b117941a0 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -43,6 +43,7 @@  #include "llinventorybridge.h"  #include "llinventoryfunctions.h"  #include "llinventorymodelbackgroundfetch.h" +#include "llnotificationsutil.h"  #include "llpreview.h"  #include "llsidepanelinventory.h"  #include "lltrans.h" @@ -168,7 +169,6 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :  	mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this));  	mCommitCallbackRegistrar.add("Inventory.Share",  boost::bind(&LLAvatarActions::shareWithAvatars, this));  	mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", boost::bind(&LLInventoryPanel::fileUploadLocation, this, _2)); -	mCommitCallbackRegistrar.add("Inventory.Purge", boost::bind(&LLInventoryPanel::purgeSelectedItems, this));  }  LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) @@ -1216,17 +1216,29 @@ void LLInventoryPanel::purgeSelectedItems()  {      const std::set<LLFolderViewItem*> inventory_selected = mFolderRoot.get()->getSelectionList();      if (inventory_selected.empty()) return; +    LLSD args; +    args["COUNT"] = (S32)inventory_selected.size(); +    LLNotificationsUtil::add("PurgeSelectedItems", args, LLSD(), boost::bind(&LLInventoryPanel::callbackPurgeSelectedItems, this, _1, _2)); +} -    std::set<LLFolderViewItem*>::const_iterator it = inventory_selected.begin(); -    const std::set<LLFolderViewItem*>::const_iterator it_end = inventory_selected.end(); -    for (; it != it_end; ++it) +void LLInventoryPanel::callbackPurgeSelectedItems(const LLSD& notification, const LLSD& response) +{ +    S32 option = LLNotificationsUtil::getSelectedOption(notification, response); +    if (option == 0)      { -        LLUUID item_id = static_cast<LLFolderViewModelItemInventory*>((*it)->getViewModelItem())->getUUID(); -        remove_inventory_object(item_id, NULL); +        const std::set<LLFolderViewItem*> inventory_selected = mFolderRoot.get()->getSelectionList(); +        if (inventory_selected.empty()) return; + +        std::set<LLFolderViewItem*>::const_iterator it = inventory_selected.begin(); +        const std::set<LLFolderViewItem*>::const_iterator it_end = inventory_selected.end(); +        for (; it != it_end; ++it) +        { +            LLUUID item_id = static_cast<LLFolderViewModelItemInventory*>((*it)->getViewModelItem())->getUUID(); +            remove_inventory_object(item_id, NULL); +        }      }  } -  bool LLInventoryPanel::attachObject(const LLSD& userdata)  {  	// Copy selected item UUIDs to a vector. @@ -1464,6 +1476,11 @@ void LLInventoryPanel::updateSelection()  void LLInventoryPanel::doToSelected(const LLSD& userdata)  { +	if (("purge" == userdata.asString())) +	{ +		purgeSelectedItems(); +		return; +	}  	LLInventoryAction::doToSelected(mInventory, mFolderRoot.get(), userdata.asString());  	return; diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 7f63ea97cc..5ee58707b0 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -233,6 +233,8 @@ public:      // Clean up stuff when the folder root gets deleted      void clearFolderRoot(); +    void callbackPurgeSelectedItems(const LLSD& notification, const LLSD& response); +  protected:  	void openStartFolderOrMyInventory(); // open the first level of inventory  	void onItemsCompletion();			// called when selected items are complete diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index ff54f83016..3db9500de0 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -118,7 +118,6 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p)  	mCommitCallbackRegistrar.add("Inventory.ResetFilters", boost::bind(&LLPanelMainInventory::resetFilters, this));  	mCommitCallbackRegistrar.add("Inventory.SetSortBy", boost::bind(&LLPanelMainInventory::setSortBy, this, _2));  	mCommitCallbackRegistrar.add("Inventory.Share",  boost::bind(&LLAvatarActions::shareWithAvatars, this)); -	mCommitCallbackRegistrar.add("Inventory.Purge",  boost::bind(&LLAvatarActions::purgeSelectedItems));  	mSavedFolderState = new LLSaveFolderState();  	mSavedFolderState->setApply(FALSE); diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 8472185457..ec9f947338 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -518,7 +518,8 @@       layout="topleft"       name="Purge Item">          <menu_item_call.on_click -         function="Inventory.Purge"/> +         function="Inventory.DoToSelected" +         parameter="purge"/>      </menu_item_call>      <menu_item_call       label="Restore Item" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 90184a581e..8620c09f9a 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -8628,7 +8628,7 @@ Select residents to share with.      name="MeshUploadErrorDetails"      icon="alert.tga"      type="alert"> -      [LABEL] failed to upload: [MESSAGE] [IDENTIFIER] +      [LABEL] failed to upload: [MESSAGE]  [DETAILS]See SecondLife.log for details    </notification> @@ -8637,7 +8637,6 @@ Select residents to share with.      icon="alert.tga"      type="alert">        [LABEL] failed to upload: [MESSAGE] -[IDENTIFIER]  See SecondLife.log for details    </notification>  | 
