From c36b7fa963511023866b6518f245d2c6edd1add0 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 3 Apr 2014 18:14:59 -0700 Subject: DD-20 : Make drop in the panel when empty work again --- indra/newview/llfloatermarketplacelistings.cpp | 22 +++++++++++++--------- .../xui/en/floater_marketplace_listings.xml | 3 ++- .../default/xui/en/panel_marketplace_listings.xml | 8 ++++---- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index e8257e52c4..42e49f5d7d 100755 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -446,31 +446,35 @@ void LLFloaterMarketplaceListings::updateView() bool LLFloaterMarketplaceListings::isAccepted(EAcceptance accept) { - // *TODO : Need a bit more test on what we accept: depends of what and where... - return (accept >= ACCEPT_YES_COPY_SINGLE); + return (accept >= ACCEPT_YES_COPY_SINGLE); } - BOOL LLFloaterMarketplaceListings::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg) { + // If there's no panel to accept drops or no existing marketplace listings folder, we refuse all drop if (!mPanelListings || mRootFolderId.isNull()) { return FALSE; } + // Pass to the children LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); BOOL handled = (handled_view != NULL); - // Pass all drag and drop for this floater to the marketplace listings inventory control - if (!handled && isAccepted(*accept) && !mPanelListings->getVisible() && mRootFolderId.notNull()) - { - LLFolderView* root_folder = mPanelListings->getRootFolder(); - handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); - } + // If no one handled it or it was not accepted, we try to accept it at the floater level as if it was dropped on the + // marketplace listings root folder + if (!handled || !isAccepted(*accept)) + { + if (!mPanelListings->getVisible() && mRootFolderId.notNull()) + { + LLFolderView* root_folder = mPanelListings->getRootFolder(); + handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + } + } return handled; } diff --git a/indra/newview/skins/default/xui/en/floater_marketplace_listings.xml b/indra/newview/skins/default/xui/en/floater_marketplace_listings.xml index 0f511c4a66..f5630aeecb 100755 --- a/indra/newview/skins/default/xui/en/floater_marketplace_listings.xml +++ b/indra/newview/skins/default/xui/en/floater_marketplace_listings.xml @@ -15,11 +15,11 @@ reuse_instance="true"> Initializing...