From ea5a1546913eea3c2e145828ffe76fac6bdfaee9 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 15 Apr 2014 14:55:40 -0700 Subject: DD-49 : Add FUI button for Marketplace Listings --- indra/newview/app_settings/commands.xml | 10 ++++++++++ indra/newview/app_settings/toolbars.xml | 1 + 2 files changed, 11 insertions(+) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 60c942094a..fd74166980 100755 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -118,6 +118,16 @@ tooltip_ref="Command_Marketplace_Tooltip" execute_function="Avatar.OpenMarketplace" /> + + -- cgit v1.3 From acdd70688bf2c53f50cb39781179bbffcb2a400d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 12 May 2014 14:58:17 -0700 Subject: DD-89 : Add a MarketplaceListingsLogging setting to get SLM API logs. DD-22 : Fixed the delete /listing route --- indra/newview/app_settings/settings.xml | 11 ++++ indra/newview/llinventorybridge.cpp | 10 +++- indra/newview/llmarketplacefunctions.cpp | 91 +++++++++++++++++--------------- 3 files changed, 68 insertions(+), 44 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index de11309394..c18e9a12d8 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5546,6 +5546,17 @@ Value + MarketplaceListingsLogging + + Comment + Enable debug output associated with the Marketplace Listings (SLM) API. + Persist + 1 + Type + Boolean + Value + 0 + MarketplaceURL Comment diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 05e6427dc1..f04724ace1 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -866,9 +866,12 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, items.push_back(std::string("Marketplace Create Listing")); items.push_back(std::string("Marketplace Associate Listing")); items.push_back(std::string("Marketplace Disassociate Listing")); - items.push_back(std::string("Marketplace Get Listing")); items.push_back(std::string("Marketplace List")); items.push_back(std::string("Marketplace Unlist")); + if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) + { + items.push_back(std::string("Marketplace Get Listing")); + } if (LLMarketplaceData::instance().isListed(mUUID)) { disabled_items.push_back(std::string("Marketplace Create Listing")); @@ -893,9 +896,12 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, else { disabled_items.push_back(std::string("Marketplace Disassociate Listing")); - disabled_items.push_back(std::string("Marketplace Get Listing")); disabled_items.push_back(std::string("Marketplace List")); disabled_items.push_back(std::string("Marketplace Unlist")); + if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) + { + disabled_items.push_back(std::string("Marketplace Get Listing")); + } } } if (depth == 2) diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index ff43d82f03..d8c25f1c02 100755 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -102,9 +102,19 @@ LLSD getMarketplaceStringSubstitutions() /////////////////////////////////////////////////////////////////////////////// // SLM Responders -void log_SLM_error(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description) +void log_SLM_warning(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description) { - LL_WARNS("SLM") << "Merov : " << request << " request failed. status : " << status << ", reason : " << reason << ", code : " << code << ", description : " << description << LL_ENDL; + if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) + { + LL_WARNS("SLM") << "SLM API : Responder to " << request << ". status : " << status << ", reason : " << reason << ", code : " << code << ", description : " << description << LL_ENDL; + } +} +void log_SLM_warning(const std::string& request, const std::string& url, const std::string& data) +{ + if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) + { + LL_WARNS("SLM") << "SLM API : Sending " << request << ". url : " << url << ", data : " << data << LL_ENDL; + } } // Merov: This is a temporary hack used by dev while secondlife-staging is down... @@ -124,15 +134,17 @@ public: { if (isGoodStatus(status) || sBypassMerchant) { + log_SLM_warning("Get /merchant", status, reason, "", "User is a merchant"); LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_MERCHANT); } else if (status == SLMErrorCodes::SLM_NOT_FOUND) { + log_SLM_warning("Get /merchant", status, reason, "", "User is not a merchant"); LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_MERCHANT); } else { - log_SLM_error("Get merchant", status, reason, content.get("error_code"), content.get("error_description")); + log_SLM_warning("Get /merchant", status, reason, content.get("error_code"), content.get("error_description")); LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE); } } @@ -152,7 +164,7 @@ public: { if (!isGoodStatus(status)) { - log_SLM_error("Get listings", status, reason, "", ""); + log_SLM_warning("Get /listings", status, reason, "", ""); return; } @@ -165,11 +177,11 @@ public: Json::Reader reader; if (!reader.parse(body,root)) { - log_SLM_error("Get listings", status, "Json parsing failed", reader.getFormatedErrorMessages(), body); + log_SLM_warning("Get /listings", status, "Json parsing failed", reader.getFormatedErrorMessages(), body); return; } - llinfos << "Merov : Get listings completedRaw : data = " << body << llendl; + log_SLM_warning("Get /listings", status, reason, "", body); // Extract the info from the Json string Json::ValueIterator it = root["listings"].begin(); @@ -211,7 +223,7 @@ public: { if (!isGoodStatus(status)) { - log_SLM_error("Post listings", status, reason, "", ""); + log_SLM_warning("Post /listings", status, reason, "", ""); return; } @@ -224,11 +236,11 @@ public: Json::Reader reader; if (!reader.parse(body,root)) { - log_SLM_error("Post listings", status, "Json parsing failed", reader.getFormatedErrorMessages(), body); + log_SLM_warning("Post /listings", status, "Json parsing failed", reader.getFormatedErrorMessages(), body); return; } - llinfos << "Merov : Create listing completedRaw : data = " << body << llendl; + log_SLM_warning("Post /listings", status, reason, "", body); // Extract the info from the Json string Json::ValueIterator it = root["listings"].begin(); @@ -271,7 +283,7 @@ public: if (!isGoodStatus(status)) { - log_SLM_error("Get listing", status, reason, "", body); + log_SLM_warning("Get /listing", status, reason, "", body); return; } @@ -279,11 +291,11 @@ public: Json::Reader reader; if (!reader.parse(body,root)) { - log_SLM_error("Get listing", status, "Json parsing failed", reader.getFormatedErrorMessages(), body); + log_SLM_warning("Get /listing", status, "Json parsing failed", reader.getFormatedErrorMessages(), body); return; } - llinfos << "Merov : Get listing completedRaw : status = " << status << ", reason = " << reason << ", body = " << body << llendl; + log_SLM_warning("Get /listing", status, reason, "", body); // Extract the info from the Json string Json::ValueIterator it = root["listings"].begin(); @@ -331,7 +343,7 @@ public: if (!isGoodStatus(status)) { - log_SLM_error("Put listings", status, reason, "", body); + log_SLM_warning("Put /listing", status, reason, "", body); return; } @@ -339,11 +351,11 @@ public: Json::Reader reader; if (!reader.parse(body,root)) { - log_SLM_error("Put listings", status, "Json parsing failed", reader.getFormatedErrorMessages(), body); + log_SLM_warning("Put /listing", status, "Json parsing failed", reader.getFormatedErrorMessages(), body); return; } - llinfos << "Merov : Update listing completedRaw : status = " << status << ", reason = " << reason << ", body = " << body << llendl; + log_SLM_warning("Put /listing", status, reason, "", body); // Extract the info from the Json string Json::ValueIterator it = root["listings"].begin(); @@ -388,7 +400,7 @@ public: { if (!isGoodStatus(status)) { - log_SLM_error("Associate listings", status, reason, "", ""); + log_SLM_warning("Put /associate_inventory", status, reason, "", ""); return; } @@ -401,11 +413,11 @@ public: Json::Reader reader; if (!reader.parse(body,root)) { - log_SLM_error("Associate listings", status, "Json parsing failed", reader.getFormatedErrorMessages(), body); + log_SLM_warning("Put /associate_inventory", status, "Json parsing failed", reader.getFormatedErrorMessages(), body); return; } - llinfos << "Merov : Associate listing completedRaw : data = " << body << llendl; + log_SLM_warning("Put /associate_inventory", status, reason, "", body); // Extract the info from the Json string Json::ValueIterator it = root["listings"].begin(); @@ -460,7 +472,7 @@ public: if (!isGoodStatus(status)) { - log_SLM_error("Delete listings", status, reason, "", body); + log_SLM_warning("Delete /listing", status, reason, "", body); return; } @@ -468,11 +480,11 @@ public: Json::Reader reader; if (!reader.parse(body,root)) { - log_SLM_error("Delete listings", status, "Json parsing failed", reader.getFormatedErrorMessages(), body); + log_SLM_warning("Delete /listing", status, "Json parsing failed", reader.getFormatedErrorMessages(), body); return; } - llinfos << "Merov : Delete listing completedRaw : data = " << body << llendl; + log_SLM_warning("Delete /listing", status, reason, "", body); // Extract the info from the Json string Json::ValueIterator it = root["listings"].begin(); @@ -482,16 +494,8 @@ public: Json::Value listing = *it; int listing_id = listing["id"].asInt(); - std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString(); - - LLUUID folder_id(folder_uuid_string); - - // Check that the listing ID is associated to the correct folder - LLUUID old_listing = LLMarketplaceData::instance().getListingFolder(listing_id); - if (old_listing == folder_id) - { - LLMarketplaceData::instance().deleteListing(folder_id); - } + LLUUID folder_id = LLMarketplaceData::instance().getListingFolder(listing_id); + LLMarketplaceData::instance().deleteListing(folder_id); it++; } @@ -1040,13 +1044,18 @@ void LLMarketplaceData::initializeSLM(const status_updated_signal_t::slot_type& mStatusUpdatedSignal = new status_updated_signal_t(); } mStatusUpdatedSignal->connect(cb); - LLHTTPClient::get(getSLMConnectURL("/merchant"), new LLSLMGetMerchantResponder(), LLSD()); + + std::string url = getSLMConnectURL("/merchant"); + log_SLM_warning("LLHTTPClient::get", url, ""); + LLHTTPClient::get(url, new LLSLMGetMerchantResponder(), LLSD()); } // Get/Post/Put requests to the SLM Server using the SLM API void LLMarketplaceData::getSLMListings() { - LLHTTPClient::get(getSLMConnectURL("/listings"), new LLSLMGetListingsResponder(), LLSD()); + std::string url = getSLMConnectURL("/listings"); + log_SLM_warning("LLHTTPClient::get", url, ""); + LLHTTPClient::get(url, new LLSLMGetListingsResponder(), LLSD()); } void LLMarketplaceData::getSLMListing(S32 listing_id) @@ -1057,7 +1066,7 @@ void LLMarketplaceData::getSLMListing(S32 listing_id) // Send request std::string url = getSLMConnectURL("/listing/") + llformat("%d",listing_id); - llinfos << "Merov : get listing : " << url << llendl; + log_SLM_warning("LLHTTPClient::get", url, ""); LLHTTPClient::get(url, new LLSLMGetListingResponder(), headers); } @@ -1083,7 +1092,9 @@ void LLMarketplaceData::createSLMListing(const LLUUID& folder_id) memcpy(data, (U8*)(json_str.c_str()), size); // Send request - LLHTTPClient::postRaw(getSLMConnectURL("/listings"), data, size, new LLSLMCreateListingsResponder(), headers); + std::string url = getSLMConnectURL("/listings"); + log_SLM_warning("LLHTTPClient::postRaw", url, json_str); + LLHTTPClient::postRaw(url, data, size, new LLSLMCreateListingsResponder(), headers); } void LLMarketplaceData::updateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed) @@ -1110,7 +1121,7 @@ void LLMarketplaceData::updateSLMListing(const LLUUID& folder_id, S32 listing_id // Send request std::string url = getSLMConnectURL("/listing/") + llformat("%d",listing_id); - llinfos << "Merov : updating listing : " << url << ", data = " << json_str << llendl; + log_SLM_warning("LLHTTPClient::putRaw", url, json_str); LLHTTPClient::putRaw(url, data, size, new LLSLMUpdateListingsResponder(), headers); } @@ -1137,7 +1148,7 @@ void LLMarketplaceData::associateSLMListing(const LLUUID& folder_id, S32 listing // Send request std::string url = getSLMConnectURL("/associate_inventory/") + llformat("%d",listing_id); - llinfos << "Merov : associate listing : " << url << ", data = " << json_str << llendl; + log_SLM_warning("LLHTTPClient::putRaw", url, json_str); LLHTTPClient::putRaw(url, data, size, new LLSLMAssociateListingsResponder(), headers); } @@ -1149,7 +1160,7 @@ void LLMarketplaceData::deleteSLMListing(S32 listing_id) // Send request std::string url = getSLMConnectURL("/listing/") + llformat("%d",listing_id); - llinfos << "Merov : delete listing : " << url << llendl; + log_SLM_warning("LLHTTPClient::del", url, ""); LLHTTPClient::del(url, new LLSLMDeleteListingsResponder(), headers); } @@ -1215,8 +1226,6 @@ bool LLMarketplaceData::clearListing(const LLUUID& folder_id) return false; } - llinfos << "Merov : clearListing, folder id = " << folder_id << ", listing uuid = " << listing_uuid << ", listing id = " << listing_id << ", depth = " << depth << llendl; - // Update the SLM Server so that this listing is deleted (actually, archived...) deleteSLMListing(listing_id); @@ -1242,8 +1251,6 @@ bool LLMarketplaceData::getListing(const LLUUID& folder_id) return false; } - llinfos << "Merov : getListing, listing uuid = " << listing_uuid << ", listing id = " << listing_id << ", depth = " << depth << llendl; - // Get listing data from SLM getSLMListing(listing_id); -- cgit v1.3 From 7911e32d4bd9f86bdde5771dcaa14203befa5f7d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 5 Jun 2014 18:02:28 -0700 Subject: DD-114, DD-115, DD-116: Fixed counts on folder, folder depth and items on operations on marketplace listings --- indra/newview/app_settings/settings.xml | 4 ++-- indra/newview/llinventorybridge.cpp | 4 ++-- indra/newview/llinventoryfunctions.cpp | 21 +++++++++++---------- 3 files changed, 15 insertions(+), 14 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 71715ed801..1966e71360 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4696,7 +4696,7 @@ Type U32 Value - 21 + 20 InventoryOutboxMaxFolderDepth @@ -4718,7 +4718,7 @@ Type U32 Value - 200 + 100 InventorySortOrder diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0f62c8555d..c50f3f8041 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3290,11 +3290,11 @@ void LLFolderBridge::perform_pasteFromClipboard() LLInventoryItem *item = model->getItem(item_id); LLInventoryCategory *cat = model->getCategory(item_id); - if (item && !can_move_item_to_marketplace(master_folder, dest_folder, item, error_msg)) + if (item && !can_move_item_to_marketplace(master_folder, dest_folder, item, error_msg, objects.size())) { break; } - if (cat && !can_move_folder_to_marketplace(master_folder, dest_folder, cat, error_msg)) + if (cat && !can_move_folder_to_marketplace(master_folder, dest_folder, cat, error_msg, objects.size())) { break; } diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index da8c03eb7c..b17e9551e5 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -1092,13 +1092,14 @@ bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLIn { bool accept = true; - // Compute the nested folder levels we'll get into with that folder - int nested_folder_levels = get_folder_levels(inv_cat); - if (root_folder) - { - nested_folder_levels += get_folder_path_length(root_folder->getUUID(), dest_folder->getUUID()); - } - if (nested_folder_levels > gSavedSettings.getU32("InventoryOutboxMaxFolderDepth")) + // Compute the nested folders level we'll add into with that incoming folder + int incoming_folder_depth = get_folder_levels(inv_cat); + // Compute the nested folders level we're inserting ourselves in + // Note: add one when inserting under a listing folder as we need to take the root listing folder in the count + int insertion_point_folder_depth = (root_folder ? get_folder_path_length(root_folder->getUUID(), dest_folder->getUUID()) + 1 : 0); + + // Compare the whole with the nested folders depth limit + if ((incoming_folder_depth + insertion_point_folder_depth) > gSavedSettings.getU32("InventoryOutboxMaxFolderDepth")) { LLStringUtil::format_map_t args; U32 amount = gSavedSettings.getU32("InventoryOutboxMaxFolderDepth"); @@ -1113,8 +1114,8 @@ bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLIn LLInventoryModel::item_array_t descendent_items; gInventory.collectDescendents(inv_cat->getUUID(), descendent_categories, descendent_items, FALSE); - int dragged_folder_count = descendent_categories.size() + 1; - int dragged_item_count = descendent_items.size() + bundle_size; + int dragged_folder_count = descendent_categories.size() + bundle_size; // Note: We assume that we're moving a bunch of folders in. That might be wrong... + int dragged_item_count = descendent_items.size(); int existing_item_count = 0; int existing_folder_count = 0; @@ -1124,7 +1125,7 @@ bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLIn { // Clear those counts or they will be counted twice because we're already inside the root category dragged_folder_count = 0; - dragged_item_count = bundle_size; + dragged_item_count = 0; } else { -- cgit v1.3 From f8098d2b0ff754d54b601b61edd49b67418e2060 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 2 Oct 2014 21:51:54 -0700 Subject: DD-174 : WIP : Use the correct icon for the marketplace listing FUI (toolbar) button --- indra/newview/app_settings/commands.xml | 2 +- indra/newview/skins/default/textures/textures.xml | 1 + .../skins/default/textures/toolbar_icons/mktlistings.png | Bin 0 -> 579 bytes 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 indra/newview/skins/default/textures/toolbar_icons/mktlistings.png (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 87ac7cce2c..9b12254ce3 100755 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -120,7 +120,7 @@ /> + diff --git a/indra/newview/skins/default/textures/toolbar_icons/mktlistings.png b/indra/newview/skins/default/textures/toolbar_icons/mktlistings.png new file mode 100644 index 0000000000..a6f90461d7 Binary files /dev/null and b/indra/newview/skins/default/textures/toolbar_icons/mktlistings.png differ -- cgit v1.3 From 6b8916e7604d47f37d30ae0c1a6ab2465da1f39d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sun, 5 Oct 2014 20:17:29 -0700 Subject: DD-170 : Handle 503 answer from SLM and added a MARKET_MERCHANT_NOT_MIGRATED state to the UI, showing only the relevant UI to the user (i.e. Merchant Outbox or Marketplace Listings). --- indra/llui/llcommandmanager.cpp | 19 ++++++++++++++++++ indra/llui/llcommandmanager.h | 1 + indra/newview/app_settings/commands.xml | 6 ++++-- indra/newview/app_settings/settings.xml | 22 ++++++++++----------- indra/newview/llmarketplacefunctions.cpp | 22 +++++++++++++++++---- indra/newview/llmarketplacefunctions.h | 1 + indra/newview/llstartup.cpp | 8 ++++++++ indra/newview/lltoolmgr.cpp | 20 +++++++++++++++++++ indra/newview/lltoolmgr.h | 2 ++ indra/newview/llviewermenu.cpp | 33 ++++++++++++++++++++++++++++++++ indra/newview/llviewermenu.h | 1 + 11 files changed, 118 insertions(+), 17 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index 74ef8dd0c3..3e159365e5 100755 --- a/indra/llui/llcommandmanager.cpp +++ b/indra/llui/llcommandmanager.cpp @@ -131,6 +131,25 @@ LLCommand * LLCommandManager::getCommand(const LLCommandId& commandId) return command_match; } +LLCommand * LLCommandManager::getCommand(const std::string& name) +{ + LLCommand * command_match = NULL; + + CommandVector::const_iterator it = mCommands.begin(); + + while (it != mCommands.end()) + { + if ((*it)->name() == name) + { + command_match = *it; + break; + } + it++; + } + + return command_match; +} + void LLCommandManager::addCommand(LLCommand * command) { LLCommandId command_id = command->id(); diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h index ff5a8a3257..f2f2145953 100755 --- a/indra/llui/llcommandmanager.h +++ b/indra/llui/llcommandmanager.h @@ -190,6 +190,7 @@ public: U32 commandCount() const; LLCommand * getCommand(U32 commandIndex); LLCommand * getCommand(const LLCommandId& commandId); + LLCommand * getCommand(const std::string& name); static bool load(); diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 9b12254ce3..2cd6638042 100755 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -123,8 +123,10 @@ icon="Command_MktListings_Icon" label_ref="Command_MarketplaceListings_Label" tooltip_ref="Command_MarketplaceListings_Tooltip" - execute_function="Floater.ToggleOrBringToFront" - execute_parameters="marketplace_listings" + execute_function="Marketplace.Toggle" + execute_parameters="marketplace" + is_enabled_function="Marketplace.Enabled" + is_enabled_parameters="marketplace" is_running_function="Floater.IsOpen" is_running_parameters="marketplace_listings" /> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index abe477f38d..a666c72686 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4621,17 +4621,6 @@ Value 0 - InventoryDisplayOutbox - - Comment - Override merchant inventory outbox display - Persist - 0 - Type - Boolean - Value - 0 - InventoryInboxToggleState Comment @@ -4654,6 +4643,17 @@ Value 0 + InventoryOutboxDisplayBoth + + Comment + Show the legacy Merchant Outbox UI as well as the Marketplace Listings UI + Persist + 1 + Type + Boolean + Value + 0 + InventoryOutboxLogging Comment diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 794bb62834..58a946e4e4 100755 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -152,6 +152,11 @@ protected: { log_SLM_infos("Get /merchant", getStatus(), "User is not a merchant"); LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_MERCHANT); + } + else if (HTTP_SERVICE_UNAVAILABLE == getStatus()) + { + log_SLM_infos("Get /merchant", getStatus(), "Merchant is not migrated"); + LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_MERCHANT_NOT_MIGRATED); } else { @@ -1133,16 +1138,25 @@ LLMarketplaceData::~LLMarketplaceData() void LLMarketplaceData::initializeSLM(const status_updated_signal_t::slot_type& cb) { - mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING; if (mStatusUpdatedSignal == NULL) { mStatusUpdatedSignal = new status_updated_signal_t(); } mStatusUpdatedSignal->connect(cb); - std::string url = getSLMConnectURL("/merchant"); - log_SLM_infos("LLHTTPClient::get", url, ""); - LLHTTPClient::get(url, new LLSLMGetMerchantResponder(), LLSD()); + if (mMarketPlaceStatus != MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED) + { + // If already initialized, just confirm the status so the callback gets called + setSLMStatus(mMarketPlaceStatus); + } + else + { + // Initiate SLM connection and set responder + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING; + std::string url = getSLMConnectURL("/merchant"); + log_SLM_infos("LLHTTPClient::get", url, ""); + LLHTTPClient::get(url, new LLSLMGetMerchantResponder(), LLSD()); + } } // Get/Post/Put requests to the SLM Server using the SLM API diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h index d9e222e05d..ae58f5fc3c 100755 --- a/indra/newview/llmarketplacefunctions.h +++ b/indra/newview/llmarketplacefunctions.h @@ -68,6 +68,7 @@ namespace MarketplaceStatusCodes MARKET_PLACE_CONNECTION_FAILURE = 2, MARKET_PLACE_MERCHANT = 3, MARKET_PLACE_NOT_MERCHANT = 4, + MARKET_MERCHANT_NOT_MIGRATED = 5 }; } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 74df18810c..77a5f4989b 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1875,6 +1875,14 @@ bool idle_startup() } display_startup(); + + // Init SLM Marketplace connection so we know which UI should be used for the user as a merchant + // Note: Eventually, all merchant will be migrated to the new SLM system and there will be no + // reason to show the old UI at all. + // *TODO : Suppress the Merchant Outbox UI completely + check_merchant_status(); + + display_startup(); if (gSavedSettings.getBOOL("HelpFloaterOpen")) { diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index 175227173f..f040a28837 100755 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -37,6 +37,7 @@ #include "llfloaterinspect.h" #include "lltool.h" #include "llmanipscale.h" +#include "llmarketplacefunctions.h" #include "llselectmgr.h" #include "lltoolbrush.h" #include "lltoolcomp.h" @@ -83,6 +84,8 @@ LLToolMgr::LLToolMgr() LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Active", boost::bind(&LLToolMgr::inEdit, this)); LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this)); LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this, _2)); + LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Marketplace.Enabled", boost::bind(&LLToolMgr::canAccessMarketplace, this)); + LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Marketplace.Toggle", boost::bind(&LLToolMgr::toggleMarketplace, this, _2)); gToolNull = new LLTool(LLStringUtil::null); // Does nothing setCurrentTool(gToolNull); @@ -345,6 +348,23 @@ bool LLToolMgr::inBuildMode() return b; } +bool LLToolMgr::canAccessMarketplace() +{ + return (LLMarketplaceData::instance().getSLMStatus() != MarketplaceStatusCodes::MARKET_MERCHANT_NOT_MIGRATED) || gSavedSettings.getBOOL("InventoryOutboxDisplayBoth"); +} + +void LLToolMgr::toggleMarketplace(const LLSD& sdname) +{ + const std::string& param = sdname.asString(); + + if ((param != "marketplace") || !canAccessMarketplace()) + { + return; + } + + LLFloaterReg::toggleInstanceOrBringToFront("marketplace_listings"); +} + void LLToolMgr::setTransientTool(LLTool* tool) { if (!tool) diff --git a/indra/newview/lltoolmgr.h b/indra/newview/lltoolmgr.h index e7d1c56c83..a3c1045aac 100755 --- a/indra/newview/lltoolmgr.h +++ b/indra/newview/lltoolmgr.h @@ -54,7 +54,9 @@ public: bool inEdit(); bool canEdit(); + bool canAccessMarketplace(); void toggleBuildMode(const LLSD& sdname); + void toggleMarketplace(const LLSD& sdname); /* Determines if we are in Build mode or not. */ bool inBuildMode(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 38aaff9279..613ad00809 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -88,6 +88,7 @@ #include "llinventoryfunctions.h" #include "llpanellogin.h" #include "llpanelblockedlist.h" +#include "llmarketplacefunctions.h" #include "llmenuoptionpathfindingrebakenavmesh.h" #include "llmoveview.h" #include "llparcel.h" @@ -98,6 +99,7 @@ #include "llspellcheckmenuhandler.h" #include "llstatusbar.h" #include "lltextureview.h" +#include "lltoolbarview.h" #include "lltoolcomp.h" #include "lltoolmgr.h" #include "lltoolpie.h" @@ -386,6 +388,37 @@ void set_underclothes_menu_options() } } +void set_merchant_menu() +{ + if (LLMarketplaceData::instance().getSLMStatus() == MarketplaceStatusCodes::MARKET_MERCHANT_NOT_MIGRATED) + { + // Merchant not migrated: show only the old Merchant Outbox menu + gMenuHolder->getChild("MerchantOutbox")->setVisible(TRUE); + } + else + { + // All other cases (new merchant, not merchant, migrated merchant): show the new Marketplace Listings menu and enable the tool + gMenuHolder->getChild("MarketplaceListings")->setVisible(TRUE); + LLCommand* command = LLCommandManager::instance().getCommand("marketplacelistings"); + gToolBarView->enableCommand(command->id(), true); + } +} + +void check_merchant_status() +{ + if (!gSavedSettings.getBOOL("InventoryOutboxDisplayBoth")) + { + // Hide both merchant related menu items + gMenuHolder->getChild("MerchantOutbox")->setVisible(FALSE); + gMenuHolder->getChild("MarketplaceListings")->setVisible(FALSE); + // Also disable the toolbar button for Marketplace Listings + LLCommand* command = LLCommandManager::instance().getCommand("marketplacelistings"); + gToolBarView->enableCommand(command->id(), false); + // Launch an SLM test connection to get the merchant status + LLMarketplaceData::instance().initializeSLM(boost::bind(&set_merchant_menu)); + } +} + void init_menus() { // Initialize actions diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 7f09fc2d8f..b7bdf00157 100755 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -83,6 +83,7 @@ BOOL enable_god_full(void* user_data); BOOL enable_god_liaison(void* user_data); BOOL enable_god_basic(void* user_data); void set_underclothes_menu_options(); +void check_merchant_status(); void exchange_callingcard(const LLUUID& dest_id); -- cgit v1.3 From 2939a542f97c5643457f0087915c733b949a0eb9 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 7 Nov 2014 16:47:19 -0800 Subject: DD-272 : Be more consistent when updating the count on hand in SLM, also prevent multiple folder update when receiving data from SLM --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llmarketplacefunctions.cpp | 102 ++++++++++++++++++++----------- indra/newview/llmarketplacefunctions.h | 16 ++--- 3 files changed, 76 insertions(+), 44 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2d835fb2f7..dca2062211 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4718,7 +4718,7 @@ Type U32 Value - 100 + 200 InventorySortOrder diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index d7a85de062..6ee81df792 100755 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -225,14 +225,18 @@ public: std::string edit_url = listing["edit_url"].asString(); std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString(); std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString(); + int count = listing["inventory_info"]["count_on_hand"].asInt(); LLUUID folder_id(folder_uuid_string); LLUUID version_id(version_uuid_string); if (folder_id.notNull()) { LLMarketplaceData::instance().deleteListing(folder_id,false); - LLMarketplaceData::instance().addListing(folder_id,listing_id,version_id,is_listed); - LLMarketplaceData::instance().setListingURL(folder_id, edit_url); + LLMarketplaceData::instance().addListing(folder_id,listing_id,version_id,is_listed,false); + LLMarketplaceData::instance().setListingURL(folder_id, edit_url,false); + LLMarketplaceData::instance().setCountOnHand(folder_id,count,false); + update_marketplace_category(folder_id, false); + gInventory.notifyObservers(); } it++; } @@ -297,11 +301,15 @@ public: std::string edit_url = listing["edit_url"].asString(); std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString(); std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString(); + int count = listing["inventory_info"]["count_on_hand"].asInt(); LLUUID folder_id(folder_uuid_string); LLUUID version_id(version_uuid_string); - LLMarketplaceData::instance().addListing(folder_id,listing_id,version_id,is_listed); - LLMarketplaceData::instance().setListingURL(folder_id, edit_url); + LLMarketplaceData::instance().addListing(folder_id,listing_id,version_id,is_listed, false); + LLMarketplaceData::instance().setListingURL(folder_id, edit_url, false); + LLMarketplaceData::instance().setCountOnHand(folder_id,count,false); + update_marketplace_category(folder_id, false); + gInventory.notifyObservers(); it++; } } @@ -361,15 +369,19 @@ public: std::string edit_url = listing["edit_url"].asString(); std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString(); std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString(); + int count = listing["inventory_info"]["count_on_hand"].asInt(); LLUUID folder_id(folder_uuid_string); LLUUID version_id(version_uuid_string); // Update that listing - LLMarketplaceData::instance().setListingID(folder_id, listing_id); - LLMarketplaceData::instance().setVersionFolderID(folder_id, version_id); - LLMarketplaceData::instance().setActivationState(folder_id, is_listed); - LLMarketplaceData::instance().setListingURL(folder_id, edit_url); + LLMarketplaceData::instance().setListingID(folder_id, listing_id, false); + LLMarketplaceData::instance().setVersionFolderID(folder_id, version_id, false); + LLMarketplaceData::instance().setActivationState(folder_id, is_listed, false); + LLMarketplaceData::instance().setListingURL(folder_id, edit_url, false); + LLMarketplaceData::instance().setCountOnHand(folder_id,count,false); + update_marketplace_category(folder_id, false); + gInventory.notifyObservers(); it++; } @@ -432,15 +444,19 @@ public: std::string edit_url = listing["edit_url"].asString(); std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString(); std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString(); + int count = listing["inventory_info"]["count_on_hand"].asInt(); LLUUID folder_id(folder_uuid_string); LLUUID version_id(version_uuid_string); // Update that listing - LLMarketplaceData::instance().setListingID(folder_id, listing_id); - LLMarketplaceData::instance().setVersionFolderID(folder_id, version_id); - LLMarketplaceData::instance().setActivationState(folder_id, is_listed); - LLMarketplaceData::instance().setListingURL(folder_id, edit_url); + LLMarketplaceData::instance().setListingID(folder_id, listing_id, false); + LLMarketplaceData::instance().setVersionFolderID(folder_id, version_id, false); + LLMarketplaceData::instance().setActivationState(folder_id, is_listed, false); + LLMarketplaceData::instance().setListingURL(folder_id, edit_url, false); + LLMarketplaceData::instance().setCountOnHand(folder_id,count,false); + update_marketplace_category(folder_id, false); + gInventory.notifyObservers(); // Show a notification alert if what we got is not what we expected // (this actually doesn't result in an error status from the SLM API protocol) @@ -516,7 +532,8 @@ public: std::string edit_url = listing["edit_url"].asString(); std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString(); std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString(); - + int count = listing["inventory_info"]["count_on_hand"].asInt(); + LLUUID folder_id(folder_uuid_string); LLUUID version_id(version_uuid_string); @@ -529,8 +546,11 @@ public: } // Add the new association - LLMarketplaceData::instance().addListing(folder_id,listing_id,version_id,is_listed); - LLMarketplaceData::instance().setListingURL(folder_id, edit_url); + LLMarketplaceData::instance().addListing(folder_id,listing_id,version_id,is_listed, false); + LLMarketplaceData::instance().setListingURL(folder_id, edit_url, false); + LLMarketplaceData::instance().setCountOnHand(folder_id,count,false); + update_marketplace_category(folder_id, false); + gInventory.notifyObservers(); // Alert with DAMA informing the user that a version folder must be designated LLNotificationsUtil::add("AlertMerchantAssociateNeedsVersion"); @@ -1498,7 +1518,7 @@ bool LLMarketplaceData::associateListing(const LLUUID& folder_id, const LLUUID& } // Methods privately called or called by SLM responders to perform changes -bool LLMarketplaceData::addListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed) +bool LLMarketplaceData::addListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed, bool update) { if (isListed(folder_id)) { @@ -1507,12 +1527,15 @@ bool LLMarketplaceData::addListing(const LLUUID& folder_id, S32 listing_id, cons } mMarketplaceItems[folder_id] = LLMarketplaceTuple(folder_id, listing_id, version_id, is_listed); - update_marketplace_category(folder_id, false); - gInventory.notifyObservers(); + if (update) + { + update_marketplace_category(folder_id, false); + gInventory.notifyObservers(); + } return true; } -bool LLMarketplaceData::deleteListing(const LLUUID& folder_id, bool update_slm) +bool LLMarketplaceData::deleteListing(const LLUUID& folder_id, bool update) { if (!isListed(folder_id)) { @@ -1521,7 +1544,7 @@ bool LLMarketplaceData::deleteListing(const LLUUID& folder_id, bool update_slm) } mMarketplaceItems.erase(folder_id); - if (update_slm) + if (update) { update_marketplace_category(folder_id, false); gInventory.notifyObservers(); @@ -1529,7 +1552,7 @@ bool LLMarketplaceData::deleteListing(const LLUUID& folder_id, bool update_slm) return true; } -bool LLMarketplaceData::deleteListing(S32 listing_id) +bool LLMarketplaceData::deleteListing(S32 listing_id, bool update) { if (listing_id == 0) { @@ -1537,7 +1560,7 @@ bool LLMarketplaceData::deleteListing(S32 listing_id) } LLUUID folder_id = getListingFolder(listing_id); - return deleteListing(folder_id); + return deleteListing(folder_id, update); } // Accessors @@ -1686,7 +1709,7 @@ void LLMarketplaceData::setUpdating(const LLUUID& folder_id, bool isUpdating) } // Private Modifiers -bool LLMarketplaceData::setListingID(const LLUUID& folder_id, S32 listing_id) +bool LLMarketplaceData::setListingID(const LLUUID& folder_id, S32 listing_id, bool update) { marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); if (it == mMarketplaceItems.end()) @@ -1696,12 +1719,15 @@ bool LLMarketplaceData::setListingID(const LLUUID& folder_id, S32 listing_id) (it->second).mListingId = listing_id; - update_marketplace_category(folder_id, false); - gInventory.notifyObservers(); + if (update) + { + update_marketplace_category(folder_id, false); + gInventory.notifyObservers(); + } return true; } -bool LLMarketplaceData::setCountOnHand(const LLUUID& folder_id, S32 count) +bool LLMarketplaceData::setCountOnHand(const LLUUID& folder_id, S32 count, bool update) { marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); if (it == mMarketplaceItems.end()) @@ -1714,7 +1740,7 @@ bool LLMarketplaceData::setCountOnHand(const LLUUID& folder_id, S32 count) return true; } -bool LLMarketplaceData::setVersionFolderID(const LLUUID& folder_id, const LLUUID& version_id) +bool LLMarketplaceData::setVersionFolderID(const LLUUID& folder_id, const LLUUID& version_id, bool update) { marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); if (it == mMarketplaceItems.end()) @@ -1729,14 +1755,17 @@ bool LLMarketplaceData::setVersionFolderID(const LLUUID& folder_id, const LLUUID } (it->second).mVersionFolderId = version_id; - - update_marketplace_category(old_version_id, false); - update_marketplace_category(version_id, false); - gInventory.notifyObservers(); + + if (update) + { + update_marketplace_category(old_version_id, false); + update_marketplace_category(version_id, false); + gInventory.notifyObservers(); + } return true; } -bool LLMarketplaceData::setActivationState(const LLUUID& folder_id, bool activate) +bool LLMarketplaceData::setActivationState(const LLUUID& folder_id, bool activate, bool update) { marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); if (it == mMarketplaceItems.end()) @@ -1746,12 +1775,15 @@ bool LLMarketplaceData::setActivationState(const LLUUID& folder_id, bool activat (it->second).mIsActive = activate; - update_marketplace_category((it->second).mListingFolderId, false); - gInventory.notifyObservers(); + if (update) + { + update_marketplace_category((it->second).mListingFolderId, false); + gInventory.notifyObservers(); + } return true; } -bool LLMarketplaceData::setListingURL(const LLUUID& folder_id, const std::string& edit_url) +bool LLMarketplaceData::setListingURL(const LLUUID& folder_id, const std::string& edit_url, bool update) { marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); if (it == mMarketplaceItems.end()) diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h index 2b578c4c37..391ab8a733 100755 --- a/indra/newview/llmarketplacefunctions.h +++ b/indra/newview/llmarketplacefunctions.h @@ -199,7 +199,7 @@ public: bool updateCountOnHand(const LLUUID& folder_id); bool getListing(const LLUUID& folder_id); bool getListing(S32 listing_id); - bool deleteListing(S32 listing_id); + bool deleteListing(S32 listing_id, bool update = true); // Probe the Marketplace data set to identify folders bool isListed(const LLUUID& folder_id); // returns true if folder_id is a Listing folder @@ -225,13 +225,13 @@ public: private: // Modify Marketplace data set : each method returns true if the function succeeds, false if error // Used internally only by SLM Responders when data are received from the SLM Server - bool addListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed); - bool deleteListing(const LLUUID& folder_id, bool update_slm = true); - bool setListingID(const LLUUID& folder_id, S32 listing_id); - bool setVersionFolderID(const LLUUID& folder_id, const LLUUID& version_id); - bool setActivationState(const LLUUID& folder_id, bool activate); - bool setListingURL(const LLUUID& folder_id, const std::string& edit_url); - bool setCountOnHand(const LLUUID& folder_id, S32 count); + bool addListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed, bool update = true); + bool deleteListing(const LLUUID& folder_id, bool update = true); + bool setListingID(const LLUUID& folder_id, S32 listing_id, bool update = true); + bool setVersionFolderID(const LLUUID& folder_id, const LLUUID& version_id, bool update = true); + bool setActivationState(const LLUUID& folder_id, bool activate, bool update = true); + bool setListingURL(const LLUUID& folder_id, const std::string& edit_url, bool update = true); + bool setCountOnHand(const LLUUID& folder_id, S32 count, bool update = true); // Private SLM API : package data and get/post/put requests to the SLM Server through the SLM API void setSLMStatus(U32 status); -- cgit v1.3 From c7f24a69cfa0e87160d98325431c3098dcd8295b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 17 Mar 2015 12:59:37 -0700 Subject: DD-362 : WIP : Check stock folder count limit --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llinventoryfunctions.cpp | 22 ++++++++++++++++++++++ indra/newview/skins/default/xui/en/strings.xml | 1 + 3 files changed, 34 insertions(+) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 4a106c08e4..731f64e70e 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4742,6 +4742,17 @@ Value 200 + InventoryOutboxMaxStockItemCount + + Comment + Maximum number of items allowed in a stock folder. + Persist + 0 + Type + U32 + Value + 200 + InventorySortOrder Comment diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 3939281d0a..229644bdf9 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -1267,6 +1267,19 @@ bool can_move_item_to_marketplace(const LLInventoryCategory* root_folder, LLInve tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects", args); accept = false; } + + if (move_in_stock) + { + int stock_size = bundle_size + count_descendants_items(dest_folder->getUUID()); + if (stock_size > gSavedSettings.getU32("InventoryOutboxMaxStockItemCount")) + { + LLStringUtil::format_map_t args; + U32 amount = gSavedSettings.getU32("InventoryOutboxMaxStockItemCount"); + args["[AMOUNT]"] = llformat("%d",amount); + tooltip_msg = LLTrans::getString("TooltipOutboxTooManyStockItems", args); + accept = false; + } + } } return accept; @@ -1803,6 +1816,15 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_ std::string message = indent + cat->getName() + LLTrans::getString("Marketplace Validation Error Subfolder In Stock"); cb(message,depth,LLError::LEVEL_ERROR); } + else if ((folder_type == LLFolderType::FT_MARKETPLACE_STOCK) && (item_array->size() > gSavedSettings.getU32("InventoryOutboxMaxStockItemCount"))) + { + // Report if a stock folder has too many items + result = false; + LLStringUtil::format_map_t args; + args["[AMOUNT]"] = llformat("%d",gSavedSettings.getU32("InventoryOutboxMaxStockItemCount")); + std::string message = indent + cat->getName() + LLTrans::getString("TooltipOutboxTooManyStockItems", args); + cb(message,depth,LLError::LEVEL_ERROR); + } else { // Simply print the folder name diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 76f4de1400..49630adb93 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -241,6 +241,7 @@ Please try logging in again in a minute. Depth of nested folders exceeds [AMOUNT]. Decrease the depth of folders-within-folders; box items if necessary. Subfolder count exceeds [AMOUNT]. Decrease the number of folders in your listing; box items if necessary. Item count exceeds [AMOUNT]. In order to sell more than [AMOUNT] items in one listing, you must box some of them. + Stock folder count exceeds [AMOUNT]. You can only drop items or folders in the ALL tab. Please select that tab and move your item(s) or folder(s) again. One or more of these objects cannot be sold or transferred You can only put items from your inventory on the marketplace -- cgit v1.3 From 7816dfd5ac8ebb92f66c738d7f0ed61bbf7c0282 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 15 May 2015 20:10:45 -0700 Subject: DD-403: Make the sort order persistent in marketplace listings floater --- indra/newview/app_settings/settings.xml | 11 ++++++++ indra/newview/llfloatermarketplacelistings.cpp | 37 ++++++++++++++++---------- indra/newview/llfloatermarketplacelistings.h | 2 ++ 3 files changed, 36 insertions(+), 14 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1b53a06a85..778020a92e 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4790,6 +4790,17 @@ Value 7 + MarketplaceListingsSortOrder + + Comment + Specifies sort for marketplace listings + Persist + 1 + Type + U32 + Value + 2 + InvertMouse Comment diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index eb7601f67e..b2d36479cd 100755 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -118,6 +118,9 @@ void LLPanelMarketplaceListings::buildAllPanels() tabs_panel->setCommitCallback(boost::bind(&LLPanelMarketplaceListings::onTabChange, this)); tabs_panel->selectTabPanel(panel_all_items); // All panel selected by default mRootFolder = panel_all_items->getRootFolder(); // Keep the root of the all panel + + // Set the default sort order + setSortOrder(gSavedSettings.getU32("MarketplaceListingsSortOrder")); } LLInventoryPanel* LLPanelMarketplaceListings::buildInventoryPanel(const std::string& childname, const std::string& filename) @@ -134,6 +137,23 @@ LLInventoryPanel* LLPanelMarketplaceListings::buildInventoryPanel(const std::str return panel; } +void LLPanelMarketplaceListings::setSortOrder(U32 sort_order) +{ + mSortOrder = sort_order; + gSavedSettings.setU32("MarketplaceListingsSortOrder", sort_order); + + // Set each panel with that sort order + LLTabContainer* tabs_panel = getChild("marketplace_filter_tabs"); + LLInventoryPanel* panel = (LLInventoryPanel*)tabs_panel->getPanelByName("All Items"); + panel->setSortOrder(mSortOrder); + panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Active Items"); + panel->setSortOrder(mSortOrder); + panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Inactive Items"); + panel->setSortOrder(mSortOrder); + panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Unassociated Items"); + panel->setSortOrder(mSortOrder); +} + void LLPanelMarketplaceListings::onFilterEdit(const std::string& search_string) { // Find active panel @@ -234,27 +254,16 @@ void LLPanelMarketplaceListings::onViewSortMenuItemClicked(const LLSD& userdata) // We're making sort options exclusive, default is SO_FOLDERS_BY_NAME if (chosen_item == "sort_by_stock_amount") { - mSortOrder = LLInventoryFilter::SO_FOLDERS_BY_WEIGHT; + setSortOrder(LLInventoryFilter::SO_FOLDERS_BY_WEIGHT); } else if (chosen_item == "sort_by_name") { - mSortOrder = LLInventoryFilter::SO_FOLDERS_BY_NAME; + setSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME); } else if (chosen_item == "sort_by_recent") { - mSortOrder = LLInventoryFilter::SO_DATE; + setSortOrder(LLInventoryFilter::SO_DATE); } - //mSortOrder = (mSortOrder == LLInventoryFilter::SO_FOLDERS_BY_NAME ? LLInventoryFilter::SO_FOLDERS_BY_WEIGHT : LLInventoryFilter::SO_FOLDERS_BY_NAME); - // Set each panel with that sort order - LLTabContainer* tabs_panel = getChild("marketplace_filter_tabs"); - LLInventoryPanel* panel = (LLInventoryPanel*)tabs_panel->getPanelByName("All Items"); - panel->setSortOrder(mSortOrder); - panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Active Items"); - panel->setSortOrder(mSortOrder); - panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Inactive Items"); - panel->setSortOrder(mSortOrder); - panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Unassociated Items"); - panel->setSortOrder(mSortOrder); } // Filter option else if (chosen_item == "show_only_listing_folders") diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h index 9fad31c456..ffc098e28a 100755 --- a/indra/newview/llfloatermarketplacelistings.h +++ b/indra/newview/llfloatermarketplacelistings.h @@ -75,6 +75,8 @@ private: void onTabChange(); void onFilterEdit(const std::string& search_string); + void setSortOrder(U32 sort_order); + LLFolderView* mRootFolder; LLButton* mAuditBtn; LLFilterEditor* mFilterEditor; -- cgit v1.3