aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatertools.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-10-18 17:58:27 -0700
committerMcCabe Maxsted2009-10-18 17:58:27 -0700
commite4b0e7c82d670081c071d8a3da31b5ec407b8e07 (patch)
tree9410962bbb582eedbec448139e217f2714050777 /linden/indra/newview/llfloatertools.cpp
parentStarted 1.3.0 branch (diff)
parentUpdated and added some Linux libs. (diff)
downloadmeta-impy-e4b0e7c82d670081c071d8a3da31b5ec407b8e07.zip
meta-impy-e4b0e7c82d670081c071d8a3da31b5ec407b8e07.tar.gz
meta-impy-e4b0e7c82d670081c071d8a3da31b5ec407b8e07.tar.bz2
meta-impy-e4b0e7c82d670081c071d8a3da31b5ec407b8e07.tar.xz
Merged working branch of 1.2 into LL 1.23 merge
Diffstat (limited to 'linden/indra/newview/llfloatertools.cpp')
-rw-r--r--linden/indra/newview/llfloatertools.cpp50
1 files changed, 41 insertions, 9 deletions
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp
index 443f684..a37663e 100644
--- a/linden/indra/newview/llfloatertools.cpp
+++ b/linden/indra/newview/llfloatertools.cpp
@@ -663,6 +663,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
663 if (mBtnLink) mBtnLink->setVisible( edit_visible ); 663 if (mBtnLink) mBtnLink->setVisible( edit_visible );
664 if (mBtnUnlink) mBtnUnlink->setVisible( edit_visible ); 664 if (mBtnUnlink) mBtnUnlink->setVisible( edit_visible );
665 665
666 //TODO: Move these into llselectmgr
666 // Check to see if we can link things 667 // Check to see if we can link things
667 bool can_link = false; 668 bool can_link = false;
668 if (!gSavedSettings.getBOOL("EditLinkedParts")) 669 if (!gSavedSettings.getBOOL("EditLinkedParts"))
@@ -685,14 +686,44 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
685 686
686 // Check to see if we can unlink things 687 // Check to see if we can unlink things
687 bool can_unlink = false; 688 bool can_unlink = false;
688 if (LLSelectMgr::getInstance()->selectGetAllRootsValid() && 689 if (tool != LLToolFace::getInstance())
689 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
690 !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment())
691 { 690 {
692 if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 691 if (LLSelectMgr::getInstance()->selectGetAllRootsValid() &&
693 LLSelectMgr::getInstance()->getSelection()->getObjectCount()) 692 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
693 !LLSelectMgr::getInstance()->getSelection()->isAttachment())
694 { 694 {
695 can_unlink = true; 695 // LL's viewer unlinks the last linkset selected,
696 // regardless of how many linksets or prims are selected total.
697 // Preserve that behavior when enabling the unlink option.
698 if (gSavedSettings.getBOOL("EditLinkedParts"))
699 {
700 struct f : public LLSelectedNodeFunctor
701 {
702 virtual bool apply(LLSelectNode* pNode)
703 {
704 // Return the first selection node that is
705 // 1) not a root prim
706 // 2) or a root prim that has child prims
707 // or in other words: any prim that is part of a linkset
708 return (pNode->getObject() != pNode->getObject()->getRootEdit()) ||
709 (pNode->getObject()->numChildren() != 0);
710 }
711 } func;
712
713 if (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(&func, TRUE))
714 {
715 // the selection contains at least one prim (child or root) that is part of a linkset
716 can_unlink = true;
717 }
718 }
719 else
720 {
721 if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() !=
722 LLSelectMgr::getInstance()->getSelection()->getObjectCount())
723 {
724 can_unlink = true;
725 }
726 }
696 } 727 }
697 } 728 }
698 mBtnUnlink->setEnabled(can_unlink); 729 mBtnUnlink->setEnabled(can_unlink);
@@ -1035,15 +1066,15 @@ void LLFloaterTools::onFocusReceived()
1035 1066
1036void LLFloaterTools::updateTreeGrassCombo(bool visible) 1067void LLFloaterTools::updateTreeGrassCombo(bool visible)
1037{ 1068{
1069 LLTextBox* tree_grass_label = getChild<LLTextBox>("tree_grass_label");
1038 if (visible) 1070 if (visible)
1039 { 1071 {
1040 LLPCode pcode = LLToolPlacer::getObjectType(); 1072 LLPCode pcode = LLToolPlacer::getObjectType();
1041 std::map<std::string, S32>::iterator it, end; 1073 std::map<std::string, S32>::iterator it, end;
1042 std::string selected; 1074 std::string selected;
1043 LLTextBox* tree_grass_label = getChild<LLTextBox>("tree_grass_label");
1044 if (pcode == LLToolPlacerPanel::sTree) 1075 if (pcode == LLToolPlacerPanel::sTree)
1045 { 1076 {
1046 tree_grass_label->setVisible(true); 1077 tree_grass_label->setVisible(visible);
1047 LLButton* button = getChild<LLButton>("ToolTree"); 1078 LLButton* button = getChild<LLButton>("ToolTree");
1048 tree_grass_label->setText(button->getToolTip()); 1079 tree_grass_label->setText(button->getToolTip());
1049 1080
@@ -1053,7 +1084,7 @@ void LLFloaterTools::updateTreeGrassCombo(bool visible)
1053 } 1084 }
1054 else if (pcode == LLToolPlacerPanel::sGrass) 1085 else if (pcode == LLToolPlacerPanel::sGrass)
1055 { 1086 {
1056 tree_grass_label->setVisible(true); 1087 tree_grass_label->setVisible(visible);
1057 LLButton* button = getChild<LLButton>("ToolGrass"); 1088 LLButton* button = getChild<LLButton>("ToolGrass");
1058 tree_grass_label->setText(button->getToolTip()); 1089 tree_grass_label->setText(button->getToolTip());
1059 1090
@@ -1089,6 +1120,7 @@ void LLFloaterTools::updateTreeGrassCombo(bool visible)
1089 } 1120 }
1090 1121
1091 mComboTreesGrass->setVisible(visible); 1122 mComboTreesGrass->setVisible(visible);
1123 tree_grass_label->setVisible(visible);
1092} 1124}
1093 1125
1094// static 1126// static