From e416840f85dc4a367894036b9fe483f17d959c54 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 24 Aug 2010 19:22:00 +0100 Subject: Backed out changeset c3d41f18ce2b back-out the back-out for this branch. yay. --- indra/newview/llpanelmaininventory.cpp | 112 +++++++++++++++++---------------- 1 file changed, 58 insertions(+), 54 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index f5e33034a3..27e054af34 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -39,6 +39,7 @@ #include "llinventorypanel.h" #include "llfiltereditor.h" #include "llfloaterreg.h" +#include "lloutfitobserver.h" #include "llpreviewtexture.h" #include "llresmgr.h" #include "llscrollcontainer.h" @@ -484,7 +485,7 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) void LLPanelMainInventory::onFilterSelected() { // Find my index - mActivePanel = (LLInventoryPanel*)childGetVisibleTab("inventory filter tabs"); + mActivePanel = (LLInventoryPanel*)getChild("inventory filter tabs")->getCurrentPanel(); if (!mActivePanel) { @@ -492,7 +493,7 @@ void LLPanelMainInventory::onFilterSelected() } BOOL recent_active = ("Recent Items" == mActivePanel->getName()); - childSetVisible("add_btn_panel", !recent_active); + getChildView("add_btn_panel")->setVisible( !recent_active); setFilterSubString(mFilterSubString); LLInventoryFilter* filter = mActivePanel->getFilter(); @@ -584,7 +585,7 @@ void LLPanelMainInventory::updateItemcountText() { text = getString("ItemcountUnknown"); } - childSetText("ItemcountText",text); + getChild("ItemcountText")->setValue(text); } void LLPanelMainInventory::setFilterTextFromFilter() @@ -651,7 +652,7 @@ void LLFloaterInventoryFinder::onCheckSinceLogoff(LLUICtrl *ctrl, void *user_dat LLFloaterInventoryFinder *self = (LLFloaterInventoryFinder *)user_data; if (!self) return; - bool since_logoff= self->childGetValue("check_since_logoff"); + bool since_logoff= self->getChild("check_since_logoff")->getValue(); if (!since_logoff && !( self->mSpinSinceDays->get() || self->mSpinSinceHours->get() ) ) @@ -691,7 +692,7 @@ void LLFloaterInventoryFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) { since_logoff = false; } - self->childSetValue("check_since_logoff", since_logoff); + self->getChild("check_since_logoff")->setValue(since_logoff); } void LLFloaterInventoryFinder::changeFilter(LLInventoryFilter* filter) @@ -714,20 +715,20 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() // update the ui elements setTitle(mFilter->getName()); - childSetValue("check_animation", (S32) (filter_types & 0x1 << LLInventoryType::IT_ANIMATION)); - - childSetValue("check_calling_card", (S32) (filter_types & 0x1 << LLInventoryType::IT_CALLINGCARD)); - childSetValue("check_clothing", (S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE)); - childSetValue("check_gesture", (S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE)); - childSetValue("check_landmark", (S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK)); - childSetValue("check_notecard", (S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD)); - childSetValue("check_object", (S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT)); - childSetValue("check_script", (S32) (filter_types & 0x1 << LLInventoryType::IT_LSL)); - childSetValue("check_sound", (S32) (filter_types & 0x1 << LLInventoryType::IT_SOUND)); - childSetValue("check_texture", (S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE)); - childSetValue("check_snapshot", (S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT)); - childSetValue("check_show_empty", show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); - childSetValue("check_since_logoff", mFilter->isSinceLogoff()); + getChild("check_animation")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_ANIMATION)); + + getChild("check_calling_card")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_CALLINGCARD)); + getChild("check_clothing")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE)); + getChild("check_gesture")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE)); + getChild("check_landmark")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK)); + getChild("check_notecard")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD)); + getChild("check_object")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT)); + getChild("check_script")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_LSL)); + getChild("check_sound")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SOUND)); + getChild("check_texture")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE)); + getChild("check_snapshot")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT)); + getChild("check_show_empty")->setValue(show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); + getChild("check_since_logoff")->setValue(mFilter->isSinceLogoff()); mSpinSinceHours->set((F32)(hours % 24)); mSpinSinceDays->set((F32)(hours / 24)); } @@ -738,32 +739,32 @@ void LLFloaterInventoryFinder::draw() U32 filter = 0xffffffff; BOOL filtered_by_all_types = TRUE; - if (!childGetValue("check_animation")) + if (!getChild("check_animation")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_ANIMATION); filtered_by_all_types = FALSE; } - if (!childGetValue("check_calling_card")) + if (!getChild("check_calling_card")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_CALLINGCARD); filtered_by_all_types = FALSE; } - if (!childGetValue("check_clothing")) + if (!getChild("check_clothing")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_WEARABLE); filtered_by_all_types = FALSE; } - if (!childGetValue("check_gesture")) + if (!getChild("check_gesture")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_GESTURE); filtered_by_all_types = FALSE; } - if (!childGetValue("check_landmark")) + if (!getChild("check_landmark")->getValue()) { @@ -771,38 +772,38 @@ void LLFloaterInventoryFinder::draw() filtered_by_all_types = FALSE; } - if (!childGetValue("check_notecard")) + if (!getChild("check_notecard")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_NOTECARD); filtered_by_all_types = FALSE; } - if (!childGetValue("check_object")) + if (!getChild("check_object")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_OBJECT); filter &= ~(0x1 << LLInventoryType::IT_ATTACHMENT); filtered_by_all_types = FALSE; } - if (!childGetValue("check_script")) + if (!getChild("check_script")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_LSL); filtered_by_all_types = FALSE; } - if (!childGetValue("check_sound")) + if (!getChild("check_sound")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_SOUND); filtered_by_all_types = FALSE; } - if (!childGetValue("check_texture")) + if (!getChild("check_texture")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_TEXTURE); filtered_by_all_types = FALSE; } - if (!childGetValue("check_snapshot")) + if (!getChild("check_snapshot")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_SNAPSHOT); filtered_by_all_types = FALSE; @@ -842,12 +843,12 @@ void LLFloaterInventoryFinder::draw() BOOL LLFloaterInventoryFinder::getCheckShowEmpty() { - return childGetValue("check_show_empty"); + return getChild("check_show_empty")->getValue(); } BOOL LLFloaterInventoryFinder::getCheckSinceLogoff() { - return childGetValue("check_since_logoff"); + return getChild("check_since_logoff")->getValue(); } void LLFloaterInventoryFinder::onCloseBtn(void* user_data) @@ -862,17 +863,17 @@ void LLFloaterInventoryFinder::selectAllTypes(void* user_data) LLFloaterInventoryFinder* self = (LLFloaterInventoryFinder*)user_data; if(!self) return; - self->childSetValue("check_animation", TRUE); - self->childSetValue("check_calling_card", TRUE); - self->childSetValue("check_clothing", TRUE); - self->childSetValue("check_gesture", TRUE); - self->childSetValue("check_landmark", TRUE); - self->childSetValue("check_notecard", TRUE); - self->childSetValue("check_object", TRUE); - self->childSetValue("check_script", TRUE); - self->childSetValue("check_sound", TRUE); - self->childSetValue("check_texture", TRUE); - self->childSetValue("check_snapshot", TRUE); + self->getChild("check_animation")->setValue(TRUE); + self->getChild("check_calling_card")->setValue(TRUE); + self->getChild("check_clothing")->setValue(TRUE); + self->getChild("check_gesture")->setValue(TRUE); + self->getChild("check_landmark")->setValue(TRUE); + self->getChild("check_notecard")->setValue(TRUE); + self->getChild("check_object")->setValue(TRUE); + self->getChild("check_script")->setValue(TRUE); + self->getChild("check_sound")->setValue(TRUE); + self->getChild("check_texture")->setValue(TRUE); + self->getChild("check_snapshot")->setValue(TRUE); } //static @@ -881,17 +882,17 @@ void LLFloaterInventoryFinder::selectNoTypes(void* user_data) LLFloaterInventoryFinder* self = (LLFloaterInventoryFinder*)user_data; if(!self) return; - self->childSetValue("check_animation", FALSE); - self->childSetValue("check_calling_card", FALSE); - self->childSetValue("check_clothing", FALSE); - self->childSetValue("check_gesture", FALSE); - self->childSetValue("check_landmark", FALSE); - self->childSetValue("check_notecard", FALSE); - self->childSetValue("check_object", FALSE); - self->childSetValue("check_script", FALSE); - self->childSetValue("check_sound", FALSE); - self->childSetValue("check_texture", FALSE); - self->childSetValue("check_snapshot", FALSE); + self->getChild("check_animation")->setValue(FALSE); + self->getChild("check_calling_card")->setValue(FALSE); + self->getChild("check_clothing")->setValue(FALSE); + self->getChild("check_gesture")->setValue(FALSE); + self->getChild("check_landmark")->setValue(FALSE); + self->getChild("check_notecard")->setValue(FALSE); + self->getChild("check_object")->setValue(FALSE); + self->getChild("check_script")->setValue(FALSE); + self->getChild("check_sound")->setValue(FALSE); + self->getChild("check_texture")->setValue(FALSE); + self->getChild("check_snapshot")->setValue(FALSE); } ////////////////////////////////////////////////////////////////////////////////// @@ -914,6 +915,9 @@ void LLPanelMainInventory::initListCommandsHandlers() mEnableCallbackRegistrar.add("Inventory.GearDefault.Enable", boost::bind(&LLPanelMainInventory::isActionEnabled, this, _2)); mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mMenuAdd = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_add.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + + // Update the trash button when selected item(s) get worn or taken off. + LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLPanelMainInventory::updateListCommands, this)); } void LLPanelMainInventory::updateListCommands() -- cgit v1.2.3