summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitedit.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-05-20 11:47:15 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-05-20 11:47:15 +0100
commit9c779e222eb6f929003e2cce446850dfbc306063 (patch)
tree2837aacd1966ea429ea450bb7869e5b6595db309 /indra/newview/llpaneloutfitedit.cpp
parent02fe5d60c0a6664bb86254347ce31467da2d90c3 (diff)
parentae0dbecb1c93347f7d83760117496048af3148da (diff)
merge from viewer-public
Diffstat (limited to 'indra/newview/llpaneloutfitedit.cpp')
-rw-r--r--indra/newview/llpaneloutfitedit.cpp35
1 files changed, 29 insertions, 6 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index 44832ac496..4178fd9c90 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -210,7 +210,8 @@ LLPanelOutfitEdit::LLPanelOutfitEdit()
mCOFWearables(NULL),
mInventoryItemsPanel(NULL),
mCOFObserver(NULL),
- mCOFDragAndDropObserver(NULL)
+ mCOFDragAndDropObserver(NULL),
+ mInitialized(false)
{
mSavedFolderState = new LLSaveFolderState();
mSavedFolderState->setApply(FALSE);
@@ -307,6 +308,16 @@ BOOL LLPanelOutfitEdit::postBuild()
return TRUE;
}
+// virtual
+void LLPanelOutfitEdit::onOpen(const LLSD& key)
+{
+ if (!mInitialized)
+ {
+ displayCurrentOutfit();
+ mInitialized = true;
+ }
+}
+
void LLPanelOutfitEdit::moveWearable(bool closer_to_body)
{
LLUUID item_id = mCOFWearables->getSelectedUUID();
@@ -446,13 +457,25 @@ void LLPanelOutfitEdit::onSearchEdit(const std::string& string)
void LLPanelOutfitEdit::onAddToOutfitClicked(void)
{
- LLFolderViewItem* curr_item = mInventoryItemsPanel->getRootFolder()->getCurSelectedItem();
- if (!curr_item) return;
+ LLUUID selected_id;
+ if (mInventoryItemsPanel->getVisible())
+ {
+ LLFolderViewItem* curr_item = mInventoryItemsPanel->getRootFolder()->getCurSelectedItem();
+ if (!curr_item) return;
+
+ LLFolderViewEventListener* listenerp = curr_item->getListener();
+ if (!listenerp) return;
+
+ selected_id = listenerp->getUUID();
+ }
+ else if (mWearableItemsPanel->getVisible())
+ {
+ selected_id = mWearableItemsList->getSelectedUUID();
+ }
- LLFolderViewEventListener* listenerp = curr_item->getListener();
- if (!listenerp) return;
+ if (selected_id.isNull()) return;
- LLAppearanceMgr::getInstance()->wearItemOnAvatar(listenerp->getUUID());
+ LLAppearanceMgr::getInstance()->wearItemOnAvatar(selected_id);
}