diff options
28 files changed, 526 insertions, 336 deletions
diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index f103dcf664..6b69388896 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -1,7 +1,7 @@ # -*- cmake -*- include(Prebuilt) -if (NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu) +if (INSTALL_PROPRIETARY AND NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu) use_prebuilt_binary(kdu) if (WINDOWS) set(KDU_LIBRARY debug kdu_cored optimized kdu_core) @@ -15,4 +15,4 @@ if (NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu) set(LLKDU_STATIC_LIBRARY llkdu_static) set(LLKDU_LIBRARIES ${LLKDU_LIBRARY}) set(LLKDU_STATIC_LIBRARIES ${LLKDU_STATIC_LIBRARY}) -endif (NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu) +endif (INSTALL_PROPRIETARY AND NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu) diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 3ca05ff0ff..732c01614b 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -105,6 +105,15 @@ struct LLPlaceHolderPanel : public LLPanel static LLDefaultChildRegistry::Register<LLPlaceHolderPanel> r1("placeholder"); static LLDefaultChildRegistry::Register<LLTabContainer> r2("tab_container"); +LLTabContainer::TabParams::TabParams() +: tab_top_image_unselected("tab_top_image_unselected"), + tab_top_image_selected("tab_top_image_selected"), + tab_bottom_image_unselected("tab_bottom_image_unselected"), + tab_bottom_image_selected("tab_bottom_image_selected"), + tab_left_image_unselected("tab_left_image_unselected"), + tab_left_image_selected("tab_left_image_selected") +{} + LLTabContainer::Params::Params() : tab_width("tab_width"), tab_min_width("tab_min_width"), @@ -113,12 +122,9 @@ LLTabContainer::Params::Params() tab_position("tab_position"), hide_tabs("hide_tabs", false), tab_padding_right("tab_padding_right"), - tab_top_image_unselected("tab_top_image_unselected"), - tab_top_image_selected("tab_top_image_selected"), - tab_bottom_image_unselected("tab_bottom_image_unselected"), - tab_bottom_image_selected("tab_bottom_image_selected"), - tab_left_image_unselected("tab_left_image_unselected"), - tab_left_image_selected("tab_left_image_selected") + first_tab("first_tab"), + middle_tab("middle_tab"), + last_tab("last_tab") { name(std::string("tab_container")); mouse_opaque = false; @@ -147,12 +153,9 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) mRightTabBtnOffset(p.tab_padding_right), mTotalTabWidth(0), mTabPosition(p.tab_position), - mImageTopUnselected(p.tab_top_image_unselected), - mImageTopSelected(p.tab_top_image_selected), - mImageBottomUnselected(p.tab_bottom_image_unselected), - mImageBottomSelected(p.tab_bottom_image_selected), - mImageLeftUnselected(p.tab_left_image_unselected), - mImageLeftSelected(p.tab_left_image_selected) + mFirstTabParams(p.first_tab), + mMiddleTabParams(p.middle_tab), + mLastTabParams(p.last_tab) { static LLUICachedControl<S32> tabcntr_vert_tab_min_width ("UITabCntrVertTabMinWidth", 0); @@ -791,6 +794,29 @@ void LLTabContainer::addTabPanel(LLPanel* panelp) addTabPanel(TabPanelParams().panel(panelp)); } +// function to update images +void LLTabContainer::update_images(LLTabTuple* tuple, TabParams params, LLTabContainer::TabPosition pos) +{ + if (tuple && tuple->mButton) + { + if (pos == LLTabContainer::TOP) + { + tuple->mButton->setImageUnselected(static_cast<LLUIImage*>(params.tab_top_image_unselected)); + tuple->mButton->setImageSelected(static_cast<LLUIImage*>(params.tab_top_image_selected)); + } + else if (pos == LLTabContainer::BOTTOM) + { + tuple->mButton->setImageUnselected(static_cast<LLUIImage*>(params.tab_bottom_image_unselected)); + tuple->mButton->setImageSelected(static_cast<LLUIImage*>(params.tab_bottom_image_selected)); + } + else if (pos == LLTabContainer::LEFT) + { + tuple->mButton->setImageUnselected(static_cast<LLUIImage*>(params.tab_left_image_unselected)); + tuple->mButton->setImageSelected(static_cast<LLUIImage*>(params.tab_left_image_selected)); + } + } +} + void LLTabContainer::addTabPanel(const TabPanelParams& panel) { LLPanel* child = panel.panel(); @@ -888,14 +914,14 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) else if( getTabPosition() == LLTabContainer::TOP ) { btn_rect.setLeftTopAndSize( 0, getRect().getHeight() - getTopBorderHeight() + tab_fudge, button_width, mTabHeight); - tab_img = mImageTopUnselected.get(); - tab_selected_img = mImageTopSelected.get(); + tab_img = mMiddleTabParams.tab_top_image_unselected; + tab_selected_img = mMiddleTabParams.tab_top_image_selected; } else { btn_rect.setOriginAndSize( 0, 0 + tab_fudge, button_width, mTabHeight); - tab_img = mImageBottomUnselected.get(); - tab_selected_img = mImageBottomSelected.get(); + tab_img = mMiddleTabParams.tab_bottom_image_unselected; + tab_selected_img = mMiddleTabParams.tab_bottom_image_selected; } LLTextBox* textbox = NULL; @@ -926,8 +952,8 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child)); p.font(font); p.label(trimmed_label); - p.image_unselected(mImageLeftUnselected); - p.image_selected(mImageLeftSelected); + p.image_unselected(mMiddleTabParams.tab_left_image_unselected); + p.image_selected(mMiddleTabParams.tab_left_image_selected); p.scale_image(true); p.font_halign = LLFontGL::LEFT; p.tab_stop(false); @@ -983,6 +1009,31 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) LLTabTuple* tuple = new LLTabTuple( this, child, btn, textbox ); insertTuple( tuple, insertion_point ); + // if new tab was added as a first or last tab, update button image + // and update button image of any tab it may have affected + if (tuple == mTabList.front()) + { + update_images(tuple, mFirstTabParams, getTabPosition()); + + if (mTabList.size() == 2) + { + update_images(mTabList[1], mLastTabParams, getTabPosition()); + } + else if (mTabList.size() > 2) + { + update_images(mTabList[1], mMiddleTabParams, getTabPosition()); + } + } + else if (tuple == mTabList.back()) + { + update_images(tuple, mLastTabParams, getTabPosition()); + + if (mTabList.size() > 2) + { + update_images(mTabList[mTabList.size()-2], mMiddleTabParams, getTabPosition()); + } + } + //Don't add button and textbox if tab buttons are invisible(EXT - 576) if (!getTabsHidden()) { @@ -1064,7 +1115,17 @@ void LLTabContainer::removeTabPanel(LLPanel* child) LLTabTuple* tuple = *iter; if( tuple->mTabPanel == child ) { - removeChild( tuple->mButton ); + // update tab button images if removing the first or last tab + if ((tuple == mTabList.front()) && (mTabList.size() > 1)) + { + update_images(mTabList[1], mFirstTabParams, getTabPosition()); + } + else if ((tuple == mTabList.back()) && (mTabList.size() > 2)) + { + update_images(mTabList[mTabList.size()-2], mLastTabParams, getTabPosition()); + } + + removeChild( tuple->mButton ); delete tuple->mButton; removeChild( tuple->mTabPanel ); diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index e3af5384b1..a81974cd42 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -61,6 +61,17 @@ public: static void declareValues(); }; + struct TabParams : public LLInitParam::Block<TabParams> + { + Optional<LLUIImage*> tab_top_image_unselected, + tab_top_image_selected, + tab_bottom_image_unselected, + tab_bottom_image_selected, + tab_left_image_unselected, + tab_left_image_selected; + TabParams(); + }; + struct Params : public LLInitParam::Block<Params, LLPanel::Params> { @@ -73,12 +84,9 @@ public: Optional<bool> hide_tabs; Optional<S32> tab_padding_right; - Optional<LLUIImage*> tab_top_image_unselected, - tab_top_image_selected, - tab_bottom_image_unselected, - tab_bottom_image_selected, - tab_left_image_unselected, - tab_left_image_selected; + Optional<TabParams> first_tab, + middle_tab, + last_tab; Params(); }; @@ -215,6 +223,9 @@ private: void updateMaxScrollPos(); void commitHoveredButton(S32 x, S32 y); + // updates tab button images given the tuple, tab position and the corresponding params + void update_images(LLTabTuple* tuple, TabParams params, LLTabContainer::TabPosition pos); + // Variables typedef std::vector<LLTabTuple*> tuple_list_t; @@ -252,12 +263,9 @@ private: LLFrameTimer mDragAndDropDelayTimer; - LLPointer<LLUIImage> mImageTopUnselected; - LLPointer<LLUIImage> mImageTopSelected; - LLPointer<LLUIImage> mImageBottomUnselected; - LLPointer<LLUIImage> mImageBottomSelected; - LLPointer<LLUIImage> mImageLeftUnselected; - LLPointer<LLUIImage> mImageLeftSelected; + TabParams mFirstTabParams; + TabParams mMiddleTabParams; + TabParams mLastTabParams; }; #endif // LL_TABCONTAINER_H diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp index 5827c0d627..851091f0ca 100644 --- a/indra/llui/lluicolortable.cpp +++ b/indra/llui/lluicolortable.cpp @@ -3,7 +3,30 @@ * @brief brief LLUIColorTable class implementation file * * $LicenseInfo:firstyear=2009&license=viewergpl$ + * * Copyright (c) 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$ */ diff --git a/indra/llui/lluicolortable.h b/indra/llui/lluicolortable.h index f102a573b8..59be0c4f9a 100644 --- a/indra/llui/lluicolortable.h +++ b/indra/llui/lluicolortable.h @@ -3,7 +3,30 @@ * @brief brief LLUIColorTable class header file * * $LicenseInfo:firstyear=2009&license=viewergpl$ + * * Copyright (c) 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$ */ diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 5fdf13b078..dd3937a6ef 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1388,7 +1388,11 @@ if (WINDOWS) COMMENT "Copying staged dlls." ) - add_dependencies(${VIEWER_BINARY_NAME} stage_third_party_libs llcommon llkdu) + add_dependencies(${VIEWER_BINARY_NAME} stage_third_party_libs llcommon) + if(LLKDU_LIBRARY) + # kdu may not exist! + add_dependencies(${VIEWER_BINARY_NAME} llkdu) + endif(LLKDU_LIBRARY) endif(WINDOWS) if (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index bb00468d40..c1866c36a2 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1310,6 +1310,11 @@ void LLAgentWearables::removeWearable(const EWearableType type, bool do_remove_a // TODO: enable the removing of a single undershirt/underpants if multiple are worn. - Nyx return; } + if (getWearableCount(type) == 0) + { + // no wearables to remove + return; + } if (do_remove_all) { @@ -1431,6 +1436,9 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it wearables_to_remove[WT_UNDERSHIRT] = (!gAgent.isTeen()) & remove; wearables_to_remove[WT_UNDERPANTS] = (!gAgent.isTeen()) & remove; wearables_to_remove[WT_SKIRT] = remove; + wearables_to_remove[WT_ALPHA] = remove; + wearables_to_remove[WT_TATTOO] = remove; + S32 count = wearables.count(); llassert(items.count() == count); @@ -1743,6 +1751,8 @@ void LLAgentWearables::userRemoveAllClothesStep2(BOOL proceed) gAgentWearables.removeWearable(WT_UNDERSHIRT,true,0); gAgentWearables.removeWearable(WT_UNDERPANTS,true,0); gAgentWearables.removeWearable(WT_SKIRT,true,0); + gAgentWearables.removeWearable(WT_ALPHA,true,0); + gAgentWearables.removeWearable(WT_TATTOO,true,0); } } diff --git a/indra/newview/llcapabilitylistener.cpp b/indra/newview/llcapabilitylistener.cpp index 785a647fa2..ed9613c1bc 100644 --- a/indra/newview/llcapabilitylistener.cpp +++ b/indra/newview/llcapabilitylistener.cpp @@ -5,7 +5,30 @@ * @brief Implementation for llcapabilitylistener. * * $LicenseInfo:firstyear=2009&license=viewergpl$ + * * Copyright (c) 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$ */ diff --git a/indra/newview/llcapabilitylistener.h b/indra/newview/llcapabilitylistener.h index ce16b7da5d..be51cf1b8c 100644 --- a/indra/newview/llcapabilitylistener.h +++ b/indra/newview/llcapabilitylistener.h @@ -5,7 +5,30 @@ * @brief Provide an event-based API for capability requests * * $LicenseInfo:firstyear=2009&license=viewergpl$ + * * Copyright (c) 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$ */ diff --git a/indra/newview/llcapabilityprovider.h b/indra/newview/llcapabilityprovider.h index 0ddb2b6cb9..3d07904775 100644 --- a/indra/newview/llcapabilityprovider.h +++ b/indra/newview/llcapabilityprovider.h @@ -6,7 +6,30 @@ * capability. * * $LicenseInfo:firstyear=2009&license=viewergpl$ + * * Copyright (c) 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$ */ diff --git a/indra/newview/llface.inl b/indra/newview/llface.inl index 38f38f5466..176c73e38e 100644 --- a/indra/newview/llface.inl +++ b/indra/newview/llface.inl @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2007, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +12,13 @@ * ("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://secondlife.com/developers/opensource/gplv2 + * 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://secondlife.com/developers/opensource/flossexception + * 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, diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 2c2a5107f5..36f0315790 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -81,6 +81,8 @@ public: LLFloaterBuyLandUI(const LLSD& key); virtual ~LLFloaterBuyLandUI(); + /*virtual*/ void onClose(bool app_quitting); + private: class SelectionObserver : public LLParcelObserver { @@ -300,11 +302,21 @@ LLFloaterBuyLandUI::LLFloaterBuyLandUI(const LLSD& key) LLFloaterBuyLandUI::~LLFloaterBuyLandUI() { LLViewerParcelMgr::getInstance()->removeObserver(&mParcelSelectionObserver); - LLViewerParcelMgr::getInstance()->deleteParcelBuy(mParcelBuyInfo); + LLViewerParcelMgr::getInstance()->deleteParcelBuy(&mParcelBuyInfo); delete mTransaction; } +// virtual +void LLFloaterBuyLandUI::onClose(bool app_quitting) +{ + // This object holds onto observer, transactions, and parcel state. + // Despite being single_instance, destroy it to call destructors and clean + // everything up. + setVisible(FALSE); + destroy(); +} + void LLFloaterBuyLandUI::SelectionObserver::changed() { if (LLViewerParcelMgr::getInstance()->selectionEmpty()) @@ -756,7 +768,7 @@ void LLFloaterBuyLandUI::sendBuyLand() if (mParcelBuyInfo) { LLViewerParcelMgr::getInstance()->sendParcelBuy(mParcelBuyInfo); - LLViewerParcelMgr::getInstance()->deleteParcelBuy(mParcelBuyInfo); + LLViewerParcelMgr::getInstance()->deleteParcelBuy(&mParcelBuyInfo); mBought = true; } } diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index e15fdd3e35..11544f5b7b 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -442,52 +442,43 @@ LLPanelRegionInfo::LLPanelRegionInfo() { } -// static -void LLPanelRegionInfo::onBtnSet(void* user_data) +void LLPanelRegionInfo::onBtnSet() { - LLPanelRegionInfo* panel = (LLPanelRegionInfo*)user_data; - if(!panel) return; - if (panel->sendUpdate()) + if (sendUpdate()) { - panel->disableButton("apply_btn"); + disableButton("apply_btn"); } } -//static -void LLPanelRegionInfo::onChangeChildCtrl(LLUICtrl* ctrl, void* user_data) +void LLPanelRegionInfo::onChangeChildCtrl(LLUICtrl* ctrl) { - if (ctrl) - { - LLPanelRegionInfo* panel = (LLPanelRegionInfo*) ctrl->getParent(); - panel->updateChild(ctrl); - } + updateChild(ctrl); // virtual function } -// static // Enables the "set" button if it is not already enabled -void LLPanelRegionInfo::onChangeAnything(LLUICtrl* ctrl, void* user_data) +void LLPanelRegionInfo::onChangeAnything() { - LLPanelRegionInfo* panel = (LLPanelRegionInfo*)user_data; - if(panel) - { - panel->enableButton("apply_btn"); - panel->refresh(); - } + enableButton("apply_btn"); + refresh(); } // static // Enables set button on change to line editor void LLPanelRegionInfo::onChangeText(LLLineEditor* caller, void* user_data) { - // reuse the previous method - onChangeAnything(0, user_data); + LLPanelRegionInfo* panel = dynamic_cast<LLPanelRegionInfo*>(caller->getParent()); + if(panel) + { + panel->enableButton("apply_btn"); + panel->refresh(); + } } // virtual BOOL LLPanelRegionInfo::postBuild() { - childSetAction("apply_btn", onBtnSet, this); + getChild<LLUICtrl>("apply_btn")->setCommitCallback(boost::bind(&LLPanelRegionInfo::onBtnSet, this)); childDisable("apply_btn"); refresh(); return TRUE; @@ -550,19 +541,17 @@ void LLPanelRegionInfo::disableButton(const std::string& btn_name) void LLPanelRegionInfo::initCtrl(const std::string& name) { - childSetCommitCallback(name, onChangeAnything, this); + getChild<LLUICtrl>(name)->setCommitCallback(boost::bind(&LLPanelRegionInfo::onChangeAnything, this)); } void LLPanelRegionInfo::initHelpBtn(const std::string& name, const std::string& xml_alert) { - childSetAction(name, onClickHelp, new std::string(xml_alert)); + getChild<LLUICtrl>(name)->setCommitCallback(boost::bind(&LLPanelRegionInfo::onClickHelp, this, xml_alert)); } -// static -void LLPanelRegionInfo::onClickHelp(void* data) +void LLPanelRegionInfo::onClickHelp(std::string xml_alert) { - std::string* xml_alert = (std::string*)data; - LLNotifications::instance().add(*xml_alert); + LLNotifications::instance().add(xml_alert); } ///////////////////////////////////////////////////////////////////////////// @@ -1207,9 +1196,9 @@ BOOL LLPanelRegionTerrainInfo::postBuild() initCtrl("terrain_lower_spin"); initCtrl("fixed_sun_check"); - childSetCommitCallback("fixed_sun_check", onChangeFixedSun, this); - childSetCommitCallback("use_estate_sun_check", onChangeUseEstateTime, this); - childSetCommitCallback("sun_hour_slider", onChangeSunHour, this); + getChild<LLUICtrl>("fixed_sun_check")->setCommitCallback(boost::bind(&LLPanelRegionTerrainInfo::onChangeFixedSun, this)); + getChild<LLUICtrl>("use_estate_sun_check")->setCommitCallback(boost::bind(&LLPanelRegionTerrainInfo::onChangeUseEstateTime, this)); + getChild<LLUICtrl>("sun_hour_slider")->setCommitCallback(boost::bind(&LLPanelRegionTerrainInfo::onChangeSunHour, this)); childSetAction("download_raw_btn", onClickDownloadRaw, this); childSetAction("upload_raw_btn", onClickUploadRaw, this); @@ -1292,39 +1281,29 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() return TRUE; } -// static -void LLPanelRegionTerrainInfo::onChangeUseEstateTime(LLUICtrl* ctrl, void* user_data) +void LLPanelRegionTerrainInfo::onChangeUseEstateTime() { - LLPanelRegionTerrainInfo* panel = (LLPanelRegionTerrainInfo*) user_data; - if (!panel) return; - BOOL use_estate_sun = panel->childGetValue("use_estate_sun_check").asBoolean(); - panel->childSetEnabled("fixed_sun_check", !use_estate_sun); - panel->childSetEnabled("sun_hour_slider", !use_estate_sun); + BOOL use_estate_sun = childGetValue("use_estate_sun_check").asBoolean(); + childSetEnabled("fixed_sun_check", !use_estate_sun); + childSetEnabled("sun_hour_slider", !use_estate_sun); if (use_estate_sun) { - panel->childSetValue("fixed_sun_check", LLSD(FALSE)); - panel->childSetValue("sun_hour_slider", LLSD(0.f)); + childSetValue("fixed_sun_check", LLSD(FALSE)); + childSetValue("sun_hour_slider", LLSD(0.f)); } - panel->childEnable("apply_btn"); + childEnable("apply_btn"); } -// static -void LLPanelRegionTerrainInfo::onChangeFixedSun(LLUICtrl* ctrl, void* user_data) +void LLPanelRegionTerrainInfo::onChangeFixedSun() { - LLPanelRegionTerrainInfo* panel = (LLPanelRegionTerrainInfo*) user_data; - if (!panel) return; // Just enable the apply button. We let the sun-hour slider be enabled // for both fixed-sun and non-fixed-sun. JC - panel->childEnable("apply_btn"); + childEnable("apply_btn"); } -// static -void LLPanelRegionTerrainInfo::onChangeSunHour(LLUICtrl* ctrl, void*) +void LLPanelRegionTerrainInfo::onChangeSunHour() { - // can't use userdata to get panel, slider uses it internally - LLPanelRegionTerrainInfo* panel = (LLPanelRegionTerrainInfo*) ctrl->getParent(); - if (!panel) return; - panel->childEnable("apply_btn"); + childEnable("apply_btn"); } // static @@ -1420,32 +1399,23 @@ void LLPanelEstateInfo::initDispatch(LLDispatcher& dispatch) estate_dispatch_initialized = true; } -// static // Disables the sun-hour slider and the use fixed time check if the use global time is check -void LLPanelEstateInfo::onChangeUseGlobalTime(LLUICtrl* ctrl, void* user_data) +void LLPanelEstateInfo::onChangeUseGlobalTime() { - LLPanelEstateInfo* panel = (LLPanelEstateInfo*) user_data; - if (panel) - { - bool enabled = !panel->childGetValue("use_global_time_check").asBoolean(); - panel->childSetEnabled("sun_hour_slider", enabled); - panel->childSetEnabled("fixed_sun_check", enabled); - panel->childSetValue("fixed_sun_check", LLSD(FALSE)); - panel->enableButton("apply_btn"); - } + bool enabled = !childGetValue("use_global_time_check").asBoolean(); + childSetEnabled("sun_hour_slider", enabled); + childSetEnabled("fixed_sun_check", enabled); + childSetValue("fixed_sun_check", LLSD(FALSE)); + enableButton("apply_btn"); } // Enables the sun-hour slider if the fixed-sun checkbox is set -void LLPanelEstateInfo::onChangeFixedSun(LLUICtrl* ctrl, void* user_data) +void LLPanelEstateInfo::onChangeFixedSun() { - LLPanelEstateInfo* panel = (LLPanelEstateInfo*) user_data; - if (panel) - { - bool enabled = !panel->childGetValue("fixed_sun_check").asBoolean(); - panel->childSetEnabled("use_global_time_check", enabled); - panel->childSetValue("use_global_time_check", LLSD(FALSE)); - panel->enableButton("apply_btn"); - } + bool enabled = !childGetValue("fixed_sun_check").asBoolean(); + childSetEnabled("use_global_time_check", enabled); + childSetValue("use_global_time_check", LLSD(FALSE)); + enableButton("apply_btn"); } @@ -2130,7 +2100,7 @@ BOOL LLPanelEstateInfo::postBuild() initCtrl("limit_payment"); initCtrl("limit_age_verified"); initCtrl("voice_chat_check"); - childSetCommitCallback("abuse_email_address", onChangeAnything, this); + getChild<LLUICtrl>("abuse_email_address")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeAnything, this)); getChild<LLLineEditor>("abuse_email_address")->setKeystrokeCallback(onChangeText, this); initHelpBtn("estate_manager_help", "HelpEstateEstateManager"); @@ -2144,15 +2114,15 @@ BOOL LLPanelEstateInfo::postBuild() initHelpBtn("allow_resident_help", "HelpEstateAllowResident"); initHelpBtn("allow_group_help", "HelpEstateAllowGroup"); initHelpBtn("ban_resident_help", "HelpEstateBanResident"); - initHelpBtn("abuse_email_address_help", "HelpEstateAbuseEmailAddress"); - initHelpBtn("voice_chat_help", "HelpEstateVoiceChat"); + initHelpBtn("abuse_email_address_help", "HelpEstateAbuseEmailAddress"); + initHelpBtn("voice_chat_help", "HelpEstateVoiceChat"); // set up the use global time checkbox - childSetCommitCallback("use_global_time_check", onChangeUseGlobalTime, this); - childSetCommitCallback("fixed_sun_check", onChangeFixedSun, this); - childSetCommitCallback("sun_hour_slider", onChangeChildCtrl, this); - - childSetCommitCallback("allowed_avatar_name_list", onChangeChildCtrl, this); + getChild<LLUICtrl>("use_global_time_check")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeUseGlobalTime, this)); + getChild<LLUICtrl>("fixed_sun_check")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeFixedSun, this)); + getChild<LLUICtrl>("sun_hour_slider")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); + + getChild<LLUICtrl>("allowed_avatar_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); LLNameListCtrl *avatar_name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list"); if (avatar_name_list) { @@ -2163,7 +2133,7 @@ BOOL LLPanelEstateInfo::postBuild() childSetAction("add_allowed_avatar_btn", onClickAddAllowedAgent, this); childSetAction("remove_allowed_avatar_btn", onClickRemoveAllowedAgent, this); - childSetCommitCallback("allowed_group_name_list", onChangeChildCtrl, this); + getChild<LLUICtrl>("allowed_group_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); LLNameListCtrl* group_name_list = getChild<LLNameListCtrl>("allowed_group_name_list"); if (group_name_list) { @@ -2174,7 +2144,7 @@ BOOL LLPanelEstateInfo::postBuild() getChild<LLUICtrl>("add_allowed_group_btn")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onClickAddAllowedGroup, this)); childSetAction("remove_allowed_group_btn", onClickRemoveAllowedGroup, this); - childSetCommitCallback("banned_avatar_name_list", onChangeChildCtrl, this); + getChild<LLUICtrl>("banned_avatar_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); LLNameListCtrl* banned_name_list = getChild<LLNameListCtrl>("banned_avatar_name_list"); if (banned_name_list) { @@ -2185,7 +2155,7 @@ BOOL LLPanelEstateInfo::postBuild() childSetAction("add_banned_avatar_btn", onClickAddBannedAgent, this); childSetAction("remove_banned_avatar_btn", onClickRemoveBannedAgent, this); - childSetCommitCallback("estate_manager_name_list", onChangeChildCtrl, this); + getChild<LLUICtrl>("estate_manager_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); LLNameListCtrl* manager_name_list = getChild<LLNameListCtrl>("estate_manager_name_list"); if (manager_name_list) { @@ -2299,13 +2269,18 @@ void LLPanelEstateInfo::getEstateOwner() class LLEstateChangeInfoResponder : public LLHTTPClient::Responder { public: - LLEstateChangeInfoResponder(void* userdata) : mpPanel((LLPanelEstateInfo*)userdata) {}; + LLEstateChangeInfoResponder(LLPanelEstateInfo* panel) + { + mpPanel = panel->getHandle(); + } // if we get a normal response, handle it here virtual void result(const LLSD& content) { // refresh the panel from the database - mpPanel->refresh(); + LLPanelEstateInfo* panel = dynamic_cast<LLPanelEstateInfo*>(mpPanel.get()); + if (panel) + panel->refresh(); } // if we get an error response @@ -2315,7 +2290,7 @@ public: << status << ": " << reason << llendl; } private: - LLPanelEstateInfo* mpPanel; + LLHandle<LLPanel> mpPanel; }; // tries to send estate info using a cap; returns true if it succeeded @@ -2353,7 +2328,7 @@ bool LLPanelEstateInfo::commitEstateInfoCaps() body["owner_abuse_email"] = childGetValue("abuse_email_address").asString(); // we use a responder so that we can re-get the data after committing to the database - LLHTTPClient::post(url, body, new LLEstateChangeInfoResponder((void*)this)); + LLHTTPClient::post(url, body, new LLEstateChangeInfoResponder(this)); return true; } diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 68ed4e0c89..95833af8a1 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -109,9 +109,9 @@ class LLPanelRegionInfo : public LLPanel public: LLPanelRegionInfo(); - static void onBtnSet(void* user_data); - static void onChangeChildCtrl(LLUICtrl* ctrl, void* user_data); - static void onChangeAnything(LLUICtrl* ctrl, void* user_data); + void onBtnSet(); + void onChangeChildCtrl(LLUICtrl* ctrl); + void onChangeAnything(); static void onChangeText(LLLineEditor* caller, void* user_data); virtual bool refreshFromRegion(LLViewerRegion* region); @@ -128,7 +128,7 @@ protected: void initHelpBtn(const std::string& name, const std::string& xml_alert); // Callback for all help buttons, data is name of XML alert to show. - static void onClickHelp(void* data); + void onClickHelp(std::string xml_alert); // Returns TRUE if update sent and apply button should be // disabled. @@ -239,9 +239,9 @@ public: protected: virtual BOOL sendUpdate(); - static void onChangeUseEstateTime(LLUICtrl* ctrl, void* user_data); - static void onChangeFixedSun(LLUICtrl* ctrl, void* user_data); - static void onChangeSunHour(LLUICtrl* ctrl, void*); + void onChangeUseEstateTime(); + void onChangeFixedSun(); + void onChangeSunHour(); static void onClickDownloadRaw(void*); static void onClickUploadRaw(void*); @@ -256,8 +256,8 @@ class LLPanelEstateInfo : public LLPanelRegionInfo public: static void initDispatch(LLDispatcher& dispatch); - static void onChangeFixedSun(LLUICtrl* ctrl, void* user_data); - static void onChangeUseGlobalTime(LLUICtrl* ctrl, void* user_data); + void onChangeFixedSun(); + void onChangeUseGlobalTime(); static void onClickEditSky(void* userdata); static void onClickEditSkyHelp(void* userdata); diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index ab5d8601d0..f9dde03451 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -68,15 +68,11 @@ LLPanelMediaSettingsGeneral::LLPanelMediaSettingsGeneral() : mHeightPixels( NULL ),
mHomeURL( NULL ),
mCurrentURL( NULL ),
- mAltImageEnable( NULL ),
mParent( NULL ),
mMediaEditable(false)
{
// build dialog from XML
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_settings_general.xml");
-// mCommitCallbackRegistrar.add("Media.ResetCurrentUrl", boost::bind(&LLPanelMediaSettingsGeneral::onBtnResetCurrentUrl, this));
-// mCommitCallbackRegistrar.add("Media.CommitHomeURL", boost::bind(&LLPanelMediaSettingsGeneral::onCommitHomeURL, this));
-
}
////////////////////////////////////////////////////////////////////////////////
@@ -84,7 +80,6 @@ LLPanelMediaSettingsGeneral::LLPanelMediaSettingsGeneral() : BOOL LLPanelMediaSettingsGeneral::postBuild()
{
// connect member vars with UI widgets
- mAltImageEnable = getChild< LLCheckBoxCtrl >( LLMediaEntry::ALT_IMAGE_ENABLE_KEY );
mAutoLoop = getChild< LLCheckBoxCtrl >( LLMediaEntry::AUTO_LOOP_KEY );
mAutoPlay = getChild< LLCheckBoxCtrl >( LLMediaEntry::AUTO_PLAY_KEY );
mAutoScale = getChild< LLCheckBoxCtrl >( LLMediaEntry::AUTO_SCALE_KEY );
@@ -192,7 +187,6 @@ void LLPanelMediaSettingsGeneral::draw() void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable)
{
LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata;
- self->mAltImageEnable ->clear();
self->mAutoLoop->clear();
self->mAutoPlay->clear();
self->mAutoScale->clear();
@@ -203,7 +197,6 @@ void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable) self->mHeightPixels->clear();
self->mHomeURL->clear();
self->mWidthPixels->clear();
- self->mAltImageEnable ->setEnabled(editable);
self->mAutoLoop ->setEnabled(editable);
self->mAutoPlay ->setEnabled(editable);
self->mAutoScale ->setEnabled(editable);
@@ -272,7 +265,6 @@ void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& media_ { LLMediaEntry::HOME_URL_KEY, self->mHomeURL, "LLLineEditor" },
{ LLMediaEntry::FIRST_CLICK_INTERACT_KEY, self->mFirstClick, "LLCheckBoxCtrl" },
{ LLMediaEntry::WIDTH_PIXELS_KEY, self->mWidthPixels, "LLSpinCtrl" },
- { LLMediaEntry::ALT_IMAGE_ENABLE_KEY, self->mAltImageEnable, "LLCheckBoxCtrl" },
{ "", NULL , "" }
};
@@ -393,7 +385,6 @@ void LLPanelMediaSettingsGeneral::apply( void* userdata ) //
void LLPanelMediaSettingsGeneral::getValues( LLSD &fill_me_in )
{
- fill_me_in[LLMediaEntry::ALT_IMAGE_ENABLE_KEY] = mAltImageEnable->getValue();
fill_me_in[LLMediaEntry::AUTO_LOOP_KEY] = mAutoLoop->getValue();
fill_me_in[LLMediaEntry::AUTO_PLAY_KEY] = mAutoPlay->getValue();
fill_me_in[LLMediaEntry::AUTO_SCALE_KEY] = mAutoScale->getValue();
diff --git a/indra/newview/llpanelmediasettingsgeneral.h b/indra/newview/llpanelmediasettingsgeneral.h index 5eb42ffaf4..e82a31382e 100644 --- a/indra/newview/llpanelmediasettingsgeneral.h +++ b/indra/newview/llpanelmediasettingsgeneral.h @@ -85,7 +85,6 @@ private: LLSpinCtrl* mHeightPixels; LLLineEditor* mHomeURL; LLLineEditor* mCurrentURL; - LLCheckBoxCtrl* mAltImageEnable; LLMediaCtrl* mPreviewMedia; }; diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 329d7d26ee..22c3779050 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -111,12 +111,72 @@ bool LLSideTray::instanceCreated () return sInstance!=0; } -LLSideTrayTab::LLSideTrayTab(const Params& params):mMainPanel(0) +////////////////////////////////////////////////////////////////////////////// +// LLSideTrayTab +// Represents a single tab in the side tray, only used by LLSideTray +////////////////////////////////////////////////////////////////////////////// + +class LLSideTrayTab: public LLPanel { - mImagePath = params.image_path; - mTabTitle = params.tab_title; - mDescription = params.description; + friend class LLUICtrlFactory; + friend class LLSideTray; +public: + + struct Params + : public LLInitParam::Block<Params, LLPanel::Params> + { + // image name + Optional<std::string> image; + Optional<std::string> image_selected; + Optional<std::string> tab_title; + Optional<std::string> description; + Params() + : image("image"), + image_selected("image_selected"), + tab_title("tab_title","no title"), + description("description","no description") + {}; + }; +protected: + LLSideTrayTab(const Params& params); + + +public: + virtual ~LLSideTrayTab(); + + /*virtual*/ BOOL postBuild (); + /*virtual*/ bool addChild (LLView* view, S32 tab_group); + + + void arrange (S32 width, S32 height); + void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE); + + static LLSideTrayTab* createInstance (); + + const std::string& getDescription () const { return mDescription;} + const std::string& getTabTitle() const { return mTabTitle;} + + void draw(); + + void onOpen (const LLSD& key); + +private: + std::string mTabTitle; + std::string mImage; + std::string mImageSelected; + std::string mDescription; + + LLView* mMainPanel; +}; +LLSideTrayTab::LLSideTrayTab(const Params& p) +: LLPanel(), + mTabTitle(p.tab_title), + mImage(p.image), + mImageSelected(p.image_selected), + mDescription(p.description), + mMainPanel(NULL) +{ // Necessary for focus movement among child controls setFocusRoot(TRUE); } @@ -221,6 +281,18 @@ LLSideTrayTab* LLSideTrayTab::createInstance () return tab; } +////////////////////////////////////////////////////////////////////////////// +// LLSideTray +////////////////////////////////////////////////////////////////////////////// + +LLSideTray::Params::Params() +: collapsed("collapsed",false), + tab_btn_image_normal("tab_btn_image","sidebar_tab_left.tga"), + tab_btn_image_selected("tab_btn_image_selected","button_enabled_selected_32x128.tga"), + default_button_width("tab_btn_width",32), + default_button_height("tab_btn_height",32), + default_button_margin("tab_btn_margin",0) +{} //virtual LLSideTray::LLSideTray(Params& params) @@ -255,35 +327,6 @@ BOOL LLSideTray::postBuild() setMouseOpaque(false); return true; } - -/** - * add new panel to tab with tab_name name - * @param tab_name - name of sidebar tab to add new panel - * @param panel - pointer to panel - */ -bool LLSideTray::addPanel ( const std::string& tab_name - ,LLPanel* panel ) -{ - return false; -} -/** - * Add new tab to side bar - * @param tab_name - name of the new tab - * @param image - image for new sidebar button - * @param title - title for new tab - */ -bool LLSideTray::addTab ( const std::string& tab_name - ,const std::string& image - ,const std::string& title) -{ - LLSideTrayTab::Params params; - params.image_path = image; - params.tab_title = title; - LLSideTrayTab* tab = LLUICtrlFactory::create<LLSideTrayTab> (params); - addChild(tab,1); - return true; -} - LLSideTrayTab* LLSideTray::getTab(const std::string& name) { @@ -291,7 +334,6 @@ LLSideTrayTab* LLSideTray::getTab(const std::string& name) } - void LLSideTray::toggleTabButton (LLSideTrayTab* tab) { if(tab == NULL) @@ -393,25 +435,30 @@ bool LLSideTray::addChild(LLView* view, S32 tab_group) void LLSideTray::createButtons () { - //create show/hide button - mCollapseButton = createButton(EXPANDED_NAME,"",boost::bind(&LLSideTray::onToggleCollapse, this)); - //create buttons for tabs child_vector_const_iter_t child_it = mTabs.begin(); - ++child_it; - for ( ; child_it != mTabs.end(); ++child_it) { LLSideTrayTab* sidebar_tab = dynamic_cast<LLSideTrayTab*>(*child_it); if(sidebar_tab == NULL) continue; - string name = sidebar_tab->getName(); + std::string name = sidebar_tab->getName(); - LLButton* button = createButton("",sidebar_tab->mImagePath,boost::bind(&LLSideTray::onTabButtonClick, this, sidebar_tab->getName())); - mTabButtons[sidebar_tab->getName()] = button; + // The "home" button will open/close the whole panel, this will need to + // change if the home screen becomes its own tab. + if (name == "sidebar_home") + { + mCollapseButton = createButton("",sidebar_tab->mImage, + boost::bind(&LLSideTray::onToggleCollapse, this)); + } + else + { + LLButton* button = createButton("",sidebar_tab->mImage, + boost::bind(&LLSideTray::onTabButtonClick, this, name)); + mTabButtons[name] = button; + } } - } void LLSideTray::onTabButtonClick(string name) @@ -514,25 +561,33 @@ void LLSideTray::arrange () } } -void LLSideTray::collapseSideBar () +void LLSideTray::collapseSideBar() { mCollapsed = true; - mCollapseButton->setLabel(COLLAPSED_NAME); + LLSideTrayTab* home_tab = getTab("sidebar_home"); + if (home_tab) + { + mCollapseButton->setImageOverlay( home_tab->mImage ); + } mActiveTab->setVisible(FALSE); reflectCollapseChange(); setFocus( FALSE ); } -void LLSideTray::expandSideBar () + +void LLSideTray::expandSideBar() { mCollapsed = false; - mCollapseButton->setLabel(EXPANDED_NAME); + LLSideTrayTab* home_tab = getTab("sidebar_home"); + if (home_tab) + { + mCollapseButton->setImageOverlay( home_tab->mImageSelected ); + } LLSD key;//empty mActiveTab->onOpen(key); mActiveTab->setVisible(TRUE); reflectCollapseChange(); - } void LLSideTray::highlightFocused() diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 6ea6bafac9..845eb86bc1 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -36,59 +36,9 @@ #include "llpanel.h" #include "string" -class LLSideTray; +class LLSideTrayTab; class LLAccordionCtrl; -class LLSideTrayTab: public LLPanel -{ - friend class LLUICtrlFactory; - friend class LLSideTray; -public: - - struct Params - : public LLInitParam::Block<Params, LLPanel::Params> - { - // image name - Optional<std::string> image_path; - Optional<std::string> tab_title; - Optional<std::string> description; - Params() - : image_path("image"), - tab_title("tab_title","no title"), - description("description","no description") - {}; - }; -protected: - LLSideTrayTab(const Params& params); - - -public: - virtual ~LLSideTrayTab(); - - /*virtual*/ BOOL postBuild (); - /*virtual*/ bool addChild (LLView* view, S32 tab_group); - - - void arrange (S32 width, S32 height); - void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE); - - static LLSideTrayTab* createInstance (); - - const std::string& getDescription () const { return mDescription;} - const std::string& getTabTitle() const { return mTabTitle;} - - void draw(); - - void onOpen (const LLSD& key); - -private: - std::string mTabTitle; - std::string mImagePath; - std::string mDescription; - - LLView* mMainPanel; -}; - // added inheritance from LLDestroyClass<LLSideTray> to enable Side Tray perform necessary actions // while disconnecting viewer in LLAppViewer::disconnectViewer(). // LLDestroyClassList::instance().fireCallbacks() calls destroyClass method. See EXT-245. @@ -112,14 +62,7 @@ public: Optional<S32> default_button_height; Optional<S32> default_button_margin; - Params() - : collapsed("collapsed",false), - tab_btn_image_normal("tab_btn_image","sidebar_tab_left.tga"), - tab_btn_image_selected("tab_btn_image_selected","button_enabled_selected_32x128.tga"), - default_button_width("tab_btn_width",32), - default_button_height("tab_btn_height",32), - default_button_margin("tab_btn_margin",0) - {}; + Params(); }; static LLSideTray* getInstance (); @@ -146,23 +89,6 @@ public: */ bool selectTabByIndex(size_t index); - /** - * add new panel to tab with tab_name name - * @param tab_name - name of sidebar tab to add new panel - * @param panel - pointer to panel - */ - bool addPanel ( const std::string& tab_name - ,LLPanel* panel ); - /** - * Add new tab to side bar - * @param tab_name - name of the new tab - * @param image - image for new sidebar button - * @param title - title for new tab - */ - bool addTab ( const std::string& tab_name - ,const std::string& image - ,const std::string& title); - /** * Activate tab with "panel_name" panel * if no such tab - return NULL, otherwise a pointer to the panel diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 44de848d19..77b023f6dd 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1162,10 +1162,11 @@ void LLViewerParcelMgr::sendParcelBuy(ParcelBuyInfo* info) msg->sendReliable(info->mHost); } -void LLViewerParcelMgr::deleteParcelBuy(ParcelBuyInfo*& info) +void LLViewerParcelMgr::deleteParcelBuy(ParcelBuyInfo* *info) { - delete info; - info = NULL; + // Must be here because ParcelBuyInfo is local to this .cpp file + delete *info; + *info = NULL; } void LLViewerParcelMgr::sendParcelDeed(const LLUUID& group_id) diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 3964a56bf6..1c8fe23dba 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -246,7 +246,7 @@ public: BOOL remove_contribution); // callers responsibility to call deleteParcelBuy() on return value void sendParcelBuy(ParcelBuyInfo*); - void deleteParcelBuy(ParcelBuyInfo*&); + void deleteParcelBuy(ParcelBuyInfo* *info); void sendParcelDeed(const LLUUID& group_id); diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index d1ad89442c..b219081cb8 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -408,9 +408,10 @@ BOOL LLWearable::importFile( LLFILE* file ) { delete mSavedTEMap[te]; } - - mTEMap[te] = new LLLocalTextureObject(image, LLUUID(text_buffer)); - mSavedTEMap[te] = new LLLocalTextureObject(image, LLUUID(text_buffer)); + + LLUUID textureid(text_buffer); + mTEMap[te] = new LLLocalTextureObject(image, textureid); + mSavedTEMap[te] = new LLLocalTextureObject(image, textureid); createLayers(te); } diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index b898fd7c93..8cdcee6927 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -247,7 +247,7 @@ name="radio stretch" /> <radio_item top_pad="6" - label="Select Texture" + label="Select Face" layout="topleft" name="radio select face" /> <radio_group.commit_callback diff --git a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml index c725334fc0..7e8b553644 100644 --- a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml +++ b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml @@ -135,7 +135,8 @@ <check_box bottom_delta="-25" - enabled="true" + visible="false" + enabled="false" follows="left|top" font="SansSerifSmall" height="16" @@ -148,7 +149,7 @@ width="150" /> <check_box - bottom_delta="-25" + bottom_delta="0" enabled="true" follows="left|top" font="SansSerifSmall" @@ -168,20 +169,6 @@ font="SansSerifSmall" height="16" initial_value="false" - label="Use Default Alternative Image" - left="10" - mouse_opaque="true" - name="alt_image_enable" - radio_style="false" - width="150" /> - - <check_box - bottom_delta="-25" - enabled="true" - follows="left|top" - font="SansSerifSmall" - height="16" - initial_value="false" label="Auto Play Media" left="10" mouse_opaque="true" diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml index 1ea6e1149d..50108aa21f 100644 --- a/indra/newview/skins/default/xui/en/panel_places.xml +++ b/indra/newview/skins/default/xui/en/panel_places.xml @@ -1,17 +1,18 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel - background_visible="true" +background_visible="true" follows="all" - height="400" + height="570" label="Places" layout="topleft" min_height="350" - min_width="240" name="places panel" + top="0" + left="0" width="333"> <string name="landmarks_tab_title" - value="Landmarks" /> + value="My Landmarks" /> <string name="teleport_history_tab_title" value="Teleport History" /> @@ -19,44 +20,47 @@ follows="left|top|right" font="SansSerif" height="23" - label="Filter" layout="topleft" left="15" + label="Filter" + max_length="300" name="Filter" top="3" - width="300" /> + width="303" /> <tab_container follows="all" - height="326" + height="500" layout="topleft" - left="9" + left="10" name="Places Tabs" + tab_min_width="70" + tab_height="30" tab_position="top" - top="30" + top_pad="10" width="313" /> <panel class="panel_place_info" filename="panel_place_info.xml" follows="all" - height="326" + height="533" layout="topleft" left="0" help_topic="places_info_tab" name="panel_place_info" - top="30" - visible="false" /> + top="5" + visible="false" + width="313" /> <panel - height="25" + height="19" layout="topleft" left="0" help_topic="places_button_tab" name="button_panel" - top_pad="10" width="313"> <button follows="bottom|left" - font="SansSerifSmallBold" - height="25" + font="SansSerifSmall" + height="19" label="Teleport" layout="topleft" left="5" @@ -65,8 +69,8 @@ width="77" /> <button follows="bottom|left" - font="SansSerifSmallBold" - height="25" + font="SansSerifSmall" + height="19" label="Map" layout="topleft" left_pad="5" @@ -76,8 +80,8 @@ <button enabled="false" follows="bottom|left" - font="SansSerifSmallBold" - height="25" + font="SansSerifSmall" + height="19" label="Share" layout="topleft" left_pad="5" @@ -86,8 +90,8 @@ width="60" /> <button follows="bottom|left" - font="SansSerifSmallBold" - height="25" + font="SansSerifSmall" + height="19" label="Edit" layout="topleft" left_pad="5" @@ -96,18 +100,21 @@ width="50" /> <button follows="bottom|right" - font="SansSerifSmallBold" - height="25" - label="▼" + font="SansSerifSmall" + height="19" + image_disabled="ForwardArrow_Disabled" + image_selected="ForwardArrow_Press" + image_unselected="ForwardArrow_Off" + picture_style="true" layout="topleft" name="overflow_btn" right="-10" top="0" - width="30" /> + width="18" /> <button follows="bottom|right" - font="SansSerifSmallBold" - height="25" + font="SansSerifSmall" + height="19" label="Close" layout="topleft" name="close_btn" @@ -116,8 +123,8 @@ width="60" /> <button follows="bottom|right" - font="SansSerifSmallBold" - height="25" + font="SansSerifSmall" + height="19" label="Cancel" layout="topleft" name="cancel_btn" @@ -126,8 +133,8 @@ width="60" /> <button follows="bottom|right" - font="SansSerifSmallBold" - height="25" + font="SansSerifSmall" + height="19" label="Save" layout="topleft" name="save_btn" diff --git a/indra/newview/skins/default/xui/en/panel_side_tray.xml b/indra/newview/skins/default/xui/en/panel_side_tray.xml index 395b574425..6abcbc40d2 100644 --- a/indra/newview/skins/default/xui/en/panel_side_tray.xml +++ b/indra/newview/skins/default/xui/en/panel_side_tray.xml @@ -18,6 +18,7 @@ tab_title="Home" description="Home." image="TabIcon_Open_Off" + image_selected="TabIcon_Close_Off" mouse_opaque="false" background_visible="true" > diff --git a/indra/newview/skins/default/xui/en/widgets/accordion_tab.xml b/indra/newview/skins/default/xui/en/widgets/accordion_tab.xml index 3ff0b3062a..dabcb1038b 100644 --- a/indra/newview/skins/default/xui/en/widgets/accordion_tab.xml +++ b/indra/newview/skins/default/xui/en/widgets/accordion_tab.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <accordion_tab - header_bg_color="0.68 0.68 0.68 1" - header_txt_color="0.68 0.68 0.68 1" + header_bg_color="DkGray2" + header_txt_color="LtGray" header_collapse_img="Accordion_ArrowClosed_Off" header_collapse_img_pressed="Accordion_ArrowClosed_Press" header_expand_img="Accordion_ArrowOpened_Off" header_expand_img_pressed="Accordion_ArrowOpened_Press" - header_image="Accordion_Off.png" + header_image="Accordion_Off" header_image_over="Accordion_Over" header_image_pressed="Accordion_Press" /> diff --git a/indra/newview/skins/default/xui/en/widgets/tab_container.xml b/indra/newview/skins/default/xui/en/widgets/tab_container.xml index 25d85899a1..2fe5f517a2 100644 --- a/indra/newview/skins/default/xui/en/widgets/tab_container.xml +++ b/indra/newview/skins/default/xui/en/widgets/tab_container.xml @@ -1,10 +1,23 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <tab_container tab_min_width="60" tab_max_width="150" - tab_height="16" - tab_top_image_unselected="TabTop_Middle_Off" - tab_top_image_selected="TabTop_Middle_Selected" + tab_height="16"> + <first_tab tab_top_image_unselected="TabTop_Left_Off" + tab_top_image_selected="TabTop_Left_Selected" tab_bottom_image_unselected="Toolbar_Left_Off" tab_bottom_image_selected="Toolbar_Left_Selected" - tab_left_image_unselected="TabTop_Left_Off" - tab_left_image_selected="TabTop_Left_Selected"/>
\ No newline at end of file + tab_left_image_unselected="TabTop_Middle_Off" + tab_left_image_selected="TabTop_Middle_Selected"/> + <middle_tab tab_top_image_unselected="TabTop_Middle_Off" + tab_top_image_selected="TabTop_Middle_Selected" + tab_bottom_image_unselected="Toolbar_Middle_Off" + tab_bottom_image_selected="Toolbar_Middle_Selected" + tab_left_image_unselected="TabTop_Middle_Off" + tab_left_image_selected="TabTop_Middle_Selected"/> + <last_tab tab_top_image_unselected="TabTop_Right_Off" + tab_top_image_selected="TabTop_Right_Selected" + tab_bottom_image_unselected="Toolbar_Right_Off" + tab_bottom_image_selected="Toolbar_Right_Selected" + tab_left_image_unselected="TabTop_Middle_Off" + tab_left_image_selected="TabTop_Middle_Selected"/> +</tab_container>
\ No newline at end of file diff --git a/indra/newview/tests/llcapabilitylistener_test.cpp b/indra/newview/tests/llcapabilitylistener_test.cpp index b965379c9c..4759c7dc91 100644 --- a/indra/newview/tests/llcapabilitylistener_test.cpp +++ b/indra/newview/tests/llcapabilitylistener_test.cpp @@ -5,7 +5,30 @@ * @brief Test for llcapabilitylistener.cpp. * * $LicenseInfo:firstyear=2008&license=viewergpl$ - * Copyright (c) 2008, Linden Research, Inc. + * + * Copyright (c) 2008-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$ */ |