From 22ee6abe0b4cd354ccbcb9055678356e91d009ff Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 28 May 2014 19:26:40 -0700 Subject: DD-84 : WIP : Add confirmation DAMA dialog when moving items in active listing --- indra/newview/llinventoryfunctions.cpp | 30 +++++++++++++++++++++- .../newview/skins/default/xui/en/notifications.xml | 14 +++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index b56383e48f..baf2a40590 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -1185,7 +1185,8 @@ bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLIn return accept; } -bool move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_folder, bool copy) +// Local : perform the move at last... +bool perform_move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_folder, bool copy) { // Get the marketplace listings depth of the destination folder, exit with error if not under marketplace S32 depth = depth_nesting_in_marketplace(dest_folder); @@ -1286,6 +1287,33 @@ bool move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_fol return true; } +// Local : Callback for the move item if DAMA required... +bool callback_move_item_to_marketplacelistings(const LLSD& notification, const LLSD& response, LLInventoryItem* inv_item, LLUUID dest_folder, bool copy) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) // YES + { + return perform_move_item_to_marketplacelistings(inv_item, dest_folder, copy); + } + return false; + } + +// Public interface: Check if confirmation dialog is required (DAMA) and call it or call the move item function directly +bool move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_folder, bool copy) +{ + // Merov : Use the following weak test for testing... + //if (LLMarketplaceData::instance().isVersionFolder(dest_folder)) + if (LLMarketplaceData::instance().getActivationState(dest_folder)) + { + LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(callback_move_item_to_marketplacelistings, _1, _2, inv_item, dest_folder, copy)); + return true; + } + else + { + return perform_move_item_to_marketplacelistings(inv_item, dest_folder, copy); + } +} + bool move_folder_to_marketplacelistings(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, bool copy) { // Check that we have adequate permission on all items being moved. Proceed if we do. diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index dcf53c8804..28ca2c7bd8 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -305,7 +305,19 @@ Initialization with the Marketplace failed because of a system or network error. name="okbutton" yestext="OK"/> - + + + This action will change the active content of this listing. Do you want to continue? + confirm + +