aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-09-30 15:24:29 -0700
committerMcCabe Maxsted2009-09-30 18:57:37 -0700
commit34b9ef2f04a6e48bf31d130497dfe83e20a12b68 (patch)
tree17203f62657a9fd57c72cb3e38198de73ce65092 /linden/indra
parentFixed Join Call button truncated in group IMs (regression) (diff)
downloadmeta-impy-34b9ef2f04a6e48bf31d130497dfe83e20a12b68.zip
meta-impy-34b9ef2f04a6e48bf31d130497dfe83e20a12b68.tar.gz
meta-impy-34b9ef2f04a6e48bf31d130497dfe83e20a12b68.tar.bz2
meta-impy-34b9ef2f04a6e48bf31d130497dfe83e20a12b68.tar.xz
Fixed Unlink not enabling when Edit Linked Parts enabled
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/newview/llfloatertools.cpp44
-rw-r--r--linden/indra/newview/llviewermenu.cpp44
2 files changed, 74 insertions, 14 deletions
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp
index d2a8040..4aca133 100644
--- a/linden/indra/newview/llfloatertools.cpp
+++ b/linden/indra/newview/llfloatertools.cpp
@@ -667,6 +667,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
667 if (mBtnLink) mBtnLink->setVisible( edit_visible ); 667 if (mBtnLink) mBtnLink->setVisible( edit_visible );
668 if (mBtnUnlink) mBtnUnlink->setVisible( edit_visible ); 668 if (mBtnUnlink) mBtnUnlink->setVisible( edit_visible );
669 669
670 //TODO: Move these into llselectmgr
670 // Check to see if we can link things 671 // Check to see if we can link things
671 bool can_link = false; 672 bool can_link = false;
672 if (!gSavedSettings.getBOOL("EditLinkedParts")) 673 if (!gSavedSettings.getBOOL("EditLinkedParts"))
@@ -689,15 +690,44 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
689 690
690 // Check to see if we can unlink things 691 // Check to see if we can unlink things
691 bool can_unlink = false; 692 bool can_unlink = false;
692 if (LLSelectMgr::getInstance()->selectGetAllRootsValid() && 693 if (tool != LLToolFace::getInstance())
693 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
694 !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment())
695 { 694 {
696 if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() > 0 && 695 if (LLSelectMgr::getInstance()->selectGetAllRootsValid() &&
697 LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 696 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
698 LLSelectMgr::getInstance()->getSelection()->getObjectCount()) 697 !LLSelectMgr::getInstance()->getSelection()->isAttachment())
699 { 698 {
700 can_unlink = true; 699 // LL's viewer unlinks the last linkset selected,
700 // regardless of how many linksets or prims are selected total.
701 // Preserve that behavior when enabling the unlink option.
702 if (gSavedSettings.getBOOL("EditLinkedParts"))
703 {
704 struct f : public LLSelectedNodeFunctor
705 {
706 virtual bool apply(LLSelectNode* pNode)
707 {
708 // Return the first selection node that is
709 // 1) not a root prim
710 // 2) or a root prim that has child prims
711 // or in other words: any prim that is part of a linkset
712 return (pNode->getObject() != pNode->getObject()->getRootEdit()) ||
713 (pNode->getObject()->numChildren() != 0);
714 }
715 } func;
716
717 if (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(&func, TRUE))
718 {
719 // the selection contains at least one prim (child or root) that is part of a linkset
720 can_unlink = true;
721 }
722 }
723 else
724 {
725 if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() !=
726 LLSelectMgr::getInstance()->getSelection()->getObjectCount())
727 {
728 can_unlink = true;
729 }
730 }
701 } 731 }
702 } 732 }
703 mBtnUnlink->setEnabled(can_unlink); 733 mBtnUnlink->setEnabled(can_unlink);
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index ba24c16..f9ae401 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -169,6 +169,7 @@
169#include "lltool.h" 169#include "lltool.h"
170#include "lltoolbar.h" 170#include "lltoolbar.h"
171#include "lltoolcomp.h" 171#include "lltoolcomp.h"
172#include "lltoolface.h"
172#include "lltoolfocus.h" 173#include "lltoolfocus.h"
173#include "lltoolgrab.h" 174#include "lltoolgrab.h"
174#include "lltoolmgr.h" 175#include "lltoolmgr.h"
@@ -4594,15 +4595,44 @@ class LLToolsEnableUnlink : public view_listener_t
4594 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4595 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4595 { 4596 {
4596 bool new_value = false; 4597 bool new_value = false;
4597 if (LLSelectMgr::getInstance()->selectGetAllRootsValid() && 4598 if (LLToolMgr::getInstance()->getCurrentTool() != LLToolFace::getInstance())
4598 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
4599 !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment())
4600 { 4599 {
4601 if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() > 0 && 4600 if (LLSelectMgr::getInstance()->selectGetAllRootsValid() &&
4602 LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 4601 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
4603 LLSelectMgr::getInstance()->getSelection()->getObjectCount()) 4602 !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment())
4604 { 4603 {
4605 new_value = true; 4604 // LL's viewer unlinks the last linkset selected,
4605 // regardless of how many linksets or prims are selected total.
4606 // Preserve that behavior when enabling the unlink option.
4607 if (gSavedSettings.getBOOL("EditLinkedParts"))
4608 {
4609 struct f : public LLSelectedNodeFunctor
4610 {
4611 virtual bool apply(LLSelectNode* pNode)
4612 {
4613 // Return the first selection node that is
4614 // 1) not a root prim
4615 // 2) or a root prim that has child prims
4616 // or in other words: any prim that is part of a linkset
4617 return (pNode->getObject() != pNode->getObject()->getRootEdit()) ||
4618 (pNode->getObject()->numChildren() != 0);
4619 }
4620 } func;
4621
4622 if (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(&func, TRUE))
4623 {
4624 // the selection contains at least one prim (child or root) that is part of a linkset
4625 new_value = true;
4626 }
4627 }
4628 else
4629 {
4630 if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() !=
4631 LLSelectMgr::getInstance()->getSelection()->getObjectCount())
4632 {
4633 new_value = true;
4634 }
4635 }
4606 } 4636 }
4607 } 4637 }
4608 4638