summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-01-05 13:38:20 -0800
committerTofu Linden <tofu.linden@lindenlab.com>2010-01-05 13:38:20 -0800
commit5a99682d16059a486ffa75aee938e3570e54c0c6 (patch)
tree83ed51de10d218c3a86fc60b9d68ff142ea6c427 /indra
parent5836902ba06f37a8e949f4ed2edbffe5f596915d (diff)
parent2ee8c957635d3bb1c0638566c47352d8ddf5b2fe (diff)
merge.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llagentwearables.cpp1
-rw-r--r--indra/newview/llappearancemgr.cpp50
-rw-r--r--indra/newview/llappearancemgr.h5
-rw-r--r--indra/newview/llsidepanelappearance.cpp4
-rw-r--r--indra/newview/llviewermedia.h1
-rw-r--r--indra/newview/skins/default/xui/en/panel_outfits_inventory.xml26
6 files changed, 61 insertions, 26 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index dc1598aacd..540dc1c539 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -1360,6 +1360,7 @@ LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name)
LLPointer<LLInventoryCallback> cb = new LLAutoRenameFolder(folder_id);
LLAppearanceManager::instance().shallowCopyCategory(LLAppearanceManager::instance().getCOF(),folder_id, cb);
+ LLAppearanceManager::instance().createBaseOutfitLink(folder_id, NULL);
return folder_id;
}
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 43b2f34ecd..25f1accb22 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -364,7 +364,7 @@ LLUUID LLAppearanceManager::getCOF()
}
-const LLViewerInventoryItem* LLAppearanceManager::getCurrentOutfitLink()
+const LLViewerInventoryItem* LLAppearanceManager::getBaseOutfitLink()
{
const LLUUID& current_outfit_cat = getCOF();
LLInventoryModel::cat_array_t cat_array;
@@ -444,6 +444,28 @@ void LLAppearanceManager::shallowCopyCategory(const LLUUID& src_id, const LLUUID
}
}
+void LLAppearanceManager::purgeBaseOutfitLink(const LLUUID& category)
+{
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ gInventory.collectDescendents(category, cats, items,
+ LLInventoryModel::EXCLUDE_TRASH);
+ for (S32 i = 0; i < items.count(); ++i)
+ {
+ LLViewerInventoryItem *item = items.get(i);
+ if (item->getActualType() != LLAssetType::AT_LINK_FOLDER)
+ continue;
+ if (item->getIsLinkType())
+ {
+ LLViewerInventoryCategory* catp = item->getLinkedCategory();
+ if(catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT)
+ {
+ gInventory.purgeObject(item->getUUID());
+ }
+ }
+ }
+}
+
void LLAppearanceManager::purgeCategory(const LLUUID& category, bool keep_outfit_links)
{
LLInventoryModel::cat_array_t cats;
@@ -578,17 +600,9 @@ void LLAppearanceManager::updateCOF(const LLUUID& category, bool append)
linkAll(cof, gest_items, link_waiter);
// Add link to outfit if category is an outfit.
- LLViewerInventoryCategory* catp = gInventory.getCategory(category);
if (!append)
{
- std::string new_outfit_name = "";
- if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT)
- {
- link_inventory_item(gAgent.getID(), category, cof, catp->getName(),
- LLAssetType::AT_LINK_FOLDER, link_waiter);
- new_outfit_name = catp->getName();
- }
- updatePanelOutfitName(new_outfit_name);
+ createBaseOutfitLink(category, link_waiter);
}
}
@@ -602,6 +616,22 @@ void LLAppearanceManager::updatePanelOutfitName(const std::string& name)
}
}
+void LLAppearanceManager::createBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> link_waiter)
+{
+ const LLUUID cof = getCOF();
+ LLViewerInventoryCategory* catp = gInventory.getCategory(category);
+ std::string new_outfit_name = "";
+
+ purgeBaseOutfitLink(cof);
+
+ if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT)
+ {
+ link_inventory_item(gAgent.getID(), category, cof, catp->getName(),
+ LLAssetType::AT_LINK_FOLDER, link_waiter);
+ new_outfit_name = catp->getName();
+ }
+ updatePanelOutfitName(new_outfit_name);
+}
void LLAppearanceManager::updateAgentWearables(LLWearableHoldingPattern* holder, bool append)
{
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index b625d42a50..11b910ee11 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -62,11 +62,13 @@ public:
LLUUID getCOF();
// Finds the folder link to the currently worn outfit
- const LLViewerInventoryItem *getCurrentOutfitLink();
+ const LLViewerInventoryItem *getBaseOutfitLink();
// Update the displayed outfit name in UI.
void updatePanelOutfitName(const std::string& name);
+ void createBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> link_waiter);
+
void updateAgentWearables(LLWearableHoldingPattern* holder, bool append);
// For debugging - could be moved elsewhere.
@@ -114,6 +116,7 @@ private:
bool follow_folder_links);
void purgeCategory(const LLUUID& category, bool keep_outfit_links);
+ void purgeBaseOutfitLink(const LLUUID& category);
std::set<LLUUID> mRegisteredAttachments;
bool mAttachmentInvLinkEnabled;
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index 30b0075c4b..e2ce534c4f 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -198,7 +198,7 @@ void LLSidepanelAppearance::onFilterEdit(const std::string& search_string)
void LLSidepanelAppearance::onOpenOutfitButtonClicked()
{
- const LLViewerInventoryItem *outfit_link = LLAppearanceManager::getInstance()->getCurrentOutfitLink();
+ const LLViewerInventoryItem *outfit_link = LLAppearanceManager::getInstance()->getBaseOutfitLink();
if (!outfit_link)
return;
if (!outfit_link->getIsLinkType())
@@ -313,7 +313,7 @@ void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name)
{
if (name == "")
{
- const LLViewerInventoryItem *outfit_link = LLAppearanceManager::getInstance()->getCurrentOutfitLink();
+ const LLViewerInventoryItem *outfit_link = LLAppearanceManager::getInstance()->getBaseOutfitLink();
if (outfit_link)
{
const LLViewerInventoryCategory *cat = outfit_link->getLinkedCategory();
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 28fb379960..63f461b4c4 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -187,6 +187,7 @@ public:
std::string getMediaURL() const { return mMediaURL; }
std::string getCurrentMediaURL();
std::string getHomeURL() { return mHomeURL; }
+ std::string getMediaEntryURL() { return mMediaEntryURL; }
void setHomeURL(const std::string& home_url) { mHomeURL = home_url; };
void clearCache();
std::string getMimeType() { return mMimeType; }
diff --git a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
index d6d8e9562b..7e512f9594 100644
--- a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml
@@ -21,19 +21,6 @@
tab_position="top"
halign="center"
width="313">
- <inventory_panel
- label="MY OUTFITS"
- help_topic="my_outfits_tab"
- allow_multi_select="true"
- follows="all"
- border="false"
- left="0"
- top="0"
- height="500"
- width="290"
- mouse_opaque="true"
- name="outfitslist_accordionpanel"
- start_folder="My Outfits" />
<inventory_panel
label="WEARING"
help_topic="now_wearing_tab"
@@ -46,6 +33,19 @@
mouse_opaque="true"
name="cof_accordionpanel"
start_folder="Current Outfit" />
+ <inventory_panel
+ label="MY OUTFITS"
+ help_topic="my_outfits_tab"
+ allow_multi_select="true"
+ follows="all"
+ border="false"
+ left="0"
+ top="0"
+ height="500"
+ width="290"
+ mouse_opaque="true"
+ name="outfitslist_accordionpanel"
+ start_folder="My Outfits" />
</tab_container>
<panel
background_visible="true"