diff options
Diffstat (limited to 'indra/newview/llfloateropenobject.cpp')
-rw-r--r-- | indra/newview/llfloateropenobject.cpp | 87 |
1 files changed, 27 insertions, 60 deletions
diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp index 71bfae316a..8b6619def2 100644 --- a/indra/newview/llfloateropenobject.cpp +++ b/indra/newview/llfloateropenobject.cpp @@ -2,31 +2,25 @@ * @file llfloateropenobject.cpp * @brief LLFloaterOpenObject class implementation * - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * - * Copyright (c) 2004-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2004&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -62,7 +56,6 @@ LLFloaterOpenObject::LLFloaterOpenObject(const LLSD& key) mPanelInventoryObject(NULL), mDirty(TRUE) { -// LLUICtrlFactory::getInstance()->buildFloater(this,"floater_openobject.xml"); mCommitCallbackRegistrar.add("OpenObject.MoveToInventory", boost::bind(&LLFloaterOpenObject::onClickMoveToInventory, this)); mCommitCallbackRegistrar.add("OpenObject.MoveAndWear", boost::bind(&LLFloaterOpenObject::onClickMoveAndWear, this)); } @@ -75,7 +68,7 @@ LLFloaterOpenObject::~LLFloaterOpenObject() // virtual BOOL LLFloaterOpenObject::postBuild() { - childSetTextArg("object_name", "[DESC]", std::string("Object") ); // *Note: probably do not want to translate this + getChild<LLUICtrl>("object_name")->setTextArg("[DESC]", std::string("Object") ); // *Note: probably do not want to translate this mPanelInventoryObject = getChild<LLPanelObjectInventory>("object_contents"); refresh(); @@ -105,49 +98,23 @@ void LLFloaterOpenObject::refresh() mPanelInventoryObject->refresh(); std::string name = ""; - - // Enable the copy || copy & wear buttons only if we have something we can copy or copy & wear (respectively). - bool copy_enabled = false; - bool wear_enabled = false; + BOOL enabled = FALSE; LLSelectNode* node = mObjectSelection->getFirstRootNode(); if (node) { name = node->mName; - copy_enabled = true; - - LLViewerObject* object = node->getObject(); - if (object) - { - // this folder is coming from an object, as there is only one folder in an object, the root, - // we need to collect the entire contents and handle them as a group - LLInventoryObject::object_list_t inventory_objects; - object->getInventoryContents(inventory_objects); - - if (!inventory_objects.empty()) - { - for (LLInventoryObject::object_list_t::iterator it = inventory_objects.begin(); - it != inventory_objects.end(); - ++it) - { - LLInventoryItem* item = static_cast<LLInventoryItem*> ((LLInventoryObject*)(*it)); - LLInventoryType::EType type = item->getInventoryType(); - if (type == LLInventoryType::IT_OBJECT - || type == LLInventoryType::IT_ATTACHMENT - || type == LLInventoryType::IT_WEARABLE - || type == LLInventoryType::IT_GESTURE) - { - wear_enabled = true; - break; - } - } - } - } + enabled = TRUE; } - - childSetTextArg("object_name", "[DESC]", name); - childSetEnabled("copy_to_inventory_button", copy_enabled); - childSetEnabled("copy_and_wear_button", wear_enabled); + else + { + name = ""; + enabled = FALSE; + } + + getChild<LLUICtrl>("object_name")->setTextArg("[DESC]", name); + getChildView("copy_to_inventory_button")->setEnabled(enabled); + getChildView("copy_and_wear_button")->setEnabled(enabled); } |