From 42319d1ab89bd3d6ba193cc2c374ddc1571f2bdf Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 13 Nov 2009 18:22:00 -0500 Subject: Header file cleanup Moved LLInventoryPanelObserver to be private to LLInventoryPanel --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 10 ---------- indra/newview/llinventorybridge.h | 16 ---------------- indra/newview/llinventorypanel.cpp | 26 ++++++++++++++++++++++++-- 3 files changed, 24 insertions(+), 28 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d7be09efa9..2a1fdb081e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -162,16 +162,6 @@ std::string ICON_NAME[ICON_NAME_COUNT] = "inv_item_linkfolder.tga" }; - -// +=================================================+ -// | LLInventoryPanelObserver | -// +=================================================+ -void LLInventoryPanelObserver::changed(U32 mask) -{ - mIP->modelChanged(mask); -} - - // +=================================================+ // | LLInvFVBridge | // +=================================================+ diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 4c7b0a0517..56cb0f93ed 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -107,22 +107,6 @@ struct LLAttachmentRezAction S32 mAttachPt; }; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryPanelObserver -// -// Bridge to support knowing when the inventory has changed. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLInventoryPanelObserver : public LLInventoryObserver -{ -public: - LLInventoryPanelObserver(LLInventoryPanel* ip) : mIP(ip) {} - virtual ~LLInventoryPanelObserver() {} - virtual void changed(U32 mask); -protected: - LLInventoryPanel* mIP; -}; - const std::string safe_inv_type_lookup(LLInventoryType::EType inv_type); void hide_context_entries(LLMenuGL& menu, const std::vector &entries_to_show, diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 6b1f7313dd..dc704f2b82 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -36,8 +36,6 @@ #include "llinventorypanel.h" -// Seraph TODO: Remove unnecessary headers - #include "llagent.h" #include "llagentwearables.h" #include "llappearancemgr.h" @@ -56,6 +54,22 @@ const std::string LLInventoryPanel::RECENTITEMS_SORT_ORDER = std::string("Recent const std::string LLInventoryPanel::INHERIT_SORT_ORDER = std::string(""); static const LLInventoryFVBridgeBuilder INVENTORY_BRIDGE_BUILDER; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryPanelObserver +// +// Bridge to support knowing when the inventory has changed. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLInventoryPanelObserver : public LLInventoryObserver +{ +public: + LLInventoryPanelObserver(LLInventoryPanel* ip) : mIP(ip) {} + virtual ~LLInventoryPanelObserver() {} + virtual void changed(U32 mask); +protected: + LLInventoryPanel* mIP; +}; + LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : LLPanel(p), mInventoryObserver(NULL), @@ -872,3 +886,11 @@ void example_param_block_usage() LLUICtrlFactory::create(param_block); } + +// +=================================================+ +// | LLInventoryPanelObserver | +// +=================================================+ +void LLInventoryPanelObserver::changed(U32 mask) +{ + mIP->modelChanged(mask); +} -- cgit v1.2.3 From 85e142b949c83c674d316493ddaed71661e73066 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 16 Nov 2009 12:23:39 -0500 Subject: Header file cleanup Removed unnecessary headers from llagent.cpp. Alphabetized headers in llagent.h and llagent.cpp. Trivial whitespace addition to llcallingcard.h --HG-- branch : avatar-pipeline --- indra/newview/llagent.cpp | 56 ++++++++++--------------------------------- indra/newview/llagent.h | 9 ++++--- indra/newview/llcallingcard.h | 1 + 3 files changed, 18 insertions(+), 48 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index ca1688ad1f..a093c1d434 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -31,83 +31,53 @@ */ #include "llviewerprecompiledheaders.h" - #include "llagent.h" -#include "llagentwearables.h" + +#include "pipeline.h" #include "llagentlistener.h" +#include "llagentwearables.h" +#include "llagentui.h" + #include "llanimationstates.h" +#include "llbottomtray.h" #include "llcallingcard.h" #include "llconsole.h" -#include "lldrawable.h" #include "llfirstuse.h" -#include "llfloaterreg.h" -#include "llspeakers.h" #include "llfloatercamera.h" #include "llfloatercustomize.h" - -#include "llfloaterland.h" -#include "llfloatersnapshot.h" +#include "llfloaterreg.h" #include "llfloatertools.h" -#include "llfloaterworldmap.h" - #include "llgroupactions.h" - -#include "llfocusmgr.h" #include "llgroupmgr.h" #include "llhomelocationresponder.h" -#include "llimview.h" #include "llhudmanager.h" #include "lljoystickbutton.h" -#include "llmenugl.h" #include "llmorphview.h" #include "llmoveview.h" +#include "llnavigationbar.h" // to show/hide navigation bar when changing mouse look state +#include "llnearbychatbar.h" #include "llparcel.h" -#include "llquantize.h" -#include "llrand.h" -#include "llregionhandle.h" #include "llsdutil.h" -#include "llselectmgr.h" +#include "llsidetray.h" #include "llsky.h" -#include "llslurl.h" #include "llsmoothstep.h" -#include "llsidetray.h" #include "llstatusbar.h" -#include "llteleportflags.h" -#include "llteleporthistory.h" -#include "lltexturestats.h" -#include "lltexturestats.h" #include "lltool.h" -#include "lltoolcomp.h" #include "lltoolmgr.h" -#include "lluictrlfactory.h" -#include "llurldispatcher.h" - -#include "llviewercamera.h" +#include "lltrans.h" +#include "llviewercontrol.h" #include "llviewerdisplay.h" +#include "llviewerjoystick.h" #include "llviewermediafocus.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" #include "llviewerstats.h" -#include "llviewerwindow.h" -#include "llviewercontrol.h" -#include "llviewerjoystick.h" - #include "llvoavatarself.h" #include "llwindow.h" #include "llworld.h" #include "llworldmap.h" -#include "pipeline.h" -#include "lltrans.h" -#include "llbottomtray.h" -#include "llnearbychatbar.h" -#include "stringize.h" -#include "llcapabilitylistener.h" - -#include "llnavigationbar.h" //to show/hide navigation bar when changing mouse look state -#include "llagentui.h" - using namespace LLVOAvatarDefines; extern LLMenuBarGL* gMenuBarView; diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 99a9bdd8e6..4162dfce1e 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -36,14 +36,13 @@ #include "indra_constants.h" #include "llevent.h" // LLObservable base class #include "llagentaccess.h" -#include "llagentaccess.h" #include "llagentconstants.h" -#include "llhudeffectpointat.h" // ELookAtType -#include "llhudeffectlookat.h" // EPointAtType -#include "llpointer.h" +#include "llagentdata.h" // gAgentID, gAgentSessionID #include "llcharacter.h" // LLAnimPauseRequest #include "llfollowcam.h" // Ventrella -#include "llagentdata.h" // gAgentID, gAgentSessionID +#include "llhudeffectlookat.h" // EPointAtType +#include "llhudeffectpointat.h" // ELookAtType +#include "llpointer.h" #include "lluicolor.h" #include "llvoavatardefines.h" diff --git a/indra/newview/llcallingcard.h b/indra/newview/llcallingcard.h index bd58b2fbe6..47b0dcb903 100644 --- a/indra/newview/llcallingcard.h +++ b/indra/newview/llcallingcard.h @@ -45,6 +45,7 @@ //class LLInventoryObserver; class LLMessageSystem; class LLTrackingData; + class LLFriendObserver { public: -- cgit v1.2.3 From 909125258dabd0722785519f689d20608bb13fc1 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 16 Nov 2009 14:23:46 -0500 Subject: Minor cleanup, changed inventorypanel start folder special casing keyword "INVENTORY" to using generic "My Inventory" keyword. --HG-- branch : avatar-pipeline --- indra/newview/llinventorypanel.cpp | 6 +----- indra/newview/skins/default/xui/en/panel_landmarks.xml | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 129178e42e..c113b9f0d0 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -149,11 +149,7 @@ BOOL LLInventoryPanel::postBuild() // of that folder (i.e. not including the folder itself). const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(mStartFolderString); - if ("INVENTORY" == mStartFolderString) - { - mStartFolderID = gInventory.getRootFolderID(); - } - else if ("LIBRARY" == mStartFolderString) + if ("LIBRARY" == mStartFolderString) { mStartFolderID = gInventory.getLibraryRootFolderID(); } diff --git a/indra/newview/skins/default/xui/en/panel_landmarks.xml b/indra/newview/skins/default/xui/en/panel_landmarks.xml index f05684db10..4b91dc6294 100644 --- a/indra/newview/skins/default/xui/en/panel_landmarks.xml +++ b/indra/newview/skins/default/xui/en/panel_landmarks.xml @@ -63,7 +63,7 @@ left="0" mouse_opaque="true" name="my_inventory_list" - start_folder="INVENTORY" + start_folder="My Inventory" width="380"/> Date: Mon, 16 Nov 2009 17:24:05 -0500 Subject: EXT-2445 appearance editor doesn't show correct previews This system is in dire need of a rewrite, but the bug reported is fairly simple. The visual params in the avatar are no longer authoritative, the real values are stored in the wearable itself. The appearance editor was manipulating the values in the avatar object, resulting in no change. Updated the preview windows to use the parameter objects stored in the wearable. Code reviewed by Bigpapi --HG-- branch : avatar-pipeline --- indra/newview/llscrollingpanelparam.cpp | 4 ++-- indra/newview/lltoolmorph.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp index 1fbaeb94f5..b5e55df1f5 100644 --- a/indra/newview/llscrollingpanelparam.cpp +++ b/indra/newview/llscrollingpanelparam.cpp @@ -73,9 +73,9 @@ LLScrollingPanelParam::LLScrollingPanelParam( const LLPanel::Params& panel_param F32 min_weight = param->getMinWeight(); F32 max_weight = param->getMaxWeight(); - mHintMin = new LLVisualParamHint( pos_x, pos_y, PARAM_HINT_WIDTH, PARAM_HINT_HEIGHT, mesh, param, min_weight); + mHintMin = new LLVisualParamHint( pos_x, pos_y, PARAM_HINT_WIDTH, PARAM_HINT_HEIGHT, mesh, (LLViewerVisualParam*) wearable->getVisualParam(param->getID()), min_weight); pos_x += PARAM_HINT_WIDTH + 3 * BTN_BORDER; - mHintMax = new LLVisualParamHint( pos_x, pos_y, PARAM_HINT_WIDTH, PARAM_HINT_HEIGHT, mesh, param, max_weight ); + mHintMax = new LLVisualParamHint( pos_x, pos_y, PARAM_HINT_WIDTH, PARAM_HINT_HEIGHT, mesh, (LLViewerVisualParam*) wearable->getVisualParam(param->getID()), max_weight ); mHintMin->setAllowsUpdates( FALSE ); mHintMax->setAllowsUpdates( FALSE ); diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index d7d7b5f44b..14524580bf 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -146,8 +146,8 @@ void LLVisualParamHint::preRender(BOOL clear_depth) { LLVOAvatarSelf* avatarp = gAgent.getAvatarObject(); - mLastParamWeight = avatarp->getVisualParamWeight(mVisualParam); - avatarp->setVisualParamWeight(mVisualParam, mVisualParamWeight); + mLastParamWeight = mVisualParam->getWeight(); + mVisualParam->setWeight(mVisualParamWeight, FALSE); avatarp->setVisualParamWeight("Blink_Left", 0.f); avatarp->setVisualParamWeight("Blink_Right", 0.f); avatarp->updateComposites(); @@ -242,7 +242,7 @@ BOOL LLVisualParamHint::render() gGL.setSceneBlendType(LLRender::BT_ALPHA); gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); } - avatarp->setVisualParamWeight(mVisualParam, mLastParamWeight); + mVisualParam->setWeight(mLastParamWeight, FALSE); gGL.color4f(1,1,1,1); mGLTexturep->setGLTextureCreated(true); return TRUE; -- cgit v1.2.3 From 4110307f28b0210311179b15bc4e85de3bdfbce0 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 16 Nov 2009 17:49:11 -0500 Subject: EXT-2527 : Allow contents of Appearance panel to be expandable Changed the InventoryFilter logic slightly, so that if it's filtering by categories, it allows the contents of those categories to pass. --HG-- branch : avatar-pipeline --- indra/newview/llinventoryfilter.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 7ec8d3d003..3e4b3327db 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -108,6 +108,10 @@ BOOL LLInventoryFilter::check(LLFolderViewItem* item) passed_type |= ((1LL << cat->getPreferredType() & mFilterOps.mFilterTypes) != U64(0)); } } + else + { + passed_type = TRUE; + } } else { -- cgit v1.2.3 From faef48504c6f07fc143f664271fa5cc2e1071cc4 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 16 Nov 2009 17:52:15 -0500 Subject: EXT-2526 : Disable "double click to wear" on outfit folders EXT-1763 : Places - Landmarks : Unable to drop a landmark into Landamrks & FavoriteBar accordian panels Threefixes in here. (1) Simple disable of double-click. (2) Corrected typos "hierary"-> "hierarchy". (3) Now adding start folder to specialized inventory panels, so that we get the start folder's listener for drag&drop operations. --HG-- branch : avatar-pipeline --- indra/newview/llfolderviewitem.cpp | 16 +++-- indra/newview/llfolderviewitem.h | 8 +-- indra/newview/llinventorypanel.cpp | 142 ++++++++++++++++++------------------- 3 files changed, 83 insertions(+), 83 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index d39a17ca3b..bf74c5c936 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -133,8 +133,8 @@ LLFolderViewItem::LLFolderViewItem(LLFolderViewItem::Params p) mIconOpen(p.icon_open), mListener(p.listener), mArrowImage(p.folder_arrow_image), - mBoxImage(p.selection_image) -, mDontShowInHierarhy(false) + mBoxImage(p.selection_image), + mDontShowInHierarchy(false) { refresh(); } @@ -411,7 +411,7 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height, S32 filter_generation) S32 LLFolderViewItem::getItemHeight() { - if (mDontShowInHierarhy) return 0; + if (mDontShowInHierarchy) return 0; S32 icon_height = mIcon->getHeight(); S32 label_height = llround(getLabelFontForStyle(mLabelStyle)->getLineHeight()); @@ -819,7 +819,7 @@ BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, void LLFolderViewItem::draw() { - if (mDontShowInHierarhy) return; + if (mDontShowInHierarchy) return; static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); @@ -995,14 +995,14 @@ void LLFolderViewItem::draw() S32 right = left + font->getWidth(combined_string, mStringMatchOffset, filter_string_length) + 2; S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3); S32 top = getRect().getHeight(); - + LLRect box_rect(left, top, right, bottom); sBoxImage->draw(box_rect, sFilterBGColor); F32 match_string_left = text_left + font->getWidthF32(combined_string, 0, mStringMatchOffset); F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD; font->renderUTF8( combined_string, mStringMatchOffset, match_string_left, y, - sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, - filter_string_length, S32_MAX, &right_x, FALSE ); + sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, + filter_string_length, S32_MAX, &right_x, FALSE ); } } } @@ -2166,6 +2166,7 @@ BOOL LLFolderViewFolder::handleMouseDown( S32 x, S32 y, MASK mask ) BOOL LLFolderViewFolder::handleDoubleClick( S32 x, S32 y, MASK mask ) { + /* Disable outfit double click to wear const LLUUID &cat_uuid = getListener()->getUUID(); const LLViewerInventoryCategory *cat = gInventory.getCategory(cat_uuid); if (cat && cat->getPreferredType() == LLFolderType::FT_OUTFIT) @@ -2173,6 +2174,7 @@ BOOL LLFolderViewFolder::handleDoubleClick( S32 x, S32 y, MASK mask ) getListener()->performAction(NULL, NULL,"replaceoutfit"); return TRUE; } + */ BOOL handled = FALSE; if( mIsOpen ) diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index 7c429fc76e..30387812a6 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -158,7 +158,7 @@ protected: LLUIImagePtr mBoxImage; BOOL mIsLoading; LLTimer mTimeSinceRequestStart; - bool mDontShowInHierarhy; + bool mDontShowInHierarchy; // helper function to change the selection from the root. void changeSelectionFromRoot(LLFolderViewItem* selection, BOOL selected); @@ -201,8 +201,8 @@ public: // makes sure that this view and it's children are the right size. virtual S32 arrange( S32* width, S32* height, S32 filter_generation ); virtual S32 getItemHeight(); - void setDontShowInHierarchy(bool dont_show) { mDontShowInHierarhy = dont_show; } - bool getDontShowInHierarchy() { return mDontShowInHierarhy; } + void setDontShowInHierarchy(bool dont_show) { mDontShowInHierarchy = dont_show; } + bool getDontShowInHierarchy() { return mDontShowInHierarchy; } // applies filters to control visibility of inventory items virtual void filter( LLInventoryFilter& filter); @@ -343,7 +343,7 @@ typedef bool (*sort_order_f)(LLFolderViewItem* a, LLFolderViewItem* b); // // An instance of an LLFolderViewFolder represents a collection of // more folders and items. This is used to build the hierarchy of -// items found in the folder view. :) +// items found in the folder view. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLFolderViewFolder : public LLFolderViewItem diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index c113b9f0d0..7b7090d10d 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -406,88 +406,86 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) { LLMemType mt(LLMemType::MTYPE_INVENTORY_BUILD_NEW_VIEWS); LLFolderViewItem* itemp = NULL; - LLInventoryObject* objectp = NULL; - - // Don't add the start folder (the inventory panel will show contents - // beginning with the children of the starting folder, excluding the starting folder itself). - if (id != mStartFolderID) + LLInventoryObject* objectp = gInventory.getObject(id); + if (objectp) { - objectp = gInventory.getObject(id); - if (objectp) - { - const LLUUID &parent_id = objectp->getParentUUID(); - // If this item's parent is the starting folder, then just add it to the top level (recall that - // the starting folder isn't actually represented in the view, parent_folder would be NULL in - // this case otherwise). - LLFolderViewFolder* parent_folder = (parent_id == mStartFolderID ? - mFolders : (LLFolderViewFolder*)mFolders->getItemByID(parent_id)); - + const LLUUID &parent_id = objectp->getParentUUID(); + LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)mFolders->getItemByID(parent_id); + if (id == mStartFolderID) + parent_folder = mFolders; + + if (!parent_folder) + { // This item exists outside the inventory's hierarchy, so don't add it. - if (!parent_folder) - { - return; - } - - if (objectp->getType() <= LLAssetType::AT_NONE || - objectp->getType() >= LLAssetType::AT_COUNT) - { - llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " << - ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() << llendl; - return; - } + return; + } + + if (objectp->getType() <= LLAssetType::AT_NONE || + objectp->getType() >= LLAssetType::AT_COUNT) + { + llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " << + ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() << llendl; + return; + } + + if (objectp->getType() == LLAssetType::AT_CATEGORY && + objectp->getActualType() != LLAssetType::AT_LINK_FOLDER) + { + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), + objectp->getType(), + LLInventoryType::IT_CATEGORY, + this, + objectp->getUUID()); - if (objectp->getType() == LLAssetType::AT_CATEGORY && - objectp->getActualType() != LLAssetType::AT_LINK_FOLDER) + if (new_listener) { - LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), - objectp->getType(), - LLInventoryType::IT_CATEGORY, - this, - objectp->getUUID()); - - if (new_listener) + LLFolderViewFolder::Params p; + p.name = new_listener->getDisplayName(); + p.icon = new_listener->getIcon(); + p.root = mFolders; + p.listener = new_listener; + p.tool_tip = p.name; + LLFolderViewFolder* folderp = LLUICtrlFactory::create(p); + folderp->setItemSortOrder(mFolders->getSortOrder()); + itemp = folderp; + + // Hide the root folder, so we can show the contents of a folder + // flat but still have the parent folder present for listener-related + // operations. + if (id == mStartFolderID) { - LLFolderViewFolder::Params p; - p.name = new_listener->getDisplayName(); - p.icon = new_listener->getIcon(); - p.root = mFolders; - p.listener = new_listener; - p.tool_tip = p.name; - LLFolderViewFolder* folderp = LLUICtrlFactory::create(p); - - folderp->setItemSortOrder(mFolders->getSortOrder()); - itemp = folderp; + folderp->setDontShowInHierarchy(TRUE); } } - else + } + else + { + // Build new view for item + LLInventoryItem* item = (LLInventoryItem*)objectp; + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(), + item->getActualType(), + item->getInventoryType(), + this, + item->getUUID(), + item->getFlags()); + + if (new_listener) { - // Build new view for item - LLInventoryItem* item = (LLInventoryItem*)objectp; - LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(), - item->getActualType(), - item->getInventoryType(), - this, - item->getUUID(), - item->getFlags()); - - if (new_listener) - { - LLFolderViewItem::Params params; - params.name(new_listener->getDisplayName()); - params.icon(new_listener->getIcon()); - params.creation_date(new_listener->getCreationDate()); - params.root(mFolders); - params.listener(new_listener); - params.rect(LLRect (0, 0, 0, 0)); - params.tool_tip = params.name; - itemp = LLUICtrlFactory::create (params); - } + LLFolderViewItem::Params params; + params.name(new_listener->getDisplayName()); + params.icon(new_listener->getIcon()); + params.creation_date(new_listener->getCreationDate()); + params.root(mFolders); + params.listener(new_listener); + params.rect(LLRect (0, 0, 0, 0)); + params.tool_tip = params.name; + itemp = LLUICtrlFactory::create (params); } + } - if (itemp) - { - itemp->addToFolder(parent_folder, mFolders); - } + if (itemp) + { + itemp->addToFolder(parent_folder, mFolders); } } -- cgit v1.2.3 From afe1ad54ee8a53525072a2c22782fa7135716d29 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 16 Nov 2009 18:19:35 -0500 Subject: EXT-1068 appearance editor previews do not update addendum: re-added changes to avatar-parameters as well as wearable parameters so that the system knows to re-update the local composite after rendering each preview. Code reviewed by Bigpapi --HG-- branch : avatar-pipeline --- indra/newview/lltoolmorph.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index 14524580bf..4fb75f7a49 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -148,6 +148,7 @@ void LLVisualParamHint::preRender(BOOL clear_depth) mLastParamWeight = mVisualParam->getWeight(); mVisualParam->setWeight(mVisualParamWeight, FALSE); + avatarp->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE); avatarp->setVisualParamWeight("Blink_Left", 0.f); avatarp->setVisualParamWeight("Blink_Right", 0.f); avatarp->updateComposites(); @@ -242,6 +243,7 @@ BOOL LLVisualParamHint::render() gGL.setSceneBlendType(LLRender::BT_ALPHA); gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); } + avatarp->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight); mVisualParam->setWeight(mLastParamWeight, FALSE); gGL.color4f(1,1,1,1); mGLTexturep->setGLTextureCreated(true); -- cgit v1.2.3 From b88778ca7d2de5b381eb59722d9075c8e02ccb39 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 16 Nov 2009 18:40:59 -0500 Subject: Header file cleanup. Spelling cleanup. Changed "Inventroy"->"Inventory". Removed a couple of headers from llinventory.h. --HG-- branch : avatar-pipeline --- indra/llinventory/llinventory.h | 4 +--- indra/newview/llpanellandmarks.cpp | 16 ++++++++-------- indra/newview/llpanellandmarks.h | 8 ++++---- 3 files changed, 13 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h index 3de9d14f54..9faecbea85 100644 --- a/indra/llinventory/llinventory.h +++ b/indra/llinventory/llinventory.h @@ -35,7 +35,6 @@ #include -#include "llassetstorage.h" #include "lldarray.h" #include "llfoldertype.h" #include "llinventorytype.h" @@ -45,7 +44,6 @@ #include "llsaleinfo.h" #include "llsd.h" #include "lluuid.h" -#include "llxmlnode.h" // consts for Key field in the task inventory update message extern const U8 TASK_INVENTORY_ITEM_KEY; @@ -357,7 +355,7 @@ protected: typedef std::list > InventoryObjectList; -// These functions convert between structured data and an inventroy +// These functions convert between structured data and an inventory // item, appropriate for serialization. LLSD ll_create_sd_from_inventory_item(LLPointer item); //LLPointer ll_create_item_from_sd(const LLSD& sd_item); diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index ce1a7f98df..e199db37ab 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -97,10 +97,10 @@ BOOL LLLandmarksPanel::postBuild() U32 sort_order = gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER); mSortByDate = sort_order & LLInventoryFilter::SO_DATE; - initFavoritesInventroyPanel(); - initLandmarksInventroyPanel(); - initMyInventroyPanel(); - initLibraryInventroyPanel(); + initFavoritesInventoryPanel(); + initLandmarksInventoryPanel(); + initMyInventoryPanel(); + initLibraryInventoryPanel(); getChild("tab_favorites")->setDisplayChildren(true); getChild("tab_landmarks")->setDisplayChildren(true); @@ -357,7 +357,7 @@ void LLLandmarksPanel::setErrorStatus(U32 status, const std::string& reason) // PRIVATE METHODS ////////////////////////////////////////////////////////////////////////// -void LLLandmarksPanel::initFavoritesInventroyPanel() +void LLLandmarksPanel::initFavoritesInventoryPanel() { mFavoritesInventoryPanel = getChild("favorites_list"); @@ -366,7 +366,7 @@ void LLLandmarksPanel::initFavoritesInventroyPanel() initAccordion("tab_favorites", mFavoritesInventoryPanel); } -void LLLandmarksPanel::initLandmarksInventroyPanel() +void LLLandmarksPanel::initLandmarksInventoryPanel() { mLandmarksInventoryPanel = getChild("landmarks_list"); @@ -380,7 +380,7 @@ void LLLandmarksPanel::initLandmarksInventroyPanel() initAccordion("tab_landmarks", mLandmarksInventoryPanel); } -void LLLandmarksPanel::initMyInventroyPanel() +void LLLandmarksPanel::initMyInventoryPanel() { mMyInventoryPanel= getChild("my_inventory_list"); @@ -389,7 +389,7 @@ void LLLandmarksPanel::initMyInventroyPanel() initAccordion("tab_inventory", mMyInventoryPanel); } -void LLLandmarksPanel::initLibraryInventroyPanel() +void LLLandmarksPanel::initLibraryInventoryPanel() { mLibraryInventoryPanel = getChild("library_list"); diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index 745f9364c2..097d79badf 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -78,10 +78,10 @@ protected: /*virtual*/ void setErrorStatus(U32 status, const std::string& reason); private: - void initFavoritesInventroyPanel(); - void initLandmarksInventroyPanel(); - void initMyInventroyPanel(); - void initLibraryInventroyPanel(); + void initFavoritesInventoryPanel(); + void initLandmarksInventoryPanel(); + void initMyInventoryPanel(); + void initLibraryInventoryPanel(); void initLandmarksPanel(LLInventorySubTreePanel* inventory_list); void initAccordion(const std::string& accordion_tab_name, LLInventorySubTreePanel* inventory_list); void onAccordionExpandedCollapsed(const LLSD& param, LLInventorySubTreePanel* inventory_list); -- cgit v1.2.3 From 9c823a1d40392dc00bdfb1f09220a5065d764f40 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 17 Nov 2009 10:33:47 -0500 Subject: Deferring work to idle time to avoid recursive notifyObservers calls - added wrapper class to defer an arbitrary boost::bind or other callable --HG-- branch : avatar-pipeline --- indra/newview/llagentwearables.cpp | 18 +++++++----------- indra/newview/llappearancemgr.cpp | 18 ++++++++++++++++-- indra/newview/llappearancemgr.h | 33 +++++++++++++++++++++++++++++++++ indra/newview/llinventorybridge.cpp | 12 ++++++++++++ 4 files changed, 68 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 17e7eea2f1..a171f75b17 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -62,7 +62,7 @@ class LLInitialWearablesFetch : public LLInventoryFetchDescendentsObserver { public: LLInitialWearablesFetch() {} - ~LLInitialWearablesFetch() {} + ~LLInitialWearablesFetch(); virtual void done(); struct InitialWearableData @@ -84,7 +84,6 @@ public: protected: void processWearablesMessage(); void processContents(); - static void onIdle(void *userdata); }; LLAgentWearables gAgentWearables; @@ -2013,6 +2012,11 @@ void LLAgentWearables::updateServer() // to avoid gInventory.notifyObservers recursion. //-------------------------------------------------------------------- +LLInitialWearablesFetch::~LLInitialWearablesFetch() +{ + llinfos << "~LLInitialWearablesFetch" << llendl; +} + // virtual void LLInitialWearablesFetch::done() { @@ -2020,15 +2024,7 @@ void LLInitialWearablesFetch::done() // gInventory.notifyObservers. The results will be handled in the next // idle tick instead. gInventory.removeObserver(this); - gIdleCallbacks.addFunction(onIdle, this); -} - -// static -void LLInitialWearablesFetch::onIdle(void *data) -{ - gIdleCallbacks.deleteFunction(onIdle, data); - LLInitialWearablesFetch *self = reinterpret_cast(data); - self->processContents(); + doOnIdle(boost::bind(&LLInitialWearablesFetch::processContents,this)); } void LLInitialWearablesFetch::processContents() diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 80ac9e4085..a23d21f84b 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -95,8 +95,9 @@ public: mCopyItems(copy_items), mAppend(append) {} - ~LLOutfitObserver() {} - virtual void done(); //public + ~LLOutfitObserver(); + virtual void done(); + void doWearCategory(); protected: LLUUID mCatID; @@ -104,7 +105,19 @@ protected: bool mAppend; }; +LLOutfitObserver::~LLOutfitObserver() +{ + llinfos << "~LLOutfitObserver" << llendl; +} + +// BAP is LLOutfitObserver getting deleted here? void LLOutfitObserver::done() +{ + gInventory.removeObserver(this); + doOnIdle(boost::bind(&LLOutfitObserver::doWearCategory,this)); +} + +void LLOutfitObserver::doWearCategory() { // We now have an outfit ready to be copied to agent inventory. Do // it, and wear that outfit normally. @@ -175,6 +188,7 @@ void LLOutfitObserver::done() // Wear the inventory category. LLAppearanceManager::instance().wearInventoryCategoryOnAvatar(gInventory.getCategory(mCatID), mAppend); } + delete this; } class LLOutfitFetch : public LLInventoryFetchDescendentsObserver diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 88d3320d1f..f39fbd7b1a 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -36,6 +36,7 @@ #include "llsingleton.h" #include "llinventorymodel.h" #include "llviewerinventory.h" +#include "llcallbacklist.h" class LLWearable; struct LLWearableHoldingPattern; @@ -111,4 +112,36 @@ private: #define SUPPORT_ENSEMBLES 0 +// Shim class and template function to allow arbitrary boost::bind +// expressions to be run as one-time idle callbacks. +template +class OnIdleCallback +{ +public: + OnIdleCallback(T callable): + mCallable(callable) + { + } + static void onIdle(void *data) + { + gIdleCallbacks.deleteFunction(onIdle, data); + OnIdleCallback* self = reinterpret_cast*>(data); + self->call(); + delete self; + } + void call() + { + mCallable(); + } +private: + T mCallable; +}; + +template +void doOnIdle(T callable) +{ + OnIdleCallback* cb_functor = new OnIdleCallback(callable); + gIdleCallbacks.addFunction(&OnIdleCallback::onIdle,cb_functor); +} + #endif diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d7be09efa9..f406547620 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1682,6 +1682,17 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // if target is an outfit or current outfit folder we use link if (move_is_into_current_outfit || move_is_into_outfit) { + if (inv_cat->getPreferredType() == LLFolderType::FT_NONE) + { + if (move_is_into_current_outfit) + { + // traverse category and add all contents to currently worn. + BOOL append = true; + LLAppearanceManager::instance().wearInventoryCategory(inv_cat, false, append); + } + } + else + { #if SUPPORT_ENSEMBLES // BAP - should skip if dup. if (move_is_into_current_outfit) @@ -1700,6 +1711,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, cb); } #endif + } } else { -- cgit v1.2.3 From 32dccaf3d89b40b711d69088a3e390119c7efc7f Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 17 Nov 2009 10:36:11 -0500 Subject: Sidepanel Appearance refactoring. Work in progress. 1. Changed sidepanel names to have "sidepanel" (e.g. panel_appearance -> sidepanel_appearance) 2. Changed some "Looks" names to "Outfits" 3. Changed LLPanelLooks to LLPanelOutfitsInventory (to match other inventory panel naming) 4. Took out tab from sidepanel_appearance. --HG-- branch : avatar-pipeline --- indra/newview/CMakeLists.txt | 10 +- indra/newview/llappearancemgr.cpp | 6 +- indra/newview/llinventoryfilter.cpp | 17 +- indra/newview/llinventorypanel.cpp | 35 +- indra/newview/llinventorypanel.h | 4 + indra/newview/llpanelmaininventory.cpp | 2 +- indra/newview/llpaneloutfitsinventory.cpp | 245 ++++++++++++++ indra/newview/llpaneloutfitsinventory.h | 76 +++++ indra/newview/llsidepanelappearance.cpp | 373 +++++++++++++++++++++ indra/newview/llsidepanelappearance.h | 102 ++++++ .../skins/default/xui/en/floater_inventory.xml | 2 +- .../default/xui/en/panel_outfits_inventory.xml | 81 +++++ .../skins/default/xui/en/panel_side_tray.xml | 6 +- .../skins/default/xui/en/sidepanel_appearance.xml | 104 ++++++ 14 files changed, 1026 insertions(+), 37 deletions(-) create mode 100644 indra/newview/llpaneloutfitsinventory.cpp create mode 100644 indra/newview/llpaneloutfitsinventory.h create mode 100644 indra/newview/llsidepanelappearance.cpp create mode 100644 indra/newview/llsidepanelappearance.h create mode 100644 indra/newview/skins/default/xui/en/panel_outfits_inventory.xml create mode 100644 indra/newview/skins/default/xui/en/sidepanel_appearance.xml (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 4adef84cd3..e7458529be 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -297,8 +297,6 @@ set(viewer_SOURCE_FILES llnotify.cpp lloutputmonitorctrl.cpp lloverlaybar.cpp - llpanelappearance.cpp - llpanelappearancetab.cpp llpanelavatar.cpp llpanelavatarrow.cpp llpanelavatartag.cpp @@ -322,7 +320,6 @@ set(viewer_SOURCE_FILES llpanellandmedia.cpp llpanellogin.cpp llpanellookinfo.cpp - llpanellooks.cpp llpanelmaininventory.cpp llpanelmediasettingsgeneral.cpp llpanelmediasettingspermissions.cpp @@ -330,6 +327,7 @@ set(viewer_SOURCE_FILES llpanelmeprofile.cpp llpanelobject.cpp llpanelobjectinventory.cpp + llpaneloutfitsinventory.cpp llpanelpeople.cpp llpanelpeoplemenus.cpp llpanelpermissions.cpp @@ -370,6 +368,7 @@ set(viewer_SOURCE_FILES llsearchcombobox.cpp llsearchhistory.cpp llselectmgr.cpp + llsidepanelappearance.cpp llsidepanelinventory.cpp llsidepanelinventorysubpanel.cpp llsidepaneliteminfo.cpp @@ -792,8 +791,6 @@ set(viewer_HEADER_FILES llnotify.h lloutputmonitorctrl.h lloverlaybar.h - llpanelappearance.h - llpanelappearancetab.h llpanelavatar.h llpanelavatarrow.h llpanelavatartag.h @@ -817,7 +814,6 @@ set(viewer_HEADER_FILES llpanellandmedia.h llpanellogin.h llpanellookinfo.h - llpanellooks.h llpanelmaininventory.h llpanelmediasettingsgeneral.h llpanelmediasettingspermissions.h @@ -825,6 +821,7 @@ set(viewer_HEADER_FILES llpanelmeprofile.h llpanelobject.h llpanelobjectinventory.h + llpaneloutfitsinventory.h llpanelpeople.h llpanelpeoplemenus.h llpanelpermissions.h @@ -867,6 +864,7 @@ set(viewer_HEADER_FILES llsearchcombobox.h llsearchhistory.h llselectmgr.h + llsidepanelappearance.h llsidepanelinventory.h llsidepanelinventorysubpanel.h llsidepaneliteminfo.h diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 80ac9e4085..554f270c02 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -40,7 +40,7 @@ #include "llinventorybridge.h" #include "llinventoryobserver.h" #include "llnotifications.h" -#include "llpanelappearance.h" +#include "llsidepanelappearance.h" #include "llsidetray.h" #include "llvoavatar.h" #include "llvoavatarself.h" @@ -530,10 +530,10 @@ void LLAppearanceManager::updateCOF(const LLUUID& category, bool append) LLAssetType::AT_LINK_FOLDER, link_waiter); // Update the current outfit name of the appearance sidepanel. - LLPanelAppearance* panel_appearance = dynamic_cast(LLSideTray::getInstance()->getPanel("panel_appearance")); + LLSidepanelAppearance* panel_appearance = dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); if (panel_appearance) { - panel_appearance->refreshCurrentLookName(catp->getName()); + panel_appearance->refreshCurrentOutfitName(catp->getName()); } } diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 3e4b3327db..085c96c93d 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -100,17 +100,18 @@ BOOL LLInventoryFilter::check(LLFolderViewItem* item) bool passed_type = false; if (mFilterOps.mFilterForCategories) { - if (listener->getInventoryType() == LLInventoryType::IT_CATEGORY) + // Pass if this item is a category of the filter type, or + // if its parent is a category of the filter type. + LLUUID uuid = listener->getUUID(); + if (listener->getInventoryType() != LLInventoryType::IT_CATEGORY) { - LLViewerInventoryCategory *cat = gInventory.getCategory(listener->getUUID()); - if (cat) - { - passed_type |= ((1LL << cat->getPreferredType() & mFilterOps.mFilterTypes) != U64(0)); - } + const LLInventoryObject *obj = gInventory.getObject(uuid); + uuid = obj->getParentUUID(); } - else + LLViewerInventoryCategory *cat = gInventory.getCategory(uuid); + if (cat) { - passed_type = TRUE; + passed_type |= ((1LL << cat->getPreferredType() & mFilterOps.mFilterTypes) != U64(0)); } } else diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 7b7090d10d..450ce92412 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -145,23 +145,10 @@ BOOL LLInventoryPanel::postBuild() mInventoryObserver = new LLInventoryPanelObserver(this); mInventory->addObserver(mInventoryObserver); - // determine the root folder, if any, so inventory contents show just the children - // of that folder (i.e. not including the folder itself). - const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(mStartFolderString); - - if ("LIBRARY" == mStartFolderString) - { - mStartFolderID = gInventory.getLibraryRootFolderID(); - } - else - { - mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); - } - // build view of inventory if we need default full hierarchy and inventory ready, otherwise wait for modelChanged() callback if (mBuildDefaultHierarchy && mInventory->isInventoryUsable() && !mHasInventoryConnection) { - rebuildViewsFor(mStartFolderID); + rebuildViews(); mHasInventoryConnection = true; defaultOpenInventory(); } @@ -268,7 +255,7 @@ void LLInventoryPanel::modelChanged(U32 mask) // inventory just initialized, do complete build if ((mask & LLInventoryObserver::ADD) && gInventory.getChangedIDs().empty() && !mHasInventoryConnection) { - rebuildViewsFor(mStartFolderID); + rebuildViews(); mHasInventoryConnection = true; defaultOpenInventory(); return; @@ -388,6 +375,24 @@ void LLInventoryPanel::modelChanged(U32 mask) } +void LLInventoryPanel::rebuildViews() +{ + // Determine the root folder and rebuild the views starting + // at that folder. + const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(mStartFolderString); + + if ("LIBRARY" == mStartFolderString) + { + mStartFolderID = gInventory.getLibraryRootFolderID(); + } + else + { + mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); + } + + rebuildViewsFor(mStartFolderID); +} + void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) { LLFolderViewItem* old_view = NULL; diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index e398c44105..0ccee337c9 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -162,6 +162,10 @@ public: void unSelectAll() { mFolders->setSelection(NULL, FALSE, FALSE); } protected: + // Destroys the old views, and regenerates them based on the + // start folder ID. + void rebuildViews(); + // Given the id and the parent, build all of the folder views. void rebuildViewsFor(const LLUUID& id); virtual void buildNewViews(const LLUUID& id); // made virtual to support derived classes. EXT-719 diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index e3b2ab77aa..6c7d434eeb 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -49,7 +49,7 @@ #include "llviewermenu.h" #include "llviewertexturelist.h" -static LLRegisterPanelClassWrapper t_inventory("panel_main_inventory"); // Seraph is this redundant with constructor? +static LLRegisterPanelClassWrapper t_inventory("panel_main_inventory"); void on_file_loaded_for_save(BOOL success, LLViewerFetchedTexture *src_vi, diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp new file mode 100644 index 0000000000..2964bbe792 --- /dev/null +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -0,0 +1,245 @@ +/** + * @file llpaneloutfitsinventory.cpp + * @brief Outfits inventory panel + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * 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 + * 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 "llpaneloutfitsinventory.h" + +#include "llagent.h" +#include "llbutton.h" +#include "llfloaterreg.h" +#include "lllandmark.h" + +#include "llfloaterworldmap.h" +#include "llfloaterinventory.h" +#include "llfoldervieweventlistener.h" +#include "llinventoryfunctions.h" +#include "llinventorypanel.h" +#include "llsidetray.h" +#include "lltabcontainer.h" +#include "llagentwearables.h" +#include "llviewerjointattachment.h" +#include "llviewerfoldertype.h" +#include "llvoavatarself.h" + +static LLRegisterPanelClassWrapper t_inventory("panel_outfits_inventory"); + +LLPanelOutfitsInventory::LLPanelOutfitsInventory() : + mInventoryPanel(NULL), + mActionBtn(NULL), + mWearBtn(NULL), + mEditBtn(NULL) +{ + mSavedFolderState = new LLSaveFolderState(); + mSavedFolderState->setApply(FALSE); + + // LLUICtrlFactory::getInstance()->buildPanel(this, "panel_outfits_inventory.xml"); +} + +LLPanelOutfitsInventory::~LLPanelOutfitsInventory() +{ + delete mSavedFolderState; +} + +// virtual +BOOL LLPanelOutfitsInventory::postBuild() +{ + mInventoryPanel = getChild("outfits_list"); + mInventoryPanel->setFilterTypes(1LL << LLFolderType::FT_OUTFIT, TRUE); + mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + mInventoryPanel->openDefaultFolderForType(LLFolderType::FT_MY_OUTFITS); + mInventoryPanel->setSelectCallback(boost::bind(&LLPanelOutfitsInventory::onSelectionChange, this, _1, _2)); + + LLFolderView* root_folder = getRootFolder(); + root_folder->setReshapeCallback(boost::bind(&LLPanelOutfitsInventory::onSelectionChange, this, _1, _2)); + + mWearBtn = getChild("wear_btn"); + mEditBtn = getChild("edit_btn"); + mActionBtn = getChild("action_btn"); + + return TRUE; +} + +// virtual +void LLPanelOutfitsInventory::onSearchEdit(const std::string& string) +{ + if (string == "") + { + mInventoryPanel->setFilterSubString(LLStringUtil::null); + + // re-open folders that were initially open + mSavedFolderState->setApply(TRUE); + getRootFolder()->applyFunctorRecursively(*mSavedFolderState); + LLOpenFoldersWithSelection opener; + getRootFolder()->applyFunctorRecursively(opener); + getRootFolder()->scrollToShowSelection(); + } + + gInventory.startBackgroundFetch(); + + if (mInventoryPanel->getFilterSubString().empty() && string.empty()) + { + // current filter and new filter empty, do nothing + return; + } + + // save current folder open state if no filter currently applied + if (getRootFolder()->getFilterSubString().empty()) + { + mSavedFolderState->setApply(FALSE); + getRootFolder()->applyFunctorRecursively(*mSavedFolderState); + } + + // set new filter string + mInventoryPanel->setFilterSubString(string); +} + +void LLPanelOutfitsInventory::onWear() +{ + LLFolderViewItem* current_item = getRootFolder()->getCurSelectedItem(); + if (!current_item) + return; + + LLFolderViewEventListener* listenerp = current_item->getListener(); + if (getIsCorrectType(listenerp)) + { + listenerp->performAction(NULL, NULL,"replaceoutfit"); + } +} + +void LLPanelOutfitsInventory::onEdit() +{ +} + +void LLPanelOutfitsInventory::onNew() +{ + const std::string& outfit_name = LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_OUTFIT); + LLUUID outfit_folder = gAgentWearables.makeNewOutfitLinks(outfit_name); + getRootFolder()->setSelectionByID(outfit_folder, TRUE); + getRootFolder()->setNeedsAutoRename(TRUE); +} + +void LLPanelOutfitsInventory::updateVerbs() +{ + BOOL enabled = FALSE; + + LLFolderViewItem* current_item = getRootFolder()->getCurSelectedItem(); + if (current_item) + { + LLFolderViewEventListener* listenerp = current_item->getListener(); + if (getIsCorrectType(listenerp)) + { + enabled = TRUE; + } + } + + if (mWearBtn) + { + mWearBtn->setEnabled(enabled); + } + // mEditBtn->setEnabled(enabled); +} + +void LLPanelOutfitsInventory::onSelectionChange(const std::deque &items, BOOL user_action) +{ + LLFolderViewItem* current_item = getRootFolder()->getCurSelectedItem(); + if (!current_item) + return; + + /* + LLFolderViewEventListener* listenerp = current_item->getListener(); + if (getIsCorrectType(listenerp)) + { + S32 bottom = 0; + LLFolderViewItem* folder = current_item->getParentFolder(); + + while ( folder->getParentFolder() != NULL ) + { + bottom += folder->getRect().mBottom; + folder = folder->getParentFolder(); + } + + LLRect rect = current_item->getRect(); + LLRect btn_rect( + rect.mRight - mActionBtn->getRect().getWidth(), + bottom + rect.mTop, + rect.mRight, + bottom + rect.mBottom); + + mActionBtn->setRect(btn_rect); + + if (!mActionBtn->getVisible()) + mActionBtn->setVisible(TRUE); + } + else + { + if (mActionBtn->getVisible()) + mActionBtn->setVisible(FALSE); + } + */ + + updateVerbs(); +} + +void LLPanelOutfitsInventory::onSelectorButtonClicked() +{ + /* + LLFolderViewItem* cur_item = getRootFolder()->getCurSelectedItem(); + + LLFolderViewEventListener* listenerp = cur_item->getListener(); + if (getIsCorrectType(listenerp)) + { + LLSD key; + key["type"] = "look"; + key["id"] = listenerp->getUUID(); + + LLSideTray::getInstance()->showPanel("sidepanel_appearance", key); + } + */ +} + +bool LLPanelOutfitsInventory::getIsCorrectType(const LLFolderViewEventListener *listenerp) const +{ + if (listenerp->getInventoryType() == LLInventoryType::IT_CATEGORY) + { + LLViewerInventoryCategory *cat = gInventory.getCategory(listenerp->getUUID()); + if (cat && cat->getPreferredType() == LLFolderType::FT_OUTFIT) + { + return true; + } + } + return false; +} + +LLFolderView *LLPanelOutfitsInventory::getRootFolder() +{ + return mInventoryPanel->getRootFolder(); +} diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h new file mode 100644 index 0000000000..3f837d3635 --- /dev/null +++ b/indra/newview/llpaneloutfitsinventory.h @@ -0,0 +1,76 @@ +/** + * @file llpaneloutfitsinventory.h + * @brief Outfits inventory panel + * class definition + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * 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 + * 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_LLPANELOUTFITSINVENTORY_H +#define LL_LLPANELOUTFITSINVENTORY_H + +#include "llpanel.h" +#include "llinventoryobserver.h" + +class LLFolderView; +class LLFolderViewItem; +class LLFolderViewEventListener; +class LLInventoryPanel; +class LLSaveFolderState; +class LLButton; + +class LLPanelOutfitsInventory : public LLPanel +{ +public: + LLPanelOutfitsInventory(); + virtual ~LLPanelOutfitsInventory(); + + /*virtual*/ BOOL postBuild(); + + void onSearchEdit(const std::string& string); + void onWear(); + void onEdit(); + void onNew(); + void updateVerbs(); + + void onSelectionChange(const std::deque &items, BOOL user_action); + void onSelectorButtonClicked(); + + LLFolderView* getRootFolder(); + +private: + bool getIsCorrectType(const LLFolderViewEventListener *listenerp) const; + LLInventoryPanel* mInventoryPanel; + LLSaveFolderState* mSavedFolderState; + + LLButton* mActionBtn; + LLButton* mWearBtn; + LLButton* mEditBtn; + +}; + +#endif //LL_LLPANELOUTFITSINVENTORY_H diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp new file mode 100644 index 0000000000..d92e404c2c --- /dev/null +++ b/indra/newview/llsidepanelappearance.cpp @@ -0,0 +1,373 @@ +/** + * @file llsidepanelappearance.cpp + * @brief Side Bar "Appearance" panel + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llsidepanelappearance.h" + +#include "llagent.h" +#include "llagentwearables.h" +#include "llfiltereditor.h" +#include "llfloaterreg.h" +#include "llfloaterworldmap.h" +#include "llpaneleditwearable.h" +#include "llpaneloutfitsinventory.h" +#include "lltextbox.h" +#include "lluictrlfactory.h" +#include "llviewerregion.h" +#include "llvoavatarself.h" +#include "llwearable.h" + +static LLRegisterPanelClassWrapper t_appearance("sidepanel_appearance"); + +class LLCurrentlyWornFetchObserver : public LLInventoryFetchObserver +{ +public: + LLCurrentlyWornFetchObserver(LLSidepanelAppearance *panel) : + mPanel(panel) + {} + ~LLCurrentlyWornFetchObserver() {} + virtual void done() + { + mPanel->inventoryFetched(); + gInventory.removeObserver(this); + } +private: + LLSidepanelAppearance *mPanel; +}; + +LLSidepanelAppearance::LLSidepanelAppearance() : + LLPanel(), + mFilterSubString(LLStringUtil::null), + mFilterEditor(NULL), + mLookInfo(NULL), + mCurrLookPanel(NULL) +{ + //LLUICtrlFactory::getInstance()->buildPanel(this, "panel_appearance.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() + mFetchWorn = new LLCurrentlyWornFetchObserver(this); +} + +LLSidepanelAppearance::~LLSidepanelAppearance() +{ +} + +// virtual +BOOL LLSidepanelAppearance::postBuild() +{ + mEditAppearanceBtn = getChild("editappearance_btn"); + mEditAppearanceBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onEditAppearanceButtonClicked, this)); + + mWearBtn = getChild("wear_btn"); + mWearBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onWearButtonClicked, this)); + + mEditBtn = getChild("edit_btn"); + mEditBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onEditButtonClicked, this)); + + mNewLookBtn = getChild("newlook_btn"); + mNewLookBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onNewOutfitButtonClicked, this)); + mNewLookBtn->setEnabled(false); + + mOverflowBtn = getChild("overflow_btn"); + + mFilterEditor = getChild("Filter"); + if (mFilterEditor) + { + mFilterEditor->setCommitCallback(boost::bind(&LLSidepanelAppearance::onFilterEdit, this, _2)); + } + + mPanelOutfitsInventory = dynamic_cast(getChild("panel_outfits_inventory")); + + mLookInfo = dynamic_cast(getChild("panel_look_info")); + if (mLookInfo) + { + LLButton* back_btn = mLookInfo->getChild("back_btn"); + if (back_btn) + { + back_btn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onBackButtonClicked, this)); + } + + // *TODO: Assign the action to an appropriate event. + // mOverflowBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::toggleMediaPanel, this)); + } + + mEditWearable = dynamic_cast(getChild("panel_edit_wearable")); + if (mEditWearable) + { + LLButton* edit_wearable_back_btn = mEditWearable->getChild("back_btn"); + if (edit_wearable_back_btn) + { + edit_wearable_back_btn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onEditWearBackClicked, this)); + } + } + + mCurrentLookName = getChild("currentlook_name"); + + mCurrLookPanel = getChild("panel_currentlook"); + + return TRUE; +} + +// virtual +void LLSidepanelAppearance::onOpen(const LLSD& key) +{ + fetchInventory(); + refreshCurrentOutfitName(); + + if(key.size() == 0) + return; + + toggleLookInfoPanel(TRUE); + updateVerbs(); + + mLookInfoType = key["type"].asString(); + + if (mLookInfoType == "look") + { + LLInventoryCategory *pLook = gInventory.getCategory(key["id"].asUUID()); + if (pLook) + mLookInfo->displayLookInfo(pLook); + } +} + +void LLSidepanelAppearance::onFilterEdit(const std::string& search_string) +{ + if (mFilterSubString != search_string) + { + mFilterSubString = search_string; + + // Searches are case-insensitive + LLStringUtil::toUpper(mFilterSubString); + LLStringUtil::trimHead(mFilterSubString); + + mPanelOutfitsInventory->onSearchEdit(mFilterSubString); + } +} + +void LLSidepanelAppearance::onWearButtonClicked() +{ + if (mLookInfo->getVisible()) + { + } + else + { + mPanelOutfitsInventory->onWear(); + } +} + +void LLSidepanelAppearance::onEditAppearanceButtonClicked() +{ + if (gAgentWearables.areWearablesLoaded()) + { + gAgent.changeCameraToCustomizeAvatar(); + } +} + +void LLSidepanelAppearance::onEditButtonClicked() +{ + toggleLookInfoPanel(FALSE); + toggleWearableEditPanel(TRUE, NULL); + /*if (mLookInfo->getVisible()) + { + } + else + { + mPanelOutfitsInventory->onEdit(); + }*/ +} + +void LLSidepanelAppearance::onNewOutfitButtonClicked() +{ + if (mLookInfo->getVisible()) + { + } + else + { + mPanelOutfitsInventory->onNew(); + } +} + + +void LLSidepanelAppearance::onBackButtonClicked() +{ + toggleLookInfoPanel(FALSE); +} + +void LLSidepanelAppearance::onEditWearBackClicked() +{ + mEditWearable->saveChanges(); + toggleWearableEditPanel(FALSE, NULL); + toggleLookInfoPanel(TRUE); +} + +void LLSidepanelAppearance::toggleLookInfoPanel(BOOL visible) +{ + if (!mLookInfo) + return; + + mLookInfo->setVisible(visible); + mPanelOutfitsInventory->setVisible(!visible); + mFilterEditor->setVisible(!visible); + mWearBtn->setVisible(!visible); + mEditBtn->setVisible(!visible); + mNewLookBtn->setVisible(!visible); + mOverflowBtn->setVisible(!visible); + mCurrLookPanel->setVisible(!visible); +} + +void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLWearable *wearable) +{ + if (!wearable) + { + wearable = gAgentWearables.getWearable(WT_SHAPE, 0); + } + if (!mEditWearable || !wearable) + { + return; + } + + mEditWearable->setVisible(visible); + mFilterEditor->setVisible(!visible); + mPanelOutfitsInventory->setVisible(!visible); +} + +void LLSidepanelAppearance::updateVerbs() +{ + bool is_look_info_visible = mLookInfo->getVisible(); + mOverflowBtn->setEnabled(false); + + if (is_look_info_visible) + { + } + else + { + mPanelOutfitsInventory->updateVerbs(); + } +} + +void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string name) +{ + if (name == "") + { + const LLUUID current_outfit_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + // Can't search on AT_OUTFIT since links to categories return AT_CATEGORY for type since they don't + // return preferred type. + LLIsType is_category( LLAssetType::AT_CATEGORY ); + gInventory.collectDescendentsIf(current_outfit_cat, + cat_array, + item_array, + false, + is_category, + false); + for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin(); + iter != item_array.end(); + iter++) + { + const LLViewerInventoryItem *item = (*iter); + const LLViewerInventoryCategory *cat = item->getLinkedCategory(); + if (cat && cat->getPreferredType() == LLFolderType::FT_OUTFIT) + { + mCurrentLookName->setText(cat->getName()); + return; + } + } + mCurrentLookName->setText(std::string("")); + } + else + { + mCurrentLookName->setText(name); + } +} + +//static +void LLSidepanelAppearance::editWearable(LLWearable *wearable, void *data) +{ + LLSidepanelAppearance *panel = (LLSidepanelAppearance*) data; + panel->toggleLookInfoPanel(FALSE); + panel->toggleWearableEditPanel(TRUE, wearable); +} + +// Fetch currently worn items and only enable the New Look button after everything's been +// fetched. Alternatively, we could stuff this logic into llagentwearables::makeNewOutfitLinks. +void LLSidepanelAppearance::fetchInventory() +{ + + mNewLookBtn->setEnabled(false); + LLInventoryFetchObserver::item_ref_t ids; + LLUUID item_id; + for(S32 type = (S32)WT_SHAPE; type < (S32)WT_COUNT; ++type) + { + // MULTI_WEARABLE: + item_id = gAgentWearables.getWearableItemID((EWearableType)type,0); + if(item_id.notNull()) + { + ids.push_back(item_id); + } + } + + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); + if( avatar ) + { + for (LLVOAvatar::attachment_map_t::const_iterator iter = avatar->mAttachmentPoints.begin(); + iter != avatar->mAttachmentPoints.end(); ++iter) + { + LLViewerJointAttachment* attachment = iter->second; + if (!attachment) continue; + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + LLViewerObject* attached_object = (*attachment_iter); + if (!attached_object) continue; + const LLUUID& item_id = attached_object->getItemID(); + if (item_id.isNull()) continue; + ids.push_back(item_id); + } + } + } + + mFetchWorn->fetchItems(ids); + // If no items to be fetched, done will never be triggered. + // TODO: Change LLInventoryFetchObserver::fetchItems to trigger done() on this condition. + if (mFetchWorn->isEverythingComplete()) + { + mFetchWorn->done(); + } + else + { + gInventory.addObserver(mFetchWorn); + } +} + +void LLSidepanelAppearance::inventoryFetched() +{ + mNewLookBtn->setEnabled(true); +} diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h new file mode 100644 index 0000000000..7be6d2d432 --- /dev/null +++ b/indra/newview/llsidepanelappearance.h @@ -0,0 +1,102 @@ +/** + * @file llsidepanelappearance.h + * @brief Side Bar "Appearance" panel + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLSIDEPANELAPPEARANCE_H +#define LL_LLSIDEPANELAPPEARANCE_H + +#include "llpanel.h" +#include "llinventoryobserver.h" + +#include "llinventory.h" +#include "llpanellookinfo.h" + +class LLFilterEditor; +class LLCurrentlyWornFetchObserver; +class LLPanelEditWearable; +class LLWearable; +class LLPanelOutfitsInventory; + +class LLSidepanelAppearance : public LLPanel +{ +public: + LLSidepanelAppearance(); + virtual ~LLSidepanelAppearance(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + + void refreshCurrentOutfitName(const std::string name = ""); + + static void editWearable(LLWearable *wearable, void *data); + + void fetchInventory(); + void inventoryFetched(); +private: + void onFilterEdit(const std::string& search_string); + + void onEditAppearanceButtonClicked(); + void onWearButtonClicked(); + void onEditButtonClicked(); + void onNewOutfitButtonClicked(); + void onBackButtonClicked(); + void onEditWearBackClicked(); + void toggleLookInfoPanel(BOOL visible); + void toggleWearableEditPanel(BOOL visible, LLWearable* wearable); + + void updateVerbs(); + + LLFilterEditor* mFilterEditor; + LLPanelOutfitsInventory* mPanelOutfitsInventory; + LLPanelLookInfo* mLookInfo; + LLPanelEditWearable* mEditWearable; + + LLButton* mEditAppearanceBtn; + LLButton* mWearBtn; + LLButton* mEditBtn; + LLButton* mNewLookBtn; + LLButton* mOverflowBtn; + LLPanel* mCurrLookPanel; + + LLTextBox* mCurrentLookName; + + // Used to make sure the user's inventory is in memory. + LLCurrentlyWornFetchObserver* mFetchWorn; + + // Search string for filtering landmarks and teleport + // history locations + std::string mFilterSubString; + + // Information type currently shown in Look Information panel + std::string mLookInfoType; + +}; + +#endif //LL_LLSIDEPANELAPPEARANCE_H diff --git a/indra/newview/skins/default/xui/en/floater_inventory.xml b/indra/newview/skins/default/xui/en/floater_inventory.xml index b48c962413..7cfcac8a9a 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory.xml @@ -30,7 +30,7 @@ name="Fetched"> Fetched - + + +