summaryrefslogtreecommitdiff
path: root/indra/newview/llplacesinventorypanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llplacesinventorypanel.cpp')
-rw-r--r--indra/newview/llplacesinventorypanel.cpp120
1 files changed, 28 insertions, 92 deletions
diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp
index f7823f4fe8..4c2213c198 100644
--- a/indra/newview/llplacesinventorypanel.cpp
+++ b/indra/newview/llplacesinventorypanel.cpp
@@ -30,7 +30,8 @@
#include "llplacesinventorypanel.h"
-#include "llfoldervieweventlistener.h"
+#include "llfolderviewmodel.h"
+#include "llplacesfolderview.h"
#include "llinventorybridge.h"
#include "llinventoryfunctions.h"
#include "llpanellandmarks.h"
@@ -57,44 +58,35 @@ LLPlacesInventoryPanel::~LLPlacesInventoryPanel()
delete mSavedFolderState;
}
-void LLPlacesInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params)
-{
- // Determine the root folder in case specified, and
- // build the views starting with that folder.
- const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(params.start_folder);
-
- LLUUID root_id;
- if ("LIBRARY" == params.start_folder())
- {
- root_id = gInventory.getLibraryRootFolderID();
- }
- else
- {
- root_id = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null);
- }
-
- LLRect folder_rect(0,
- 0,
- getRect().getWidth(),
- 0);
- LLPlacesFolderView::Params p;
- p.name = getName();
- p.title = getLabel();
- p.rect = folder_rect;
- p.listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY,
- LLAssetType::AT_CATEGORY,
- LLInventoryType::IT_CATEGORY,
- this,
- NULL,
- root_id);
- p.parent_panel = this;
- p.allow_multiselect = mAllowMultiSelect;
- p.use_ellipses = true; // truncate inventory item text so remove horizontal scroller
- mFolderRoot = (LLFolderView*)LLUICtrlFactory::create<LLPlacesFolderView>(p);
+LLFolderView * LLPlacesInventoryPanel::createFolderRoot(LLUUID root_id )
+{
+ LLPlacesFolderView::Params p;
+
+ 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;
+ p.use_ellipses = mParams.folder_view.use_ellipses;
+ p.options_menu = "menu_inventory.xml";
+
+ return LLUICtrlFactory::create<LLPlacesFolderView>(p);
}
-
// save current folder open state
void LLPlacesInventoryPanel::saveFolderState()
{
@@ -128,59 +120,3 @@ S32 LLPlacesInventoryPanel::notify(const LLSD& info)
}
return 0;
}
-
-/************************************************************************/
-/* PROTECTED METHODS */
-/************************************************************************/
-
-
-
-/************************************************************************/
-/* LLPlacesFolderView implementation */
-/************************************************************************/
-
-//////////////////////////////////////////////////////////////////////////
-// PUBLIC METHODS
-//////////////////////////////////////////////////////////////////////////
-
-LLPlacesFolderView::LLPlacesFolderView(const LLFolderView::Params& p)
-: LLFolderView(p)
-{
- // we do not need auto select functionality in places landmarks, so override default behavior.
- // this disables applying of the LLSelectFirstFilteredItem in LLFolderView::doIdle.
- // Fixed issues: EXT-1631, EXT-4994.
- mAutoSelectOverride = TRUE;
-}
-
-BOOL LLPlacesFolderView::handleRightMouseDown(S32 x, S32 y, MASK mask)
-{
- // let children to change selection first
- childrenHandleRightMouseDown(x, y, mask);
- mParentLandmarksPanel->setCurrentSelectedList((LLPlacesInventoryPanel*)getParentPanel());
-
- // then determine its type and set necessary menu handle
- if (getCurSelectedItem())
- {
- LLInventoryType::EType inventory_type = getCurSelectedItem()->getListener()->getInventoryType();
- inventory_type_menu_handle_t::iterator it_handle = mMenuHandlesByInventoryType.find(inventory_type);
-
- if (it_handle != mMenuHandlesByInventoryType.end())
- {
- mPopupMenuHandle = (*it_handle).second;
- }
- else
- {
- llwarns << "Requested menu handle for non-setup inventory type: " << inventory_type << llendl;
- }
-
- }
-
- return LLFolderView::handleRightMouseDown(x, y, mask);
-}
-
-void LLPlacesFolderView::setupMenuHandle(LLInventoryType::EType asset_type, LLHandle<LLView> menu_handle)
-{
- mMenuHandlesByInventoryType[asset_type] = menu_handle;
-}
-
-// EOF