summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/llview.h3
-rw-r--r--indra/newview/llfolderview.cpp3
-rw-r--r--indra/newview/llinventorybridge.cpp34
-rw-r--r--indra/newview/llinventoryfunctions.cpp20
4 files changed, 46 insertions, 14 deletions
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 9ff6a4e1a0..aba6c310f1 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -310,7 +310,8 @@ public:
void pushVisible(BOOL visible) { mLastVisible = mVisible; setVisible(visible); }
void popVisible() { setVisible(mLastVisible); }
-
+ BOOL getLastVisible() const { return mLastVisible; }
+
LLHandle<LLView> getHandle() { mHandle.bind(this); return mHandle; }
U32 getFollows() const { return mReshapeFlags; }
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index f241d18a21..87c5a830e9 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1868,7 +1868,8 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
LLView::child_list_t::const_iterator menu_itor;
for (menu_itor = list->begin(); menu_itor != list->end(); ++menu_itor)
{
- (*menu_itor)->setVisible(TRUE);
+ (*menu_itor)->setVisible(FALSE);
+ (*menu_itor)->pushVisible(TRUE);
(*menu_itor)->setEnabled(TRUE);
}
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index bc28140b75..2cc61a69c1 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -452,13 +452,15 @@ void hide_context_entries(LLMenuGL& menu,
// if the first element is a separator, it will not be shown.
BOOL is_previous_entry_separator = TRUE;
- LLView::child_list_t::const_iterator itor;
- for (itor = list->begin(); itor != list->end(); ++itor)
+ for (LLView::child_list_t::const_iterator itor = list->begin();
+ itor != list->end();
+ ++itor)
{
- std::string name = (*itor)->getName();
+ LLView *menu_item = (*itor);
+ std::string name = menu_item->getName();
// descend into split menus:
- LLMenuItemBranchGL* branchp = dynamic_cast<LLMenuItemBranchGL*>(*itor);
+ LLMenuItemBranchGL* branchp = dynamic_cast<LLMenuItemBranchGL*>(menu_item);
if ((name == "More") && branchp)
{
hide_context_entries(*branchp->getBranch(), entries_to_show, disabled_entries);
@@ -479,7 +481,7 @@ void hide_context_entries(LLMenuGL& menu,
// between two separators).
if (found)
{
- const BOOL is_entry_separator = (dynamic_cast<LLMenuItemSeparatorGL *>(*itor) != NULL);
+ const BOOL is_entry_separator = (dynamic_cast<LLMenuItemSeparatorGL *>(menu_item) != NULL);
if (is_entry_separator && is_previous_entry_separator)
found = false;
is_previous_entry_separator = is_entry_separator;
@@ -487,16 +489,23 @@ void hide_context_entries(LLMenuGL& menu,
if (!found)
{
- (*itor)->setVisible(FALSE);
+ if (!menu_item->getLastVisible())
+ {
+ menu_item->setVisible(FALSE);
+ }
+ menu_item->setEnabled(FALSE);
}
else
{
- (*itor)->setVisible(TRUE);
+ menu_item->setVisible(TRUE);
+ // A bit of a hack so we can remember that some UI element explicitly set this to be visible
+ // so that some other UI element from multi-select doesn't later set this invisible.
+ menu_item->pushVisible(TRUE);
for (itor2 = disabled_entries.begin(); itor2 != disabled_entries.end(); ++itor2)
{
if (*itor2 == name)
{
- (*itor)->setEnabled(FALSE);
+ menu_item->setEnabled(FALSE);
}
}
}
@@ -3730,6 +3739,9 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
disabled_items.push_back(std::string("Share"));
}
+ addOpenRightClickMenuOption(items);
+ items.push_back(std::string("Properties"));
+
getClipboardEntries(true, items, disabled_items, flags);
items.push_back(std::string("Gesture Separator"));
@@ -4379,7 +4391,6 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
can_open = FALSE;
}
-
items.push_back(std::string("Share"));
if (!canShare())
{
@@ -4390,6 +4401,11 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
addOpenRightClickMenuOption(items);
}
+ else
+ {
+ disabled_items.push_back(std::string("Open"));
+ disabled_items.push_back(std::string("Open Original"));
+ }
items.push_back(std::string("Properties"));
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 7e9a2cb716..7463658003 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -323,7 +323,9 @@ BOOL get_is_item_removable(const LLInventoryModel* model, const LLUUID& id)
BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id)
{
- // This function doesn't check the folder's children.
+ // NOTE: This function doesn't check the folder's children.
+ // See LLFolderBridge::isItemRemovable for a function that does
+ // consider the children.
if (!model)
{
@@ -337,17 +339,29 @@ BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id)
if (!isAgentAvatarValid()) return FALSE;
- LLInventoryCategory* category = model->getCategory(id);
+ const LLInventoryCategory* category = model->getCategory(id);
if (!category)
{
return FALSE;
}
- if (LLFolderType::lookupIsProtectedType(category->getPreferredType()))
+ const LLFolderType::EType folder_type = category->getPreferredType();
+
+ if (LLFolderType::lookupIsProtectedType(folder_type))
{
return FALSE;
}
+ // Can't delete the outfit that is currently being worn.
+ if (folder_type == LLFolderType::FT_OUTFIT)
+ {
+ const LLViewerInventoryItem *base_outfit_link = LLAppearanceMgr::instance().getBaseOutfitLink();
+ if (base_outfit_link && (category == base_outfit_link->getLinkedCategory()))
+ {
+ return FALSE;
+ }
+ }
+
return TRUE;
}