summaryrefslogtreecommitdiff
path: root/indra/newview/llwearableitemslist.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-05-20 14:54:34 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-05-20 14:54:34 +0300
commitd634239bac4ee94d96a17b4ba68015c9f90b727a (patch)
tree46e0e07cdc51165e2a7723a270e1c678a6afb23d /indra/newview/llwearableitemslist.cpp
parent8c83a6ca620c46a7df23ab6e567bfb29dc98d1a7 (diff)
EXT-6726 WIP Added stubs for most of Appearance SP context/gear menus.
Shared code with avatar lists context menus. Reviewed by Mike Antipov and Nyx at https://codereview.productengine.com/secondlife/r/415/ --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llwearableitemslist.cpp')
-rw-r--r--indra/newview/llwearableitemslist.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index b209dfecce..5836252eac 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -35,8 +35,10 @@
#include "lliconctrl.h"
+#include "llagentwearables.h"
#include "llinventoryfunctions.h"
#include "llinventorymodel.h"
+#include "llmenugl.h" // for LLContextMenu
#include "lltransutil.h"
class LLFindOutfitItems : public LLInventoryCollectFunctor
@@ -377,12 +379,17 @@ static const LLWearableItemTypeNameComparator WEARABLE_TYPE_NAME_COMPARATOR;
static const LLDefaultChildRegistry::Register<LLWearableItemsList> r("wearable_items_list");
LLWearableItemsList::Params::Params()
+: use_internal_context_menu("use_internal_context_menu", true)
{}
LLWearableItemsList::LLWearableItemsList(const LLWearableItemsList::Params& p)
: LLInventoryItemsList(p)
{
setComparator(&WEARABLE_TYPE_NAME_COMPARATOR);
+ if (p.use_internal_context_menu)
+ {
+ setRightMouseDownCallback(boost::bind(&LLWearableItemsList::onRightClick, this, _2, _3));
+ }
}
// virtual
@@ -406,4 +413,27 @@ void LLWearableItemsList::updateList(const LLUUID& category_id)
refreshList(item_array);
}
+void LLWearableItemsList::onRightClick(S32 x, S32 y)
+{
+ uuid_vec_t selected_uuids;
+
+ getSelectedUUIDs(selected_uuids);
+ if (selected_uuids.empty())
+ {
+ return;
+ }
+
+ ContextMenu::instance().show(this, selected_uuids, x, y);
+}
+
+//////////////////////////////////////////////////////////////////////////
+/// ContextMenu
+//////////////////////////////////////////////////////////////////////////
+
+// virtual
+LLContextMenu* LLWearableItemsList::ContextMenu::createMenu()
+{
+ return createFromFile("menu_wearable_list_item.xml");
+}
+
// EOF