From 1be44136e08d632fcf0ebcfd88484793437bd551 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Mon, 5 Jul 2010 20:18:52 +0300 Subject: 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 + indra/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 c5d259e517..ca5679d5b0 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 a50e047140..5c397e9c29 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -94,6 +94,7 @@ 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(); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 290c8c55a9..04a8a02ecd 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 <nolink>[PICK]</nolink>? yestext="OK"/> + + Delete the selected outfit/s? + + + Date: Tue, 6 Jul 2010 11:20:05 +0100 Subject: CID-486 Checker: NULL_RETURNS Function: LLAgentWearables::revertWearable(LLWearableType::EType, unsigned int) File: /indra/newview/llagentwearables.cpp --- indra/newview/llagentwearables.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index e70511ce6e..6acbc16018 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -511,7 +511,11 @@ void LLAgentWearables::saveWearableAs(const LLWearableType::EType type, void LLAgentWearables::revertWearable(const LLWearableType::EType type, const U32 index) { LLWearable* wearable = getWearable(type, index); - wearable->revertValues(); + llassert(wearable); + if (wearable) + { + wearable->revertValues(); + } gAgent.sendAgentSetAppearance(); } -- cgit v1.2.3 From e04df15bf1280d29f998a18bbb326f4bfa991f69 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 6 Jul 2010 11:21:45 +0100 Subject: CID-484 Checker: NULL_RETURNS Function: LLAgentWearables::animateAllWearableParams(float, int) File: /indra/newview/llagentwearables.cpp --- indra/newview/llagentwearables.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 6acbc16018..266aaaff4a 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1944,7 +1944,11 @@ void LLAgentWearables::animateAllWearableParams(F32 delta, BOOL upload_bake) for (S32 count = 0; count < (S32)getWearableCount((LLWearableType::EType)type); ++count) { LLWearable *wearable = getWearable((LLWearableType::EType)type,count); - wearable->animateParams(delta, upload_bake); + llassert(wearable); + if (wearable) + { + wearable->animateParams(delta, upload_bake); + } } } } -- cgit v1.2.3 From a1bbba2be64daf332bdf511129b1ec4f2bea1540 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 6 Jul 2010 11:23:22 +0100 Subject: CID-485 Checker: NULL_RETURNS Function: LLAgentWearables::setWearableName(const LLUUID &, const std::basic_string, std::allocator>&) File: /indra/newview/llagentwearables.cpp --- indra/newview/llagentwearables.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 266aaaff4a..efa5eca217 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -547,6 +547,7 @@ void LLAgentWearables::setWearableName(const LLUUID& item_id, const std::string& { LLWearable* old_wearable = getWearable((LLWearableType::EType)i,j); llassert(old_wearable); + if (!old_wearable) continue; std::string old_name = old_wearable->getName(); old_wearable->setName(new_name); -- cgit v1.2.3 From 9d96da4b94c875b8f32e9893f37142ba07b0c453 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 6 Jul 2010 12:44:43 -0400 Subject: EXT-8249 FIX coverity fix - eliminating fallthrough for switch statement Code reviewed by Seraph --- indra/newview/llappearancemgr.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 17efc28a6a..f8cff42412 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -989,16 +989,15 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up { removeCOFItemLinks(gAgentWearables.getWearableItemID(item_to_wear->getWearableType(), wearable_count-1), false); } + addCOFItemLink(item_to_wear, do_update); } + break; case LLAssetType::AT_BODYPART: // TODO: investigate wearables may not be loaded at this point EXT-8231 // Remove the existing wearables of the same type. // Remove existing body parts anyway because we must not be able to wear e.g. two skins. - if (item_to_wear->getType() == LLAssetType::AT_BODYPART) - { - removeCOFLinksOfType(item_to_wear->getWearableType(), false); - } + removeCOFLinksOfType(item_to_wear->getWearableType(), false); addCOFItemLink(item_to_wear, do_update); break; -- cgit v1.2.3