summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llagentwearables.cpp42
-rw-r--r--indra/newview/llinventorybridge.cpp2
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp5
-rw-r--r--indra/newview/llpaneloutfitsinventory.h4
4 files changed, 38 insertions, 15 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 475f34dc2b..f0742876e2 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -49,6 +49,9 @@
#include "llgesturemgr.h"
#include "llappearancemgr.h"
#include "lltexlayer.h"
+#include "llsidetray.h"
+#include "llpaneloutfitsinventory.h"
+#include "llfolderview.h"
#include <boost/scoped_ptr.hpp>
@@ -1295,6 +1298,33 @@ 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"));
+ outfit_panel->getRootFolder()->clearSelection();
+ outfit_panel->getRootFolder()->setSelectionByID(mFolderID, TRUE);
+ outfit_panel->getRootFolder()->setNeedsAutoRename(TRUE);
+ }
+
+ virtual void fire(const LLUUID&)
+ {
+ }
+
+private:
+ LLUUID mFolderID;
+};
+
LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name)
{
if (mAvatarObject.isNull())
@@ -1309,17 +1339,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;
}
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 9421cf5716..fedc45b1fb 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2385,6 +2385,8 @@ void LLFolderBridge::folderOptionsMenu()
if (is_sidepanel)
{
mItems.clear();
+ mItems.push_back("Rename");
+ mItems.push_back("Delete");
}
// Only enable calling-card related options for non-default folders.
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index 5af26c1ad9..951e74abf9 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -144,16 +144,13 @@ 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::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action)
{
updateListCommands();
updateParent();
- if (getRootFolder()->needsAutoRename())
+ if (getRootFolder()->needsAutoRename() && items.size())
{
getRootFolder()->startRenamingSelectedItem();
getRootFolder()->setNeedsAutoRename(FALSE);
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index 7769a7d172..aa0ab4efbc 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -65,10 +65,12 @@ public:
// Otherwise, return NULL.
LLFolderViewEventListener* getCorrectListenerForAction();
void setParent(LLSidepanelAppearance *parent);
+
+ LLFolderView* getRootFolder();
+
protected:
void updateParent();
bool getIsCorrectType(const LLFolderViewEventListener *listenerp) const;
- LLFolderView* getRootFolder();
private:
LLSidepanelAppearance* mParent;