From 570d02dc7e41c3e08477e7f759d632db78690eb4 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 29 Nov 2011 16:57:37 -0800 Subject: Initial merchant outbox button --- indra/newview/llfloateroutbox.cpp | 68 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 indra/newview/llfloateroutbox.cpp (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp new file mode 100644 index 0000000000..8fea3d674e --- /dev/null +++ b/indra/newview/llfloateroutbox.cpp @@ -0,0 +1,68 @@ +/** + * @file llfloateroutbox.cpp + * @brief Implementation of the merchant outbox window + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloateroutbox.h" + +#include "llfloaterreg.h" +#include "lltransientfloatermgr.h" + + +///---------------------------------------------------------------------------- +/// LLFloaterOutbox +///---------------------------------------------------------------------------- + +LLFloaterOutbox::LLFloaterOutbox(const LLSD& key) + : LLFloater(key) + , mPanelOutboxInventory(NULL) +{ + LLTransientFloaterMgr::getInstance()->addControlView(this); +} + +LLFloaterOutbox::~LLFloaterOutbox() +{ + LLTransientFloaterMgr::getInstance()->removeControlView(this); +} + +BOOL LLFloaterOutbox::postBuild() +{ + return TRUE; +} + +void LLFloaterOutbox::onOpen(const LLSD& key) +{ + //LLFirstUse::useInventory(); +} + +void LLFloaterOutbox::onClose(bool app_quitting) +{ + LLFloater::onClose(app_quitting); + if (mKey.asInteger() > 1) + { + destroy(); + } +} -- cgit v1.2.3 From 67f1321f31d5988e7b383cfbf4fbd6537f3d2710 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 8 Dec 2011 16:46:30 -0800 Subject: Initial functional merchant outbox floater --- indra/newview/llfloateroutbox.cpp | 309 +++++++++++++++++++++++++++++++++++++- 1 file changed, 301 insertions(+), 8 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 8fea3d674e..79cd90ba1c 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -29,40 +29,333 @@ #include "llfloateroutbox.h" #include "llfloaterreg.h" +#include "llfolderview.h" +#include "llinventoryobserver.h" +#include "llinventorypanel.h" +#include "llloadingindicator.h" +#include "llmarketplacefunctions.h" +#include "llnotificationsutil.h" +#include "lltextbox.h" #include "lltransientfloatermgr.h" +#include "lltrans.h" +#include "llviewernetwork.h" +///---------------------------------------------------------------------------- +/// LLOutboxAddedObserver helper class +///---------------------------------------------------------------------------- + +class LLOutboxAddedObserver : public LLInventoryCategoryAddedObserver +{ +public: + LLOutboxAddedObserver(LLFloaterOutbox * outboxFloater) + : LLInventoryCategoryAddedObserver() + , mOutboxFloater(outboxFloater) + { + } + + void done() + { + for (cat_vec_t::iterator it = mAddedCategories.begin(); it != mAddedCategories.end(); ++it) + { + LLViewerInventoryCategory* added_category = *it; + + LLFolderType::EType added_category_type = added_category->getPreferredType(); + + if (added_category_type == LLFolderType::FT_OUTBOX) + { + mOutboxFloater->setupOutbox(added_category->getUUID()); + } + } + } + +private: + LLFloaterOutbox * mOutboxFloater; +}; + ///---------------------------------------------------------------------------- /// LLFloaterOutbox ///---------------------------------------------------------------------------- LLFloaterOutbox::LLFloaterOutbox(const LLSD& key) : LLFloater(key) - , mPanelOutboxInventory(NULL) + , mCategoriesObserver(NULL) + , mCategoryAddedObserver(NULL) + , mOutboxId(LLUUID::null) + , mOutboxInventoryPanel(NULL) + , mOutboxItemCount(0) + , mInventoryDisablePanel(NULL) + , mInventoryFolderCountText(NULL) + , mInventoryImportInProgress(NULL) + , mInventoryPlaceholder(NULL) + , mInventoryText(NULL) + , mInventoryTitle(NULL) + , mImportButton(NULL) { - LLTransientFloaterMgr::getInstance()->addControlView(this); } LLFloaterOutbox::~LLFloaterOutbox() { - LLTransientFloaterMgr::getInstance()->removeControlView(this); +// delete mCategoriesObserver; +// delete mCategoryAddedObserver; } BOOL LLFloaterOutbox::postBuild() { + mInventoryDisablePanel = getChild("outbox_inventory_disable_panel"); + mInventoryFolderCountText = getChild("outbox_folder_count"); + mInventoryImportInProgress = getChild("import_progress_indicator"); + mInventoryPlaceholder = getChild("outbox_inventory_placeholder_panel"); + mInventoryText = mInventoryPlaceholder->getChild("outbox_inventory_placeholder_text"); + mInventoryTitle = mInventoryPlaceholder->getChild("outbox_inventory_placeholder_title"); + + mImportButton = getChild("outbox_import_btn"); + mImportButton->setCommitCallback(boost::bind(&LLFloaterOutbox::onImportButtonClicked, this)); + return TRUE; } void LLFloaterOutbox::onOpen(const LLSD& key) { - //LLFirstUse::useInventory(); + // + // Initialize the marketplace import API + // + + LLMarketplaceInventoryImporter::getInstance()->initialize(); + LLMarketplaceInventoryImporter::getInstance()->setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1)); + LLMarketplaceInventoryImporter::getInstance()->setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2)); + + // + // Look for an outbox and set up the inventory API + // + + const bool do_not_create_folder = false; + const bool do_not_find_in_library = false; + + const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library); + + if (outbox_id.isNull()) + { + // Observe category creation to catch outbox creation + mCategoryAddedObserver = new LLOutboxAddedObserver(this); + gInventory.addObserver(mCategoryAddedObserver); + } + else + { + setupOutbox(outbox_id); + } + + updateView(); +} + +void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId) +{ + llassert(mOutboxId.isNull()); + llassert(mCategoriesObserver == NULL); + + mOutboxId = outboxId; + + // No longer need to observe new category creation + if (mCategoryAddedObserver != NULL) + { + gInventory.removeObserver(mCategoryAddedObserver); + } + + // Create observer for outbox modifications + mCategoriesObserver = new LLInventoryCategoriesObserver(); + gInventory.addObserver(mCategoriesObserver); + + mCategoriesObserver->addCategory(mOutboxId, boost::bind(&LLFloaterOutbox::onOutboxChanged, this)); + + // + // Set up the outbox inventory view + // + + mOutboxInventoryPanel = + LLUICtrlFactory::createFromFile("panel_outbox_inventory.xml", + mInventoryPlaceholder->getParent(), + LLInventoryPanel::child_registry_t::instance()); + + llassert(mOutboxInventoryPanel); + + // Reshape the inventory to the proper size + LLRect inventory_placeholder_rect = mInventoryPlaceholder->getRect(); + mOutboxInventoryPanel->setShape(inventory_placeholder_rect); + + // Set the sort order newest to oldest + mOutboxInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); + mOutboxInventoryPanel->getFilter()->markDefault(); + + // Set selection callback for proper update of inventory status buttons + //mOutboxInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceOutbox::onSelectionChange, this)); + + // Set up the note to display when the outbox is empty + mOutboxInventoryPanel->getFilter()->setEmptyLookupMessage("InventoryOutboxNoItems"); +} + +void LLFloaterOutbox::updateView() +{ + if (mOutboxItemCount > 0) + { + mOutboxInventoryPanel->setVisible(TRUE); + mInventoryPlaceholder->setVisible(FALSE); + } + else + { + mOutboxInventoryPanel->setVisible(FALSE); + mInventoryPlaceholder->setVisible(TRUE); + + std::string outbox_text; + std::string outbox_title; + std::string outbox_tooltip; + + if (mOutboxId.notNull()) + { + outbox_text = LLTrans::getString("InventoryOutboxNoItems"); + outbox_title = LLTrans::getString("InventoryOutboxNoItemsTitle"); + outbox_tooltip = LLTrans::getString("InventoryOutboxNoItemsTooltip"); + } + else + { + // + // The string to become a merchant contains 3 URL's which need the domain name patched in. + // + + std::string domain = "secondlife.com"; + + if (!LLGridManager::getInstance()->isInProductionGrid()) + { + std::string gridLabel = LLGridManager::getInstance()->getGridLabel(); + domain = llformat("%s.lindenlab.com", utf8str_tolower(gridLabel).c_str()); + } + + LLStringUtil::format_map_t domain_arg; + domain_arg["[DOMAIN_NAME]"] = domain; + + std::string marketplace_url = LLTrans::getString("MarketplaceURL", domain_arg); + std::string marketplace_url_create = LLTrans::getString("MarketplaceURL_CreateStore", domain_arg); + std::string marketplace_url_info = LLTrans::getString("MarketplaceURL_LearnMore", domain_arg); + + LLStringUtil::format_map_t args1, args2, args3; + args1["[MARKETPLACE_URL]"] = marketplace_url; + args2["[LEARN_MORE_URL]"] = marketplace_url_info; + args3["[CREATE_STORE_URL]"] = marketplace_url_create; + + // NOTE: This is dumb, ridiculous and very finicky. The order of these is very important + // to have these three string substitutions work properly. + outbox_text = LLTrans::getString("InventoryOutboxNotMerchant", args1); + LLStringUtil::format(outbox_text, args2); + LLStringUtil::format(outbox_text, args3); + + outbox_title = LLTrans::getString("InventoryOutboxNotMerchantTitle"); + outbox_tooltip = LLTrans::getString("InventoryOutboxNotMerchantTooltip"); + } + + mInventoryText->setValue(outbox_text); + mInventoryTitle->setValue(outbox_title); + mInventoryPlaceholder->getParent()->setToolTip(outbox_tooltip); + } +} + +BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) +{ + // Pass drag and drop to this floater to the outbox inventory control + + S32 local_x = x - mOutboxInventoryPanel->getRect().mLeft; + S32 local_y = y - mOutboxInventoryPanel->getRect().mBottom; + + return mOutboxInventoryPanel->handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); +} + +void LLFloaterOutbox::onImportButtonClicked() +{ + LLMarketplaceInventoryImporter::instance().triggerImport(); +} + +void LLFloaterOutbox::onOutboxChanged() +{ + llassert(!mOutboxId.isNull()); + + U32 item_count = 0; + + const LLFolderViewFolder * outbox_folder = mOutboxInventoryPanel->getRootFolder(); + + if (outbox_folder) + { + item_count += outbox_folder->getFoldersCount(); + item_count += outbox_folder->getItemsCount(); + } + + mOutboxItemCount = item_count; + + switch (mOutboxItemCount) + { + case 0: mInventoryFolderCountText->setText(getString("OutboxFolderCount0")); break; + case 1: mInventoryFolderCountText->setText(getString("OutboxFolderCount1")); break; + default: + { + std::string item_count_str = llformat("%d", mOutboxItemCount); + + LLStringUtil::format_map_t args; + args["[NUM]"] = item_count_str; + + mInventoryFolderCountText->setText(getString("OutboxFolderCountN", args)); + break; + } + } + + mImportButton->setEnabled(mOutboxItemCount > 0); + + updateView(); } -void LLFloaterOutbox::onClose(bool app_quitting) +void LLFloaterOutbox::importReportResults(U32 status, const LLSD& content) { - LLFloater::onClose(app_quitting); - if (mKey.asInteger() > 1) + if (status == MarketplaceErrorCodes::IMPORT_DONE) + { + LLNotificationsUtil::add("OutboxImportComplete", LLSD::emptyMap(), LLSD::emptyMap()); + } + else if (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS) + { + LLNotificationsUtil::add("OutboxImportHadErrors", LLSD::emptyMap(), LLSD::emptyMap()); + } + else { - destroy(); + char status_string[16]; + sprintf(status_string, "%d", status); + + LLSD subs; + subs["ERROR_CODE"] = status_string; + + //llassert(status == MarketplaceErrorCodes::IMPORT_JOB_FAILED); + LLNotificationsUtil::add("OutboxImportFailed", LLSD::emptyMap(), LLSD::emptyMap()); } } + +void LLFloaterOutbox::importStatusChanged(bool inProgress) +{ + if (inProgress) + { + mImportButton->setEnabled(false); + + mInventoryDisablePanel->setVisible(true); + + mInventoryImportInProgress->setVisible(true); + mInventoryImportInProgress->reset(); + mInventoryImportInProgress->start(); + } + else + { + mImportButton->setEnabled(mOutboxItemCount > 0); + + mInventoryDisablePanel->setVisible(false); + + mInventoryImportInProgress->stop(); + mInventoryImportInProgress->setVisible(false); + } +} + -- cgit v1.2.3 From a7b04c9dd44274b3548402de2f4a9b8bc20e3e50 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 9 Dec 2011 10:31:16 -0800 Subject: * Removed old inventory window outbox. * Added centered progress indicator for outbox. --- indra/newview/llfloateroutbox.cpp | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 79cd90ba1c..6a3eaba016 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -32,7 +32,6 @@ #include "llfolderview.h" #include "llinventoryobserver.h" #include "llinventorypanel.h" -#include "llloadingindicator.h" #include "llmarketplacefunctions.h" #include "llnotificationsutil.h" #include "lltextbox.h" @@ -96,15 +95,24 @@ LLFloaterOutbox::LLFloaterOutbox(const LLSD& key) LLFloaterOutbox::~LLFloaterOutbox() { -// delete mCategoriesObserver; -// delete mCategoryAddedObserver; + if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver)) + { + gInventory.removeObserver(mCategoriesObserver); + } + delete mCategoriesObserver; + + if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver)) + { + gInventory.removeObserver(mCategoryAddedObserver); + } + delete mCategoryAddedObserver; } BOOL LLFloaterOutbox::postBuild() { mInventoryDisablePanel = getChild("outbox_inventory_disable_panel"); mInventoryFolderCountText = getChild("outbox_folder_count"); - mInventoryImportInProgress = getChild("import_progress_indicator"); + mInventoryImportInProgress = getChild("import_progress_indicator"); mInventoryPlaceholder = getChild("outbox_inventory_placeholder_panel"); mInventoryText = mInventoryPlaceholder->getChild("outbox_inventory_placeholder_text"); mInventoryTitle = mInventoryPlaceholder->getChild("outbox_inventory_placeholder_title"); @@ -264,6 +272,11 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, std::string& tooltip_msg) { // Pass drag and drop to this floater to the outbox inventory control + + if (LLMarketplaceInventoryImporter::getInstance()->isImportInProgress()) + { + return FALSE; + } S32 local_x = x - mOutboxInventoryPanel->getRect().mLeft; S32 local_y = y - mOutboxInventoryPanel->getRect().mBottom; @@ -317,11 +330,11 @@ void LLFloaterOutbox::importReportResults(U32 status, const LLSD& content) { if (status == MarketplaceErrorCodes::IMPORT_DONE) { - LLNotificationsUtil::add("OutboxImportComplete", LLSD::emptyMap(), LLSD::emptyMap()); + LLNotificationsUtil::add("OutboxImportComplete"); } else if (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS) { - LLNotificationsUtil::add("OutboxImportHadErrors", LLSD::emptyMap(), LLSD::emptyMap()); + LLNotificationsUtil::add("OutboxImportHadErrors"); } else { @@ -329,10 +342,10 @@ void LLFloaterOutbox::importReportResults(U32 status, const LLSD& content) sprintf(status_string, "%d", status); LLSD subs; - subs["ERROR_CODE"] = status_string; + subs["[ERROR_CODE]"] = status_string; //llassert(status == MarketplaceErrorCodes::IMPORT_JOB_FAILED); - LLNotificationsUtil::add("OutboxImportFailed", LLSD::emptyMap(), LLSD::emptyMap()); + LLNotificationsUtil::add("OutboxImportFailed", subs); } } @@ -343,19 +356,14 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress) mImportButton->setEnabled(false); mInventoryDisablePanel->setVisible(true); - mInventoryImportInProgress->setVisible(true); - mInventoryImportInProgress->reset(); - mInventoryImportInProgress->start(); } else { - mImportButton->setEnabled(mOutboxItemCount > 0); - + mInventoryImportInProgress->setVisible(false); mInventoryDisablePanel->setVisible(false); - mInventoryImportInProgress->stop(); - mInventoryImportInProgress->setVisible(false); + mImportButton->setEnabled(mOutboxItemCount > 0); } } -- cgit v1.2.3 From 8878a5e561f292a8afcd933eaafb2c4c65b7bf7f Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 9 Dec 2011 12:29:33 -0800 Subject: * Changed background opacity of outbox and inventory to match. * Removed superfluous marketplace layout stack, leftover from inbox/outbox in same inventory window. --- indra/newview/llfloateroutbox.cpp | 40 ++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 6a3eaba016..619be87187 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -83,7 +83,6 @@ LLFloaterOutbox::LLFloaterOutbox(const LLSD& key) , mOutboxId(LLUUID::null) , mOutboxInventoryPanel(NULL) , mOutboxItemCount(0) - , mInventoryDisablePanel(NULL) , mInventoryFolderCountText(NULL) , mInventoryImportInProgress(NULL) , mInventoryPlaceholder(NULL) @@ -110,7 +109,6 @@ LLFloaterOutbox::~LLFloaterOutbox() BOOL LLFloaterOutbox::postBuild() { - mInventoryDisablePanel = getChild("outbox_inventory_disable_panel"); mInventoryFolderCountText = getChild("outbox_folder_count"); mInventoryImportInProgress = getChild("import_progress_indicator"); mInventoryPlaceholder = getChild("outbox_inventory_placeholder_panel"); @@ -136,21 +134,24 @@ void LLFloaterOutbox::onOpen(const LLSD& key) // // Look for an outbox and set up the inventory API // - - const bool do_not_create_folder = false; - const bool do_not_find_in_library = false; - - const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library); - if (outbox_id.isNull()) - { - // Observe category creation to catch outbox creation - mCategoryAddedObserver = new LLOutboxAddedObserver(this); - gInventory.addObserver(mCategoryAddedObserver); - } - else + if (mOutboxId.isNull()) { - setupOutbox(outbox_id); + const bool do_not_create_folder = false; + const bool do_not_find_in_library = false; + + const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library); + + if (outbox_id.isNull()) + { + // Observe category creation to catch outbox creation + mCategoryAddedObserver = new LLOutboxAddedObserver(this); + gInventory.addObserver(mCategoryAddedObserver); + } + else + { + setupOutbox(outbox_id); + } } updateView(); @@ -164,10 +165,11 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId) mOutboxId = outboxId; // No longer need to observe new category creation - if (mCategoryAddedObserver != NULL) + if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver)) { gInventory.removeObserver(mCategoryAddedObserver); - } + delete mCategoryAddedObserver; + } // Create observer for outbox modifications mCategoriesObserver = new LLInventoryCategoriesObserver(); @@ -286,6 +288,8 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, void LLFloaterOutbox::onImportButtonClicked() { + mOutboxInventoryPanel->clearSelection(); + LLMarketplaceInventoryImporter::instance().triggerImport(); } @@ -355,13 +359,11 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress) { mImportButton->setEnabled(false); - mInventoryDisablePanel->setVisible(true); mInventoryImportInProgress->setVisible(true); } else { mInventoryImportInProgress->setVisible(false); - mInventoryDisablePanel->setVisible(false); mImportButton->setEnabled(mOutboxItemCount > 0); } -- cgit v1.2.3 From cc92db1f353de96f6d27863b92671b2d847536f4 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 9 Dec 2011 16:19:03 -0800 Subject: Moved outbox import confirmations to window shades on the merchant outbox floater, rather than modal dialogs. --- indra/newview/llfloateroutbox.cpp | 61 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 619be87187..8d64214e8c 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -33,11 +33,32 @@ #include "llinventoryobserver.h" #include "llinventorypanel.h" #include "llmarketplacefunctions.h" +#include "llnotificationhandler.h" #include "llnotificationsutil.h" #include "lltextbox.h" #include "lltransientfloatermgr.h" #include "lltrans.h" #include "llviewernetwork.h" +#include "llwindowshade.h" + + +///---------------------------------------------------------------------------- +/// LLOutboxNotification class +///---------------------------------------------------------------------------- + +bool LLNotificationsUI::LLOutboxNotification::processNotification(const LLSD& notify) +{ + LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID()); + + if (notification) + { + LLFloaterOutbox* outbox_floater = LLFloaterReg::getTypedInstance("outbox"); + + outbox_floater->showNotification(notification); + } + + return false; +} ///---------------------------------------------------------------------------- @@ -89,6 +110,7 @@ LLFloaterOutbox::LLFloaterOutbox(const LLSD& key) , mInventoryText(NULL) , mInventoryTitle(NULL) , mImportButton(NULL) + , mWindowShade(NULL) { } @@ -121,6 +143,16 @@ BOOL LLFloaterOutbox::postBuild() return TRUE; } +void LLFloaterOutbox::onClose(bool app_quitting) +{ + if (mWindowShade) + { + delete mWindowShade; + + mWindowShade = NULL; + } +} + void LLFloaterOutbox::onOpen(const LLSD& key) { // @@ -275,7 +307,8 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, { // Pass drag and drop to this floater to the outbox inventory control - if (LLMarketplaceInventoryImporter::getInstance()->isImportInProgress()) + if (LLMarketplaceInventoryImporter::getInstance()->isImportInProgress() || + (mWindowShade && mWindowShade->isShown())) { return FALSE; } @@ -369,3 +402,29 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress) } } +void LLFloaterOutbox::showNotification(LLNotificationPtr notify) +{ + if (mWindowShade) + { + delete mWindowShade; + } + + LLRect floater_rect = getLocalRect(); + floater_rect.mTop -= getHeaderHeight(); + floater_rect.stretch(-5, 0); + + LLWindowShade::Params params; + params.name = "notification_shade"; + params.rect = floater_rect; + params.follows.flags = FOLLOWS_ALL; + params.notification = notify; + params.modal = true; + params.can_close = false; + params.text_color = LLColor4::white; + + mWindowShade = LLUICtrlFactory::create(params); + + addChild(mWindowShade); + mWindowShade->show(); +} + -- cgit v1.2.3 From e826cbd90750fd38565e4e44390948f36254cf1f Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 12 Dec 2011 15:02:52 -0800 Subject: EXP-1682 FIX EXP-1683 FIX EXP-1705 FIX EXP-1707 FIX * Outbox folder count now uses inventory API directly rather than inventory folder view for folder count and item status * Asynchronous fetches are triggered for the outbox content when the window is opened and when it receives focus * Marketplace URL's for empty and non-merchant outbox view have been updated * "Copy to Merchant Outbox" and "Delete" context menu items should be fully functional now with item counts, etc. --- indra/newview/llfloateroutbox.cpp | 135 +++++++++++++++++++------------------- 1 file changed, 68 insertions(+), 67 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 8d64214e8c..b10ef0ba64 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -30,6 +30,7 @@ #include "llfloaterreg.h" #include "llfolderview.h" +#include "llinventorymodelbackgroundfetch.h" #include "llinventoryobserver.h" #include "llinventorypanel.h" #include "llmarketplacefunctions.h" @@ -139,6 +140,8 @@ BOOL LLFloaterOutbox::postBuild() mImportButton = getChild("outbox_import_btn"); mImportButton->setCommitCallback(boost::bind(&LLFloaterOutbox::onImportButtonClicked, this)); + + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLFloaterOutbox::onFocusReceived, this)); return TRUE; } @@ -187,10 +190,30 @@ void LLFloaterOutbox::onOpen(const LLSD& key) } updateView(); + + // + // Trigger fetch of outbox contents + // + + fetchOutboxContents(); +} + +void LLFloaterOutbox::onFocusReceived() +{ + fetchOutboxContents(); +} + +void LLFloaterOutbox::fetchOutboxContents() +{ + if (mOutboxId.notNull()) + { + LLInventoryModelBackgroundFetch::instance().start(mOutboxId); + } } void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId) -{ +{ + llassert(outboxId.notNull()); llassert(mOutboxId.isNull()); llassert(mCategoriesObserver == NULL); @@ -228,15 +251,47 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId) mOutboxInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); mOutboxInventoryPanel->getFilter()->markDefault(); - // Set selection callback for proper update of inventory status buttons - //mOutboxInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceOutbox::onSelectionChange, this)); + fetchOutboxContents(); +} + +void LLFloaterOutbox::updateItemCount() +{ + S32 item_count = 0; + + if (mOutboxId.notNull()) + { + LLInventoryModel::cat_array_t * cats; + LLInventoryModel::item_array_t * items; + gInventory.getDirectDescendentsOf(mOutboxId, cats, items); + + item_count = cats->count() + items->count(); + } + + mOutboxItemCount = item_count; + + switch (mOutboxItemCount) + { + case 0: mInventoryFolderCountText->setText(getString("OutboxFolderCount0")); break; + case 1: mInventoryFolderCountText->setText(getString("OutboxFolderCount1")); break; + default: + { + std::string item_count_str = llformat("%d", mOutboxItemCount); + + LLStringUtil::format_map_t args; + args["[NUM]"] = item_count_str; + + mInventoryFolderCountText->setText(getString("OutboxFolderCountN", args)); + break; + } + } - // Set up the note to display when the outbox is empty - mOutboxInventoryPanel->getFilter()->setEmptyLookupMessage("InventoryOutboxNoItems"); + mImportButton->setEnabled(mOutboxItemCount > 0); } void LLFloaterOutbox::updateView() { + updateItemCount(); + if (mOutboxItemCount > 0) { mOutboxInventoryPanel->setVisible(TRUE); @@ -251,44 +306,17 @@ void LLFloaterOutbox::updateView() std::string outbox_title; std::string outbox_tooltip; + LLStringUtil::format_map_t subs = getMarketplaceStringSubstitutions(); + if (mOutboxId.notNull()) { - outbox_text = LLTrans::getString("InventoryOutboxNoItems"); + outbox_text = LLTrans::getString("InventoryOutboxNoItems", subs); outbox_title = LLTrans::getString("InventoryOutboxNoItemsTitle"); outbox_tooltip = LLTrans::getString("InventoryOutboxNoItemsTooltip"); } else { - // - // The string to become a merchant contains 3 URL's which need the domain name patched in. - // - - std::string domain = "secondlife.com"; - - if (!LLGridManager::getInstance()->isInProductionGrid()) - { - std::string gridLabel = LLGridManager::getInstance()->getGridLabel(); - domain = llformat("%s.lindenlab.com", utf8str_tolower(gridLabel).c_str()); - } - - LLStringUtil::format_map_t domain_arg; - domain_arg["[DOMAIN_NAME]"] = domain; - - std::string marketplace_url = LLTrans::getString("MarketplaceURL", domain_arg); - std::string marketplace_url_create = LLTrans::getString("MarketplaceURL_CreateStore", domain_arg); - std::string marketplace_url_info = LLTrans::getString("MarketplaceURL_LearnMore", domain_arg); - - LLStringUtil::format_map_t args1, args2, args3; - args1["[MARKETPLACE_URL]"] = marketplace_url; - args2["[LEARN_MORE_URL]"] = marketplace_url_info; - args3["[CREATE_STORE_URL]"] = marketplace_url_create; - - // NOTE: This is dumb, ridiculous and very finicky. The order of these is very important - // to have these three string substitutions work properly. - outbox_text = LLTrans::getString("InventoryOutboxNotMerchant", args1); - LLStringUtil::format(outbox_text, args2); - LLStringUtil::format(outbox_text, args3); - + outbox_text = LLTrans::getString("InventoryOutboxNotMerchant", subs); outbox_title = LLTrans::getString("InventoryOutboxNotMerchantTitle"); outbox_tooltip = LLTrans::getString("InventoryOutboxNotMerchantTooltip"); } @@ -306,7 +334,7 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, std::string& tooltip_msg) { // Pass drag and drop to this floater to the outbox inventory control - + if (LLMarketplaceInventoryImporter::getInstance()->isImportInProgress() || (mWindowShade && mWindowShade->isShown())) { @@ -329,37 +357,8 @@ void LLFloaterOutbox::onImportButtonClicked() void LLFloaterOutbox::onOutboxChanged() { llassert(!mOutboxId.isNull()); - - U32 item_count = 0; - - const LLFolderViewFolder * outbox_folder = mOutboxInventoryPanel->getRootFolder(); - - if (outbox_folder) - { - item_count += outbox_folder->getFoldersCount(); - item_count += outbox_folder->getItemsCount(); - } - - mOutboxItemCount = item_count; - - switch (mOutboxItemCount) - { - case 0: mInventoryFolderCountText->setText(getString("OutboxFolderCount0")); break; - case 1: mInventoryFolderCountText->setText(getString("OutboxFolderCount1")); break; - default: - { - std::string item_count_str = llformat("%d", mOutboxItemCount); - - LLStringUtil::format_map_t args; - args["[NUM]"] = item_count_str; - - mInventoryFolderCountText->setText(getString("OutboxFolderCountN", args)); - break; - } - } - - mImportButton->setEnabled(mOutboxItemCount > 0); + fetchOutboxContents(); updateView(); } @@ -384,6 +383,8 @@ void LLFloaterOutbox::importReportResults(U32 status, const LLSD& content) //llassert(status == MarketplaceErrorCodes::IMPORT_JOB_FAILED); LLNotificationsUtil::add("OutboxImportFailed", subs); } + + updateView(); } void LLFloaterOutbox::importStatusChanged(bool inProgress) -- cgit v1.2.3 From d3f06b296203c08c900c4e569ce5df0ac2f27715 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 12 Dec 2011 17:04:58 -0800 Subject: Fixed marketplace URL trailing '/' and updated to latest window shade code from viewer-experience --- indra/newview/llfloateroutbox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index b10ef0ba64..972e1e8cdc 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -418,14 +418,14 @@ void LLFloaterOutbox::showNotification(LLNotificationPtr notify) params.name = "notification_shade"; params.rect = floater_rect; params.follows.flags = FOLLOWS_ALL; - params.notification = notify; params.modal = true; params.can_close = false; + params.shade_color = LLColor4::white % 0.25f; params.text_color = LLColor4::white; mWindowShade = LLUICtrlFactory::create(params); addChild(mWindowShade); - mWindowShade->show(); + mWindowShade->show(notify); } -- cgit v1.2.3 From 181eaa8196d19d5d0c1db17fe27bd2bdee11525b Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 12 Dec 2011 17:22:47 -0800 Subject: EXP-1648 FIX * Merchant outbox no longer crashes for non-merchants. * Folder count is hidden for non-merchants. * Drag and drop to merchant outbox floater is disabled for non-merchants. --- indra/newview/llfloateroutbox.cpp | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 972e1e8cdc..b15380d427 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -269,22 +269,25 @@ void LLFloaterOutbox::updateItemCount() mOutboxItemCount = item_count; - switch (mOutboxItemCount) + if (mOutboxInventoryPanel) { - case 0: mInventoryFolderCountText->setText(getString("OutboxFolderCount0")); break; - case 1: mInventoryFolderCountText->setText(getString("OutboxFolderCount1")); break; - default: + switch (mOutboxItemCount) { - std::string item_count_str = llformat("%d", mOutboxItemCount); - - LLStringUtil::format_map_t args; - args["[NUM]"] = item_count_str; - - mInventoryFolderCountText->setText(getString("OutboxFolderCountN", args)); - break; + case 0: mInventoryFolderCountText->setText(getString("OutboxFolderCount0")); break; + case 1: mInventoryFolderCountText->setText(getString("OutboxFolderCount1")); break; + default: + { + std::string item_count_str = llformat("%d", mOutboxItemCount); + + LLStringUtil::format_map_t args; + args["[NUM]"] = item_count_str; + + mInventoryFolderCountText->setText(getString("OutboxFolderCountN", args)); + break; + } } } - + mImportButton->setEnabled(mOutboxItemCount > 0); } @@ -299,7 +302,11 @@ void LLFloaterOutbox::updateView() } else { - mOutboxInventoryPanel->setVisible(FALSE); + if (mOutboxInventoryPanel) + { + mOutboxInventoryPanel->setVisible(FALSE); + } + mInventoryPlaceholder->setVisible(TRUE); std::string outbox_text; @@ -335,8 +342,9 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, { // Pass drag and drop to this floater to the outbox inventory control - if (LLMarketplaceInventoryImporter::getInstance()->isImportInProgress() || - (mWindowShade && mWindowShade->isShown())) + if ((mOutboxInventoryPanel == NULL) || + (mWindowShade && mWindowShade->isShown()) || + LLMarketplaceInventoryImporter::getInstance()->isImportInProgress()) { return FALSE; } -- cgit v1.2.3 From d7fabfee19e536dd8df356fd4531437ccb3630d5 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 13 Dec 2011 13:56:41 -0800 Subject: EXP-1715 FIX -- Merchant outbox drag and drop has offset between mouse position and selected folder EXP-1717 FIX -- Drag and drop within the outbox can result in an item created at the top level of the outbox Folders are now created for items dragged around within the merchant outbox if their drop target is the top level outbox inventory panel itself. --- indra/newview/llfloateroutbox.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index b15380d427..eb11933368 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -248,7 +248,7 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId) mOutboxInventoryPanel->setShape(inventory_placeholder_rect); // Set the sort order newest to oldest - mOutboxInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); + mOutboxInventoryPanel->setSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME); mOutboxInventoryPanel->getFilter()->markDefault(); fetchOutboxContents(); @@ -340,19 +340,25 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EAcceptance* accept, std::string& tooltip_msg) { - // Pass drag and drop to this floater to the outbox inventory control - if ((mOutboxInventoryPanel == NULL) || (mWindowShade && mWindowShade->isShown()) || LLMarketplaceInventoryImporter::getInstance()->isImportInProgress()) { return FALSE; } - - S32 local_x = x - mOutboxInventoryPanel->getRect().mLeft; - S32 local_y = y - mOutboxInventoryPanel->getRect().mBottom; - - return mOutboxInventoryPanel->handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + + BOOL handled = (childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg) != NULL); + + // Pass drag and drop to this floater to the outbox inventory control if no other children handle it + if (!handled) + { + S32 local_x = x - mOutboxInventoryPanel->getRect().mLeft; + S32 local_y = y - mOutboxInventoryPanel->getRect().mBottom; + + handled = mOutboxInventoryPanel->handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + } + + return handled; } void LLFloaterOutbox::onImportButtonClicked() -- cgit v1.2.3 From bb39e3fa3cc2cd9617d63b93bcf1d6da364cd917 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 13 Dec 2011 16:42:14 -0800 Subject: EXP-1718 FIX -- Drag and drop within the outbox can result in folders being out of order * Outbox updates now result in a resort to keep drag and drop items and folders properly sorted * New icon for merchant outbox * New behavior to accept drag and drop files over the entire merchant outbox floater --- indra/newview/llfloateroutbox.cpp | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index eb11933368..984f47abb0 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -158,14 +158,6 @@ void LLFloaterOutbox::onClose(bool app_quitting) void LLFloaterOutbox::onOpen(const LLSD& key) { - // - // Initialize the marketplace import API - // - - LLMarketplaceInventoryImporter::getInstance()->initialize(); - LLMarketplaceInventoryImporter::getInstance()->setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1)); - LLMarketplaceInventoryImporter::getInstance()->setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2)); - // // Look for an outbox and set up the inventory API // @@ -224,6 +216,7 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId) { gInventory.removeObserver(mCategoryAddedObserver); delete mCategoryAddedObserver; + mCategoryAddedObserver = NULL; } // Create observer for outbox modifications @@ -252,6 +245,14 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId) mOutboxInventoryPanel->getFilter()->markDefault(); fetchOutboxContents(); + + // + // Initialize the marketplace import API + // + + LLMarketplaceInventoryImporter::getInstance()->initialize(); + LLMarketplaceInventoryImporter::getInstance()->setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1)); + LLMarketplaceInventoryImporter::getInstance()->setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2)); } void LLFloaterOutbox::updateItemCount() @@ -350,12 +351,20 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, BOOL handled = (childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg) != NULL); // Pass drag and drop to this floater to the outbox inventory control if no other children handle it - if (!handled) + if (!handled || (*accept == ACCEPT_NO)) { - S32 local_x = x - mOutboxInventoryPanel->getRect().mLeft; - S32 local_y = y - mOutboxInventoryPanel->getRect().mBottom; + S32 local_x; + S32 local_y; + + LLFolderView * outbox_root_folder = mOutboxInventoryPanel->getRootFolder(); + localPointToOtherView(x, y, &local_x, &local_y, outbox_root_folder); - handled = mOutboxInventoryPanel->handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + const LLRect& outbox_rect = outbox_root_folder->getRect(); + + local_x = llclamp(local_x, outbox_rect.mLeft + 1, outbox_rect.mRight - 1); + local_y = llclamp(local_y, outbox_rect.mBottom + 1, outbox_rect.mTop - 1); + + handled = outbox_root_folder->LLFolderViewFolder::handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); } return handled; @@ -371,6 +380,11 @@ void LLFloaterOutbox::onImportButtonClicked() void LLFloaterOutbox::onOutboxChanged() { llassert(!mOutboxId.isNull()); + + if (mOutboxInventoryPanel) + { + mOutboxInventoryPanel->requestSort(); + } fetchOutboxContents(); updateView(); -- cgit v1.2.3 From 399f8dd1913530488744046794a74d6c7e61ffa3 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 14 Dec 2011 14:37:38 -0800 Subject: EXP-1723 -- Improved drag and drop behavior for outbox floater. --- indra/newview/llfloateroutbox.cpp | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 984f47abb0..725e521e58 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -30,6 +30,7 @@ #include "llfloaterreg.h" #include "llfolderview.h" +#include "llinventorybridge.h" #include "llinventorymodelbackgroundfetch.h" #include "llinventoryobserver.h" #include "llinventorypanel.h" @@ -348,23 +349,34 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, return FALSE; } - BOOL handled = (childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg) != NULL); + LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + BOOL handled = (handled_view != NULL); - // Pass drag and drop to this floater to the outbox inventory control if no other children handle it + // Pass all drag and drop for this floater to the outbox inventory control if (!handled || (*accept == ACCEPT_NO)) { - S32 local_x; - S32 local_y; + // Always assume we are going to move the drag and drop operation to the outbox root folder + bool move_to_root = true; - LLFolderView * outbox_root_folder = mOutboxInventoryPanel->getRootFolder(); - localPointToOtherView(x, y, &local_x, &local_y, outbox_root_folder); - - const LLRect& outbox_rect = outbox_root_folder->getRect(); - - local_x = llclamp(local_x, outbox_rect.mLeft + 1, outbox_rect.mRight - 1); - local_y = llclamp(local_y, outbox_rect.mBottom + 1, outbox_rect.mTop - 1); + // If the inventory panel is visible, then only override it to the outbox root if we're outside the inventory panel + // (otherwise the inventory panel itself will handle the drag and drop operation, without any override) + if (mOutboxInventoryPanel->getVisible()) + { + S32 inv_x, inv_y; + localPointToOtherView(x, y, &inv_x, &inv_y, mOutboxInventoryPanel); + + const LLRect& inv_rect = mOutboxInventoryPanel->getRect(); - handled = outbox_root_folder->LLFolderViewFolder::handleDragAndDrop(local_x, local_y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + move_to_root = !inv_rect.pointInRect(inv_x, inv_y); + } + + // Handle the drag and drop directly to the root of the outbox + if (move_to_root) + { + LLFolderView * root_folder = mOutboxInventoryPanel->getRootFolder(); + + handled = root_folder->handleDragAndDropToRoot(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + } } return handled; -- cgit v1.2.3 From 6c26fdea4d62f723c3bdbec9ded032e6d77301b8 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 19 Dec 2011 16:46:26 -0800 Subject: EXP-1741 FIX -- Learn more link goes to page not found from Outbox for user that is not a merchant an Agni EXP-1746 FIX -- Update Outbox messaging EXP-1748 FIX -- Close down on messaging with Spinner MKT-3403 support -- viewer tooltips updated to match errors in marketplace * Copy has been updated to match the design per Leo and Brooke * Marketplace URL's have also been updated * The outbox floater now reports a status string in the existing folder count control --- indra/newview/llfloateroutbox.cpp | 43 +++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 11 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 725e521e58..239ba7ad4d 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -103,15 +103,16 @@ LLFloaterOutbox::LLFloaterOutbox(const LLSD& key) : LLFloater(key) , mCategoriesObserver(NULL) , mCategoryAddedObserver(NULL) - , mOutboxId(LLUUID::null) - , mOutboxInventoryPanel(NULL) - , mOutboxItemCount(0) + , mImportBusy(false) + , mImportButton(NULL) , mInventoryFolderCountText(NULL) , mInventoryImportInProgress(NULL) , mInventoryPlaceholder(NULL) , mInventoryText(NULL) , mInventoryTitle(NULL) - , mImportButton(NULL) + , mOutboxId(LLUUID::null) + , mOutboxInventoryPanel(NULL) + , mOutboxItemCount(0) , mWindowShade(NULL) { } @@ -251,12 +252,22 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId) // Initialize the marketplace import API // + mImportBusy = true; + setStatusString(getString("OutboxInitializing")); + LLMarketplaceInventoryImporter::getInstance()->initialize(); LLMarketplaceInventoryImporter::getInstance()->setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1)); LLMarketplaceInventoryImporter::getInstance()->setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2)); } -void LLFloaterOutbox::updateItemCount() +void LLFloaterOutbox::setStatusString(const std::string& statusString) +{ + llassert(mInventoryFolderCountText != NULL); + + mInventoryFolderCountText->setText(statusString); +} + +void LLFloaterOutbox::updateFolderCount() { S32 item_count = 0; @@ -275,8 +286,8 @@ void LLFloaterOutbox::updateItemCount() { switch (mOutboxItemCount) { - case 0: mInventoryFolderCountText->setText(getString("OutboxFolderCount0")); break; - case 1: mInventoryFolderCountText->setText(getString("OutboxFolderCount1")); break; + case 0: setStatusString(getString("OutboxFolderCount0")); break; + case 1: setStatusString(getString("OutboxFolderCount1")); break; default: { std::string item_count_str = llformat("%d", mOutboxItemCount); @@ -284,7 +295,7 @@ void LLFloaterOutbox::updateItemCount() LLStringUtil::format_map_t args; args["[NUM]"] = item_count_str; - mInventoryFolderCountText->setText(getString("OutboxFolderCountN", args)); + setStatusString(getString("OutboxFolderCountN", args)); break; } } @@ -295,7 +306,10 @@ void LLFloaterOutbox::updateItemCount() void LLFloaterOutbox::updateView() { - updateItemCount(); + if (!mImportBusy) + { + updateFolderCount(); + } if (mOutboxItemCount > 0) { @@ -431,15 +445,22 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress) { if (inProgress) { - mImportButton->setEnabled(false); + if (!mImportBusy) + { + setStatusString(getString("OutboxImporting")); + } + mImportBusy = true; + mImportButton->setEnabled(false); mInventoryImportInProgress->setVisible(true); } else { + mImportBusy = false; + mImportButton->setEnabled(mOutboxItemCount > 0); mInventoryImportInProgress->setVisible(false); - mImportButton->setEnabled(mOutboxItemCount > 0); + updateView(); } } -- cgit v1.2.3 From 744484699cec728f60463755d409fbde681429ea Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 19 Dec 2011 17:29:17 -0800 Subject: EXP-1749 FIX -- Merchant outbox import completion messages are to be modal dialogs * Merchant outbox completion messages now shown as modal dialogs rather than window shades. --- indra/newview/llfloateroutbox.cpp | 42 +++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 239ba7ad4d..b97cc54dd1 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -36,6 +36,7 @@ #include "llinventorypanel.h" #include "llmarketplacefunctions.h" #include "llnotificationhandler.h" +#include "llnotificationmanager.h" #include "llnotificationsutil.h" #include "lltextbox.h" #include "lltransientfloatermgr.h" @@ -43,6 +44,8 @@ #include "llviewernetwork.h" #include "llwindowshade.h" +#define USE_WINDOWSHADE_DIALOGS 0 + ///---------------------------------------------------------------------------- /// LLOutboxNotification class @@ -50,14 +53,9 @@ bool LLNotificationsUI::LLOutboxNotification::processNotification(const LLSD& notify) { - LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID()); - - if (notification) - { - LLFloaterOutbox* outbox_floater = LLFloaterReg::getTypedInstance("outbox"); - - outbox_floater->showNotification(notification); - } + LLFloaterOutbox* outbox_floater = LLFloaterReg::getTypedInstance("outbox"); + + outbox_floater->showNotification(notify); return false; } @@ -413,6 +411,7 @@ void LLFloaterOutbox::onOutboxChanged() } fetchOutboxContents(); + updateView(); } @@ -464,8 +463,19 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress) } } -void LLFloaterOutbox::showNotification(LLNotificationPtr notify) +void LLFloaterOutbox::showNotification(const LLSD& notify) { + LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID()); + + if (!notification) + { + llerrs << "Unable to find outbox notification!" << notify.asString() << llendl; + + return; + } + +#if USE_WINDOWSHADE_DIALOGS + if (mWindowShade) { delete mWindowShade; @@ -487,6 +497,18 @@ void LLFloaterOutbox::showNotification(LLNotificationPtr notify) mWindowShade = LLUICtrlFactory::create(params); addChild(mWindowShade); - mWindowShade->show(notify); + mWindowShade->show(notification); + +#else + + LLNotificationsUI::LLEventHandler * handler = + LLNotificationsUI::LLNotificationManager::instance().getHandlerForNotification("alertmodal"); + + LLNotificationsUI::LLSysHandler * sys_handler = dynamic_cast(handler); + llassert(sys_handler); + + sys_handler->processNotification(notify); + +#endif } -- cgit v1.2.3 From 912833bafa9a59734432787158e36b66ee9586aa Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 4 Jan 2012 14:04:32 -0800 Subject: EXP-1738 FIX -- Disable drag and drop to folders in the outbox that would create a hierarchy that contains too many folders * Updated drag and drop to correctly handle moving to and from outbox as opposed to within the outbox when dealing with folder and item count limitations related to depth and total folder count. --- indra/newview/llfloateroutbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index b97cc54dd1..8ccebb36dc 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -387,7 +387,7 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, { LLFolderView * root_folder = mOutboxInventoryPanel->getRootFolder(); - handled = root_folder->handleDragAndDropToRoot(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); } } -- cgit v1.2.3 From af32a74b77ffc2110de821e0159de8eb5aa0f454 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 5 Jan 2012 16:30:15 -0800 Subject: EXP-1757 FIX -- Merchant Outbox shows as empty when first opening/initializing even when populated * Updated merchant outbox floater to not wait for initialization to complete before displaying outbox inventory contents. --- indra/newview/llfloateroutbox.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 8ccebb36dc..6ecf715588 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -280,6 +280,14 @@ void LLFloaterOutbox::updateFolderCount() mOutboxItemCount = item_count; + if (!mImportBusy) + { + updateFolderCountStatus(); + } +} + +void LLFloaterOutbox::updateFolderCountStatus() +{ if (mOutboxInventoryPanel) { switch (mOutboxItemCount) @@ -304,10 +312,7 @@ void LLFloaterOutbox::updateFolderCount() void LLFloaterOutbox::updateView() { - if (!mImportBusy) - { - updateFolderCount(); - } + updateFolderCount(); if (mOutboxItemCount > 0) { -- cgit v1.2.3 From 00b767e5a91d9e3379119c867164f9be40f888cc Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 11 Jan 2012 10:05:15 -0800 Subject: EXP-1791 - Handle case where initialization with SLM fails in the Merchant Outbox floater in the viewer * Added code to clear and re-initialize the SLM cookie when authentication errors are encountered. * Re-organized logic for outbox import a bit to hopefully be more robust when errors are encountered. --- indra/newview/llfloateroutbox.cpp | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 6ecf715588..28589f5e9a 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -250,12 +250,12 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId) // Initialize the marketplace import API // - mImportBusy = true; - setStatusString(getString("OutboxInitializing")); - - LLMarketplaceInventoryImporter::getInstance()->initialize(); - LLMarketplaceInventoryImporter::getInstance()->setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1)); - LLMarketplaceInventoryImporter::getInstance()->setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2)); + LLMarketplaceInventoryImporter& importer = LLMarketplaceInventoryImporter::instance(); + + importer.setInitializationErrorCallback(boost::bind(&LLFloaterOutbox::initializationReportError, this, _1, _2)); + importer.setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1)); + importer.setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2)); + importer.initialize(); } void LLFloaterOutbox::setStatusString(const std::string& statusString) @@ -403,7 +403,7 @@ void LLFloaterOutbox::onImportButtonClicked() { mOutboxInventoryPanel->clearSelection(); - LLMarketplaceInventoryImporter::instance().triggerImport(); + mImportBusy = LLMarketplaceInventoryImporter::instance().triggerImport(); } void LLFloaterOutbox::onOutboxChanged() @@ -449,10 +449,14 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress) { if (inProgress) { - if (!mImportBusy) + if (mImportBusy) { setStatusString(getString("OutboxImporting")); } + else + { + setStatusString(getString("OutboxInitializing")); + } mImportBusy = true; mImportButton->setEnabled(false); @@ -463,9 +467,25 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress) mImportBusy = false; mImportButton->setEnabled(mOutboxItemCount > 0); mInventoryImportInProgress->setVisible(false); + } + + updateView(); +} - updateView(); +void LLFloaterOutbox::initializationReportError(U32 status, const LLSD& content) +{ + if (status != MarketplaceErrorCodes::IMPORT_DONE) + { + char status_string[16]; + sprintf(status_string, "%d", status); + + LLSD subs; + subs["[ERROR_CODE]"] = status_string; + + LLNotificationsUtil::add("OutboxInitFailed", subs); } + + updateView(); } void LLFloaterOutbox::showNotification(const LLSD& notify) -- cgit v1.2.3 From 0a1cb4f03ee1aeb0cfc9d9bdb837043d0f46f292 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 11 Jan 2012 11:26:56 -0800 Subject: EXP-1791 FIX -- Handle case where initialization with SLM fails in the Merchant Outbox floater in the viewer * Updated marketplace import to properly handle failed cases of authentications and invalid cookies. The import will reset to an uninitialized state and then trigger and initialization followed immediately by an import when appropriate. --- indra/newview/llfloateroutbox.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 28589f5e9a..130c26acdc 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -438,7 +438,6 @@ void LLFloaterOutbox::importReportResults(U32 status, const LLSD& content) LLSD subs; subs["[ERROR_CODE]"] = status_string; - //llassert(status == MarketplaceErrorCodes::IMPORT_JOB_FAILED); LLNotificationsUtil::add("OutboxImportFailed", subs); } -- cgit v1.2.3 From 59950f6178699b96e86bfd2c0bc701271b3f1a6b Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 11 Jan 2012 16:49:32 -0800 Subject: EXP-1778 FIX -- Link to Marketplace Error log in transfer failed viewer notification * Added a link to the "imports" log from the "done with errors" notification when sending folders to the marketplace. --- indra/newview/llfloateroutbox.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 130c26acdc..597602d5ab 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -332,7 +332,7 @@ void LLFloaterOutbox::updateView() std::string outbox_title; std::string outbox_tooltip; - LLStringUtil::format_map_t subs = getMarketplaceStringSubstitutions(); + const LLSD& subs = getMarketplaceStringSubstitutions(); if (mOutboxId.notNull()) { @@ -428,7 +428,9 @@ void LLFloaterOutbox::importReportResults(U32 status, const LLSD& content) } else if (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS) { - LLNotificationsUtil::add("OutboxImportHadErrors"); + const LLSD& subs = getMarketplaceStringSubstitutions(); + + LLNotificationsUtil::add("OutboxImportHadErrors", subs); } else { -- cgit v1.2.3 From d6add298d7c793eda1fee2c03b2ccf91df7f6102 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 13 Jan 2012 16:06:58 -0800 Subject: EXP-1802 FIX -- Create labeled drop target region at bottom of merchant outbox floater for easy top level drop access * Added generic drop zone that highlights green when its functionality will be used. --- indra/newview/llfloateroutbox.cpp | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 597602d5ab..297736f3bd 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -111,6 +111,7 @@ LLFloaterOutbox::LLFloaterOutbox(const LLSD& key) , mOutboxId(LLUUID::null) , mOutboxInventoryPanel(NULL) , mOutboxItemCount(0) + , mOutboxTopLevelDropZone(NULL) , mWindowShade(NULL) { } @@ -140,7 +141,9 @@ BOOL LLFloaterOutbox::postBuild() mImportButton = getChild("outbox_import_btn"); mImportButton->setCommitCallback(boost::bind(&LLFloaterOutbox::onImportButtonClicked, this)); - + + mOutboxTopLevelDropZone = getChild("outbox_generic_drag_target"); + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLFloaterOutbox::onFocusReceived, this)); return TRUE; @@ -353,6 +356,11 @@ void LLFloaterOutbox::updateView() } } +bool isAccepted(EAcceptance accept) +{ + return (accept >= ACCEPT_YES_COPY_SINGLE); +} + BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, @@ -370,7 +378,7 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, BOOL handled = (handled_view != NULL); // Pass all drag and drop for this floater to the outbox inventory control - if (!handled || (*accept == ACCEPT_NO)) + if (!handled || !isAccepted(*accept)) { // Always assume we are going to move the drag and drop operation to the outbox root folder bool move_to_root = true; @@ -394,11 +402,33 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); } + + if (mOutboxTopLevelDropZone) + { + mOutboxTopLevelDropZone->setBackgroundVisible(handled && !drop && isAccepted(*accept)); + } + } + else + { + if (mOutboxTopLevelDropZone) + { + mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); + } } return handled; } +void LLFloaterOutbox::onMouseLeave(S32 x, S32 y, MASK mask) +{ + if (mOutboxTopLevelDropZone) + { + mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); + } + + LLFloater::onMouseLeave(x, y, mask); +} + void LLFloaterOutbox::onImportButtonClicked() { mOutboxInventoryPanel->clearSelection(); -- cgit v1.2.3 From b18d54be9fb4998854e39df8fbaa271ceb2b8f89 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 18 Jan 2012 13:11:57 -0800 Subject: EXP-1816 FIX -- Drag area in outbox can remain highlighted after drag and drop ends * Added handleHover function to clear highlight --- indra/newview/llfloateroutbox.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 297736f3bd..08cd8082aa 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -419,6 +419,16 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, return handled; } +BOOL LLFloaterOutbox::handleHover(S32 x, S32 y, MASK mask) +{ + if (mOutboxTopLevelDropZone) + { + mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); + } + + return LLFloater::handleHover(x, y, mask); +} + void LLFloaterOutbox::onMouseLeave(S32 x, S32 y, MASK mask) { if (mOutboxTopLevelDropZone) -- cgit v1.2.3 From bb79bbf3209fbb962ca1b284076738eb5ba6019c Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 19 Jan 2012 13:53:48 -0800 Subject: EXP-1827 FIX -- Drag area in outbox does not always highlight green when indicating a top level drop * Updated the outbox drop area highlight to include top level drops within the outbox inventory panel itself. --- indra/newview/llfloateroutbox.cpp | 55 +++++++++++++++------------------------ 1 file changed, 21 insertions(+), 34 deletions(-) (limited to 'indra/newview/llfloateroutbox.cpp') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 08cd8082aa..540f977305 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -376,44 +376,37 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); BOOL handled = (handled_view != NULL); + + // Determine if the mouse is inside the inventory panel itself or just within the floater + bool pointInInventoryPanel = false; + bool pointInInventoryPanelChild = false; + LLFolderView * root_folder = mOutboxInventoryPanel->getRootFolder(); + if (mOutboxInventoryPanel->getVisible()) + { + S32 inv_x, inv_y; + localPointToOtherView(x, y, &inv_x, &inv_y, mOutboxInventoryPanel); + + pointInInventoryPanel = mOutboxInventoryPanel->getRect().pointInRect(inv_x, inv_y); + + LLView * inventory_panel_child_at_point = mOutboxInventoryPanel->childFromPoint(inv_x, inv_y, true); + pointInInventoryPanelChild = (inventory_panel_child_at_point != root_folder); + } // Pass all drag and drop for this floater to the outbox inventory control if (!handled || !isAccepted(*accept)) { - // Always assume we are going to move the drag and drop operation to the outbox root folder - bool move_to_root = true; - - // If the inventory panel is visible, then only override it to the outbox root if we're outside the inventory panel + // Handle the drag and drop directly to the root of the outbox if we're not in the inventory panel // (otherwise the inventory panel itself will handle the drag and drop operation, without any override) - if (mOutboxInventoryPanel->getVisible()) - { - S32 inv_x, inv_y; - localPointToOtherView(x, y, &inv_x, &inv_y, mOutboxInventoryPanel); - - const LLRect& inv_rect = mOutboxInventoryPanel->getRect(); - - move_to_root = !inv_rect.pointInRect(inv_x, inv_y); - } - - // Handle the drag and drop directly to the root of the outbox - if (move_to_root) + if (!pointInInventoryPanel) { - LLFolderView * root_folder = mOutboxInventoryPanel->getRootFolder(); - handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); } - if (mOutboxTopLevelDropZone) - { - mOutboxTopLevelDropZone->setBackgroundVisible(handled && !drop && isAccepted(*accept)); - } + mOutboxTopLevelDropZone->setBackgroundVisible(handled && !drop && isAccepted(*accept)); } else { - if (mOutboxTopLevelDropZone) - { - mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); - } + mOutboxTopLevelDropZone->setBackgroundVisible(!pointInInventoryPanelChild); } return handled; @@ -421,20 +414,14 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, BOOL LLFloaterOutbox::handleHover(S32 x, S32 y, MASK mask) { - if (mOutboxTopLevelDropZone) - { - mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); - } + mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); return LLFloater::handleHover(x, y, mask); } void LLFloaterOutbox::onMouseLeave(S32 x, S32 y, MASK mask) { - if (mOutboxTopLevelDropZone) - { - mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); - } + mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); LLFloater::onMouseLeave(x, y, mask); } -- cgit v1.2.3