summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2012-08-20 16:11:03 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2012-08-20 16:11:03 -0700
commitbec60ef80e72ab6df8ae0bf6b7a7824e8504426a (patch)
tree295b64dc9d31888bcbc890bf84ec95d8b7ae4999 /indra
parent41cba389f89ff16c0e574ea26d6a1ceb60133ef7 (diff)
CHUI-295: Problem: The places panel implemention was incomplete and trying to make use of a class that was not fully implemented (placesfolderview). Resoltuion: Upon creation of the places panel, placesfolderview is created which contains the proper overloaded functions to show the correct menu when right clicking.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/CMakeLists.txt2
-rw-r--r--indra/newview/llinventorypanel.cpp48
-rw-r--r--indra/newview/llinventorypanel.h1
-rw-r--r--indra/newview/llpanellandmarks.cpp1
-rw-r--r--indra/newview/llplacesfolderview.cpp74
-rw-r--r--indra/newview/llplacesfolderview.h72
-rw-r--r--indra/newview/llplacesinventorypanel.cpp86
-rw-r--r--indra/newview/llplacesinventorypanel.h33
8 files changed, 206 insertions, 111 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 70493b1214..9553476aaf 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -445,6 +445,7 @@ set(viewer_SOURCE_FILES
llphysicsshapebuilderutil.cpp
llplacesinventorybridge.cpp
llplacesinventorypanel.cpp
+ llplacesfolderview.cpp
llpopupview.cpp
llpolymesh.cpp
llpolymorph.cpp
@@ -1015,6 +1016,7 @@ set(viewer_HEADER_FILES
llphysicsshapebuilderutil.h
llplacesinventorybridge.h
llplacesinventorypanel.h
+ llplacesfolderview.h
llpolymesh.h
llpolymorph.h
llpopupview.h
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 22e6943f50..03dfada77c 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -151,6 +151,30 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
}
+LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id )
+{
+ 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;
+
+ return LLUICtrlFactory::create<LLFolderView>(p);
+}
void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
{
@@ -172,29 +196,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
{
// 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);
+ mFolderRoot = createFolderRoot(root_id);
addItemID(root_id, mFolderRoot);
}
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index e9bfcb0ccf..c4f3c1b47d 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -278,6 +278,7 @@ protected:
LLFolderViewItem* buildNewViews(const LLUUID& id);
BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const;
+ virtual LLFolderView * createFolderRoot(LLUUID root_id );
virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge);
virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge);
private:
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 9225ea3d53..469656c33f 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -52,6 +52,7 @@
#include "llmenubutton.h"
#include "llplacesinventorybridge.h"
#include "llplacesinventorypanel.h"
+#include "llplacesfolderview.h"
#include "lltoggleablemenu.h"
#include "llviewermenu.h"
#include "llviewerregion.h"
diff --git a/indra/newview/llplacesfolderview.cpp b/indra/newview/llplacesfolderview.cpp
new file mode 100644
index 0000000000..3caa93ae71
--- /dev/null
+++ b/indra/newview/llplacesfolderview.cpp
@@ -0,0 +1,74 @@
+/**
+* @file llplacesfolderview.cpp
+* @brief llplacesfolderview used within llplacesinventorypanel
+* @author Gilbert@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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 "llplacesfolderview.h"
+
+#include "llplacesinventorypanel.h"
+#include "llpanellandmarks.h"
+
+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 = static_cast<LLFolderViewModelItemInventory*>(getCurSelectedItem()->getViewModelItem())->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;
+}
+
diff --git a/indra/newview/llplacesfolderview.h b/indra/newview/llplacesfolderview.h
new file mode 100644
index 0000000000..8c5be39b5e
--- /dev/null
+++ b/indra/newview/llplacesfolderview.h
@@ -0,0 +1,72 @@
+/**
+* @file llplacesfolderview.h
+* @brief llplacesfolderview used within llplacesinventorypanel
+* @author Gilbert@lindenlab.com
+*
+* $LicenseInfo:firstyear=2012&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2012, 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_LLPLACESFOLDERVIEW_H
+#define LL_LLPLACESFOLDERVIEW_H
+
+#include "llfolderview.h"
+#include "llinventorypanel.h"
+
+class LLLandmarksPanel;
+
+class LLPlacesFolderView : public LLFolderView
+{
+public:
+
+ struct Params : public LLInitParam::Block<Params, LLFolderView::Params>
+ {
+ Params()
+ {}
+ };
+
+ LLPlacesFolderView(const LLFolderView::Params& p);
+ /**
+ * Handles right mouse down
+ *
+ * Contains workaround for EXT-2786: sets current selected list for landmark
+ * panel using @c mParentLandmarksPanel which is set in @c LLLandmarksPanel::initLandmarksPanel
+ */
+ /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
+
+ void setupMenuHandle(LLInventoryType::EType asset_type, LLHandle<LLView> menu_handle);
+
+ void setParentLandmarksPanel(LLLandmarksPanel* panel)
+ {
+ mParentLandmarksPanel = panel;
+ }
+
+private:
+ /**
+ * holds pointer to landmark panel. This pointer is used in @c LLPlacesFolderView::handleRightMouseDown
+ */
+ LLLandmarksPanel* mParentLandmarksPanel;
+ typedef std::map<LLInventoryType::EType, LLHandle<LLView> > inventory_type_menu_handle_t;
+ inventory_type_menu_handle_t mMenuHandlesByInventoryType;
+
+};
+
+#endif // LL_LLPLACESFOLDERVIEW_H
+
diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp
index db3f245389..01586a4d91 100644
--- a/indra/newview/llplacesinventorypanel.cpp
+++ b/indra/newview/llplacesinventorypanel.cpp
@@ -31,7 +31,7 @@
#include "llplacesinventorypanel.h"
#include "llfolderviewmodel.h"
-#include "llfolderview.h"
+#include "llplacesfolderview.h"
#include "llinventorybridge.h"
#include "llinventoryfunctions.h"
#include "llpanellandmarks.h"
@@ -58,6 +58,34 @@ LLPlacesInventoryPanel::~LLPlacesInventoryPanel()
delete mSavedFolderState;
}
+
+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;
+
+ return LLUICtrlFactory::create<LLPlacesFolderView>(p);
+}
+
// save current folder open state
void LLPlacesInventoryPanel::saveFolderState()
{
@@ -91,59 +119,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 = static_cast<LLFolderViewModelItemInventory*>(getCurSelectedItem()->getViewModelItem())->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
diff --git a/indra/newview/llplacesinventorypanel.h b/indra/newview/llplacesinventorypanel.h
index 1544b51aed..2805fc4257 100644
--- a/indra/newview/llplacesinventorypanel.h
+++ b/indra/newview/llplacesinventorypanel.h
@@ -29,9 +29,9 @@
#include "llfloaterinventory.h"
#include "llinventorypanel.h"
-#include "llfolderview.h"
class LLLandmarksPanel;
+class LLFolderView;
class LLPlacesInventoryPanel : public LLInventoryPanel
{
@@ -46,6 +46,7 @@ public:
LLPlacesInventoryPanel(const Params& p);
~LLPlacesInventoryPanel();
+ LLFolderView * createFolderRoot(LLUUID root_id );
void saveFolderState();
void restoreFolderState();
@@ -55,34 +56,4 @@ private:
LLSaveFolderState* mSavedFolderState;
};
-//TODO RN: this class is currently unused, make sure that behavior remains
-class LLPlacesFolderView : public LLFolderView
-{
-public:
- LLPlacesFolderView(const LLFolderView::Params& p);
- /**
- * Handles right mouse down
- *
- * Contains workaround for EXT-2786: sets current selected list for landmark
- * panel using @c mParentLandmarksPanel which is set in @c LLLandmarksPanel::initLandmarksPanel
- */
- /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
-
- void setupMenuHandle(LLInventoryType::EType asset_type, LLHandle<LLView> menu_handle);
-
- void setParentLandmarksPanel(LLLandmarksPanel* panel)
- {
- mParentLandmarksPanel = panel;
- }
-
-private:
- /**
- * holds pointer to landmark panel. This pointer is used in @c LLPlacesFolderView::handleRightMouseDown
- */
- LLLandmarksPanel* mParentLandmarksPanel;
- typedef std::map<LLInventoryType::EType, LLHandle<LLView> > inventory_type_menu_handle_t;
- inventory_type_menu_handle_t mMenuHandlesByInventoryType;
-
-};
-
#endif //LL_LLINVENTORYSUBTREEPANEL_H