summaryrefslogtreecommitdiff
path: root/indra/newview/llagentwearables.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rw-r--r--indra/newview/llagentwearables.cpp51
1 files changed, 41 insertions, 10 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index e2d0daa245..1552c98594 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -49,6 +49,10 @@
#include "llgesturemgr.h"
#include "llappearancemgr.h"
#include "lltexlayer.h"
+#include "llsidetray.h"
+#include "llpaneloutfitsinventory.h"
+#include "llfolderview.h"
+#include "llaccordionctrltab.h"
#include <boost/scoped_ptr.hpp>
@@ -1295,6 +1299,41 @@ void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name,
}
}
+class LLAutoRenameFolder: public LLInventoryCallback
+{
+public:
+ LLAutoRenameFolder(LLUUID& folder_id):
+ mFolderID(folder_id)
+ {
+ }
+
+ virtual ~LLAutoRenameFolder()
+ {
+ LLSD key;
+ LLSideTray::getInstance()->showPanel("panel_outfits_inventory", key);
+ LLPanelOutfitsInventory *outfit_panel =
+ dynamic_cast<LLPanelOutfitsInventory*>(LLSideTray::getInstance()->getPanel("panel_outfits_inventory"));
+ if (outfit_panel)
+ {
+ outfit_panel->getRootFolder()->clearSelection();
+ outfit_panel->getRootFolder()->setSelectionByID(mFolderID, TRUE);
+ outfit_panel->getRootFolder()->setNeedsAutoRename(TRUE);
+ }
+ LLAccordionCtrlTab* tab_outfits = outfit_panel ? outfit_panel->findChild<LLAccordionCtrlTab>("tab_outfits") : 0;
+ if (tab_outfits && !tab_outfits->getDisplayChildren())
+ {
+ tab_outfits->changeOpenClose(tab_outfits->getDisplayChildren());
+ }
+ }
+
+ virtual void fire(const LLUUID&)
+ {
+ }
+
+private:
+ LLUUID mFolderID;
+};
+
LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name)
{
if (mAvatarObject.isNull())
@@ -1309,17 +1348,9 @@ LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name)
LLFolderType::FT_OUTFIT,
new_folder_name);
- LLAppearanceManager::instance().shallowCopyCategory(LLAppearanceManager::instance().getCOF(),folder_id, NULL);
+ LLPointer<LLInventoryCallback> cb = new LLAutoRenameFolder(folder_id);
+ LLAppearanceManager::instance().shallowCopyCategory(LLAppearanceManager::instance().getCOF(),folder_id, cb);
-#if 0 // BAP - fix to go into rename state automatically after outfit is created.
- LLViewerInventoryCategory *parent_category = gInventory.getCategory(parent_id);
- if (parent_category)
- {
- parent_category->setSelectionByID(folder_id,TRUE);
- parent_category->setNeedsAutoRename(TRUE);
- }
-#endif
-
return folder_id;
}