Commits

Anonymous committed f85b25a

EXT-7847 FIXED Disabled "trash" button if an item is selected inside selected outfit.

- Added bool mItemSelected variable and getter for it to determine if the selection inside outfit exists, and used it when determining whether to enable "Trash" button in My Outfits.

Reviewed by Vadim Savchuk and Neal Orman at https://codereview.productengine.com/secondlife/r/600/

Comments (0)

Files changed (3)

indra/newview/lloutfitslist.cpp

 	,	mAccordion(NULL)
 	,	mListCommands(NULL)
 	,	mIsInitialized(false)
+	,	mItemSelected(false)
 {
 	mCategoriesObserver = new LLInventoryCategoriesObserver();
 
 	return mSelectionChangeSignal.connect(cb);
 }
 
+bool LLOutfitsList::hasItemSelected()
+{
+	return mItemSelected;
+}
+
 //////////////////////////////////////////////////////////////////////////
 // Private methods
 //////////////////////////////////////////////////////////////////////////
 		mSelectedListsMap.clear();
 	}
 
+	mItemSelected = list && (list->getSelectedItem() != NULL);
+
 	mSelectedListsMap.insert(wearables_lists_map_value_t(category_id, list));
 	setSelectedOutfitUUID(category_id);
 }

indra/newview/lloutfitslist.h

 
 	boost::signals2::connection addSelectionChangeCallback(selection_change_callback_t cb);
 
+	/**
+	 * Returns true if there is a selection inside currently selected outfit
+	 */
+	bool hasItemSelected();
+
 private:
 	/**
 	 * Reads xml with accordion tab and Flat list from xml file.
 	LLListContextMenu*			mOutfitMenu;
 
 	bool							mIsInitialized;
+	/**
+	 * True if there is a selection inside currently selected outfit
+	 */
+	bool							mItemSelected;
 };
 
 #endif //LL_LLOUTFITSLIST_H

indra/newview/llpaneloutfitsinventory.cpp

 		else // "My Outfits" tab active
 		{
 			const LLUUID& selected_outfit = mMyOutfitsPanel->getSelectedOutfitUUID();
-			can_delete = LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit);
+			// first condition prevents trash btn from enabling when items are selected inside outfit (EXT-7847)
+			can_delete = !mMyOutfitsPanel->hasItemSelected() && LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit);
 		}
 
 		return can_delete;