summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpaneloutfitedit.cpp')
-rw-r--r--indra/newview/llpaneloutfitedit.cpp50
1 files changed, 21 insertions, 29 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index 2b25c544e3..1ab2100a41 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -113,9 +113,9 @@ private:
LLPanelOutfitEdit::LLPanelOutfitEdit()
-: LLPanel(), mLookID(), mFetchLook(NULL), mSearchFilter(NULL),
+: LLPanel(), mCurrentOutfitID(), mFetchLook(NULL), mSearchFilter(NULL),
mLookContents(NULL), mInventoryItemsPanel(NULL), mAddToLookBtn(NULL),
-mRemoveFromLookBtn(NULL), mLookObserver(NULL), mNumItemsInLook(0)
+mRemoveFromLookBtn(NULL), mLookObserver(NULL)
{
mSavedFolderState = new LLSaveFolderState();
mSavedFolderState->setApply(FALSE);
@@ -157,7 +157,7 @@ BOOL LLPanelOutfitEdit::postBuild()
{
// gInventory.isInventoryUsable() no longer needs to be tested per Richard's fix for race conditions between inventory and panels
- mLookName = getChild<LLTextBox>("curr_look_name");
+ mCurrentOutfitName = getChild<LLTextBox>("curr_outfit_name");
childSetCommitCallback("add_btn", boost::bind(&LLPanelOutfitEdit::showAddWearablesPanel, this), NULL);
@@ -206,7 +206,7 @@ BOOL LLPanelOutfitEdit::postBuild()
mLookContents = getChild<LLScrollListCtrl>("look_items_list");
mLookContents->sortByColumn("look_item_sort", TRUE);
mLookContents->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onLookItemSelectionChange, this));
-
+
/*
LLButton::Params remove_params;
remove_params.name("remove_from_look");
@@ -220,12 +220,12 @@ BOOL LLPanelOutfitEdit::postBuild()
//childSetAction("remove_from_look_btn", boost::bind(&LLPanelOutfitEdit::onRemoveFromLookClicked, this), this);
mRemoveFromLookBtn->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onRemoveFromLookClicked, this));
//getChild<LLPanel>("look_info_group_bar")->addChild(mRemoveFromLookBtn); remove_item_btn
-
+
mEditWearableBtn = getChild<LLButton>("edit_wearable_btn");
mEditWearableBtn->setEnabled(FALSE);
mEditWearableBtn->setVisible(FALSE);
mEditWearableBtn->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onEditWearableClicked, this));
-
+
childSetAction("remove_item_btn", boost::bind(&LLPanelOutfitEdit::onRemoveFromLookClicked, this), this);
return TRUE;
@@ -302,7 +302,7 @@ void LLPanelOutfitEdit::onAddToLookClicked(void)
{
LLFolderViewItem* curr_item = mInventoryItemsPanel->getRootFolder()->getCurSelectedItem();
LLFolderViewEventListener* listenerp = curr_item->getListener();
- link_inventory_item(gAgent.getID(), listenerp->getUUID(), mLookID, listenerp->getName(),
+ link_inventory_item(gAgent.getID(), listenerp->getUUID(), mCurrentOutfitID, listenerp->getName(),
LLAssetType::AT_LINK, LLPointer<LLInventoryCallback>(NULL));
updateLookInfo();
}
@@ -445,7 +445,7 @@ void LLPanelOutfitEdit::lookFetched(void)
// collectDescendentsIf takes non-const reference:
LLFindCOFValidItems is_cof_valid;
- gInventory.collectDescendentsIf(mLookID,
+ gInventory.collectDescendentsIf(mCurrentOutfitID,
cat_array,
item_array,
LLInventoryModel::EXCLUDE_TRASH,
@@ -468,12 +468,6 @@ void LLPanelOutfitEdit::lookFetched(void)
mLookContents->addElement(row);
}
-
- if (mLookContents->getItemCount() != mNumItemsInLook)
- {
- mNumItemsInLook = mLookContents->getItemCount();
- LLAppearanceMgr::instance().updateCOF(mLookID);
- }
}
void LLPanelOutfitEdit::updateLookInfo()
@@ -483,7 +477,7 @@ void LLPanelOutfitEdit::updateLookInfo()
mLookContents->clearRows();
uuid_vec_t folders;
- folders.push_back(mLookID);
+ folders.push_back(mCurrentOutfitID);
mFetchLook->fetchDescendents(folders);
if (mFetchLook->isEverythingComplete())
{
@@ -496,28 +490,26 @@ void LLPanelOutfitEdit::updateLookInfo()
}
}
-void LLPanelOutfitEdit::displayLookInfo(const LLInventoryCategory* pLook)
+void LLPanelOutfitEdit::displayCurrentOutfit()
{
- if (!pLook)
- {
- return;
- }
-
if (!getVisible())
{
setVisible(TRUE);
}
- if (mLookID != pLook->getUUID())
+ mCurrentOutfitID = LLAppearanceMgr::getInstance()->getCOF();
+
+ std::string current_outfit_name;
+ if (LLAppearanceMgr::getInstance()->getBaseOutfitName(current_outfit_name))
{
- mLookID = pLook->getUUID();
- mLookName->setText(pLook->getName());
- updateLookInfo();
+ mCurrentOutfitName->setText(current_outfit_name);
+ }
+ else
+ {
+ mCurrentOutfitName->setText(getString("No Outfit"));
}
-}
-void LLPanelOutfitEdit::reset()
-{
- mLookID.setNull();
+ updateLookInfo();
}
+