From 4b8d41214bb4c3a13050956fcf6f4aaee571e52a Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Tue, 10 Aug 2010 19:16:18 +0300 Subject: EXT-8255 FIXED Added confirmation dialog when removing items. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/849/ --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 12 ++++++++++++ indra/newview/llfolderview.h | 2 ++ indra/newview/skins/default/xui/en/notifications.xml | 13 +++++++++++++ indra/newview/skins/default/xui/en/strings.xml | 4 ++++ 4 files changed, 31 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index e8891d1cc5..ab36a76153 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -62,6 +62,7 @@ #include "llviewerwindow.h" #include "llvoavatar.h" #include "llfloaterproperties.h" +#include "llnotificationsutil.h" // Linden library includes #include "lldbstrings.h" @@ -1024,6 +1025,17 @@ void LLFolderView::closeRenamer( void ) void LLFolderView::removeSelectedItems( void ) { + if (mSelectedItems.empty()) return; + LLSD args; + args["QUESTION"] = LLTrans::getString(mSelectedItems.size() > 1 ? "DeleteItems" : "DeleteItem"); + LLNotificationsUtil::add("DeleteItems", args, LLSD(), boost::bind(&LLFolderView::onItemsRemovalConfirmation, this, _1, _2)); +} + +void LLFolderView::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option != 0) return; // canceled + if(getVisible() && getEnabled()) { // just in case we're removing the renaming item. diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index a7763e8eeb..f5f229a602 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -293,6 +293,8 @@ protected: BOOL addNoOptions(LLMenuGL* menu) const; + void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response); + protected: LLHandle mPopupMenuHandle; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 3576462cca..609a9b09be 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4021,6 +4021,19 @@ Are you sure you want to quit? + + [QUESTION] + + + + Notices Chat + + Delete selected items? + Delete selected item? + -- cgit v1.2.3