From 776dde83ed99c313760d11b4c6b8dbd3287daee5 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Tue, 22 Feb 2011 15:24:55 +0200 Subject: STORM-889 FIXED Put Link/Unlink in Edit Panel - Moved callbacks for Link/Unlink to the LLSelectMgr - Binded Link/Unlink callbacks with buttons in Build Floater - Replaced view_listener_t usage for Link, Unlink, EnableLink, EnableUnlink with boost::bind --- indra/newview/llfloatertools.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatertools.cpp') diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 370bf05bf7..364fbad193 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -220,6 +220,8 @@ BOOL LLFloaterTools::postBuild() mRadioGroupEdit = getChild("edit_radio_group"); mBtnGridOptions = getChild("Options..."); mTitleMedia = getChild("title_media"); + mBtnLink = getChild("link_btn"); + mBtnUnlink = getChild("unlink_btn"); mCheckSelectIndividual = getChild("checkbox edit linked parts"); getChild("checkbox edit linked parts")->setValue((BOOL)gSavedSettings.getBOOL("EditLinkedParts")); @@ -315,6 +317,9 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) mBtnRotateReset(NULL), mBtnRotateRight(NULL), + mBtnLink(NULL), + mBtnUnlink(NULL), + mBtnDelete(NULL), mBtnDuplicate(NULL), mBtnDuplicateInPlace(NULL), @@ -341,7 +346,7 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) mNeedMediaTitle(TRUE) { gFloaterTools = this; - + setAutoFocus(FALSE); mFactoryMap["General"] = LLCallbackMap(createPanelPermissions, this);//LLPanelPermissions mFactoryMap["Object"] = LLCallbackMap(createPanelObject, this);//LLPanelObject @@ -366,6 +371,9 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) mCommitCallbackRegistrar.add("BuildTool.DeleteMedia", boost::bind(&LLFloaterTools::onClickBtnDeleteMedia,this)); mCommitCallbackRegistrar.add("BuildTool.EditMedia", boost::bind(&LLFloaterTools::onClickBtnEditMedia,this)); + mCommitCallbackRegistrar.add("BuildTool.LinkObjects", boost::bind(&LLSelectMgr::linkObjects, LLSelectMgr::getInstance())); + mCommitCallbackRegistrar.add("BuildTool.UnlinkObjects", boost::bind(&LLSelectMgr::unlinkObjects, LLSelectMgr::getInstance())); + } LLFloaterTools::~LLFloaterTools() @@ -566,6 +574,12 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) bool linked_parts = gSavedSettings.getBOOL("EditLinkedParts"); getChildView("RenderingCost")->setVisible( !linked_parts && (edit_visible || focus_visible || move_visible) && sShowObjectCost); + mBtnLink->setVisible(edit_visible); + mBtnUnlink->setVisible(edit_visible); + + mBtnLink->setEnabled(LLSelectMgr::instance().enableLinkObjects()); + mBtnUnlink->setEnabled(LLSelectMgr::instance().enableUnlinkObjects()); + if (mCheckSelectIndividual) { mCheckSelectIndividual->setVisible(edit_visible); -- cgit v1.2.3