summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-05-28 19:26:40 -0700
committerMerov Linden <merov@lindenlab.com>2014-05-28 19:26:40 -0700
commit22ee6abe0b4cd354ccbcb9055678356e91d009ff (patch)
treeb8350f439ee5fcf2d04d5208f11e98bfb4dfc81a /indra/newview
parent273ef6a9813dac45e44a4581f4d613a60ec5c58b (diff)
DD-84 : WIP : Add confirmation DAMA dialog when moving items in active listing
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llinventoryfunctions.cpp30
-rwxr-xr-xindra/newview/skins/default/xui/en/notifications.xml14
2 files changed, 42 insertions, 2 deletions
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"/>
</notification>
-
+
+ <notification
+ icon="alertmodal.tga"
+ name="ConfirmMerchantActiveChange"
+ type="alertmodal">
+ This action will change the active content of this listing. Do you want to continue?
+ <tag>confirm</tag>
+ <usetemplate
+ ignoretext="Confirm before I change an active listing on the marketplace"
+ name="okcancelignore"
+ notext="Cancel"
+ yestext="OK"/>
+ </notification>
<notification
icon="alertmodal.tga"