diff options
| author | Merov Linden <merov@lindenlab.com> | 2010-10-28 16:02:47 -0700 | 
|---|---|---|
| committer | Merov Linden <merov@lindenlab.com> | 2010-10-28 16:02:47 -0700 | 
| commit | 49b39c7edf5c9381e5adb04823a000f378a7f063 (patch) | |
| tree | fc967e26901a97e94310c1072bd10c2382ec6d84 /indra/newview | |
| parent | e68aa811cea4a68f2ee09546a26ee4b655224778 (diff) | |
| parent | 6be708677eee1cad00e618bce7d7e7ba27c7a547 (diff) | |
STORM-459 : merge with viewer-development
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/lloutfitslist.cpp | 35 | ||||
| -rw-r--r-- | indra/newview/lloutfitslist.h | 2 | ||||
| -rw-r--r-- | indra/newview/llpaneloutfitsinventory.cpp | 10 | ||||
| -rw-r--r-- | indra/newview/llpaneloutfitsinventory.h | 1 | 
4 files changed, 21 insertions, 27 deletions
| diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 70295259b3..6435126fc0 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -115,7 +115,7 @@ public:  		registrar.add("Gear.Wear", boost::bind(&LLOutfitListGearMenu::onWear, this));  		registrar.add("Gear.TakeOff", boost::bind(&LLOutfitListGearMenu::onTakeOff, this));  		registrar.add("Gear.Rename", boost::bind(&LLOutfitListGearMenu::onRename, this)); -		registrar.add("Gear.Delete", boost::bind(&LLOutfitListGearMenu::onDelete, this)); +		registrar.add("Gear.Delete", boost::bind(&LLOutfitsList::removeSelected, mOutfitList));  		registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenu::onCreate, this, _2));  		registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenu::onAdd, this)); @@ -197,15 +197,6 @@ private:  		}  	} -	void onDelete() -	{ -		const LLUUID& selected_outfit_id = getSelectedOutfitID(); -		if (selected_outfit_id.notNull()) -		{ -			remove_category(&gInventory, selected_outfit_id); -		} -	} -  	void onCreate(const LLSD& data)  	{  		LLWearableType::EType type = LLWearableType::typeNameToType(data.asString()); @@ -260,6 +251,12 @@ private:  class LLOutfitContextMenu : public LLListContextMenu  { +public: + +	LLOutfitContextMenu(LLOutfitsList* outfit_list) +	:		LLListContextMenu(), +	 		mOutfitList(outfit_list) +	{}  protected:  	/* virtual */ LLContextMenu* createMenu()  	{ @@ -275,7 +272,7 @@ protected:  				boost::bind(&LLAppearanceMgr::takeOffOutfit, &LLAppearanceMgr::instance(), selected_id));  		registrar.add("Outfit.Edit", boost::bind(editOutfit));  		registrar.add("Outfit.Rename", boost::bind(renameOutfit, selected_id)); -		registrar.add("Outfit.Delete", boost::bind(deleteOutfit, selected_id)); +		registrar.add("Outfit.Delete", boost::bind(&LLOutfitsList::removeSelected, mOutfitList));  		enable_registrar.add("Outfit.OnEnable", boost::bind(&LLOutfitContextMenu::onEnable, this, _2));  		enable_registrar.add("Outfit.OnVisible", boost::bind(&LLOutfitContextMenu::onVisible, this, _2)); @@ -338,10 +335,8 @@ protected:  		LLAppearanceMgr::instance().renameOutfit(outfit_cat_id);  	} -	static void deleteOutfit(const LLUUID& outfit_cat_id) -	{ -		remove_category(&gInventory, outfit_cat_id); -	} +private: +	LLOutfitsList*	mOutfitList;  };  ////////////////////////////////////////////////////////////////////////// @@ -358,7 +353,7 @@ LLOutfitsList::LLOutfitsList()  	mCategoriesObserver = new LLInventoryCategoriesObserver();  	mGearMenu = new LLOutfitListGearMenu(this); -	mOutfitMenu = new LLOutfitContextMenu(); +	mOutfitMenu = new LLOutfitContextMenu(this);  }  LLOutfitsList::~LLOutfitsList() @@ -635,6 +630,14 @@ void LLOutfitsList::performAction(std::string action)  void LLOutfitsList::removeSelected()  { +	LLNotificationsUtil::add("DeleteOutfits", LLSD(), LLSD(), boost::bind(&LLOutfitsList::onOutfitsRemovalConfirmation, this, _1, _2)); +} + +void LLOutfitsList::onOutfitsRemovalConfirmation(const LLSD& notification, const LLSD& response) +{ +	S32 option = LLNotificationsUtil::getSelectedOption(notification, response); +	if (option != 0) return; // canceled +  	if (mSelectedOutfitUUID.notNull())  	{  		remove_category(&gInventory, mSelectedOutfitUUID); diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 5fecbb83e7..a0598737f1 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -110,6 +110,8 @@ public:  private: +	void onOutfitsRemovalConfirmation(const LLSD& notification, const LLSD& response); +  	/**  	 * Wrapper for LLCommonUtils::computeDifference. @see LLCommonUtils::computeDifference  	 */ diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 4f2cfa2bbc..a90f864ae2 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -258,17 +258,7 @@ void LLPanelOutfitsInventory::updateListCommands()  void LLPanelOutfitsInventory::onTrashButtonClick()  { -	LLNotificationsUtil::add("DeleteOutfits", LLSD(), LLSD(), boost::bind(&LLPanelOutfitsInventory::onOutfitsRemovalConfirmation, this, _1, _2)); -} - -void LLPanelOutfitsInventory::onOutfitsRemovalConfirmation(const LLSD& notification, const LLSD& response) -{ -	S32 option = LLNotificationsUtil::getSelectedOption(notification, response); -	if (option != 0) return; // canceled -  	mMyOutfitsPanel->removeSelected(); -	updateListCommands(); -	updateVerbs();  }  bool LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index f1ca1dbfeb..a7917b457c 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -89,7 +89,6 @@ protected:  	void onWearButtonClick();  	void showGearMenu();  	void onTrashButtonClick(); -	void onOutfitsRemovalConfirmation(const LLSD& notification, const LLSD& response);  	bool isActionEnabled(const LLSD& userdata);  	void setWearablesLoading(bool val);  	void onWearablesLoaded(); | 
