From e1189d0e2ee47539edc68c3532e0a5ce64d5dcd1 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Fri, 4 Jun 2010 13:29:25 +0300 Subject: EXT-7368 FIXED Implemented new "empty_accordion_text" textbox to show help text when there are no visible tabs in accordion. * Textbox always fit whole accordion. * This text is updated with search_term (in link to open Search floater) when new filter substring is passed to accordion. * Accordion is notified by its tabs when their visibility is changed. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/486/ --HG-- branch : product-engine --- indra/llui/llaccordionctrl.cpp | 66 +++++++++++++++++++++- indra/llui/llaccordionctrl.h | 13 +++++ indra/llui/llaccordionctrltab.cpp | 7 +++ indra/llui/llaccordionctrltab.h | 5 ++ indra/newview/lloutfitslist.cpp | 2 + indra/newview/llpanelpeople.cpp | 2 + .../skins/default/xui/en/panel_outfits_list.xml | 1 + .../skins/default/xui/en/widgets/accordion.xml | 15 +++++ 8 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 indra/newview/skins/default/xui/en/widgets/accordion.xml (limited to 'indra') diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 8e0245c451..5f866c49e6 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -66,8 +66,11 @@ LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params) , mAutoScrolling( false ) , mAutoScrollRate( 0.f ) , mSelectedTab( NULL ) + , mNoVisibleTabsHelpText(NULL) { - mSingleExpansion = params.single_expansion; + initNoTabsWidget(params.empty_accordion_text); + + mSingleExpansion = params.single_expansion; if(mFitParent && !mSingleExpansion) { llinfos << "fit_parent works best when combined with single_expansion" << llendl; @@ -78,7 +81,10 @@ LLAccordionCtrl::LLAccordionCtrl() : LLPanel() , mAutoScrolling( false ) , mAutoScrollRate( 0.f ) , mSelectedTab( NULL ) + , mNoVisibleTabsHelpText(NULL) { + initNoTabsWidget(LLTextBox::Params()); + mSingleExpansion = false; mFitParent = false; LLUICtrlFactory::getInstance()->buildPanel(this, "accordion_parent.xml"); @@ -168,6 +174,8 @@ BOOL LLAccordionCtrl::postBuild() } } + updateNoTabsHelpTextVisibility(); + return TRUE; } @@ -187,8 +195,15 @@ void LLAccordionCtrl::reshape(S32 width, S32 height, BOOL called_from_parent) rcLocal.mRight = rcLocal.mLeft + width; rcLocal.mTop = rcLocal.mBottom + height; + // get textbox a chance to reshape its content + mNoVisibleTabsHelpText->reshape(width, height, called_from_parent); + setRect(rcLocal); + // assume that help text is always fit accordion. + // necessary text paddings can be set via h_pad and v_pad + mNoVisibleTabsHelpText->setRect(getLocalRect()); + arrange(); } @@ -359,6 +374,31 @@ void LLAccordionCtrl::removeCollapsibleCtrl(LLView* view) } } +void LLAccordionCtrl::initNoTabsWidget(const LLTextBox::Params& tb_params) +{ + LLTextBox::Params tp = tb_params; + tp.rect(getLocalRect()); + mNoVisibleTabsOrigString = tp.initial_value().asString(); + mNoVisibleTabsHelpText = LLUICtrlFactory::create(tp, this); +} + +void LLAccordionCtrl::updateNoTabsHelpTextVisibility() +{ + bool visible_exists = false; + std::vector::const_iterator it = mAccordionTabs.begin(); + const std::vector::const_iterator it_end = mAccordionTabs.end(); + for (; it != it_end; ++it) + { + if ((*it)->getVisible()) + { + visible_exists = true; + break; + } + } + + mNoVisibleTabsHelpText->setVisible(!visible_exists); +} + void LLAccordionCtrl::arrangeSinge() { S32 panel_left = BORDER_MARGIN; // Margin from left side of Splitter @@ -737,6 +777,20 @@ S32 LLAccordionCtrl::notifyParent(const LLSD& info) } return 1; } + else if (info.has("child_visibility_change")) + { + BOOL new_visibility = info["child_visibility_change"]; + if (new_visibility) + { + // there is at least one visible tab + mNoVisibleTabsHelpText->setVisible(FALSE); + } + else + { + // it could be the latest visible tab, check all of them + updateNoTabsHelpTextVisibility(); + } + } return LLPanel::notifyParent(info); } void LLAccordionCtrl::reset () @@ -745,6 +799,16 @@ void LLAccordionCtrl::reset () mScrollbar->setDocPos(0); } +void LLAccordionCtrl::setFilterSubString(const std::string& filter_string) +{ + LLStringUtil::format_map_t args; + args["[SEARCH_TERM]"] = LLURI::escape(filter_string); + std::string text = mNoVisibleTabsOrigString; + LLStringUtil::format(text, args); + + mNoVisibleTabsHelpText->setValue(text); +} + S32 LLAccordionCtrl::calcExpandedTabHeight(S32 tab_index /* = 0 */, S32 available_height /* = 0 */) { if(tab_index < 0) diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index a029201c90..2f483eafb2 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -34,6 +34,7 @@ #define LL_ACCORDIONCTRL_H #include "llpanel.h" +#include "lltextbox.h" #include "llscrollbar.h" #include @@ -64,10 +65,12 @@ public: accordion tabs are responsible for scrolling their content. *NOTE fit_parent works best when combined with single_expansion. Accordion view should implement getRequiredRect() and provide valid height*/ + Optional empty_accordion_text; Params() : single_expansion("single_expansion",false) , fit_parent("fit_parent", false) + , empty_accordion_text("empty_accordion_text") {}; }; @@ -105,7 +108,15 @@ public: void reset (); + /** + * Sets filter substring as a search_term for help text when there are no any visible tabs. + */ + void setFilterSubString(const std::string& filter_string); + private: + void initNoTabsWidget(const LLTextBox::Params& tb_params); + void updateNoTabsHelpTextVisibility(); + void arrangeSinge(); void arrangeMultiple(); @@ -131,6 +142,8 @@ private: bool mAutoScrolling; F32 mAutoScrollRate; LLAccordionCtrlTab* mSelectedTab; + LLTextBox* mNoVisibleTabsHelpText; + std::string mNoVisibleTabsOrigString; }; diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 83e67980a3..83fcc77f2a 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -409,6 +409,13 @@ void LLAccordionCtrlTab::changeOpenClose(bool is_open) } } +void LLAccordionCtrlTab::handleVisibilityChange(BOOL new_visibility) +{ + LLUICtrl::handleVisibilityChange(new_visibility); + + notifyParent(LLSD().with("child_visibility_change", new_visibility)); +} + BOOL LLAccordionCtrlTab::handleMouseDown(S32 x, S32 y, MASK mask) { if(mCollapsible && mHeaderVisible && mCanOpenClose) diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index 83a9024a74..be8b464b8e 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -154,6 +154,11 @@ public: // Call reshape after changing size virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + /** + * Raises notifyParent event with "child_visibility_change" = new_visibility + */ + void handleVisibilityChange(BOOL new_visibility); + // Changes expand/collapse state and triggers expand/collapse callbacks virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 77db280487..a4ae957c76 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -500,6 +500,8 @@ void LLOutfitsList::onFilteredWearableItemsListRefresh(LLUICtrl* ctrl) void LLOutfitsList::applyFilter(const std::string& new_filter_substring) { + mAccordion->setFilterSubString(new_filter_substring); + for (outfits_map_t::iterator iter = mOutfitsMap.begin(), iter_end = mOutfitsMap.end(); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 0a4af00f78..f16d1d8fda 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1450,6 +1450,8 @@ void LLPanelPeople::showFriendsAccordionsIfNeeded() LLAccordionCtrl* accordion = getChild("friends_accordion"); accordion->arrange(); + // *TODO: new empty_accordion_text attribute was implemented in accordion (EXT-7368). + // this code should be refactored to use it // keep help text in a synchronization with accordions visibility. updateFriendListHelpText(); } diff --git a/indra/newview/skins/default/xui/en/panel_outfits_list.xml b/indra/newview/skins/default/xui/en/panel_outfits_list.xml index 5cf94c25d7..5c9ae51a48 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_list.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_list.xml @@ -14,6 +14,7 @@ background_visible="true" bg_alpha_color="DkGray2" bg_opaque_color="DkGray2" + empty_accordion_text.value="Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]." follows="all" height="400" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/widgets/accordion.xml b/indra/newview/skins/default/xui/en/widgets/accordion.xml new file mode 100644 index 0000000000..b817ba56ca --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/accordion.xml @@ -0,0 +1,15 @@ + + + + -- cgit v1.2.3 From 9345f01d4b61f857ed540cf725c8cd0ee1b0ef24 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Fri, 4 Jun 2010 13:57:19 +0300 Subject: EXT-7547 FIX update allowing padding according to sidebar state reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/492/ --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 39 +++++++++++++++++++++++++++++++++++---- indra/newview/llimfloater.h | 4 ++++ indra/newview/llsidetray.cpp | 3 +++ indra/newview/llsidetray.h | 4 ++++ 4 files changed, 46 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 3aa9d75bc0..967f38bfd2 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -60,8 +60,14 @@ #include "llinventorymodel.h" #include "llrootview.h" #include "llspeakers.h" +#include "llsidetray.h" +static const S32 RECT_PADDING_NOT_INIT = -1; +static const S32 RECT_PADDING_NEED_RECALC = -2; + +S32 LLIMFloater::sAllowedRectRightPadding = RECT_PADDING_NOT_INIT; + LLIMFloater::LLIMFloater(const LLUUID& session_id) : LLTransientDockableFloater(NULL, true, session_id), mControlPanel(NULL), @@ -444,19 +450,44 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) return floater; } +//static +bool LLIMFloater::resetAllowedRectPadding(const LLSD& newvalue) +{ + //reset allowed rect right padding if "SidebarCameraMovement" option + //or sidebar state changed + sAllowedRectRightPadding = RECT_PADDING_NEED_RECALC ; + return true; +} + void LLIMFloater::getAllowedRect(LLRect& rect) { + if (sAllowedRectRightPadding == RECT_PADDING_NOT_INIT) //wasn't initialized + { + gSavedSettings.getControl("SidebarCameraMovement")->getSignal()->connect(boost::bind(&LLIMFloater::resetAllowedRectPadding, _2)); + + LLSideTray* side_bar = LLSideTray::getInstance(); + side_bar->getCollapseSignal().connect(boost::bind(&LLIMFloater::resetAllowedRectPadding, _2)); + sAllowedRectRightPadding = RECT_PADDING_NEED_RECALC; + } + rect = gViewerWindow->getWorldViewRectScaled(); - static S32 right_padding = 0; - if (right_padding == 0) + if (sAllowedRectRightPadding == RECT_PADDING_NEED_RECALC) //recalc allowed rect right padding { LLPanel* side_bar_tabs = gViewerWindow->getRootView()->getChild ( "side_bar_tabs"); - right_padding = side_bar_tabs->getRect().getWidth(); + sAllowedRectRightPadding = side_bar_tabs->getRect().getWidth(); LLTransientFloaterMgr::getInstance()->addControlView(side_bar_tabs); + + if (gSavedSettings.getBOOL("SidebarCameraMovement") == FALSE) + { + LLSideTray* side_bar = LLSideTray::getInstance(); + + if (side_bar->getVisible() && !side_bar->getCollapsed()) + sAllowedRectRightPadding += side_bar->getRect().getWidth(); + } } - rect.mRight -= right_padding; + rect.mRight -= sAllowedRectRightPadding; } void LLIMFloater::setDocked(bool docked, bool pop_on_undock) diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index fef178e3a2..f1e68a2b3d 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -155,6 +155,10 @@ private: static void closeHiddenIMToasts(); + static bool resetAllowedRectPadding(const LLSD& newvalue); + //need to keep this static for performance issues + static S32 sAllowedRectRightPadding; + static void confirmLeaveCallCallback(const LLSD& notification, const LLSD& response); LLPanelChatControlPanel* mControlPanel; diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 3c97f01887..9406f80b75 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -469,6 +469,9 @@ void LLSideTray::reflectCollapseChange() } gFloaterView->refresh(); + + LLSD new_value = mCollapsed; + mCollapseSignal(this,new_value); } void LLSideTray::arrange() diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index e8fdee9430..e176ff5aff 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -159,6 +159,8 @@ public: void updateSidetrayVisibility(); + commit_signal_t& getCollapseSignal() { return mCollapseSignal; } + protected: LLSideTrayTab* getTab (const std::string& name); @@ -187,6 +189,8 @@ private: child_vector_t mTabs; LLSideTrayTab* mActiveTab; + commit_signal_t mCollapseSignal; + LLButton* mCollapseButton; bool mCollapsed; -- cgit v1.2.3 From f99a601dbe7d783b8bd80e0791a222ce51bd7dc6 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 4 Jun 2010 14:58:48 +0300 Subject: EXT-7485 FIXED Provided update of 'save as' button status and save outfit panel status. 1 published LLCOFObserver as LLOutfitObserver(moved from llpaneloutfitedit.cpp to lloutfitobserver.h) 2 decoupled outfit edit panel and observer by replacing pointer to panel with signals and made observer as singleton 3 moved call of LLAppearanceMgr::getInstance()->updateIsDirty() from outfit edit panel to observer(discussed with IB) 4 modified updating of combo button state on outfit panel using LLOutfitObserver 5 modified refresh of outfit name and status on outfit change event using LLOutfitObserver 6 removed unnecessary LLWatchForOutfitRenameObserver that caused excessive updates of outfit panel status name --HG-- branch : product-engine --- indra/newview/CMakeLists.txt | 2 + indra/newview/lloutfitobserver.cpp | 125 ++++++++++++++++++++++++++++++ indra/newview/lloutfitobserver.h | 82 ++++++++++++++++++++ indra/newview/llpaneloutfitedit.cpp | 106 ++----------------------- indra/newview/llpaneloutfitedit.h | 3 +- indra/newview/llpaneloutfitsinventory.cpp | 10 ++- indra/newview/llpaneloutfitsinventory.h | 2 +- indra/newview/llsaveoutfitcombobtn.cpp | 1 + indra/newview/llsidepanelappearance.cpp | 28 +------ indra/newview/llsidepanelappearance.h | 4 - 10 files changed, 230 insertions(+), 133 deletions(-) create mode 100644 indra/newview/lloutfitobserver.cpp create mode 100644 indra/newview/lloutfitobserver.h (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 7dbe650625..3b1c49edd3 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -306,6 +306,7 @@ set(viewer_SOURCE_FILES llnotificationstorage.cpp llnotificationtiphandler.cpp lloutfitslist.cpp + lloutfitobserver.cpp lloutputmonitorctrl.cpp llpanelavatar.cpp llpanelavatartag.cpp @@ -822,6 +823,7 @@ set(viewer_HEADER_FILES llnotificationmanager.h llnotificationstorage.h lloutfitslist.h + lloutfitobserver.h lloutputmonitorctrl.h llpanelavatar.h llpanelavatartag.h diff --git a/indra/newview/lloutfitobserver.cpp b/indra/newview/lloutfitobserver.cpp new file mode 100644 index 0000000000..848b595613 --- /dev/null +++ b/indra/newview/lloutfitobserver.cpp @@ -0,0 +1,125 @@ +/** + * @file lloutfitobserver.cpp + * @brief Outfit observer facade. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, 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 "llappearancemgr.h" +#include "lloutfitobserver.h" +#include "llinventorymodel.h" +#include "llviewerinventory.h" + +LLOutfitObserver::LLOutfitObserver() : + mCOFLastVersion(LLViewerInventoryCategory::VERSION_UNKNOWN) +{ + gInventory.addObserver(this); +} + +LLOutfitObserver::~LLOutfitObserver() +{ + if (gInventory.containsObserver(this)) + { + gInventory.removeObserver(this); + } +} + +void LLOutfitObserver::changed(U32 mask) +{ + if (!gInventory.isInventoryUsable()) + return; + + bool panel_updated = checkCOF(); + + if (!panel_updated) + { + checkBaseOutfit(); + } +} + +// static +S32 LLOutfitObserver::getCategoryVersion(const LLUUID& cat_id) +{ + LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); + if (!cat) + return LLViewerInventoryCategory::VERSION_UNKNOWN; + + return cat->getVersion(); +} + +bool LLOutfitObserver::checkCOF() +{ + LLUUID cof = LLAppearanceMgr::getInstance()->getCOF(); + if (cof.isNull()) + return false; + + S32 cof_version = getCategoryVersion(cof); + + if (cof_version == mCOFLastVersion) + return false; + + mCOFLastVersion = cof_version; + + LLAppearanceMgr::getInstance()->updateIsDirty(); + mCOFChanged(); + + return true; +} + +void LLOutfitObserver::checkBaseOutfit() +{ + LLUUID baseoutfit_id = + LLAppearanceMgr::getInstance()->getBaseOutfitUUID(); + + if (baseoutfit_id == mBaseOutfitId) + { + if (baseoutfit_id.isNull()) + return; + + const S32 baseoutfit_ver = getCategoryVersion(baseoutfit_id); + + if (baseoutfit_ver == mBaseOutfitLastVersion) + return; + } + else + { + mBaseOutfitId = baseoutfit_id; + mBOFReplaced(); + + if (baseoutfit_id.isNull()) + return; + + mBaseOutfitLastVersion = getCategoryVersion(mBaseOutfitId); + } + + LLAppearanceMgr& app_mgr = LLAppearanceMgr::instance(); + app_mgr.updateIsDirty(); + mBOFChanged(); +} diff --git a/indra/newview/lloutfitobserver.h b/indra/newview/lloutfitobserver.h new file mode 100644 index 0000000000..4cb40ead15 --- /dev/null +++ b/indra/newview/lloutfitobserver.h @@ -0,0 +1,82 @@ +/** + * @file lloutfitobserver.h + * @brief Outfit observer facade. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, 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$ + */ + +#ifndef LL_OUTFITOBSERVER_H +#define LL_OUTFITOBSERVER_H + +#include "llsingleton.h" + +/** + * Outfit observer facade that provides simple possibility to subscribe on + * BOF(base outfit) replaced, BOF changed, COF(current outfit) changed events. + */ +class LLOutfitObserver: public LLInventoryObserver, public LLSingleton +{ +public: + virtual ~LLOutfitObserver(); + + friend class LLSingleton; + + virtual void changed(U32 mask); + + typedef boost::signals2::signal signal_t; + + void addBOFReplacedCallback(const signal_t::slot_type& cb) { mBOFReplaced.connect(cb); } + + void addBOFChangedCallback(const signal_t::slot_type& cb) { mBOFChanged.connect(cb); } + + void addCOFChangedCallback(const signal_t::slot_type& cb) { mCOFChanged.connect(cb); } + +protected: + LLOutfitObserver(); + + /** Get a version of an inventory category specified by its UUID */ + static S32 getCategoryVersion(const LLUUID& cat_id); + + bool checkCOF(); + + void checkBaseOutfit(); + + //last version number of a COF category + S32 mCOFLastVersion; + + LLUUID mBaseOutfitId; + + S32 mBaseOutfitLastVersion; + +private: + signal_t mBOFReplaced; + signal_t mBOFChanged; + signal_t mCOFChanged; +}; + +#endif /* LL_OUTFITOBSERVER_H */ diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 4982e98f8e..ea7410502d 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -39,6 +39,7 @@ #include "llagentcamera.h" #include "llagentwearables.h" #include "llappearancemgr.h" +#include "lloutfitobserver.h" #include "llcofwearables.h" #include "llfilteredwearablelist.h" #include "llinventory.h" @@ -143,100 +144,6 @@ private: } }; -class LLCOFObserver : public LLInventoryObserver -{ -public: - LLCOFObserver(LLPanelOutfitEdit *panel) : mPanel(panel), - mCOFLastVersion(LLViewerInventoryCategory::VERSION_UNKNOWN) - { - gInventory.addObserver(this); - } - - virtual ~LLCOFObserver() - { - if (gInventory.containsObserver(this)) - { - gInventory.removeObserver(this); - } - } - - virtual void changed(U32 mask) - { - if (!gInventory.isInventoryUsable()) return; - - bool panel_updated = checkCOF(); - - if (!panel_updated) - { - checkBaseOutfit(); - } - } - -protected: - - /** Get a version of an inventory category specified by its UUID */ - static S32 getCategoryVersion(const LLUUID& cat_id) - { - LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); - if (!cat) return LLViewerInventoryCategory::VERSION_UNKNOWN; - - return cat->getVersion(); - } - - bool checkCOF() - { - LLUUID cof = LLAppearanceMgr::getInstance()->getCOF(); - if (cof.isNull()) return false; - - S32 cof_version = getCategoryVersion(cof); - - if (cof_version == mCOFLastVersion) return false; - - mCOFLastVersion = cof_version; - - mPanel->update(); - - return true; - } - - void checkBaseOutfit() - { - LLUUID baseoutfit_id = LLAppearanceMgr::getInstance()->getBaseOutfitUUID(); - - if (baseoutfit_id == mBaseOutfitId) - { - if (baseoutfit_id.isNull()) return; - - const S32 baseoutfit_ver = getCategoryVersion(baseoutfit_id); - - if (baseoutfit_ver == mBaseOutfitLastVersion) return; - } - else - { - mBaseOutfitId = baseoutfit_id; - mPanel->updateCurrentOutfitName(); - - if (baseoutfit_id.isNull()) return; - - mBaseOutfitLastVersion = getCategoryVersion(mBaseOutfitId); - } - - mPanel->updateVerbs(); - } - - - - - LLPanelOutfitEdit *mPanel; - - //last version number of a COF category - S32 mCOFLastVersion; - - LLUUID mBaseOutfitId; - - S32 mBaseOutfitLastVersion; -}; - class LLCOFDragAndDropObserver : public LLInventoryAddItemByAssetObserver { public: @@ -277,7 +184,6 @@ LLPanelOutfitEdit::LLPanelOutfitEdit() mSearchFilter(NULL), mCOFWearables(NULL), mInventoryItemsPanel(NULL), - mCOFObserver(NULL), mGearMenu(NULL), mCOFDragAndDropObserver(NULL), mInitialized(false), @@ -288,7 +194,11 @@ LLPanelOutfitEdit::LLPanelOutfitEdit() mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); - mCOFObserver = new LLCOFObserver(this); + + LLOutfitObserver& observer = LLOutfitObserver::instance(); + observer.addBOFReplacedCallback(boost::bind(&LLPanelOutfitEdit::updateCurrentOutfitName, this)); + observer.addBOFChangedCallback(boost::bind(&LLPanelOutfitEdit::updateVerbs, this)); + observer.addCOFChangedCallback(boost::bind(&LLPanelOutfitEdit::update, this)); mLookItemTypes.reserve(NUM_LOOK_ITEM_TYPES); for (U32 i = 0; i < NUM_LOOK_ITEM_TYPES; i++) @@ -303,7 +213,6 @@ LLPanelOutfitEdit::~LLPanelOutfitEdit() { delete mSavedFolderState; - delete mCOFObserver; delete mCOFDragAndDropObserver; delete mWearableListMaskCollector; @@ -756,9 +665,6 @@ void LLPanelOutfitEdit::updateCurrentOutfitName() //private void LLPanelOutfitEdit::updateVerbs() { - //*TODO implement better handling of COF dirtiness - LLAppearanceMgr::getInstance()->updateIsDirty(); - bool outfit_is_dirty = LLAppearanceMgr::getInstance()->isOutfitDirty(); bool has_baseoutfit = LLAppearanceMgr::getInstance()->getBaseOutfitUUID().notNull(); diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 802386c573..24ecf75c18 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -49,7 +49,7 @@ class LLButton; class LLCOFWearables; class LLTextBox; class LLInventoryCategory; -class LLCOFObserver; +class LLOutfitObserver; class LLCOFDragAndDropObserver; class LLInventoryPanel; class LLSaveFolderState; @@ -153,7 +153,6 @@ private: LLInventoryItemsList* mWearableItemsList; LLPanel* mWearableItemsPanel; - LLCOFObserver* mCOFObserver; LLCOFDragAndDropObserver* mCOFDragAndDropObserver; std::vector mLookItemTypes; diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 5f67f3d989..8836672f91 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -50,6 +50,7 @@ #include "lllineeditor.h" #include "llmodaldialog.h" #include "llnotificationsutil.h" +#include "lloutfitobserver.h" #include "lloutfitslist.h" #include "llsaveoutfitcombobtn.h" #include "llsidepanelappearance.h" @@ -204,6 +205,10 @@ LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); gAgentWearables.addLoadedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoaded, this)); + + LLOutfitObserver& observer = LLOutfitObserver::instance(); + observer.addBOFChangedCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); + observer.addCOFChangedCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this)); } LLPanelOutfitsInventory::~LLPanelOutfitsInventory() @@ -522,7 +527,7 @@ void LLPanelOutfitsInventory::updateListCommands() mListCommands->childSetEnabled("trash_btn", trash_enabled); mListCommands->childSetEnabled("wear_btn", wear_enabled); mListCommands->childSetVisible("wear_btn", wear_enabled); - mSaveComboBtn->setSaveBtnEnabled(make_outfit_enabled); + mSaveComboBtn->setMenuItemEnabled("save_outfit", make_outfit_enabled); } void LLPanelOutfitsInventory::showGearMenu() @@ -665,7 +670,7 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) } if (command_name == "make_outfit") { - return TRUE; + return LLAppearanceMgr::getInstance()->isOutfitDirty(); } if (command_name == "edit" || @@ -789,6 +794,7 @@ void LLPanelOutfitsInventory::onWearablesLoaded() setWearablesLoading(false); } +// static LLSidepanelAppearance* LLPanelOutfitsInventory::getAppearanceSP() { static LLSidepanelAppearance* panel_appearance = diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index aff7839bcc..d58ae554b0 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -75,7 +75,7 @@ public: void setParent(LLSidepanelAppearance *parent); LLFolderView* getRootFolder(); - LLSidepanelAppearance* getAppearanceSP(); + static LLSidepanelAppearance* getAppearanceSP(); static LLPanelOutfitsInventory* findInstance(); diff --git a/indra/newview/llsaveoutfitcombobtn.cpp b/indra/newview/llsaveoutfitcombobtn.cpp index b9b577084b..9518b0cbb3 100644 --- a/indra/newview/llsaveoutfitcombobtn.cpp +++ b/indra/newview/llsaveoutfitcombobtn.cpp @@ -34,6 +34,7 @@ #include "llappearancemgr.h" #include "llpaneloutfitsinventory.h" +#include "llsidepanelappearance.h" #include "llsaveoutfitcombobtn.h" #include "llviewermenu.h" diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index b66789448f..ef7286b7b4 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -42,6 +42,7 @@ #include "llfloaterreg.h" #include "llfloaterworldmap.h" #include "llfoldervieweventlistener.h" +#include "lloutfitobserver.h" #include "llpaneleditwearable.h" #include "llpaneloutfitsinventory.h" #include "llsidetray.h" @@ -73,26 +74,6 @@ private: LLSidepanelAppearance *mPanel; }; -class LLWatchForOutfitRenameObserver : public LLInventoryObserver -{ -public: - LLWatchForOutfitRenameObserver(LLSidepanelAppearance *panel) : - mPanel(panel) - {} - virtual void changed(U32 mask); - -private: - LLSidepanelAppearance *mPanel; -}; - -void LLWatchForOutfitRenameObserver::changed(U32 mask) -{ - if (mask & LABEL) - { - mPanel->refreshCurrentOutfitName(); - } -} - LLSidepanelAppearance::LLSidepanelAppearance() : LLPanel(), mFilterSubString(LLStringUtil::null), @@ -101,12 +82,13 @@ LLSidepanelAppearance::LLSidepanelAppearance() : mCurrOutfitPanel(NULL), mOpened(false) { + LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); + outfit_observer.addBOFChangedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, "")); + outfit_observer.addCOFChangedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, "")); } LLSidepanelAppearance::~LLSidepanelAppearance() { - gInventory.removeObserver(mOutfitRenameWatcher); - delete mOutfitRenameWatcher; } // virtual @@ -160,8 +142,6 @@ BOOL LLSidepanelAppearance::postBuild() mCurrOutfitPanel = getChild("panel_currentlook"); - mOutfitRenameWatcher = new LLWatchForOutfitRenameObserver(this); - gInventory.addObserver(mOutfitRenameWatcher); setVisibleCallback(boost::bind(&LLSidepanelAppearance::onVisibilityChange,this,_2)); diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 30022ae375..812d6362ef 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -40,7 +40,6 @@ class LLFilterEditor; class LLCurrentlyWornFetchObserver; -class LLWatchForOutfitRenameObserver; class LLPanelEditWearable; class LLWearable; class LLPanelOutfitsInventory; @@ -97,9 +96,6 @@ private: // Used to make sure the user's inventory is in memory. LLCurrentlyWornFetchObserver* mFetchWorn; - // Used to update title when currently worn outfit gets renamed. - LLWatchForOutfitRenameObserver* mOutfitRenameWatcher; - // Search string for filtering landmarks and teleport // history locations std::string mFilterSubString; -- cgit v1.2.3 From 5e05d94f1379c5971a036dfe3468d067c3cfdbc5 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Fri, 4 Jun 2010 15:41:04 +0300 Subject: EXT-7548 FIXED Reset control variable for "Build" & "Map" buttons on destroy. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/517/ --HG-- branch : product-engine --- indra/newview/llbottomtray.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 7a3eddf7a6..41f5fe64a1 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -203,7 +203,9 @@ LLBottomTray::~LLBottomTray() // override effect of save_visibility=true. // this attribute is necessary to button.initial_callback=Button.SetFloaterToggle works properly: // i.g when floater changes its visibility - button changes its toggle state. + getChild("build_btn")->setControlValue(false); getChild("search_btn")->setControlValue(false); + getChild("world_map_btn")->setControlValue(false); } // *TODO Vadim: why void* ? -- cgit v1.2.3 From caeeebe86a73486288e31751cde3b4989def379f Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Fri, 4 Jun 2010 15:49:59 +0300 Subject: EXT-7607 FIXED added 2px gap between a texture label and a texture preview area for all texture pickers Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/509/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/widgets/color_swatch.xml | 3 ++- indra/newview/skins/default/xui/en/widgets/texture_picker.xml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml index dfd301a770..48b987d7e8 100644 --- a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml +++ b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml @@ -4,5 +4,6 @@ name="color_swatch"> + follows="left|right|bottom" + v_pad="2"/> diff --git a/indra/newview/skins/default/xui/en/widgets/texture_picker.xml b/indra/newview/skins/default/xui/en/widgets/texture_picker.xml index 33c3475eb2..757f0f49d1 100644 --- a/indra/newview/skins/default/xui/en/widgets/texture_picker.xml +++ b/indra/newview/skins/default/xui/en/widgets/texture_picker.xml @@ -3,7 +3,8 @@ + font="SansSerifSmall" + v_pad="2"/> -- cgit v1.2.3 From f954936d600c24d5263ee100d3808503b34fc6fc Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Fri, 4 Jun 2010 15:53:07 +0300 Subject: EXT-7575 FIXED appended attachment location after name in parenthesis. Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/514 --HG-- branch : product-engine --- indra/newview/llcofwearables.cpp | 2 +- indra/newview/llinventoryitemslist.h | 6 ++++-- indra/newview/llwearableitemslist.cpp | 26 ++++++++++++++++++++++++++ indra/newview/llwearableitemslist.h | 15 +++++++++++++++ 4 files changed, 46 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 7ac3d14c72..05046aca5a 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -427,7 +427,7 @@ LLPanelDeletableWearableListItem* LLCOFWearables::buildAttachemntListItem(LLView llassert(item); if (!item) return NULL; - LLPanelDeletableWearableListItem* item_panel = LLPanelDeletableWearableListItem::create(item); + LLPanelAttachmentListItem* item_panel = LLPanelAttachmentListItem::create(item); if (!item_panel) return NULL; //setting callbacks diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index 0dd6f53be7..2c60d38cb5 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -177,7 +177,10 @@ protected: void setIconImage(const LLUIImagePtr& image); /** Set item title - inventory item name usually */ - void setTitle(const std::string& title, const std::string& highlit_text); + virtual void setTitle(const std::string& title, const std::string& highlit_text); + + + LLViewerInventoryItem* mItem; // force not showing link icon on item's icon bool mForceNoLinksOnIcons; @@ -196,7 +199,6 @@ private: /** reshape remaining widgets */ void reshapeMiddleWidgets(); - LLViewerInventoryItem* mItem; LLIconCtrl* mIconCtrl; LLTextBox* mTitleCtrl; diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index ba1d0b727d..edee30c2ed 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -42,6 +42,7 @@ #include "llmenugl.h" // for LLContextMenu #include "lltransutil.h" #include "llviewerattachmenu.h" +#include "llvoavatarself.h" class LLFindOutfitItems : public LLInventoryCollectFunctor { @@ -258,6 +259,31 @@ BOOL LLPanelDeletableWearableListItem::postBuild() } +// static +LLPanelAttachmentListItem* LLPanelAttachmentListItem::create(LLViewerInventoryItem* item) +{ + LLPanelAttachmentListItem* list_item = NULL; + if(item) + { + list_item = new LLPanelAttachmentListItem(item); + list_item->init(); + } + return list_item; +} + +void LLPanelAttachmentListItem::setTitle(const std::string& title, const std::string& highlit_text) +{ + std::string title_joint = title; + + if (mItem && isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(mItem->getLinkedUUID())) + { + std::string joint = LLTrans::getString(gAgentAvatarp->getAttachedPointName(mItem->getLinkedUUID())); + title_joint = title + " (" + joint + ")"; + } + + LLPanelDeletableWearableListItem::setTitle(title_joint, highlit_text); +} + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 2fdb8f0ab8..f03336186c 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -116,6 +116,21 @@ protected: /*virtual*/ void init(); }; +/** Outfit list item for an attachment */ +class LLPanelAttachmentListItem : public LLPanelDeletableWearableListItem +{ + LOG_CLASS(LLPanelAttachmentListItem); +public: + static LLPanelAttachmentListItem* create(LLViewerInventoryItem* item); + virtual ~LLPanelAttachmentListItem() {}; + + /** Set item title. Joint name is added to the title in parenthesis */ + /*virtual*/ void setTitle(const std::string& title, const std::string& highlit_text); + +protected: + LLPanelAttachmentListItem(LLViewerInventoryItem* item) : LLPanelDeletableWearableListItem(item) {}; +}; + /** * @class LLPanelClothingListItem * -- cgit v1.2.3 From 9343389313f9d4895b5826bfc68d7998763254e7 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Fri, 4 Jun 2010 17:44:28 +0300 Subject: EXT-7595 FIXED Add empty space above button bar with 'Add more...' button in Add Wearables panel - Decreased accordion height Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/512/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_cof_wearables.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml index 5f34c24bca..83040a745b 100644 --- a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml +++ b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml @@ -11,7 +11,7 @@ Date: Fri, 4 Jun 2010 17:45:07 +0300 Subject: EXT-7596 FIXED Reworked filters 'My Appearance' and 'Add Wearaples' panel corresponding with spec - Changed label and font of filter's label in 'Add Wearables' panel - Added magnifier icon to the filters of 'My Appearance' and 'Add Wearables' panels Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/515/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_outfit_edit.xml | 5 ++--- indra/newview/skins/default/xui/en/sidepanel_appearance.xml | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index 769f9b7bbf..40f60d50fb 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -256,15 +256,14 @@ It is calculated as border_size + 2*UIResizeBarOverlap background_image="TextField_Search_Off" enabled="true" follows="left|right|top" - font="SansSerif" - label="Filter" + label="Filter Inventory Wearables" layout="topleft" left="5" width="290" height="25" name="look_item_filter" + search_button_visible="true" text_color="black" - text_pad_left="25" visible="true"/> diff --git a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml index 3d7b0b7edc..ae08a13793 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml @@ -111,6 +111,7 @@ width="333"> label="Filter Outfits" max_length="300" name="Filter" + search_button_visible="true" top_pad="10" width="303" /> Date: Fri, 4 Jun 2010 18:29:39 +0300 Subject: EXT-7641 FIXED removed a button bar from Edit Wearable panel Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/521/ --HG-- branch : product-engine --- .../skins/default/xui/en/panel_edit_wearable.xml | 92 ++++------------------ 1 file changed, 17 insertions(+), 75 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml index 67ff71cef1..8604f42e75 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml @@ -235,7 +235,7 @@ left="0" - -