summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llnavigationbar.cpp2
-rw-r--r--indra/newview/llpanelobjectinventory.cpp2
-rw-r--r--indra/newview/llselectmgr.cpp29
-rw-r--r--indra/newview/llviewermenu.cpp32
4 files changed, 44 insertions, 21 deletions
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
index 9797c01371..08bc1fac8b 100644
--- a/indra/newview/llnavigationbar.cpp
+++ b/indra/newview/llnavigationbar.cpp
@@ -127,7 +127,6 @@ LLTeleportHistoryMenuItem::LLTeleportHistoryMenuItem(const Params& p)
if (p.item_type == TYPE_BACKWARD)
{
setFont( p.back_item_font );
- setLabel(std::string(" ") + std::string(p.label));
}
else if (p.item_type == TYPE_CURRENT)
{
@@ -136,7 +135,6 @@ LLTeleportHistoryMenuItem::LLTeleportHistoryMenuItem(const Params& p)
else
{
setFont( p.forward_item_font );
- setLabel(std::string(" ") + std::string(p.label));
}
LLIconCtrl::Params icon_params;
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index 4f8aff6f78..9d38dab26e 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -1697,7 +1697,7 @@ void LLPanelObjectInventory::updateInventory()
mFolders->requestArrange();
mInventoryNeedsUpdate = FALSE;
- LLEditMenuHandler::gEditMenuHandler = mFolders;
+ // Edit menu handler is set in onFocusReceived
}
// *FIX: This is currently a very expensive operation, because we have
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 1605838b94..4d6c19157a 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -104,6 +104,7 @@ const F32 SILHOUETTE_UPDATE_THRESHOLD_SQUARED = 0.02f;
const S32 MAX_ACTION_QUEUE_SIZE = 20;
const S32 MAX_SILS_PER_FRAME = 50;
const S32 MAX_OBJECTS_PER_PACKET = 254;
+const S32 TE_SELECT_MASK_ALL = 0xFFFFFFFF;
//
// Globals
@@ -5110,7 +5111,7 @@ LLSelectNode::~LLSelectNode()
void LLSelectNode::selectAllTEs(BOOL b)
{
- mTESelectMask = b ? 0xFFFFFFFF : 0x0;
+ mTESelectMask = b ? TE_SELECT_MASK_ALL : 0x0;
mLastTESelected = 0;
}
@@ -5753,8 +5754,22 @@ void LLSelectMgr::redo()
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::canDoDelete() const
{
- // Note: Can only delete root objects (see getFirstDeleteableObject() for more info)
- return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstDeleteableObject() != NULL; // HACK: casting away constness - MG
+ bool can_delete = false;
+ // This function is "logically const" - it does not change state in
+ // a way visible outside the selection manager.
+ LLSelectMgr* self = const_cast<LLSelectMgr*>(this);
+ LLViewerObject* obj = self->mSelectedObjects->getFirstDeleteableObject();
+ // Note: Can only delete root objects (see getFirstDeleteableObject() for more info)
+ if (obj!= NULL)
+ {
+ // all the faces needs to be selected
+ if(self->mSelectedObjects->contains(obj,SELECT_ALL_TES ))
+ {
+ can_delete = true;
+ }
+ }
+
+ return can_delete;
}
//-----------------------------------------------------------------------------
@@ -6189,8 +6204,14 @@ BOOL LLObjectSelection::contains(LLViewerObject* object, S32 te)
LLSelectNode* nodep = *iter;
if (nodep->getObject() == object)
{
+ // Optimization
+ if (nodep->getTESelectMask() == TE_SELECT_MASK_ALL)
+ {
+ return TRUE;
+ }
+
BOOL all_selected = TRUE;
- for (S32 i = 0; i < SELECT_MAX_TES; i++)
+ for (S32 i = 0; i < object->getNumTEs(); i++)
{
all_selected = all_selected && nodep->isTESelected(i);
}
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 86c29c388e..8090096944 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -2698,20 +2698,24 @@ BOOL enable_has_attachments(void*)
bool enable_object_mute()
{
LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
- bool new_value = (object != NULL);
- if (new_value)
- {
- LLVOAvatar* avatar = find_avatar_from_object(object);
- if (avatar)
- {
- // It's an avatar
- LLNameValue *lastname = avatar->getNVPair("LastName");
- BOOL is_linden = lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden");
- BOOL is_self = avatar->isSelf();
- new_value = !is_linden && !is_self;
- }
- }
- return new_value;
+ if (!object) return false;
+
+ LLVOAvatar* avatar = find_avatar_from_object(object);
+ if (avatar)
+ {
+ // It's an avatar
+ LLNameValue *lastname = avatar->getNVPair("LastName");
+ bool is_linden =
+ lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden");
+ bool is_self = avatar->isSelf();
+ return !is_linden && !is_self;
+ }
+ else
+ {
+ // Just a regular object
+ return LLSelectMgr::getInstance()->getSelection()->
+ contains( object, SELECT_ALL_TES );
+ }
}
class LLObjectMute : public view_listener_t