From b7d020e744e69749dc946ce63fdb18d613a18e0a Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 3 Nov 2009 16:28:52 -0500 Subject: EXT-2168 : Rename ObjectInfo to ItemInfo Renaming for better clarity as to what llsidepaneliteminfo does. Also fixed an error where Edit was not enabling the panel. Also did some superficial cleanup and reorganization of llsidepanel- files. --HG-- branch : avatar-pipeline --- indra/newview/llsidepanelinventory.cpp | 481 ++++++++++++++++----------------- 1 file changed, 237 insertions(+), 244 deletions(-) (limited to 'indra/newview/llsidepanelinventory.cpp') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 3cf17fb7f2..dbe7e9fec6 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -1,244 +1,237 @@ -/** - * @file LLSidepanelInventory.cpp - * @brief Side Bar "Inventory" panel - * - * $LicenseInfo:firstyear=2009&license=viewergpl$ - * - * Copyright (c) 2004-2009, Linden Research, Inc. - * - * 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 - * - * 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 - * - * 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. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" -#include "llsidepanelinventory.h" - -#include "llagent.h" -#include "llbutton.h" -#include "llinventorybridge.h" -#include "llinventorypanel.h" -#include "llpanelmaininventory.h" -#include "llsidepanelobjectinfo.h" -#include "lltabcontainer.h" - -static const S32 LANDMARK_FOLDERS_MENU_WIDTH = 250; -static const std::string AGENT_INFO_TYPE = "agent"; -static const std::string CREATE_LANDMARK_INFO_TYPE = "create_landmark"; -static const std::string LANDMARK_INFO_TYPE = "landmark"; -static const std::string REMOTE_PLACE_INFO_TYPE = "remote_place"; -static const std::string TELEPORT_HISTORY_INFO_TYPE = "teleport_history"; - -static LLRegisterPanelClassWrapper t_inventory("sidepanel_inventory"); - -LLSidepanelInventory::LLSidepanelInventory() - : LLPanel(), - mSidepanelObjectInfo(NULL) -{ - - //LLUICtrlFactory::getInstance()->buildPanel(this, "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() -} - -LLSidepanelInventory::~LLSidepanelInventory() -{ -} - -BOOL LLSidepanelInventory::postBuild() -{ - mInfoBtn = getChild("info_btn"); - mInfoBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onInfoButtonClicked, this)); - - mShareBtn = getChild("share_btn"); - mShareBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onShareButtonClicked, this)); - - mShareBtn = getChild("share_btn"); - mShareBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onShareButtonClicked, this)); - - mWearBtn = getChild("wear_btn"); - mWearBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onWearButtonClicked, this)); - - mPlayBtn = getChild("play_btn"); - mPlayBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onPlayButtonClicked, this)); - - mTeleportBtn = getChild("teleport_btn"); - mTeleportBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onTeleportButtonClicked, this)); - - mOverflowBtn = getChild("overflow_btn"); - mOverflowBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onOverflowButtonClicked, this)); - - mTabContainer = getChild("Inventory Tabs"); - mSidepanelObjectInfo = getChild("sidepanel_object_info"); - - mPanelMainInventory = getChild("panel_main_inventory"); - mPanelMainInventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2)); - - LLButton* back_btn = mSidepanelObjectInfo->getChild("back_btn"); - back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); - - return TRUE; -} - -void LLSidepanelInventory::onOpen(const LLSD& key) -{ - if(key.size() == 0) - return; - - mSidepanelObjectInfo->reset(); - - if (key.has("id")) - { - mSidepanelObjectInfo->setItemID(key["id"].asUUID()); - } - - if (key.has("object")) - { - mSidepanelObjectInfo->setObjectID(key["object"].asUUID()); - } - - toggleObjectInfoPanel(TRUE); -} - -void LLSidepanelInventory::onInfoButtonClicked() -{ - LLInventoryItem *item = getSelectedItem(); - if (item) - { - mSidepanelObjectInfo->reset(); - mSidepanelObjectInfo->setItemID(item->getUUID()); - toggleObjectInfoPanel(TRUE); - } -} - -void LLSidepanelInventory::onShareButtonClicked() -{ -} - -void LLSidepanelInventory::performActionOnSelection(const std::string &action) -{ - LLInventoryPanel *panel = mPanelMainInventory->getActivePanel(); - LLFolderViewItem* current_item = panel->getRootFolder()->getCurSelectedItem(); - if (!current_item) - { - return; - } - current_item->getListener()->performAction(panel->getRootFolder(), panel->getModel(), action); -} - -void LLSidepanelInventory::onWearButtonClicked() -{ - performActionOnSelection("wear"); - performActionOnSelection("attach"); -} - -void LLSidepanelInventory::onPlayButtonClicked() -{ - performActionOnSelection("activate"); -} - -void LLSidepanelInventory::onTeleportButtonClicked() -{ - performActionOnSelection("teleport"); -} - -void LLSidepanelInventory::onOverflowButtonClicked() -{ -} - -void LLSidepanelInventory::onBackButtonClicked() -{ - toggleObjectInfoPanel(FALSE); - updateVerbs(); -} - -void LLSidepanelInventory::onSelectionChange(const std::deque &items, BOOL user_action) -{ - updateVerbs(); -} - -void LLSidepanelInventory::toggleObjectInfoPanel(BOOL visible) -{ - mSidepanelObjectInfo->setVisible(visible); - mTabContainer->setVisible(!visible); - - if (visible) - { - mSidepanelObjectInfo->reset(); - mSidepanelObjectInfo->setEditMode(FALSE); - - LLRect rect = getRect(); - LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom); - mSidepanelObjectInfo->reshape(new_rect.getWidth(),new_rect.getHeight()); - } -} - -void LLSidepanelInventory::updateVerbs() -{ - mInfoBtn->setEnabled(FALSE); - mShareBtn->setEnabled(FALSE); - - mWearBtn->setVisible(FALSE); - mWearBtn->setEnabled(FALSE); - mPlayBtn->setVisible(FALSE); - mPlayBtn->setEnabled(FALSE); - mTeleportBtn->setVisible(FALSE); - mTeleportBtn->setEnabled(FALSE); - - const LLInventoryItem *item = getSelectedItem(); - if (!item) - return; - - mInfoBtn->setEnabled(TRUE); - mShareBtn->setEnabled(TRUE); - - switch(item->getInventoryType()) - { - case LLInventoryType::IT_WEARABLE: - case LLInventoryType::IT_OBJECT: - case LLInventoryType::IT_ATTACHMENT: - mWearBtn->setVisible(TRUE); - mWearBtn->setEnabled(TRUE); - break; - case LLInventoryType::IT_SOUND: - case LLInventoryType::IT_GESTURE: - case LLInventoryType::IT_ANIMATION: - mPlayBtn->setVisible(TRUE); - mPlayBtn->setEnabled(TRUE); - break; - case LLInventoryType::IT_LANDMARK: - mTeleportBtn->setVisible(TRUE); - mTeleportBtn->setEnabled(TRUE); - break; - default: - break; - } -} - -LLInventoryItem *LLSidepanelInventory::getSelectedItem() -{ - LLFolderViewItem* current_item = mPanelMainInventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); - if (!current_item) - { - return NULL; - } - const LLUUID &item_id = current_item->getListener()->getUUID(); - LLInventoryItem *item = gInventory.getItem(item_id); - return item; -} +/** + * @file LLSidepanelInventory.cpp + * @brief Side Bar "Inventory" panel + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * 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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llsidepanelinventory.h" + +#include "llagent.h" +#include "llbutton.h" +#include "llinventorybridge.h" +#include "llinventorypanel.h" +#include "llpanelmaininventory.h" +#include "llsidepaneliteminfo.h" +#include "lltabcontainer.h" + +static LLRegisterPanelClassWrapper t_inventory("sidepanel_inventory"); + +LLSidepanelInventory::LLSidepanelInventory() + : LLPanel(), + mSidepanelItemInfo(NULL) +{ + + //LLUICtrlFactory::getInstance()->buildPanel(this, "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() +} + +LLSidepanelInventory::~LLSidepanelInventory() +{ +} + +BOOL LLSidepanelInventory::postBuild() +{ + mInfoBtn = getChild("info_btn"); + mInfoBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onInfoButtonClicked, this)); + + mShareBtn = getChild("share_btn"); + mShareBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onShareButtonClicked, this)); + + mShareBtn = getChild("share_btn"); + mShareBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onShareButtonClicked, this)); + + mWearBtn = getChild("wear_btn"); + mWearBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onWearButtonClicked, this)); + + mPlayBtn = getChild("play_btn"); + mPlayBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onPlayButtonClicked, this)); + + mTeleportBtn = getChild("teleport_btn"); + mTeleportBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onTeleportButtonClicked, this)); + + mOverflowBtn = getChild("overflow_btn"); + mOverflowBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onOverflowButtonClicked, this)); + + mTabContainer = getChild("Inventory Tabs"); + mSidepanelItemInfo = getChild("sidepanel_item_info"); + + mPanelMainInventory = getChild("panel_main_inventory"); + mPanelMainInventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2)); + + LLButton* back_btn = mSidepanelItemInfo->getChild("back_btn"); + back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); + + return TRUE; +} + +void LLSidepanelInventory::onOpen(const LLSD& key) +{ + if(key.size() == 0) + return; + + mSidepanelItemInfo->reset(); + + if (key.has("id")) + { + mSidepanelItemInfo->setItemID(key["id"].asUUID()); + } + + if (key.has("object")) + { + mSidepanelItemInfo->setObjectID(key["object"].asUUID()); + } + + toggleItemInfoPanel(TRUE); +} + +void LLSidepanelInventory::onInfoButtonClicked() +{ + LLInventoryItem *item = getSelectedItem(); + if (item) + { + mSidepanelItemInfo->reset(); + mSidepanelItemInfo->setItemID(item->getUUID()); + toggleItemInfoPanel(TRUE); + } +} + +void LLSidepanelInventory::onShareButtonClicked() +{ +} + +void LLSidepanelInventory::performActionOnSelection(const std::string &action) +{ + LLInventoryPanel *panel = mPanelMainInventory->getActivePanel(); + LLFolderViewItem* current_item = panel->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return; + } + current_item->getListener()->performAction(panel->getRootFolder(), panel->getModel(), action); +} + +void LLSidepanelInventory::onWearButtonClicked() +{ + performActionOnSelection("wear"); + performActionOnSelection("attach"); +} + +void LLSidepanelInventory::onPlayButtonClicked() +{ + performActionOnSelection("activate"); +} + +void LLSidepanelInventory::onTeleportButtonClicked() +{ + performActionOnSelection("teleport"); +} + +void LLSidepanelInventory::onOverflowButtonClicked() +{ +} + +void LLSidepanelInventory::onBackButtonClicked() +{ + toggleItemInfoPanel(FALSE); + updateVerbs(); +} + +void LLSidepanelInventory::onSelectionChange(const std::deque &items, BOOL user_action) +{ + updateVerbs(); +} + +void LLSidepanelInventory::toggleItemInfoPanel(BOOL visible) +{ + mSidepanelItemInfo->setVisible(visible); + mTabContainer->setVisible(!visible); + + if (visible) + { + mSidepanelItemInfo->dirty(); + mSidepanelItemInfo->setEditMode(FALSE); + + LLRect rect = getRect(); + LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom); + mSidepanelItemInfo->reshape(new_rect.getWidth(),new_rect.getHeight()); + } +} + +void LLSidepanelInventory::updateVerbs() +{ + mInfoBtn->setEnabled(FALSE); + mShareBtn->setEnabled(FALSE); + + mWearBtn->setVisible(FALSE); + mWearBtn->setEnabled(FALSE); + mPlayBtn->setVisible(FALSE); + mPlayBtn->setEnabled(FALSE); + mTeleportBtn->setVisible(FALSE); + mTeleportBtn->setEnabled(FALSE); + + const LLInventoryItem *item = getSelectedItem(); + if (!item) + return; + + mInfoBtn->setEnabled(TRUE); + mShareBtn->setEnabled(TRUE); + + switch(item->getInventoryType()) + { + case LLInventoryType::IT_WEARABLE: + case LLInventoryType::IT_OBJECT: + case LLInventoryType::IT_ATTACHMENT: + mWearBtn->setVisible(TRUE); + mWearBtn->setEnabled(TRUE); + break; + case LLInventoryType::IT_SOUND: + case LLInventoryType::IT_GESTURE: + case LLInventoryType::IT_ANIMATION: + mPlayBtn->setVisible(TRUE); + mPlayBtn->setEnabled(TRUE); + break; + case LLInventoryType::IT_LANDMARK: + mTeleportBtn->setVisible(TRUE); + mTeleportBtn->setEnabled(TRUE); + break; + default: + break; + } +} + +LLInventoryItem *LLSidepanelInventory::getSelectedItem() +{ + LLFolderViewItem* current_item = mPanelMainInventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return NULL; + } + const LLUUID &item_id = current_item->getListener()->getUUID(); + LLInventoryItem *item = gInventory.getItem(item_id); + return item; +} -- cgit v1.2.3 From f263d119c4c4a3816da15e327afc99fd94d39eef Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 3 Nov 2009 19:46:57 -0500 Subject: EXT-2130 : XUI cleanup Reformatted sidepanel_inventory Took out tab container from both sidepanel_inventory and sidepanel_item_info --HG-- branch : avatar-pipeline --- indra/newview/llsidepanelinventory.cpp | 98 ++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 46 deletions(-) (limited to 'indra/newview/llsidepanelinventory.cpp') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index dbe7e9fec6..2ea84efd30 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -44,7 +44,7 @@ static LLRegisterPanelClassWrapper t_inventory("sidepanel_ LLSidepanelInventory::LLSidepanelInventory() : LLPanel(), - mSidepanelItemInfo(NULL) + mItemPanel(NULL) { //LLUICtrlFactory::getInstance()->buildPanel(this, "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() @@ -56,36 +56,40 @@ LLSidepanelInventory::~LLSidepanelInventory() BOOL LLSidepanelInventory::postBuild() { - mInfoBtn = getChild("info_btn"); - mInfoBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onInfoButtonClicked, this)); - - mShareBtn = getChild("share_btn"); - mShareBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onShareButtonClicked, this)); - - mShareBtn = getChild("share_btn"); - mShareBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onShareButtonClicked, this)); - - mWearBtn = getChild("wear_btn"); - mWearBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onWearButtonClicked, this)); - - mPlayBtn = getChild("play_btn"); - mPlayBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onPlayButtonClicked, this)); - - mTeleportBtn = getChild("teleport_btn"); - mTeleportBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onTeleportButtonClicked, this)); - - mOverflowBtn = getChild("overflow_btn"); - mOverflowBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onOverflowButtonClicked, this)); - - mTabContainer = getChild("Inventory Tabs"); - mSidepanelItemInfo = getChild("sidepanel_item_info"); - - mPanelMainInventory = getChild("panel_main_inventory"); - mPanelMainInventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2)); - - LLButton* back_btn = mSidepanelItemInfo->getChild("back_btn"); - back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); + // UI elements from inventory panel + { + mInventoryPanel = getChild("sidepanel__inventory_panel"); + + mInfoBtn = mInventoryPanel->getChild("info_btn"); + mInfoBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onInfoButtonClicked, this)); + + mShareBtn = mInventoryPanel->getChild("share_btn"); + mShareBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onShareButtonClicked, this)); + + mWearBtn = mInventoryPanel->getChild("wear_btn"); + mWearBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onWearButtonClicked, this)); + + mPlayBtn = mInventoryPanel->getChild("play_btn"); + mPlayBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onPlayButtonClicked, this)); + + mTeleportBtn = mInventoryPanel->getChild("teleport_btn"); + mTeleportBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onTeleportButtonClicked, this)); + + mOverflowBtn = mInventoryPanel->getChild("overflow_btn"); + mOverflowBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onOverflowButtonClicked, this)); + + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild("panel_main_inventory"); + panel_main_inventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2)); + } + // UI elements from item panel + { + mItemPanel = getChild("sidepanel__item_panel"); + + LLButton* back_btn = mItemPanel->getChild("back_btn"); + back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); + } + return TRUE; } @@ -94,16 +98,16 @@ void LLSidepanelInventory::onOpen(const LLSD& key) if(key.size() == 0) return; - mSidepanelItemInfo->reset(); + mItemPanel->reset(); if (key.has("id")) { - mSidepanelItemInfo->setItemID(key["id"].asUUID()); + mItemPanel->setItemID(key["id"].asUUID()); } if (key.has("object")) { - mSidepanelItemInfo->setObjectID(key["object"].asUUID()); + mItemPanel->setObjectID(key["object"].asUUID()); } toggleItemInfoPanel(TRUE); @@ -114,8 +118,8 @@ void LLSidepanelInventory::onInfoButtonClicked() LLInventoryItem *item = getSelectedItem(); if (item) { - mSidepanelItemInfo->reset(); - mSidepanelItemInfo->setItemID(item->getUUID()); + mItemPanel->reset(); + mItemPanel->setItemID(item->getUUID()); toggleItemInfoPanel(TRUE); } } @@ -126,13 +130,13 @@ void LLSidepanelInventory::onShareButtonClicked() void LLSidepanelInventory::performActionOnSelection(const std::string &action) { - LLInventoryPanel *panel = mPanelMainInventory->getActivePanel(); - LLFolderViewItem* current_item = panel->getRootFolder()->getCurSelectedItem(); + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild("panel_main_inventory"); + LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { return; } - current_item->getListener()->performAction(panel->getRootFolder(), panel->getModel(), action); + current_item->getListener()->performAction(panel_main_inventory->getActivePanel()->getRootFolder(), panel_main_inventory->getActivePanel()->getModel(), action); } void LLSidepanelInventory::onWearButtonClicked() @@ -168,17 +172,18 @@ void LLSidepanelInventory::onSelectionChange(const std::deque void LLSidepanelInventory::toggleItemInfoPanel(BOOL visible) { - mSidepanelItemInfo->setVisible(visible); - mTabContainer->setVisible(!visible); + mItemPanel->setVisible(visible); + mInventoryPanel->setVisible(!visible); if (visible) { - mSidepanelItemInfo->dirty(); - mSidepanelItemInfo->setEditMode(FALSE); - + mItemPanel->dirty(); + mItemPanel->setEditMode(FALSE); + /* LLRect rect = getRect(); - LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom); - mSidepanelItemInfo->reshape(new_rect.getWidth(),new_rect.getHeight()); + LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mInventoryPanel->getRect().mBottom); + mItemPanel->reshape(new_rect.getWidth(),new_rect.getHeight()); + */ } } @@ -226,7 +231,8 @@ void LLSidepanelInventory::updateVerbs() LLInventoryItem *LLSidepanelInventory::getSelectedItem() { - LLFolderViewItem* current_item = mPanelMainInventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild("panel_main_inventory"); + LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { return NULL; -- cgit v1.2.3 From 7383cfe14bd1522d921b96c6ab0804f888f8c5c0 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 4 Nov 2009 13:18:29 -0500 Subject: EXT-2216 : Task properties sidepanel Guts of task properteis sidepanel created. --HG-- branch : avatar-pipeline --- indra/newview/llsidepanelinventory.cpp | 59 ++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 21 deletions(-) (limited to 'indra/newview/llsidepanelinventory.cpp') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 2ea84efd30..9b67bc701d 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -38,6 +38,7 @@ #include "llinventorypanel.h" #include "llpanelmaininventory.h" #include "llsidepaneliteminfo.h" +#include "llsidepaneltaskinfo.h" #include "lltabcontainer.h" static LLRegisterPanelClassWrapper t_inventory("sidepanel_inventory"); @@ -89,6 +90,13 @@ BOOL LLSidepanelInventory::postBuild() LLButton* back_btn = mItemPanel->getChild("back_btn"); back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); } + + // UI elements from task panel + { + mTaskPanel = getChild("sidepanel__task_panel"); + LLButton* back_btn = mTaskPanel->getChild("back_btn"); + back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); + } return TRUE; } @@ -103,14 +111,16 @@ void LLSidepanelInventory::onOpen(const LLSD& key) if (key.has("id")) { mItemPanel->setItemID(key["id"].asUUID()); + if (key.has("object")) + { + mItemPanel->setObjectID(key["object"].asUUID()); + } + showItemInfoPanel(); } - - if (key.has("object")) + if (key.has("task")) { - mItemPanel->setObjectID(key["object"].asUUID()); + showTaskInfoPanel(); } - - toggleItemInfoPanel(TRUE); } void LLSidepanelInventory::onInfoButtonClicked() @@ -120,7 +130,7 @@ void LLSidepanelInventory::onInfoButtonClicked() { mItemPanel->reset(); mItemPanel->setItemID(item->getUUID()); - toggleItemInfoPanel(TRUE); + showItemInfoPanel(); } } @@ -161,8 +171,7 @@ void LLSidepanelInventory::onOverflowButtonClicked() void LLSidepanelInventory::onBackButtonClicked() { - toggleItemInfoPanel(FALSE); - updateVerbs(); + showInventoryPanel(); } void LLSidepanelInventory::onSelectionChange(const std::deque &items, BOOL user_action) @@ -170,21 +179,29 @@ void LLSidepanelInventory::onSelectionChange(const std::deque updateVerbs(); } -void LLSidepanelInventory::toggleItemInfoPanel(BOOL visible) +void LLSidepanelInventory::showItemInfoPanel() { - mItemPanel->setVisible(visible); - mInventoryPanel->setVisible(!visible); + mItemPanel->setVisible(TRUE); + mTaskPanel->setVisible(FALSE); + mInventoryPanel->setVisible(FALSE); - if (visible) - { - mItemPanel->dirty(); - mItemPanel->setEditMode(FALSE); - /* - LLRect rect = getRect(); - LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mInventoryPanel->getRect().mBottom); - mItemPanel->reshape(new_rect.getWidth(),new_rect.getHeight()); - */ - } + mItemPanel->dirty(); + mItemPanel->setEditMode(FALSE); +} + +void LLSidepanelInventory::showTaskInfoPanel() +{ + mItemPanel->setVisible(FALSE); + mTaskPanel->setVisible(TRUE); + mInventoryPanel->setVisible(FALSE); +} + +void LLSidepanelInventory::showInventoryPanel() +{ + mItemPanel->setVisible(FALSE); + mTaskPanel->setVisible(FALSE); + mInventoryPanel->setVisible(TRUE); + updateVerbs(); } void LLSidepanelInventory::updateVerbs() -- cgit v1.2.3 From ec9da605c120b9df648eb163dc8647f955275f5f Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 4 Nov 2009 16:25:13 -0500 Subject: EXT-2216 : Task properties sidepanel Subclassing sidepanel item/task info with llsidepanelinventorysubpanel. Some bug fixing and cleanup. --HG-- branch : avatar-pipeline --- indra/newview/llsidepanelinventory.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llsidepanelinventory.cpp') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 9b67bc701d..c4779cd29a 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -186,7 +186,7 @@ void LLSidepanelInventory::showItemInfoPanel() mInventoryPanel->setVisible(FALSE); mItemPanel->dirty(); - mItemPanel->setEditMode(FALSE); + mItemPanel->setIsEditing(FALSE); } void LLSidepanelInventory::showTaskInfoPanel() @@ -194,6 +194,9 @@ void LLSidepanelInventory::showTaskInfoPanel() mItemPanel->setVisible(FALSE); mTaskPanel->setVisible(TRUE); mInventoryPanel->setVisible(FALSE); + + mTaskPanel->dirty(); + mTaskPanel->setIsEditing(FALSE); } void LLSidepanelInventory::showInventoryPanel() -- cgit v1.2.3 From 7615ec497e7b69c8eefbf8ef1a464eaa22e77bf1 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 4 Nov 2009 20:30:11 -0500 Subject: EXT-2216 : Task properties sidepanel EXT-2224 : Edit item then delete item -- edit panel still active EXT-2228 : Buy/Pay/Open buttons for Task sidepanel --HG-- branch : avatar-pipeline --- indra/newview/llsidepanelinventory.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llsidepanelinventory.cpp') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index c4779cd29a..3a1b354c50 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -40,6 +40,7 @@ #include "llsidepaneliteminfo.h" #include "llsidepaneltaskinfo.h" #include "lltabcontainer.h" +#include "llselectmgr.h" static LLRegisterPanelClassWrapper t_inventory("sidepanel_inventory"); @@ -119,6 +120,7 @@ void LLSidepanelInventory::onOpen(const LLSD& key) } if (key.has("task")) { + mTaskPanel->setObjectSelection(LLSelectMgr::getInstance()->getSelection()); showTaskInfoPanel(); } } -- cgit v1.2.3 From 5e85642650d4ffa822b749c5a4a211531545d660 Mon Sep 17 00:00:00 2001 From: Steve Bennetts Date: Fri, 6 Nov 2009 18:04:29 -0800 Subject: Temp fix to prevent crash while missing sidepanel_task_info.xml. --- indra/newview/llsidepanelinventory.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'indra/newview/llsidepanelinventory.cpp') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 3a1b354c50..6aa5c53194 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -95,8 +95,11 @@ BOOL LLSidepanelInventory::postBuild() // UI elements from task panel { mTaskPanel = getChild("sidepanel__task_panel"); - LLButton* back_btn = mTaskPanel->getChild("back_btn"); - back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); + if (mTaskPanel) + { + LLButton* back_btn = mTaskPanel->getChild("back_btn"); + back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); + } } return TRUE; @@ -120,7 +123,8 @@ void LLSidepanelInventory::onOpen(const LLSD& key) } if (key.has("task")) { - mTaskPanel->setObjectSelection(LLSelectMgr::getInstance()->getSelection()); + if (mTaskPanel) + mTaskPanel->setObjectSelection(LLSelectMgr::getInstance()->getSelection()); showTaskInfoPanel(); } } @@ -184,7 +188,8 @@ void LLSidepanelInventory::onSelectionChange(const std::deque void LLSidepanelInventory::showItemInfoPanel() { mItemPanel->setVisible(TRUE); - mTaskPanel->setVisible(FALSE); + if (mTaskPanel) + mTaskPanel->setVisible(FALSE); mInventoryPanel->setVisible(FALSE); mItemPanel->dirty(); @@ -194,17 +199,21 @@ void LLSidepanelInventory::showItemInfoPanel() void LLSidepanelInventory::showTaskInfoPanel() { mItemPanel->setVisible(FALSE); - mTaskPanel->setVisible(TRUE); mInventoryPanel->setVisible(FALSE); - mTaskPanel->dirty(); - mTaskPanel->setIsEditing(FALSE); + if (mTaskPanel) + { + mTaskPanel->setVisible(TRUE); + mTaskPanel->dirty(); + mTaskPanel->setIsEditing(FALSE); + } } void LLSidepanelInventory::showInventoryPanel() { mItemPanel->setVisible(FALSE); - mTaskPanel->setVisible(FALSE); + if (mTaskPanel) + mTaskPanel->setVisible(FALSE); mInventoryPanel->setVisible(TRUE); updateVerbs(); } -- cgit v1.2.3