summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermarketplacelistings.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-04-29 07:43:28 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-04-29 07:56:09 +0300
commit1b68f71348ecf3983b76b40d7940da8377f049b7 (patch)
tree2974eddaef130a067c26033d60a59fc790365b3d /indra/newview/llfloatermarketplacelistings.cpp
parentaf4ea94efc1999f3b19fd8d643d0331f0b77e265 (diff)
#824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed
Diffstat (limited to 'indra/newview/llfloatermarketplacelistings.cpp')
-rw-r--r--indra/newview/llfloatermarketplacelistings.cpp480
1 files changed, 240 insertions, 240 deletions
diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp
index 6216f4e39a..266648bc54 100644
--- a/indra/newview/llfloatermarketplacelistings.cpp
+++ b/indra/newview/llfloatermarketplacelistings.cpp
@@ -1,4 +1,4 @@
-/**
+/**
* @file llfloatermarketplacelistings.cpp
* @brief Implementation of the marketplace listings floater and panels
* @author merov@lindenlab.com
@@ -6,21 +6,21 @@
* $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$
*/
@@ -58,21 +58,21 @@ LLPanelMarketplaceListings::LLPanelMarketplaceListings()
, mSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME)
, mFilterListingFoldersOnly(false)
{
- mCommitCallbackRegistrar.add("Marketplace.ViewSort.Action", boost::bind(&LLPanelMarketplaceListings::onViewSortMenuItemClicked, this, _2));
- mEnableCallbackRegistrar.add("Marketplace.ViewSort.CheckItem", boost::bind(&LLPanelMarketplaceListings::onViewSortMenuItemCheck, this, _2));
+ mCommitCallbackRegistrar.add("Marketplace.ViewSort.Action", boost::bind(&LLPanelMarketplaceListings::onViewSortMenuItemClicked, this, _2));
+ mEnableCallbackRegistrar.add("Marketplace.ViewSort.CheckItem", boost::bind(&LLPanelMarketplaceListings::onViewSortMenuItemCheck, this, _2));
}
BOOL LLPanelMarketplaceListings::postBuild()
{
- childSetAction("add_btn", boost::bind(&LLPanelMarketplaceListings::onAddButtonClicked, this));
- childSetAction("audit_btn", boost::bind(&LLPanelMarketplaceListings::onAuditButtonClicked, this));
+ childSetAction("add_btn", boost::bind(&LLPanelMarketplaceListings::onAddButtonClicked, this));
+ childSetAction("audit_btn", boost::bind(&LLPanelMarketplaceListings::onAuditButtonClicked, this));
- mFilterEditor = getChild<LLFilterEditor>("filter_editor");
+ mFilterEditor = getChild<LLFilterEditor>("filter_editor");
mFilterEditor->setCommitCallback(boost::bind(&LLPanelMarketplaceListings::onFilterEdit, this, _2));
-
+
mAuditBtn = getChild<LLButton>("audit_btn");
mAuditBtn->setEnabled(FALSE);
-
+
return LLPanel::postBuild();
}
@@ -98,48 +98,48 @@ void LLPanelMarketplaceListings::buildAllPanels()
// Build the All panel first
LLInventoryPanel* panel_all_items;
panel_all_items = buildInventoryPanel("All Items", "panel_marketplace_listings_inventory.xml");
- panel_all_items->getFilter().setEmptyLookupMessage("MarketplaceNoMatchingItems");
- panel_all_items->getFilter().markDefault();
-
+ panel_all_items->getFilter().setEmptyLookupMessage("MarketplaceNoMatchingItems");
+ panel_all_items->getFilter().markDefault();
+
// Build the other panels
LLInventoryPanel* panel;
panel = buildInventoryPanel("Active Items", "panel_marketplace_listings_listed.xml");
- panel->getFilter().setFilterMarketplaceActiveFolders();
- panel->getFilter().setEmptyLookupMessage("MarketplaceNoMatchingItems");
- panel->getFilter().setDefaultEmptyLookupMessage("MarketplaceNoListing");
- panel->getFilter().markDefault();
+ panel->getFilter().setFilterMarketplaceActiveFolders();
+ panel->getFilter().setEmptyLookupMessage("MarketplaceNoMatchingItems");
+ panel->getFilter().setDefaultEmptyLookupMessage("MarketplaceNoListing");
+ panel->getFilter().markDefault();
panel = buildInventoryPanel("Inactive Items", "panel_marketplace_listings_unlisted.xml");
- panel->getFilter().setFilterMarketplaceInactiveFolders();
- panel->getFilter().setEmptyLookupMessage("MarketplaceNoMatchingItems");
- panel->getFilter().setDefaultEmptyLookupMessage("MarketplaceNoListing");
- panel->getFilter().markDefault();
+ panel->getFilter().setFilterMarketplaceInactiveFolders();
+ panel->getFilter().setEmptyLookupMessage("MarketplaceNoMatchingItems");
+ panel->getFilter().setDefaultEmptyLookupMessage("MarketplaceNoListing");
+ panel->getFilter().markDefault();
panel = buildInventoryPanel("Unassociated Items", "panel_marketplace_listings_unassociated.xml");
- panel->getFilter().setFilterMarketplaceUnassociatedFolders();
- panel->getFilter().setEmptyLookupMessage("MarketplaceNoMatchingItems");
- panel->getFilter().setDefaultEmptyLookupMessage("MarketplaceNoListing");
- panel->getFilter().markDefault();
+ panel->getFilter().setFilterMarketplaceUnassociatedFolders();
+ panel->getFilter().setEmptyLookupMessage("MarketplaceNoMatchingItems");
+ panel->getFilter().setDefaultEmptyLookupMessage("MarketplaceNoListing");
+ panel->getFilter().markDefault();
// Set the tab panel
- LLTabContainer* tabs_panel = getChild<LLTabContainer>("marketplace_filter_tabs");
- tabs_panel->setCommitCallback(boost::bind(&LLPanelMarketplaceListings::onTabChange, this));
+ LLTabContainer* tabs_panel = getChild<LLTabContainer>("marketplace_filter_tabs");
+ 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)
{
- LLTabContainer* tabs_panel = getChild<LLTabContainer>("marketplace_filter_tabs");
+ LLTabContainer* tabs_panel = getChild<LLTabContainer>("marketplace_filter_tabs");
LLInventoryPanel* panel = LLUICtrlFactory::createFromFile<LLInventoryPanel>(filename, tabs_panel, LLInventoryPanel::child_registry_t::instance());
- llassert(panel != NULL);
-
- // Set sort order and callbacks
- panel = getChild<LLInventoryPanel>(childname);
- panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME);
+ llassert(panel != NULL);
+
+ // Set sort order and callbacks
+ panel = getChild<LLInventoryPanel>(childname);
+ panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME);
panel->setSelectCallback(boost::bind(&LLPanelMarketplaceListings::onSelectionChange, this, panel, _1, _2));
-
+
return panel;
}
@@ -147,7 +147,7 @@ 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<LLTabContainer>("marketplace_filter_tabs");
LLInventoryPanel* panel = (LLInventoryPanel*)tabs_panel->getPanelByName("All Items");
@@ -162,15 +162,15 @@ void LLPanelMarketplaceListings::setSortOrder(U32 sort_order)
void LLPanelMarketplaceListings::onFilterEdit(const std::string& search_string)
{
- // Find active panel
- LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel();
- if (panel)
- {
+ // Find active panel
+ LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel();
+ if (panel)
+ {
// Save filter string (needed when switching tabs)
mFilterSubString = search_string;
// Set filter string on active panel
panel->setFilterSubString(mFilterSubString);
- }
+ }
}
void LLPanelMarketplaceListings::draw()
@@ -186,34 +186,34 @@ void LLPanelMarketplaceListings::draw()
LLInventoryModelBackgroundFetch* inst = LLInventoryModelBackgroundFetch::getInstance();
mAuditBtn->setEnabled(inst->isEverythingFetched() && !inst->folderFetchActive());
}
-
- LLPanel::draw();
+
+ LLPanel::draw();
}
void LLPanelMarketplaceListings::onSelectionChange(LLInventoryPanel *panel, const std::deque<LLFolderViewItem*>& items, BOOL user_action)
{
- panel->onSelectionChange(items, user_action);
+ panel->onSelectionChange(items, user_action);
}
bool LLPanelMarketplaceListings::allowDropOnRoot()
{
- LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel();
+ LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel();
return (panel ? panel->getAllowDropOnRoot() : false);
}
void LLPanelMarketplaceListings::onTabChange()
{
- // Find active panel
- LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel();
- if (panel)
- {
+ // Find active panel
+ LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel();
+ if (panel)
+ {
// If the panel doesn't allow drop on root, it doesn't allow the creation of new folder on root either
LLButton* add_btn = getChild<LLButton>("add_btn");
add_btn->setEnabled(panel->getAllowDropOnRoot());
-
+
// Set filter string on active panel
panel->setFilterSubString(mFilterSubString);
-
+
// Show/hide the drop zone and resize the inventory tabs panel accordingly
LLPanel* drop_zone = (LLPanel*)getChild<LLPanel>("marketplace_drop_zone");
bool drop_zone_visible = drop_zone->getVisible();
@@ -226,7 +226,7 @@ void LLPanelMarketplaceListings::onTabChange()
tabs->translate(0,-delta_height);
}
drop_zone->setVisible(panel->getAllowDropOnRoot());
- }
+ }
}
void LLPanelMarketplaceListings::onAddButtonClicked()
@@ -266,11 +266,11 @@ void LLPanelMarketplaceListings::onAuditButtonClicked()
void LLPanelMarketplaceListings::onViewSortMenuItemClicked(const LLSD& userdata)
{
- std::string chosen_item = userdata.asString();
-
+ std::string chosen_item = userdata.asString();
+
// Sort options
- if ((chosen_item == "sort_by_stock_amount") || (chosen_item == "sort_by_name") || (chosen_item == "sort_by_recent"))
- {
+ if ((chosen_item == "sort_by_stock_amount") || (chosen_item == "sort_by_name") || (chosen_item == "sort_by_recent"))
+ {
// We're making sort options exclusive, default is SO_FOLDERS_BY_NAME
if (chosen_item == "sort_by_stock_amount")
{
@@ -284,7 +284,7 @@ void LLPanelMarketplaceListings::onViewSortMenuItemClicked(const LLSD& userdata)
{
setSortOrder(LLInventoryFilter::SO_DATE);
}
- }
+ }
// Filter option
else if (chosen_item == "show_only_listing_folders")
{
@@ -304,8 +304,8 @@ void LLPanelMarketplaceListings::onViewSortMenuItemClicked(const LLSD& userdata)
bool LLPanelMarketplaceListings::onViewSortMenuItemCheck(const LLSD& userdata)
{
- std::string chosen_item = userdata.asString();
-
+ std::string chosen_item = userdata.asString();
+
if ((chosen_item == "sort_by_stock_amount") || (chosen_item == "sort_by_name") || (chosen_item == "sort_by_recent"))
{
if (chosen_item == "sort_by_stock_amount")
@@ -325,7 +325,7 @@ bool LLPanelMarketplaceListings::onViewSortMenuItemCheck(const LLSD& userdata)
{
return mFilterListingFoldersOnly;
}
- return false;
+ return false;
}
///----------------------------------------------------------------------------
@@ -335,29 +335,29 @@ bool LLPanelMarketplaceListings::onViewSortMenuItemCheck(const LLSD& userdata)
class LLMarketplaceListingsAddedObserver : public LLInventoryCategoryAddedObserver
{
public:
- LLMarketplaceListingsAddedObserver(LLFloaterMarketplaceListings * marketplace_listings_floater)
+ LLMarketplaceListingsAddedObserver(LLFloaterMarketplaceListings * marketplace_listings_floater)
: LLInventoryCategoryAddedObserver()
, mMarketplaceListingsFloater(marketplace_listings_floater)
- {
- }
-
- 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_MARKETPLACE_LISTINGS)
- {
- mMarketplaceListingsFloater->initializeMarketPlace();
- }
- }
- }
-
+ {
+ }
+
+ 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_MARKETPLACE_LISTINGS)
+ {
+ mMarketplaceListingsFloater->initializeMarketPlace();
+ }
+ }
+ }
+
private:
- LLFloaterMarketplaceListings * mMarketplaceListingsFloater;
+ LLFloaterMarketplaceListings * mMarketplaceListingsFloater;
};
///----------------------------------------------------------------------------
@@ -382,35 +382,35 @@ LLFloaterMarketplaceListings::LLFloaterMarketplaceListings(const LLSD& key)
LLFloaterMarketplaceListings::~LLFloaterMarketplaceListings()
{
- if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver))
- {
- gInventory.removeObserver(mCategoriesObserver);
- }
- delete mCategoriesObserver;
-
- if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver))
- {
- gInventory.removeObserver(mCategoryAddedObserver);
- }
- delete mCategoryAddedObserver;
+ if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver))
+ {
+ gInventory.removeObserver(mCategoriesObserver);
+ }
+ delete mCategoriesObserver;
+
+ if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver))
+ {
+ gInventory.removeObserver(mCategoryAddedObserver);
+ }
+ delete mCategoryAddedObserver;
}
BOOL LLFloaterMarketplaceListings::postBuild()
{
- mInventoryStatus = getChild<LLTextBox>("marketplace_status");
- mInventoryInitializationInProgress = getChild<LLView>("initialization_progress_indicator");
- mInventoryPlaceholder = getChild<LLView>("marketplace_listings_inventory_placeholder_panel");
- mInventoryText = mInventoryPlaceholder->getChild<LLTextBox>("marketplace_listings_inventory_placeholder_text");
- mInventoryTitle = mInventoryPlaceholder->getChild<LLTextBox>("marketplace_listings_inventory_placeholder_title");
+ mInventoryStatus = getChild<LLTextBox>("marketplace_status");
+ mInventoryInitializationInProgress = getChild<LLView>("initialization_progress_indicator");
+ mInventoryPlaceholder = getChild<LLView>("marketplace_listings_inventory_placeholder_panel");
+ mInventoryText = mInventoryPlaceholder->getChild<LLTextBox>("marketplace_listings_inventory_placeholder_text");
+ mInventoryTitle = mInventoryPlaceholder->getChild<LLTextBox>("marketplace_listings_inventory_placeholder_title");
- mPanelListings = static_cast<LLPanelMarketplaceListings*>(getChild<LLUICtrl>("panel_marketplace_listing"));
+ mPanelListings = static_cast<LLPanelMarketplaceListings*>(getChild<LLUICtrl>("panel_marketplace_listing"));
+
+ LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLFloaterMarketplaceListings::onFocusReceived, this));
+
+ // Observe category creation to catch marketplace listings creation (moot if already existing)
+ mCategoryAddedObserver = new LLMarketplaceListingsAddedObserver(this);
+ gInventory.addObserver(mCategoryAddedObserver);
- LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLFloaterMarketplaceListings::onFocusReceived, this));
-
- // Observe category creation to catch marketplace listings creation (moot if already existing)
- mCategoryAddedObserver = new LLMarketplaceListingsAddedObserver(this);
- gInventory.addObserver(mCategoryAddedObserver);
-
// Fetch aggressively so we can interact with listings as soon as possible
if (!fetchContents())
@@ -418,9 +418,9 @@ BOOL LLFloaterMarketplaceListings::postBuild()
const LLUUID& marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS);
LLInventoryModelBackgroundFetch::instance().start(marketplacelistings_id, true);
}
-
- return TRUE;
+
+ return TRUE;
}
void LLFloaterMarketplaceListings::onClose(bool app_quitting)
@@ -429,22 +429,22 @@ void LLFloaterMarketplaceListings::onClose(bool app_quitting)
void LLFloaterMarketplaceListings::onOpen(const LLSD& key)
{
- //
- // Initialize the Market Place or go update the marketplace listings
- //
+ //
+ // Initialize the Market Place or go update the marketplace listings
+ //
if (LLMarketplaceData::instance().getSLMStatus() <= MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE)
- {
- initializeMarketPlace();
- }
+ {
+ initializeMarketPlace();
+ }
else
{
updateView();
- }
+ }
}
void LLFloaterMarketplaceListings::onFocusReceived()
{
- updateView();
+ updateView();
}
bool LLFloaterMarketplaceListings::fetchContents()
@@ -466,18 +466,18 @@ void LLFloaterMarketplaceListings::setRootFolder()
{
if ((LLMarketplaceData::instance().getSLMStatus() != MarketplaceStatusCodes::MARKET_PLACE_MERCHANT) &&
(LLMarketplaceData::instance().getSLMStatus() != MarketplaceStatusCodes::MARKET_PLACE_MIGRATED_MERCHANT))
- {
- // If we are *not* a merchant or we have no market place connection established yet, do nothing
- return;
- }
+ {
+ // If we are *not* a merchant or we have no market place connection established yet, do nothing
+ return;
+ }
if (!gInventory.isInventoryUsable())
{
return;
}
-
+
LLFolderType::EType preferred_type = LLFolderType::FT_MARKETPLACE_LISTINGS;
- // We are a merchant. Get the Marketplace listings folder, create it if needs be.
- LLUUID marketplacelistings_id = gInventory.findCategoryUUIDForType(preferred_type);
+ // We are a merchant. Get the Marketplace listings folder, create it if needs be.
+ LLUUID marketplacelistings_id = gInventory.findCategoryUUIDForType(preferred_type);
if (marketplacelistings_id.isNull())
{
@@ -514,22 +514,22 @@ void LLFloaterMarketplaceListings::setRootFolder()
}
mRootFolderCreating = false;
-
- // No longer need to observe new category creation
- if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver))
- {
- gInventory.removeObserver(mCategoryAddedObserver);
- delete mCategoryAddedObserver;
- mCategoryAddedObserver = NULL;
- }
- llassert(!mCategoryAddedObserver);
-
+
+ // No longer need to observe new category creation
+ if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver))
+ {
+ gInventory.removeObserver(mCategoryAddedObserver);
+ delete mCategoryAddedObserver;
+ mCategoryAddedObserver = NULL;
+ }
+ llassert(!mCategoryAddedObserver);
+
if (marketplacelistings_id == mRootFolderId)
{
LL_WARNS("SLM") << "Inventory warning: Marketplace listings folder already set" << LL_ENDL;
return;
}
-
+
mRootFolderId = marketplacelistings_id;
}
@@ -539,16 +539,16 @@ void LLFloaterMarketplaceListings::setPanels()
{
return;
}
-
+
// Consolidate Marketplace listings
// We shouldn't have to do that but with a client/server system relying on a "well known folder" convention,
// things get messy and conventions get broken down eventually
gInventory.consolidateForType(mRootFolderId, LLFolderType::FT_MARKETPLACE_LISTINGS);
-
+
// Now that we do have a non NULL root, we can build the inventory panels
mPanelListings->buildAllPanels();
-
- // Create observer for marketplace listings modifications
+
+ // Create observer for marketplace listings modifications
if (!mCategoriesObserver)
{
mCategoriesObserver = new LLInventoryCategoriesObserver();
@@ -556,10 +556,10 @@ void LLFloaterMarketplaceListings::setPanels()
gInventory.addObserver(mCategoriesObserver);
mCategoriesObserver->addCategory(mRootFolderId, boost::bind(&LLFloaterMarketplaceListings::onChanged, this));
}
-
- // Get the content of the marketplace listings folder
- fetchContents();
-
+
+ // Get the content of the marketplace listings folder
+ fetchContents();
+
// Flag that this is done
mPanelListingsSet = true;
}
@@ -571,12 +571,12 @@ void LLFloaterMarketplaceListings::initializeMarketPlace()
S32 LLFloaterMarketplaceListings::getFolderCount()
{
- if (mPanelListings && mRootFolderId.notNull())
- {
+ if (mPanelListings && mRootFolderId.notNull())
+ {
LLInventoryModel::cat_array_t * cats;
LLInventoryModel::item_array_t * items;
gInventory.getDirectDescendentsOf(mRootFolderId, cats, items);
-
+
return (cats->size() + items->size());
}
else
@@ -587,7 +587,7 @@ S32 LLFloaterMarketplaceListings::getFolderCount()
void LLFloaterMarketplaceListings::setStatusString(const std::string& statusString)
{
- mInventoryStatus->setText(statusString);
+ mInventoryStatus->setText(statusString);
}
void LLFloaterMarketplaceListings::updateView()
@@ -595,7 +595,7 @@ void LLFloaterMarketplaceListings::updateView()
U32 mkt_status = LLMarketplaceData::instance().getSLMStatus();
bool is_merchant = (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_MERCHANT) || (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_MIGRATED_MERCHANT);
U32 data_fetched = LLMarketplaceData::instance().getSLMDataFetched();
-
+
// Get or create the root folder if we are a merchant and it hasn't been done already
if (mRootFolderId.isNull() && is_merchant)
{
@@ -620,27 +620,27 @@ void LLFloaterMarketplaceListings::updateView()
{
mInventoryInitializationInProgress->setVisible(false);
}
-
+
// Update the middle portion : tabs or messages
- if (getFolderCount() > 0)
- {
+ if (getFolderCount() > 0)
+ {
if (!mPanelListingsSet)
{
// We need to rebuild the tabs cleanly the first time we make them visible
setPanels();
}
- mPanelListings->setVisible(TRUE);
- mInventoryPlaceholder->setVisible(FALSE);
- }
- else
- {
+ mPanelListings->setVisible(TRUE);
+ mInventoryPlaceholder->setVisible(FALSE);
+ }
+ else
+ {
mPanelListings->setVisible(FALSE);
- mInventoryPlaceholder->setVisible(TRUE);
-
+ mInventoryPlaceholder->setVisible(TRUE);
+
std::string text;
std::string title;
std::string tooltip;
-
+
const LLSD& subs = LLMarketplaceData::getMarketplaceStringSubstitutions();
// Update the top message or flip to the tabs and folders view
@@ -692,7 +692,7 @@ void LLFloaterMarketplaceListings::updateView()
tooltip = LLTrans::getString("InventoryOutboxErrorTooltip");
LL_WARNS() << "Marketplace status code: " << mkt_status << LL_ENDL;
}
-
+
mInventoryText->setValue(text);
mInventoryTitle->setValue(title);
mInventoryPlaceholder->getParent()->setToolTip(tooltip);
@@ -705,24 +705,24 @@ bool LLFloaterMarketplaceListings::isAccepted(EAcceptance accept)
}
BOOL LLFloaterMarketplaceListings::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
- EDragAndDropType cargo_type,
- void* cargo_data,
- EAcceptance* accept,
- std::string& tooltip_msg)
+ 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;
- }
-
+ if (!mPanelListings || mRootFolderId.isNull())
+ {
+ return FALSE;
+ }
+
tooltip_msg = "";
-
+
// Pass to the children
- LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
- BOOL handled = (handled_view != NULL);
-
- // If no one handled it or it was not accepted and we drop on an empty panel, we try to accept it at the floater level
+ LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+ BOOL handled = (handled_view != NULL);
+
+ // If no one handled it or it was not accepted and we drop on an empty panel, we try to accept it at the floater level
// as if it was dropped on the marketplace listings root folder
if ((!handled || !isAccepted(*accept)) && !mPanelListings->getVisible() && mRootFolderId.notNull())
{
@@ -733,24 +733,24 @@ BOOL LLFloaterMarketplaceListings::handleDragAndDrop(S32 x, S32 y, MASK mask, BO
LLFolderView* root_folder = mPanelListings->getRootFolder();
handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
}
-
- return handled;
+
+ return handled;
}
BOOL LLFloaterMarketplaceListings::handleHover(S32 x, S32 y, MASK mask)
{
- return LLFloater::handleHover(x, y, mask);
+ return LLFloater::handleHover(x, y, mask);
}
void LLFloaterMarketplaceListings::onMouseLeave(S32 x, S32 y, MASK mask)
{
- LLFloater::onMouseLeave(x, y, mask);
+ LLFloater::onMouseLeave(x, y, mask);
}
void LLFloaterMarketplaceListings::onChanged()
{
LLViewerInventoryCategory* category = gInventory.getCategory(mRootFolderId);
- if (mRootFolderId.notNull() && category)
+ if (mRootFolderId.notNull() && category)
{
updateView();
}
@@ -768,9 +768,9 @@ void LLFloaterMarketplaceListings::onChanged()
// Tell if a listing has one only version folder
bool hasUniqueVersionFolder(const LLUUID& folder_id)
{
- LLInventoryModel::cat_array_t* categories;
- LLInventoryModel::item_array_t* items;
- gInventory.getDirectDescendentsOf(folder_id, categories, items);
+ LLInventoryModel::cat_array_t* categories;
+ LLInventoryModel::item_array_t* items;
+ gInventory.getDirectDescendentsOf(folder_id, categories, items);
return (categories->size() == 1);
}
@@ -782,43 +782,43 @@ LLFloaterAssociateListing::LLFloaterAssociateListing(const LLSD& key)
LLFloaterAssociateListing::~LLFloaterAssociateListing()
{
- gFocusMgr.releaseFocusIfNeeded( this );
+ gFocusMgr.releaseFocusIfNeeded( this );
}
BOOL LLFloaterAssociateListing::postBuild()
{
- getChild<LLButton>("OK")->setCommitCallback(boost::bind(&LLFloaterAssociateListing::apply, this, TRUE));
- getChild<LLButton>("Cancel")->setCommitCallback(boost::bind(&LLFloaterAssociateListing::cancel, this));
- getChild<LLLineEditor>("listing_id")->setPrevalidate(&LLTextValidate::validateNonNegativeS32);
- center();
-
- return LLFloater::postBuild();
+ getChild<LLButton>("OK")->setCommitCallback(boost::bind(&LLFloaterAssociateListing::apply, this, TRUE));
+ getChild<LLButton>("Cancel")->setCommitCallback(boost::bind(&LLFloaterAssociateListing::cancel, this));
+ getChild<LLLineEditor>("listing_id")->setPrevalidate(&LLTextValidate::validateNonNegativeS32);
+ center();
+
+ return LLFloater::postBuild();
}
BOOL LLFloaterAssociateListing::handleKeyHere(KEY key, MASK mask)
{
- if (key == KEY_RETURN && mask == MASK_NONE)
- {
- apply();
- return TRUE;
- }
- else if (key == KEY_ESCAPE && mask == MASK_NONE)
- {
- cancel();
- return TRUE;
- }
-
- return LLFloater::handleKeyHere(key, mask);
+ if (key == KEY_RETURN && mask == MASK_NONE)
+ {
+ apply();
+ return TRUE;
+ }
+ else if (key == KEY_ESCAPE && mask == MASK_NONE)
+ {
+ cancel();
+ return TRUE;
+ }
+
+ return LLFloater::handleKeyHere(key, mask);
}
// static
LLFloaterAssociateListing* LLFloaterAssociateListing::show(const LLUUID& folder_id)
{
- LLFloaterAssociateListing* floater = LLFloaterReg::showTypedInstance<LLFloaterAssociateListing>("associate_listing");
-
- floater->mUUID = folder_id;
-
- return floater;
+ LLFloaterAssociateListing* floater = LLFloaterReg::showTypedInstance<LLFloaterAssociateListing>("associate_listing");
+
+ floater->mUUID = folder_id;
+
+ return floater;
}
// Callback for apply if DAMA required...
@@ -833,8 +833,8 @@ void LLFloaterAssociateListing::callback_apply(const LLSD& notification, const L
void LLFloaterAssociateListing::apply(BOOL user_confirm)
{
- if (mUUID.notNull())
- {
+ if (mUUID.notNull())
+ {
S32 id = (S32)getChild<LLUICtrl>("listing_id")->getValue().asInteger();
if (id > 0)
{
@@ -854,13 +854,13 @@ void LLFloaterAssociateListing::apply(BOOL user_confirm)
{
LLNotificationsUtil::add("AlertMerchantListingInvalidID");
}
- }
- closeFloater();
+ }
+ closeFloater();
}
void LLFloaterAssociateListing::cancel()
{
- closeFloater();
+ closeFloater();
}
//-----------------------------------------------------------------------------
@@ -871,22 +871,22 @@ void LLFloaterAssociateListing::cancel()
// Validates the whole marketplace listings content if UUID is null.
LLFloaterMarketplaceValidation::LLFloaterMarketplaceValidation(const LLSD& key)
-: LLFloater(key),
+: LLFloater(key),
mEditor(NULL)
{
}
BOOL LLFloaterMarketplaceValidation::postBuild()
{
- childSetAction("OK", onOK, this);
-
+ childSetAction("OK", onOK, this);
+
// This widget displays the validation messages
mEditor = getChild<LLTextEditor>("validation_text");
mEditor->setEnabled(FALSE);
mEditor->setFocus(TRUE);
mEditor->setValue(LLSD());
-
- return TRUE;
+
+ return TRUE;
}
LLFloaterMarketplaceValidation::~LLFloaterMarketplaceValidation()
@@ -896,15 +896,15 @@ LLFloaterMarketplaceValidation::~LLFloaterMarketplaceValidation()
// virtual
void LLFloaterMarketplaceValidation::draw()
{
- // draw children
- LLFloater::draw();
+ // draw children
+ LLFloater::draw();
}
void LLFloaterMarketplaceValidation::onOpen(const LLSD& key)
{
// Clear the messages
clearMessages();
-
+
// Get the folder UUID to validate. Use the whole marketplace listing if none provided.
LLUUID cat_id(key.asUUID());
if (cat_id.isNull())
@@ -921,10 +921,10 @@ void LLFloaterMarketplaceValidation::onOpen(const LLSD& key)
boost::bind(&LLFloaterMarketplaceValidation::appendMessage, this, _1, _2, _3),
false);
}
-
+
// Handle the listing folder being processed
handleCurrentListing();
-
+
// Dump result to the editor panel
if (mEditor)
{
@@ -960,10 +960,10 @@ void LLFloaterMarketplaceValidation::onOpen(const LLSD& key)
// static
void LLFloaterMarketplaceValidation::onOK( void* userdata )
{
- // destroys this object
- LLFloaterMarketplaceValidation* self = (LLFloaterMarketplaceValidation*) userdata;
+ // destroys this object
+ LLFloaterMarketplaceValidation* self = (LLFloaterMarketplaceValidation*) userdata;
self->clearMessages();
- self->closeFloater();
+ self->closeFloater();
}
void LLFloaterMarketplaceValidation::appendMessage(std::string& message, S32 depth, LLError::ELevel log_level)
@@ -973,7 +973,7 @@ void LLFloaterMarketplaceValidation::appendMessage(std::string& message, S32 dep
{
handleCurrentListing();
}
-
+
// Store the message in the current listing message list
Message current_message;
current_message.mErrorLevel = log_level;
@@ -995,7 +995,7 @@ void LLFloaterMarketplaceValidation::handleCurrentListing()
mCurrentLine++;
}
}
-
+
// Reset the current listing
mCurrentListingMessages.clear();
mCurrentListingErrorLevel = LLError::LEVEL_INFO;
@@ -1013,7 +1013,7 @@ void LLFloaterMarketplaceValidation::clearMessages()
//-----------------------------------------------------------------------------
LLFloaterItemProperties::LLFloaterItemProperties(const LLSD& key)
-: LLFloater(key)
+: LLFloater(key)
{
}
@@ -1023,14 +1023,14 @@ LLFloaterItemProperties::~LLFloaterItemProperties()
BOOL LLFloaterItemProperties::postBuild()
{
- return LLFloater::postBuild();
+ return LLFloater::postBuild();
}
void LLFloaterItemProperties::onOpen(const LLSD& key)
{
// Tell the panel which item it needs to visualize
LLPanel* panel = findChild<LLPanel>("sidepanel");
-
+
LLSidepanelItemInfo* item_panel = dynamic_cast<LLSidepanelItemInfo*>(panel);
if (item_panel)
{
@@ -1041,7 +1041,7 @@ void LLFloaterItemProperties::onOpen(const LLSD& key)
}
item_panel->setParentFloater(this);
}
-
+
LLSidepanelTaskInfo* task_panel = dynamic_cast<LLSidepanelTaskInfo*>(panel);
if (task_panel)
{
@@ -1050,17 +1050,17 @@ void LLFloaterItemProperties::onOpen(const LLSD& key)
}
LLMultiItemProperties::LLMultiItemProperties(const LLSD& key)
- : LLMultiFloater(LLSD())
+ : LLMultiFloater(LLSD())
{
- // start with a small rect in the top-left corner ; will get resized
- LLRect rect;
- rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeightScaled(), 350, 350);
- setRect(rect);
- LLFloater* last_floater = LLFloaterReg::getLastFloaterInGroup(key.asString());
- if (last_floater)
- {
- stackWith(*last_floater);
- }
- setTitle(LLTrans::getString("MultiPropertiesTitle"));
- buildTabContainer();
+ // start with a small rect in the top-left corner ; will get resized
+ LLRect rect;
+ rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeightScaled(), 350, 350);
+ setRect(rect);
+ LLFloater* last_floater = LLFloaterReg::getLastFloaterInGroup(key.asString());
+ if (last_floater)
+ {
+ stackWith(*last_floater);
+ }
+ setTitle(LLTrans::getString("MultiPropertiesTitle"));
+ buildTabContainer();
}