summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-07-30 15:15:42 -0700
committerRichard Linden <none@none>2012-07-30 15:15:42 -0700
commit4285cc271eacaca31a1d5d76c8e88debf00235c2 (patch)
tree3d9f338dcdd999fd4e7e2737e4cdec588af2dbcd
parent209fd15176647a4b8defbb6e66daea6eb12d4b42 (diff)
CHUI-217 FIX Items are not visible in Merchant Outbox
cleaned up a lot custom code for folder view item creation in inbox and outbox proper initialization of views from inventory panel starting folder
-rw-r--r--indra/llui/llfolderviewitem.cpp13
-rw-r--r--indra/llui/llfolderviewitem.h10
-rw-r--r--indra/llui/lluictrlfactory.cpp5
-rw-r--r--indra/llui/lluictrlfactory.h5
-rw-r--r--indra/newview/CMakeLists.txt2
-rw-r--r--indra/newview/llagentwearablesfetch.cpp2
-rw-r--r--indra/newview/llappearancemgr.cpp2
-rw-r--r--indra/newview/llfloateroutbox.cpp3
-rw-r--r--indra/newview/llinventorybridge.cpp16
-rw-r--r--indra/newview/llinventorybridge.h12
-rw-r--r--indra/newview/llinventorymodel.cpp46
-rw-r--r--indra/newview/llinventorymodel.h9
-rw-r--r--indra/newview/llinventorypanel.cpp198
-rw-r--r--indra/newview/llinventorypanel.h59
-rw-r--r--indra/newview/llpanellandmarks.cpp12
-rw-r--r--indra/newview/llpanelmarketplaceinboxinventory.cpp70
-rw-r--r--indra/newview/llpanelmarketplaceinboxinventory.h13
-rw-r--r--indra/newview/llpanelmarketplaceoutboxinventory.cpp141
-rw-r--r--indra/newview/llpanelmarketplaceoutboxinventory.h78
-rw-r--r--indra/newview/llplacesinventorybridge.cpp4
-rw-r--r--indra/newview/llplacesinventorybridge.h2
-rw-r--r--indra/newview/llplacesinventorypanel.cpp5
-rw-r--r--indra/newview/llplacesinventorypanel.h6
-rw-r--r--indra/newview/llsidepanelinventory.cpp3
-rw-r--r--indra/newview/lltooldraganddrop.cpp2
-rw-r--r--indra/newview/pipeline.cpp2
-rw-r--r--indra/newview/skins/default/xui/en/panel_inbox_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_landmarks.xml8
-rw-r--r--indra/newview/skins/default/xui/en/panel_outbox_inventory.xml18
-rw-r--r--indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml3
-rw-r--r--indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml9
-rw-r--r--indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml2
32 files changed, 282 insertions, 480 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index b9b6ea7444..1d8dfbbafa 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -89,7 +89,8 @@ LLFolderViewItem::Params::Params()
selection_image("selection_image"),
item_height("item_height"),
item_top_pad("item_top_pad"),
- creation_date()
+ creation_date(),
+ allow_open("allow_open", true)
{}
// Default constructor
@@ -112,7 +113,8 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
mLabel(p.name),
mRoot(p.root),
mViewModelItem(p.listener),
- mIsMouseOverTitle(false)
+ mIsMouseOverTitle(false),
+ mAllowOpen(p.allow_open)
{
if (mViewModelItem)
{
@@ -404,7 +406,10 @@ void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags)
void LLFolderViewItem::openItem( void )
{
- getViewModelItem()->openItem();
+ if (mAllowOpen)
+ {
+ getViewModelItem()->openItem();
+ }
}
void LLFolderViewItem::rename(const std::string& new_name)
@@ -517,7 +522,7 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask )
BOOL LLFolderViewItem::handleDoubleClick( S32 x, S32 y, MASK mask )
{
- getViewModelItem()->openItem();
+ openItem();
return TRUE;
}
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index 50d3e0580e..df007dd15d 100644
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -61,6 +61,7 @@ public:
item_top_pad;
Optional<time_t> creation_date;
+ Optional<bool> allow_open;
Params();
};
@@ -92,14 +93,11 @@ protected:
bool mLabelWidthDirty;
LLFolderViewFolder* mParentFolder;
LLFolderViewModelItem* mViewModelItem;
- BOOL mIsCurSelection;
- BOOL mSelectPending;
LLFontGL::StyleFlags mLabelStyle;
std::string mLabelSuffix;
LLUIImagePtr mIcon;
LLUIImagePtr mIconOpen;
LLUIImagePtr mIconOverlay;
- BOOL mHasVisibleChildren;
S32 mIndentation;
S32 mItemHeight;
S32 mDragStartX,
@@ -109,8 +107,12 @@ protected:
//std::string::size_type mStringMatchOffset;
F32 mControlLabelRotation;
LLFolderView* mRoot;
- BOOL mDragAndDropTarget;
+ bool mHasVisibleChildren;
+ bool mIsCurSelection;
+ bool mDragAndDropTarget;
bool mIsMouseOverTitle;
+ bool mAllowOpen;
+ bool mSelectPending;
// this is an internal method used for adding items to folders. A
// no-op at this level, but reimplemented in derived classes.
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index f64f33bc5e..91a6b3259c 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -304,9 +304,4 @@ void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const st
//LLDefaultParamBlockRegistry::instance().defaultRegistrar().add(widget_type, &get_empty_param_block<T>);
}
-//static
-const std::string* LLUICtrlFactory::getWidgetName(const std::type_info* widget_type)
-{
- return LLWidgetNameRegistry::instance().getValue(widget_type);
-}
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index b441cb0c9d..9f18be2371 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -105,7 +105,7 @@ private:
ParamDefaults()
{
// look up template file for this param block...
- const std::string* param_block_tag = getWidgetName(&typeid(PARAM_BLOCK));
+ const std::string* param_block_tag = LLWidgetNameRegistry::instance().getValue(&typeid(PARAM_BLOCK));
if (param_block_tag)
{ // ...and if it exists, back fill values using the most specific template first
PARAM_BLOCK params;
@@ -139,7 +139,6 @@ public:
template<typename T>
static const typename T::Params& getDefaultParams()
{
- //#pragma message("Generating ParamDefaults")
return ParamDefaults<typename T::Params, 0>::instance().get();
}
@@ -303,8 +302,6 @@ private:
}
- static const std::string* getWidgetName(const std::type_info* widget_type);
-
// this exists to get around dependency on llview
static void setCtrlParent(LLView* view, LLView* parent, S32 tab_group);
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index b71f13a450..626fb8caa5 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -383,7 +383,6 @@ set(viewer_SOURCE_FILES
llpanelmaininventory.cpp
llpanelmarketplaceinbox.cpp
llpanelmarketplaceinboxinventory.cpp
- llpanelmarketplaceoutboxinventory.cpp
llpanelmediasettingsgeneral.cpp
llpanelmediasettingspermissions.cpp
llpanelmediasettingssecurity.cpp
@@ -942,7 +941,6 @@ set(viewer_HEADER_FILES
llpanelmaininventory.h
llpanelmarketplaceinbox.h
llpanelmarketplaceinboxinventory.h
- llpanelmarketplaceoutboxinventory.h
llpanelmediasettingsgeneral.h
llpanelmediasettingspermissions.h
llpanelmediasettingssecurity.h
diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp
index e2417cdddb..e31e39dca2 100644
--- a/indra/newview/llagentwearablesfetch.cpp
+++ b/indra/newview/llagentwearablesfetch.cpp
@@ -342,7 +342,7 @@ void LLLibraryOutfitsFetch::folderDone()
}
mClothingID = gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
- mLibraryClothingID = gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING, false, true);
+ mLibraryClothingID = gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_CLOTHING, false);
// If Library->Clothing->Initial Outfits exists, use that.
LLNameCategoryCollector matchFolderFunctor("Initial Outfits");
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 6d67e098a6..510abf198a 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2330,7 +2330,7 @@ void LLAppearanceMgr::copyLibraryGestures()
// Copy gestures
LLUUID lib_gesture_cat_id =
- gInventory.findCategoryUUIDForType(LLFolderType::FT_GESTURE,false,true);
+ gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_GESTURE,false);
if (lib_gesture_cat_id.isNull())
{
llwarns << "Unable to copy gestures, source category not found" << llendl;
diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 04a55b261c..e4ed97892e 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -174,9 +174,8 @@ void LLFloaterOutbox::onOpen(const LLSD& key)
if (mOutboxId.isNull())
{
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);
+ const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder);
if (outbox_id.isNull())
{
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 9f1d4bdec9..14616ca7ab 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -955,7 +955,7 @@ BOOL LLInvFVBridge::isCOFFolder() const
BOOL LLInvFVBridge::isInboxFolder() const
{
- const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false);
+ const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false);
if (inbox_id.isNull())
{
@@ -995,7 +995,7 @@ BOOL LLInvFVBridge::isOutboxFolderDirectParent() const
const LLUUID LLInvFVBridge::getOutboxFolder() const
{
- const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
+ const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
return outbox_id;
}
@@ -1330,7 +1330,7 @@ LLToolDragAndDrop::ESource LLInvFVBridge::getDragSource() const
// +=================================================+
// | InventoryFVBridgeBuilder |
// +=================================================+
-LLInvFVBridge* LLInventoryFVBridgeBuilder::createBridge(LLAssetType::EType asset_type,
+LLInvFVBridge* LLInventoryFolderViewModelBuilder::createBridge(LLAssetType::EType asset_type,
LLAssetType::EType actual_asset_type,
LLInventoryType::EType inv_type,
LLInventoryPanel* inventory,
@@ -1438,7 +1438,7 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
LLInventoryItem* itemp = model->getItem(mUUID);
if (!itemp) return;
- const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
+ const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
copy_item_to_outbox(itemp, outbox_id, LLUUID::null, LLToolDragAndDrop::getOperationId());
}
}
@@ -2469,7 +2469,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
}
else
{
- if (model->isObjectDescendentOf(cat_id, model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false)))
+ if (model->isObjectDescendentOf(cat_id, model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false)))
{
set_dad_inbox_object(cat_id);
}
@@ -2909,7 +2909,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
LLInventoryCategory * cat = gInventory.getCategory(mUUID);
if (!cat) return;
- const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
+ const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
copy_folder_to_outbox(cat, outbox_id, cat->getUUID(), LLToolDragAndDrop::getOperationId());
}
#if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU
@@ -4068,7 +4068,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
else
{
// set up observer to select item once drag and drop from inbox is complete
- if (gInventory.isObjectDescendentOf(inv_item->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false)))
+ if (gInventory.isObjectDescendentOf(inv_item->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false)))
{
set_dad_inbox_object(inv_item->getUUID());
}
@@ -6487,7 +6487,7 @@ LLInvFVBridge* LLRecentInventoryBridgeBuilder::createBridge(
}
else
{
- new_listener = LLInventoryFVBridgeBuilder::createBridge(asset_type,
+ new_listener = LLInventoryFolderViewModelBuilder::createBridge(asset_type,
actual_asset_type,
inv_type,
inventory,
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 9997d1720f..fc0b15acad 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -185,15 +185,15 @@ protected:
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// Class LLInvFVBridgeBuilder
+// Class LLInventoryFolderViewModelBuilder
//
-// This class intended to build Folder View Bridge via LLInvFVBridge::createBridge.
-// It can be overridden with another way of creation necessary Inventory-Folder-View-Bridge.
+// This class intended to build Folder View Model via LLInvFVBridge::createBridge.
+// It can be overridden with another way of creation necessary Inventory Folder View Models.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-class LLInventoryFVBridgeBuilder
+class LLInventoryFolderViewModelBuilder
{
public:
- virtual ~LLInventoryFVBridgeBuilder() {}
+ virtual ~LLInventoryFolderViewModelBuilder() {}
virtual LLInvFVBridge* createBridge(LLAssetType::EType asset_type,
LLAssetType::EType actual_asset_type,
LLInventoryType::EType inv_type,
@@ -637,7 +637,7 @@ public:
};
// Bridge builder to create Inventory-Folder-View-Bridge for Recent Inventory Panel
-class LLRecentInventoryBridgeBuilder : public LLInventoryFVBridgeBuilder
+class LLRecentInventoryBridgeBuilder : public LLInventoryFolderViewModelBuilder
{
public:
// Overrides FolderBridge for Recent Inventory Panel.
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 5cb7f53bfa..0673970d89 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -373,13 +373,12 @@ void LLInventoryModel::unlockDirectDescendentArrays(const LLUUID& cat_id)
// specifies 'type' as what it defaults to containing. The category is
// not necessarily only for that type. *NOTE: This will create a new
// inventory category on the fly if one does not exist.
-const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType preferred_type,
- bool create_folder,
- bool find_in_library)
+const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder/*,
+ bool find_in_library*/)
{
LLUUID rv = LLUUID::null;
- const LLUUID &root_id = (find_in_library) ? gInventory.getLibraryRootFolderID() : gInventory.getRootFolderID();
+ const LLUUID &root_id = /*(find_in_library) ? gInventory.getLibraryRootFolderID() :*/ gInventory.getRootFolderID();
if(LLFolderType::FT_ROOT_INVENTORY == preferred_type)
{
rv = root_id;
@@ -402,7 +401,44 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType prefe
}
}
- if(rv.isNull() && isInventoryUsable() && (create_folder && !find_in_library))
+ if(rv.isNull() && isInventoryUsable() && (create_folder && true/*!find_in_library*/))
+ {
+ if(root_id.notNull())
+ {
+ return createNewCategory(root_id, preferred_type, LLStringUtil::null);
+ }
+ }
+ return rv;
+}
+
+const LLUUID LLInventoryModel::findLibraryCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder)
+{
+ LLUUID rv = LLUUID::null;
+
+ const LLUUID &root_id = gInventory.getLibraryRootFolderID();
+ if(LLFolderType::FT_ROOT_INVENTORY == preferred_type)
+ {
+ rv = root_id;
+ }
+ else if (root_id.notNull())
+ {
+ cat_array_t* cats = NULL;
+ cats = get_ptr_in_map(mParentChildCategoryTree, root_id);
+ if(cats)
+ {
+ S32 count = cats->count();
+ for(S32 i = 0; i < count; ++i)
+ {
+ if(cats->get(i)->getPreferredType() == preferred_type)
+ {
+ rv = cats->get(i)->getUUID();
+ break;
+ }
+ }
+ }
+ }
+
+ if(rv.isNull() && isInventoryUsable() && (create_folder && true/*!find_in_library*/))
{
if(root_id.notNull())
{
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 3613bc4917..503de627a0 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -231,11 +231,12 @@ public:
// Returns the uuid of the category that specifies 'type' as what it
// defaults to containing. The category is not necessarily only for that type.
// NOTE: If create_folder is true, this will create a new inventory category
- // on the fly if one does not exist. *NOTE: if find_in_library is true it
- // will search in the user's library folder instead of "My Inventory"
+ // on the fly if one does not exist.
const LLUUID findCategoryUUIDForType(LLFolderType::EType preferred_type,
- bool create_folder = true,
- bool find_in_library = false);
+ bool create_folder = true);
+ // will search in the user's library folder instead of "My Inventory"
+ const LLUUID findLibraryCategoryUUIDForType(LLFolderType::EType preferred_type,
+ bool create_folder = true);
// Get whatever special folder this object is a child of, if any.
const LLViewerInventoryCategory *getFirstNondefaultParent(const LLUUID& obj_id) const;
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index be1cd2510d..e9b128e836 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -55,7 +55,7 @@ static LLDefaultChildRegistry::Register<LLInventoryPanel> r("inventory_panel");
const std::string LLInventoryPanel::DEFAULT_SORT_ORDER = std::string("InventorySortOrder");
const std::string LLInventoryPanel::RECENTITEMS_SORT_ORDER = std::string("RecentItemsSortOrder");
const std::string LLInventoryPanel::INHERIT_SORT_ORDER = std::string("");
-static const LLInventoryFVBridgeBuilder INVENTORY_BRIDGE_BUILDER;
+static const LLInventoryFolderViewModelBuilder INVENTORY_BRIDGE_BUILDER;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLInventoryPanelObserver
@@ -140,7 +140,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
{
mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER;
- // contex menu callbacks
+ // context menu callbacks
mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLInventoryPanel::doToSelected, this, _2));
mCommitCallbackRegistrar.add("Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH));
mCommitCallbackRegistrar.add("Inventory.EmptyLostAndFound", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND));
@@ -151,71 +151,60 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
}
-void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params)
-{
- // Determine the root folder in case specified, and
- // build the views starting with that folder.
-
- std::string start_folder_name(params.start_folder());
-
- const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(start_folder_name);
-
- LLUUID root_id;
-
- if ("LIBRARY" == params.start_folder())
- {
- root_id = gInventory.getLibraryRootFolderID();
- }
- else
- {
- root_id = (preferred_type != LLFolderType::FT_NONE)
- ? gInventory.findCategoryUUIDForType(preferred_type, false, false)
- : LLUUID::null;
- }
-
- if ((root_id == LLUUID::null) && !start_folder_name.empty())
- {
- llwarns << "No category found that matches start_folder: " << start_folder_name << llendl;
- root_id = LLUUID::generateNewID();
- }
-
- LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY,
- LLAssetType::AT_CATEGORY,
- LLInventoryType::IT_CATEGORY,
- this,
- &mInventoryViewModel,
- NULL,
- root_id);
-
- mFolderRoot = createFolderView(new_listener, params.use_label_suffix());
- addItemID(root_id, mFolderRoot);
-}
void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
{
+ // save off copy of params
+ mParams = params;
// Clear up the root view
// Note: This needs to be done *before* we build the new folder view
- LLFolderViewItem* root_view = getItemByID(gInventory.getRootFolderID());
- if (root_view)
+ LLUUID root_id = getRootFolderID();
+ if (mFolderRoot)
{
- removeItemID(static_cast<LLFolderViewModelItemInventory*>(root_view->getViewModelItem())->getUUID());
- root_view->destroyView();
+ removeItemID(root_id);
+ mFolderRoot->destroyView();
+ mFolderRoot = NULL;
}
LLMemType mt(LLMemType::MTYPE_INVENTORY_POST_BUILD);
-
- mCommitCallbackRegistrar.pushScope(); // registered as a widget; need to push callback scope ourselves
- buildFolderView(params);
-
+ mCommitCallbackRegistrar.pushScope(); // registered as a widget; need to push callback scope ourselves
+ {
+ // Determine the root folder in case specified, and
+ // build the views starting with that folder.
+
+
+ LLFolderView::Params p(mParams.folder_view);
+ p.name = getName();
+ p.title = getLabel();
+ p.rect = LLRect(0, 0, getRect().getWidth(), 0);
+ p.parent_panel = this;
+ p.tool_tip = p.name;
+ p.listener = mInvFVBridgeBuilder->createBridge( LLAssetType::AT_CATEGORY,
+ LLAssetType::AT_CATEGORY,
+ LLInventoryType::IT_CATEGORY,
+ this,
+ &mInventoryViewModel,
+ NULL,
+ root_id);
+ p.view_model = &mInventoryViewModel;
+ p.use_label_suffix = mParams.use_label_suffix;
+ p.allow_multiselect = mAllowMultiSelect;
+ p.show_empty_message = mShowEmptyMessage;
+ p.show_item_link_overlays = mShowItemLinkOverlays;
+ p.root = NULL;
+
+ mFolderRoot = LLUICtrlFactory::create<LLFolderView>(p);
+
+ addItemID(root_id, mFolderRoot);
+ }
mCommitCallbackRegistrar.popScope();
-
mFolderRoot->setCallbackRegistrar(&mCommitCallbackRegistrar);
// Scroller
LLRect scroller_view_rect = getRect();
scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom);
- LLScrollContainer::Params scroller_params(params.scroll());
+ LLScrollContainer::Params scroller_params(mParams.scroll());
scroller_params.rect(scroller_view_rect);
mScroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroller_params);
addChild(mScroller);
@@ -263,7 +252,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
mClipboardState = LLClipboard::instance().getGeneration();
// Initialize base class params.
- LLPanel::initFromParams(params);
+ LLPanel::initFromParams(mParams);
}
LLInventoryPanel::~LLInventoryPanel()
@@ -562,7 +551,40 @@ LLFolderView* LLInventoryPanel::getRootFolder()
LLUUID LLInventoryPanel::getRootFolderID()
{
- return static_cast<LLFolderViewModelItemInventory*>(mFolderRoot->getViewModelItem())->getUUID();
+ if (mFolderRoot && mFolderRoot->getViewModelItem())
+ {
+ return static_cast<LLFolderViewModelItemInventory*>(mFolderRoot->getViewModelItem())->getUUID();
+
+ }
+ else
+ {
+ LLUUID root_id;
+ if (mParams.start_folder.id.isChosen())
+ {
+ root_id = mParams.start_folder.id;
+ }
+ else
+ {
+ const LLFolderType::EType preferred_type = mParams.start_folder.type.isChosen()
+ ? mParams.start_folder.type
+ : LLViewerFolderType::lookupTypeFromNewCategoryName(mParams.start_folder.name);
+
+ if ("LIBRARY" == mParams.start_folder.name())
+ {
+ root_id = gInventory.getLibraryRootFolderID();
+ }
+ else if (preferred_type != LLFolderType::FT_NONE)
+ {
+ root_id = gInventory.findCategoryUUIDForType(preferred_type, false);
+ if (root_id.isNull())
+ {
+ llwarns << "Could not find folder of type " << preferred_type << llendl;
+ root_id.generateNewID();
+ }
+ }
+ }
+ return root_id;
+ }
}
@@ -612,7 +634,16 @@ void LLInventoryPanel::initializeViews()
{
if (!gInventory.isInventoryUsable()) return;
- buildNewViews(gInventory.getRootFolderID());
+ LLUUID root_id = getRootFolderID();
+ if (root_id.notNull())
+ {
+ buildNewViews(getRootFolderID());
+ }
+ else
+ {
+ buildNewViews(gInventory.getRootFolderID());
+ buildNewViews(gInventory.getLibraryRootFolderID());
+ }
gIdleCallbacks.addFunction(idle, this);
@@ -639,34 +670,10 @@ void LLInventoryPanel::initializeViews()
}
}
-LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool useLabelSuffix)
-{
- LLRect folder_rect(0,
- 0,
- getRect().getWidth(),
- 0);
-
- LLFolderView::Params p;
-
- p.name = getName();
- p.title = getLabel();
- p.rect = folder_rect;
- p.parent_panel = this;
- p.tool_tip = p.name;
- p.listener = bridge;
- p.view_model = &mInventoryViewModel;
- p.use_label_suffix = useLabelSuffix;
- p.allow_multiselect = mAllowMultiSelect;
- p.show_empty_message = mShowEmptyMessage;
- p.show_item_link_overlays = mShowItemLinkOverlays;
- p.root = NULL;
-
- return LLUICtrlFactory::create<LLFolderView>(p);
-}
LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge)
{
- LLFolderViewFolder::Params params;
+ LLFolderViewFolder::Params params(mParams.folder);
params.name = bridge->getDisplayName();
params.root = mFolderRoot;
@@ -678,7 +685,7 @@ LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * br
LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge)
{
- LLFolderViewItem::Params params;
+ LLFolderViewItem::Params params(mParams.item);
params.name = bridge->getDisplayName();
params.creation_date = bridge->getCreationDate();
@@ -1329,3 +1336,34 @@ LLInventoryRecentItemsPanel::LLInventoryRecentItemsPanel( const Params& params)
mInvFVBridgeBuilder = &RECENT_ITEMS_BUILDER;
}
+namespace LLInitParam
+{
+ void TypeValues<LLFolderType::EType>::declareValues()
+ {
+ declare(LLFolderType::lookup(LLFolderType::FT_TEXTURE) , LLFolderType::FT_TEXTURE);
+ declare(LLFolderType::lookup(LLFolderType::FT_SOUND) , LLFolderType::FT_SOUND);
+ declare(LLFolderType::lookup(LLFolderType::FT_CALLINGCARD) , LLFolderType::FT_CALLINGCARD);
+ declare(LLFolderType::lookup(LLFolderType::FT_LANDMARK) , LLFolderType::FT_LANDMARK);
+ declare(LLFolderType::lookup(LLFolderType::FT_CLOTHING) , LLFolderType::FT_CLOTHING);
+ declare(LLFolderType::lookup(LLFolderType::FT_OBJECT) , LLFolderType::FT_OBJECT);
+ declare(LLFolderType::lookup(LLFolderType::FT_NOTECARD) , LLFolderType::FT_NOTECARD);
+ declare(LLFolderType::lookup(LLFolderType::FT_ROOT_INVENTORY) , LLFolderType::FT_ROOT_INVENTORY);
+ declare(LLFolderType::lookup(LLFolderType::FT_LSL_TEXT) , LLFolderType::FT_LSL_TEXT);
+ declare(LLFolderType::lookup(LLFolderType::FT_BODYPART) , LLFolderType::FT_BODYPART);
+ declare(LLFolderType::lookup(LLFolderType::FT_TRASH) , LLFolderType::FT_TRASH);
+ declare(LLFolderType::lookup(LLFolderType::FT_SNAPSHOT_CATEGORY), LLFolderType::FT_SNAPSHOT_CATEGORY);
+ declare(LLFolderType::lookup(LLFolderType::FT_LOST_AND_FOUND) , LLFolderType::FT_LOST_AND_FOUND);
+ declare(LLFolderType::lookup(LLFolderType::FT_ANIMATION) , LLFolderType::FT_ANIMATION);
+ declare(LLFolderType::lookup(LLFolderType::FT_GESTURE) , LLFolderType::FT_GESTURE);
+ declare(LLFolderType::lookup(LLFolderType::FT_FAVORITE) , LLFolderType::FT_FAVORITE);
+ declare(LLFolderType::lookup(LLFolderType::FT_ENSEMBLE_START) , LLFolderType::FT_ENSEMBLE_START);
+ declare(LLFolderType::lookup(LLFolderType::FT_ENSEMBLE_END) , LLFolderType::FT_ENSEMBLE_END);
+ declare(LLFolderType::lookup(LLFolderType::FT_CURRENT_OUTFIT) , LLFolderType::FT_CURRENT_OUTFIT);
+ declare(LLFolderType::lookup(LLFolderType::FT_OUTFIT) , LLFolderType::FT_OUTFIT);
+ declare(LLFolderType::lookup(LLFolderType::FT_MY_OUTFITS) , LLFolderType::FT_MY_OUTFITS);
+ declare(LLFolderType::lookup(LLFolderType::FT_MESH ) , LLFolderType::FT_MESH );
+ declare(LLFolderType::lookup(LLFolderType::FT_INBOX) , LLFolderType::FT_INBOX);
+ declare(LLFolderType::lookup(LLFolderType::FT_OUTBOX) , LLFolderType::FT_OUTBOX);
+ declare(LLFolderType::lookup(LLFolderType::FT_BASIC_ROOT) , LLFolderType::FT_BASIC_ROOT);
+ }
+}
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 910325cdbc..b66b53f642 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -41,10 +41,19 @@
#include <set>
class LLInvFVBridge;
-class LLInventoryFVBridgeBuilder;
+class LLInventoryFolderViewModelBuilder;
class LLInvPanelComplObserver;
class LLFolderViewModelInventory;
+namespace LLInitParam
+{
+ template<>
+ struct TypeValues<LLFolderType::EType> : public TypeValuesHelper<LLFolderType::EType>
+ {
+ static void declareValues();
+ };
+}
+
class LLInventoryPanel : public LLPanel
{
//--------------------------------------------------------------------
@@ -64,6 +73,19 @@ public:
{}
};
+ struct StartFolder : public LLInitParam::ChoiceBlock<StartFolder>
+ {
+ Alternative<std::string> name;
+ Alternative<LLUUID> id;
+ Alternative<LLFolderType::EType> type;
+
+ StartFolder()
+ : name("name"),
+ id("id"),
+ type("type")
+ {}
+ };
+
struct Params
: public LLInitParam::Block<Params, LLPanel::Params>
{
@@ -72,11 +94,14 @@ public:
Optional<bool> allow_multi_select;
Optional<bool> show_item_link_overlays;
Optional<Filter> filter;
- Optional<std::string> start_folder;
+ Optional<StartFolder> start_folder;
Optional<bool> use_label_suffix;
Optional<bool> show_empty_message;
Optional<LLScrollContainer::Params> scroll;
Optional<bool> accepts_drag_and_drop;
+ Optional<LLFolderView::Params> folder_view;
+ Optional<LLFolderViewFolder::Params> folder;
+ Optional<LLFolderViewItem::Params> item;
Params()
: sort_order_setting("sort_order_setting"),
@@ -88,7 +113,10 @@ public:
use_label_suffix("use_label_suffix", true),
show_empty_message("show_empty_message", true),
scroll("scroll"),
- accepts_drag_and_drop("accepts_drag_and_drop")
+ accepts_drag_and_drop("accepts_drag_and_drop"),
+ folder_view("folder_view"),
+ folder("folder"),
+ item("item")
{}
};
@@ -98,6 +126,7 @@ public:
protected:
LLInventoryPanel(const Params&);
void initFromParams(const Params&);
+
friend class LLUICtrlFactory;
public:
virtual ~LLInventoryPanel();
@@ -187,29 +216,30 @@ protected:
void openStartFolderOrMyInventory(); // open the first level of inventory
void onItemsCompletion(); // called when selected items are complete
- LLUUID mSelectThisID;
+ LLUUID mSelectThisID;
LLInventoryModel* mInventory;
LLInventoryObserver* mInventoryObserver;
LLInvPanelComplObserver* mCompletionObserver;
- BOOL mAcceptsDragAndDrop;
- BOOL mAllowMultiSelect;
- BOOL mShowItemLinkOverlays; // Shows link graphic over inventory item icons
- BOOL mShowEmptyMessage;
+ bool mAcceptsDragAndDrop;
+ bool mAllowMultiSelect;
+ bool mShowItemLinkOverlays; // Shows link graphic over inventory item icons
+ bool mShowEmptyMessage;
LLFolderView* mFolderRoot;
LLScrollContainer* mScroller;
LLFolderViewModelInventory mInventoryViewModel;
+ Params mParams; // stored copy of parameter block
std::map<LLUUID, LLFolderViewItem*> mItemMap;
/**
- * Pointer to LLInventoryFVBridgeBuilder.
+ * Pointer to LLInventoryFolderViewModelBuilder.
*
* It is set in LLInventoryPanel's constructor and can be overridden in derived classes with
* another implementation.
* Take into account it will not be deleted by LLInventoryPanel itself.
*/
- const LLInventoryFVBridgeBuilder* mInvFVBridgeBuilder;
+ const LLInventoryFolderViewModelBuilder* mInvFVBridgeBuilder;
//--------------------------------------------------------------------
@@ -239,19 +269,14 @@ protected:
// Builds the UI. Call this once the inventory is usable.
void initializeViews();
- virtual void buildFolderView(const LLInventoryPanel::Params& params);
LLFolderViewItem* buildNewViews(const LLUUID& id);
BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const;
- virtual LLFolderView* createFolderView(LLInvFVBridge * bridge, bool useLabelSuffix);
virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge);
virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge);
private:
- BOOL mBuildDefaultHierarchy; // default inventory hierarchy should be created in postBuild()
- BOOL mViewsInitialized; // Views have been generated
- // UUID of category from which hierarchy should be built. Set with the
- // "start_folder" xml property. Default is LLUUID::null that means total Inventory hierarchy.
- LLUUID mStartFolderID;
+ bool mBuildDefaultHierarchy; // default inventory hierarchy should be created in postBuild()
+ bool mViewsInitialized; // Views have been generated
};
#endif // LL_LLINVENTORYPANEL_H
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 4bbab52e5a..1a4f3708ac 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -177,7 +177,7 @@ void LLLandmarksPanelObserver::changed(U32 mask)
if (!mIsLibraryLandmarksOpen && library)
{
// Search for "Landmarks" folder in the Library and open it once on start up. See EXT-4827.
- const LLUUID &landmarks_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false, true);
+ const LLUUID &landmarks_cat = gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_LANDMARK, false);
if (landmarks_cat.notNull())
{
LLOpenFolderByID opener(landmarks_cat);
@@ -306,8 +306,7 @@ bool LLLandmarksPanel::isSingleItemSelected()
if (mCurrentSelectedList != NULL)
{
- LLPlacesFolderView* root_view =
- static_cast<LLPlacesFolderView*>(mCurrentSelectedList->getRootFolder());
+ LLFolderView* root_view = mCurrentSelectedList->getRootFolder();
if (root_view->getSelectedCount() == 1)
{
@@ -588,7 +587,7 @@ void LLLandmarksPanel::initLibraryInventoryPanel()
initLandmarksPanel(mLibraryInventoryPanel);
// We want to fetch only "Landmarks" category from the library.
- const LLUUID &landmarks_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false, true);
+ const LLUUID &landmarks_cat = gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_LANDMARK, false);
if (landmarks_cat.notNull())
{
LLInventoryModelBackgroundFetch::instance().start(landmarks_cat);
@@ -918,8 +917,9 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
{
std::string command_name = userdata.asString();
- LLPlacesFolderView* root_folder_view = mCurrentSelectedList ?
- static_cast<LLPlacesFolderView*>(mCurrentSelectedList->getRootFolder()) : NULL;
+ LLFolderView* root_folder_view = mCurrentSelectedList
+ ? mCurrentSelectedList->getRootFolder()
+ : NULL;
if ("collapse_all" == command_name)
{
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp
index 6e5a522297..8ad3929999 100644
--- a/indra/newview/llpanelmarketplaceinboxinventory.cpp
+++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp
@@ -54,69 +54,11 @@ static LLDefaultChildRegistry::Register<LLInboxFolderViewItem> r3("inbox_folder_
//
LLInboxInventoryPanel::LLInboxInventoryPanel(const LLInboxInventoryPanel::Params& p)
- : LLInventoryPanel(p)
-{
-}
+: LLInventoryPanel(p)
+{}
LLInboxInventoryPanel::~LLInboxInventoryPanel()
-{
-}
-
-// virtual
-void LLInboxInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params)
-{
- // Determine the root folder in case specified, and
- // build the views starting with that folder.
-
- LLUUID root_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false);
-
- // leslie -- temporary HACK to work around sim not creating inbox with proper system folder type
- if (root_id.isNull())
- {
- std::string start_folder_name(params.start_folder());
-
- LLInventoryModel::cat_array_t* cats;
- LLInventoryModel::item_array_t* items;
-
- gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items);
-
- if (cats)
- {
- for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it)
- {
- LLInventoryCategory* cat = *cat_it;
-
- if (cat->getName() == start_folder_name)
- {
- root_id = cat->getUUID();
- break;
- }
- }
- }
-
- if (root_id == LLUUID::null)
- {
- llwarns << "No category found that matches inbox inventory panel start_folder: " << start_folder_name << llendl;
- }
- }
- // leslie -- end temporary HACK
-
- if (root_id == LLUUID::null)
- {
- llwarns << "Inbox inventory panel has no root folder!" << llendl;
- root_id = LLUUID::generateNewID();
- }
-
- LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY,
- LLAssetType::AT_CATEGORY,
- LLInventoryType::IT_CATEGORY,
- this,
- &mInventoryViewModel,
- NULL,
- root_id);
-
- mFolderRoot = createFolderView(new_listener, params.use_label_suffix());
-}
+{}
LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge)
{
@@ -149,9 +91,9 @@ LLFolderViewItem * LLInboxInventoryPanel::createFolderViewItem(LLInvFVBridge * b
//
LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p)
- : LLFolderViewFolder(p)
- , LLBadgeOwner(getHandle())
- , mFresh(false)
+: LLFolderViewFolder(p),
+ LLBadgeOwner(getHandle()),
+ mFresh(false)
{
#if SUPPORTING_FRESH_ITEM_COUNT
initBadgeParams(p.new_badge());
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h
index 209f3a4098..d8b8a2fe63 100644
--- a/indra/newview/llpanelmarketplaceinboxinventory.h
+++ b/indra/newview/llpanelmarketplaceinboxinventory.h
@@ -47,9 +47,6 @@ public:
~LLInboxInventoryPanel();
// virtual
- void buildFolderView(const LLInventoryPanel::Params& params);
-
- // virtual
LLFolderViewFolder * createFolderViewFolder(LLInvFVBridge * bridge);
LLFolderViewItem * createFolderViewItem(LLInvFVBridge * bridge);
};
@@ -63,9 +60,8 @@ public:
Optional<LLBadge::Params> new_badge;
Params()
- : new_badge("new_badge")
- {
- }
+ : new_badge("new_badge")
+ {}
};
LLInboxFolderViewFolder(const Params& p);
@@ -93,9 +89,8 @@ public:
Optional<LLBadge::Params> new_badge;
Params()
- : new_badge("new_badge")
- {
- }
+ : new_badge("new_badge")
+ {}
};
LLInboxFolderViewItem(const Params& p);
diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.cpp b/indra/newview/llpanelmarketplaceoutboxinventory.cpp
deleted file mode 100644
index 2885dd6266..0000000000
--- a/indra/newview/llpanelmarketplaceoutboxinventory.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/**
- * @file llpanelmarketplaceoutboxinventory.cpp
- * @brief LLOutboxInventoryPanel class definition
- *
- * $LicenseInfo:firstyear=2009&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 "llpanelmarketplaceoutboxinventory.h"
-
-#include "llfolderviewitem.h"
-#include "llfolderviewmodel.h"
-#include "llinventorybridge.h"
-#include "llinventoryfunctions.h"
-#include "llpanellandmarks.h"
-#include "llplacesinventorybridge.h"
-#include "lltrans.h"
-#include "llviewerfoldertype.h"
-
-
-//
-// statics
-//
-
-static LLDefaultChildRegistry::Register<LLOutboxInventoryPanel> r1("outbox_inventory_panel");
-static LLDefaultChildRegistry::Register<LLOutboxFolderViewFolder> r2("outbox_folder_view_folder");
-
-
-//
-// LLOutboxInventoryPanel Implementation
-//
-
-LLOutboxInventoryPanel::LLOutboxInventoryPanel(const LLOutboxInventoryPanel::Params& p)
- : LLInventoryPanel(p)
-{
-}
-
-LLOutboxInventoryPanel::~LLOutboxInventoryPanel()
-{
-}
-
-// virtual
-void LLOutboxInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params)
-{
- // Determine the root folder in case specified, and
- // build the views starting with that folder.
-
- LLUUID root_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
-
- if (root_id == LLUUID::null)
- {
- llwarns << "Outbox inventory panel has no root folder!" << llendl;
- root_id = LLUUID::generateNewID();
- }
-
- LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY,
- LLAssetType::AT_CATEGORY,
- LLInventoryType::IT_CATEGORY,
- this,
- &mInventoryViewModel,
- NULL,
- root_id);
-
- mFolderRoot = createFolderView(new_listener, params.use_label_suffix());
-}
-
-LLFolderViewFolder * LLOutboxInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge)
-{
- LLOutboxFolderViewFolder::Params params;
-
- params.name = bridge->getDisplayName();
- params.root = mFolderRoot;
- params.listener = bridge;
- params.tool_tip = params.name;
-
- return LLUICtrlFactory::create<LLOutboxFolderViewFolder>(params);
-}
-
-LLFolderViewItem * LLOutboxInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge)
-{
- LLFolderViewItem::Params params;
-
- params.name = bridge->getDisplayName();
- params.creation_date = bridge->getCreationDate();
- params.root = mFolderRoot;
- params.listener = bridge;
- params.rect = LLRect (0, 0, 0, 0);
- params.tool_tip = params.name;
-
- return LLUICtrlFactory::create<LLOutboxFolderViewItem>(params);
-}
-
-//
-// LLOutboxFolderViewFolder Implementation
-//
-
-LLOutboxFolderViewFolder::LLOutboxFolderViewFolder(const Params& p)
- : LLFolderViewFolder(p)
-{
-}
-
-//
-// LLOutboxFolderViewItem Implementation
-//
-
-LLOutboxFolderViewItem::LLOutboxFolderViewItem(const Params& p)
- : LLFolderViewItem(p)
-{
-}
-
-BOOL LLOutboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask)
-{
- return TRUE;
-}
-
-void LLOutboxFolderViewItem::openItem()
-{
- // Intentionally do nothing to block attaching items from the outbox
-}
-
-// eof
diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.h b/indra/newview/llpanelmarketplaceoutboxinventory.h
deleted file mode 100644
index a6c522b7c2..0000000000
--- a/indra/newview/llpanelmarketplaceoutboxinventory.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file llpanelmarketplaceoutboxinventory.h
- * @brief LLOutboxInventoryPanel class declaration
- *
- * $LicenseInfo:firstyear=2009&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$
- */
-
-#ifndef LL_OUTBOXINVENTORYPANEL_H
-#define LL_OUTBOXINVENTORYPANEL_H
-
-
-#include "llinventorypanel.h"
-#include "llfolderviewitem.h"
-
-
-class LLOutboxInventoryPanel : public LLInventoryPanel
-{
-public:
- struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params>
- {
- Params() {}
- };
-
- LLOutboxInventoryPanel(const Params& p);
- ~LLOutboxInventoryPanel();
-
- // virtual
- void buildFolderView(const LLInventoryPanel::Params& params);
-
- // virtual
- LLFolderViewFolder * createFolderViewFolder(LLInvFVBridge * bridge);
- LLFolderViewItem * createFolderViewItem(LLInvFVBridge * bridge);
-};
-
-
-class LLOutboxFolderViewFolder : public LLFolderViewFolder
-{
-public:
- struct Params : public LLInitParam::Block<Params, LLFolderViewFolder::Params>
- {
- Params() {}
- };
-
- LLOutboxFolderViewFolder(const Params& p);
-};
-
-
-class LLOutboxFolderViewItem : public LLFolderViewItem
-{
-public:
- LLOutboxFolderViewItem(const Params& p);
-
- // virtual
- BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
- void openItem();
-};
-
-
-#endif //LL_OUTBOXINVENTORYPANEL_H
diff --git a/indra/newview/llplacesinventorybridge.cpp b/indra/newview/llplacesinventorybridge.cpp
index 1a5f64e295..ebd9604c5b 100644
--- a/indra/newview/llplacesinventorybridge.cpp
+++ b/indra/newview/llplacesinventorybridge.cpp
@@ -170,7 +170,7 @@ LLInvFVBridge* LLPlacesInventoryBridgeBuilder::createBridge(
if (actual_asset_type == LLAssetType::AT_LINK_FOLDER)
{
// *TODO: Create a link folder handler instead if it is necessary
- new_listener = LLInventoryFVBridgeBuilder::createBridge(
+ new_listener = LLInventoryFolderViewModelBuilder::createBridge(
asset_type,
actual_asset_type,
inv_type,
@@ -184,7 +184,7 @@ LLInvFVBridge* LLPlacesInventoryBridgeBuilder::createBridge(
new_listener = new LLPlacesFolderBridge(inv_type, inventory, root, uuid);
break;
default:
- new_listener = LLInventoryFVBridgeBuilder::createBridge(
+ new_listener = LLInventoryFolderViewModelBuilder::createBridge(
asset_type,
actual_asset_type,
inv_type,
diff --git a/indra/newview/llplacesinventorybridge.h b/indra/newview/llplacesinventorybridge.h
index 791502990b..07d18d03c5 100644
--- a/indra/newview/llplacesinventorybridge.h
+++ b/indra/newview/llplacesinventorybridge.h
@@ -82,7 +82,7 @@ protected:
*
* It builds Bridges for Landmarks and Folders in Places Landmarks Panel
*/
-class LLPlacesInventoryBridgeBuilder : public LLInventoryFVBridgeBuilder
+class LLPlacesInventoryBridgeBuilder : public LLInventoryFolderViewModelBuilder
{
public:
/*virtual*/ LLInvFVBridge* createBridge(LLAssetType::EType asset_type,
diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp
index c46681f556..db3f245389 100644
--- a/indra/newview/llplacesinventorypanel.cpp
+++ b/indra/newview/llplacesinventorypanel.cpp
@@ -58,11 +58,6 @@ LLPlacesInventoryPanel::~LLPlacesInventoryPanel()
delete mSavedFolderState;
}
-void LLPlacesInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params)
-{
- LLInventoryPanel::buildFolderView(params);
-}
-
// save current folder open state
void LLPlacesInventoryPanel::saveFolderState()
{
diff --git a/indra/newview/llplacesinventorypanel.h b/indra/newview/llplacesinventorypanel.h
index f647e7f970..1544b51aed 100644
--- a/indra/newview/llplacesinventorypanel.h
+++ b/indra/newview/llplacesinventorypanel.h
@@ -46,8 +46,6 @@ public:
LLPlacesInventoryPanel(const Params& p);
~LLPlacesInventoryPanel();
- /*virtual*/ void buildFolderView(const LLInventoryPanel::Params& params);
-
void saveFolderState();
void restoreFolderState();
@@ -57,7 +55,7 @@ private:
LLSaveFolderState* mSavedFolderState;
};
-
+//TODO RN: this class is currently unused, make sure that behavior remains
class LLPlacesFolderView : public LLFolderView
{
public:
@@ -77,8 +75,6 @@ public:
mParentLandmarksPanel = panel;
}
- S32 getSelectedCount() { return (S32)mSelectedItems.size(); }
-
private:
/**
* holds pointer to landmark panel. This pointer is used in @c LLPlacesFolderView::handleRightMouseDown
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 47bd620fc6..acb232c77f 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -260,9 +260,8 @@ void LLSidepanelInventory::updateInbox()
//
const bool do_not_create_folder = false;
- const bool do_not_find_in_library = false;
- const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder, do_not_find_in_library);
+ const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder);
// Set up observer to listen for creation of inbox if at least one of them doesn't exist
if (inbox_id.isNull())
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 2680e4451b..94c97158a8 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -812,7 +812,7 @@ void LLToolDragAndDrop::dragOrDrop( S32 x, S32 y, MASK mask, BOOL drop,
if (!handled)
{
// Disallow drag and drop to 3D from the outbox
- const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
+ const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
if (outbox_id.notNull())
{
for (S32 item_index = 0; item_index < (S32)mCargoIDs.size(); item_index++)
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 7c744f3c3f..9268e5a869 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -5318,7 +5318,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera)
// crazy cast so that we can overwrite the fade value
// even though gcc enforces sets as const
// (fade value doesn't affect sort so this is safe)
- Light* farthest_light = ((Light*) (&(*(mNearbyLights.rbegin()))));
+ Light* farthest_light = (const_cast<Light*>(&(*(mNearbyLights.rbegin()))));
if (light->dist < farthest_light->dist)
{
if (farthest_light->fade >= 0.f)
diff --git a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
index 413e22e444..48d38d50e0 100644
--- a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
@@ -2,7 +2,7 @@
<inbox_inventory_panel
accepts_drag_and_drop="false"
name="inventory_inbox"
- start_folder="Received Items"
+ start_folder.name="Received Items"
follows="all" layout="topleft"
top="0" left="0" height="165" width="308"
top_pad="0"
diff --git a/indra/newview/skins/default/xui/en/panel_landmarks.xml b/indra/newview/skins/default/xui/en/panel_landmarks.xml
index 2a5933e3e9..39805637a0 100644
--- a/indra/newview/skins/default/xui/en/panel_landmarks.xml
+++ b/indra/newview/skins/default/xui/en/panel_landmarks.xml
@@ -35,7 +35,7 @@
left="0"
mouse_opaque="true"
name="favorites_list"
- start_folder="Favorites"
+ start_folder.name="Favorites"
width="307"/>
</accordion_tab>
<accordion_tab
@@ -51,7 +51,7 @@
left="0"
mouse_opaque="true"
name="landmarks_list"
- start_folder="Landmarks"
+ start_folder.name="Landmarks"
width="307"/>
</accordion_tab>
<accordion_tab
@@ -67,7 +67,7 @@
left="0"
mouse_opaque="true"
name="my_inventory_list"
- start_folder="My Inventory"
+ start_folder.name="My Inventory"
width="307"/>
</accordion_tab>
<accordion_tab
@@ -83,7 +83,7 @@
left="0"
mouse_opaque="true"
name="library_list"
- start_folder="LIBRARY"
+ start_folder.name="LIBRARY"
width="313"/>
</accordion_tab>
</accordion>
diff --git a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
index a3d39e55af..203febbf18 100644
--- a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<outbox_inventory_panel
+<inventory_panel
name="inventory_outbox"
- start_folder="Outbox"
+ start_folder.name="Outbox"
+ show_empty_message="false"
+ show_load_status="false"
+ start_folder.type="outbox"
follows="all" layout="topleft"
top="0" left="0" height="165" width="308"
top_pad="0"
@@ -12,6 +15,11 @@
bevel_style="none"
show_item_link_overlays="true"
tool_tip="Drag and drop items here to prepare them for sale on your storefront"
- >
- <scroll reserve_scroll_corner="false" />
-</outbox_inventory_panel>
+ scroll.reserve_scroll_corner="false">
+ <folder folder_arrow_image="Folder_Arrow"
+ folder_indentation="8"
+ item_height="20"
+ item_top_pad="4"
+ selection_image="Rounded_Square"/>
+ <item allow_open="false"/>
+</inventory_panel>
diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml
index 830c27bdac..d5b10e7f51 100644
--- a/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml
+++ b/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml
@@ -1,2 +1,3 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<inbox_inventory_panel show_load_status="false" />
+<inbox_inventory_panel show_load_status="false"
+ start_folder.type="inbox"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
deleted file mode 100644
index d19c47f54f..0000000000
--- a/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<outbox_folder_view_folder
- folder_arrow_image="Folder_Arrow"
- folder_indentation="8"
- item_height="20"
- item_top_pad="4"
- selection_image="Rounded_Square"
- >
-</outbox_folder_view_folder>
diff --git a/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml
deleted file mode 100644
index 3964569da2..0000000000
--- a/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<outbox_inventory_panel show_empty_message="false" show_load_status="false" />