From 1be44136e08d632fcf0ebcfd88484793437bd551 Mon Sep 17 00:00:00 2001
From: Andrew Dyukov <adyukov@productengine.com>
Date: Mon, 5 Jul 2010 20:18:52 +0300
Subject: [PATCH] EXT-8146 FIXED Added confirmation dialog before outfit(s)
 deleting.

- Added new notification which appears when trash button in "My Outfits" is clicked. Used it in code to only delete outfits if OK is selected.

Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/695/

--HG--
branch : product-engine
---
 indra/newview/llpaneloutfitsinventory.cpp           | 13 ++++++++++---
 indra/newview/llpaneloutfitsinventory.h             |  1 +
 .../newview/skins/default/xui/en/notifications.xml  | 11 +++++++++++
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index c5d259e5175..ca5679d5b09 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -282,10 +282,17 @@ void LLPanelOutfitsInventory::showGearMenu()
 
 void LLPanelOutfitsInventory::onTrashButtonClick()
 {
-	mMyOutfitsPanel->removeSelected();
+	LLNotificationsUtil::add("DeleteOutfits", LLSD(), LLSD(), boost::bind(&LLPanelOutfitsInventory::onOutfitsRemovalConfirmation, this, _1, _2));
+}
 
- 	updateListCommands();
- 	updateVerbs();
+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 a50e047140c..5c397e9c291 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -94,6 +94,7 @@ class LLPanelOutfitsInventory : public LLPanel
 	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();
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 290c8c55a9b..04a8a02ecd7 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -815,6 +815,17 @@ Delete pick &lt;nolink&gt;[PICK]&lt;/nolink&gt;?
      yestext="OK"/>
   </notification>
 
+  <notification
+   icon="alertmodal.tga"
+   name="DeleteOutfits"
+   type="alertmodal">
+    Delete the selected outfit/s?
+    <usetemplate
+     name="okcancelbuttons"
+     notext="Cancel"
+     yestext="OK"/>
+  </notification>
+
   <notification
    icon="alertmodal.tga"
    name="PromptGoToEventsPage"
-- 
GitLab