diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 2aa0ac9b0..9bb230124 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -598,21 +598,29 @@ void LLAgentWearables::setWearableName(const LLUUID& item_id, const std::string& } } -void LLAgentWearables::descriptionChanged(LLUUID const& item_id) +void LLAgentWearables::nameOrDescriptionChanged(LLUUID const& item_id) { - for (S32 i=0; i < LLWearableType::WT_COUNT; i++) + for (int i = 0; i < LLWearableType::WT_COUNT; ++i) { - for (U32 j=0; j < getWearableCount((LLWearableType::EType)i); j++) + LLWearableType::EType type = (LLWearableType::EType)i; + for (U32 j = 0; j < getWearableCount(type); ++j) { - LLUUID curr_item_id = getWearableItemID((LLWearableType::EType)i,j); + LLUUID curr_item_id = getWearableItemID(type, j); if (curr_item_id == item_id) { - LLViewerWearable* wearable = getViewerWearable((LLWearableType::EType)i,j); + LLViewerWearable* wearable = getViewerWearable(type, j); llassert(wearable); if (!wearable) continue; wearable->refreshNameAndDescription(); - break; + + // Update the name in the appearance editor. + if (LLFloaterCustomize::instanceExists()) + { + LLFloaterCustomize::getInstance()->wearablesChanged(type); + } + + return; } } } diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 318ff832b..5f8ece16e 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -116,7 +116,7 @@ public: // void setWearableItem(LLInventoryItem* new_item, LLViewerWearable* wearable, bool do_append = false); void setWearableOutfit(const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLViewerWearable* >& wearables, BOOL remove); void setWearableName(const LLUUID& item_id, const std::string& new_name); - void descriptionChanged(LLUUID const& item_id); + void nameOrDescriptionChanged(LLUUID const& item_id); // *TODO: Move this into llappearance/LLWearableData ? void addLocalTextureObject(const LLWearableType::EType wearable_type, const LLAvatarAppearanceDefines::ETextureIndex texture_type, U32 wearable_index); diff --git a/indra/newview/llfoldervieweventlistener.h b/indra/newview/llfoldervieweventlistener.h index a679f43d2..39e96424a 100644 --- a/indra/newview/llfoldervieweventlistener.h +++ b/indra/newview/llfoldervieweventlistener.h @@ -67,7 +67,7 @@ public: virtual void showProperties(void) = 0; virtual BOOL isItemRenameable() const = 0; virtual BOOL renameItem(const std::string& new_name) = 0; - virtual void descriptionChanged(void) const = 0; + virtual void nameOrDescriptionChanged(void) const { } // Singu note: Currently only used by LLWearableBridge. virtual BOOL isItemMovable( void ) const = 0; // Can be moved to another folder virtual BOOL isItemRemovable( void ) const = 0; // Can be destroyed virtual BOOL isItemInTrash( void) const { return FALSE; } // TODO: make into pure virtual. diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 63be87aae..fdbe6f51a 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -615,12 +615,12 @@ void LLFolderViewItem::rename(const std::string& new_name) } } -void LLFolderViewItem::descriptionChanged(void) const +void LLFolderViewItem::nameOrDescriptionChanged(void) const { - // We don't have a description, but the listener does! + // Inform the listeners. Our name was already updated (and we don't have a description). if( mListener ) { - mListener->descriptionChanged(); + mListener->nameOrDescriptionChanged(); } } diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index f15978433..8d4362683 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -277,8 +277,8 @@ public: // just rename the object. void rename(const std::string& new_name); - // Alert mListener that the description of this item changed. - void descriptionChanged(void) const; + // Alert mListener that the name or description of this item changed. + void nameOrDescriptionChanged(void) const; // open virtual void openItem( void ); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 65533ea85..d7319756b 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1724,11 +1724,6 @@ BOOL LLItemBridge::renameItem(const std::string& new_name) return FALSE; } -void LLItemBridge::descriptionChanged(void) const -{ - // Nothing to do. -} - BOOL LLItemBridge::removeItem() { if(!isItemRemovable()) @@ -2970,12 +2965,6 @@ BOOL LLFolderBridge::renameItem(const std::string& new_name) return FALSE; } -void LLFolderBridge::descriptionChanged(void) const -{ - // A folder has no description. - llerrs << "Calling LLFolderBridge::descriptionChanged" << llendl; -} - BOOL LLFolderBridge::removeItem() { if(!isItemRemovable()) @@ -5479,11 +5468,6 @@ BOOL LLObjectBridge::renameItem(const std::string& new_name) return FALSE; } -void LLObjectBridge::descriptionChanged(void) const -{ - // Nothing to do. -} - // +=================================================+ // | LLLSLTextBridge | // +=================================================+ @@ -5642,11 +5626,11 @@ BOOL LLWearableBridge::renameItem(const std::string& new_name) return LLItemBridge::renameItem(new_name); } -void LLWearableBridge::descriptionChanged(void) const +void LLWearableBridge::nameOrDescriptionChanged(void) const { if (get_is_item_worn(mUUID)) { - gAgentWearables.descriptionChanged(mUUID); + gAgentWearables.nameOrDescriptionChanged(mUUID); } } diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index b7dfc0623..5fa3641a7 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -211,7 +211,6 @@ public: virtual time_t getCreationDate() const; virtual BOOL isItemRenameable() const; virtual BOOL renameItem(const std::string& new_name); - virtual void descriptionChanged(void) const; virtual BOOL removeItem(); virtual BOOL isItemCopyable() const; virtual BOOL hasChildren() const { return FALSE; } @@ -258,7 +257,6 @@ public: static LLUIImagePtr getIcon(LLFolderType::EType preferred_type); virtual BOOL renameItem(const std::string& new_name); - virtual void descriptionChanged(void) const; virtual BOOL removeItem(); BOOL removeSystemFolder(); @@ -468,7 +466,6 @@ public: virtual std::string getLabelSuffix() const; virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual BOOL renameItem(const std::string& new_name); - virtual void descriptionChanged(void) const; LLInventoryObject* getObject() const; protected: static LLUUID sContextMenuItemID; // Only valid while the context menu is open. @@ -502,7 +499,7 @@ public: virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual std::string getLabelSuffix() const; virtual BOOL renameItem(const std::string& new_name); - virtual void descriptionChanged(void) const; + virtual void nameOrDescriptionChanged(void) const; virtual LLWearableType::EType getWearableType() const { return mWearableType; } static void onWearOnAvatar( void* userdata ); // Access to wearOnAvatar() from menu diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index e04d7bb89..3de4fc349 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -479,8 +479,8 @@ void LLInventoryPanel::modelChanged(U32 mask) view_item->refresh(); } - // Singu note: let listeners know it was renamed. - view_item->rename(view_item->getLabel()); + // Singu note: Needed to propagate name change to wearables. + view_item->nameOrDescriptionChanged(); } } @@ -491,7 +491,7 @@ void LLInventoryPanel::modelChanged(U32 mask) { if (view_item) { - view_item->descriptionChanged(); + view_item->nameOrDescriptionChanged(); } } diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 8cd506ce3..c2d3c549b 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -933,12 +933,7 @@ void LLPanelEditWearable::setWearableIndex(S32 index) LLViewerWearable* wearable = gAgentWearables.getViewerWearable(mType,mCurrentIndex); - if(wearable == getWearable()) - return; - - mCurrentWearable = wearable; - - + // Singu note: Set title even if the wearable didn't change: the name might have changed (when renamed). if(wearable) { childSetTextArg("title", "[DESC]", wearable->getName() ); @@ -950,6 +945,11 @@ void LLPanelEditWearable::setWearableIndex(S32 index) childSetTextArg("title_no_modify", "[DESC]", std::string(LLWearableType::getTypeLabel( mType ))); } + if(wearable == getWearable()) + return; + + mCurrentWearable = wearable; + if(mActiveModal) mActiveModal->close(); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 1477f5336..380607cd4 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -123,7 +123,6 @@ public: virtual void selectItem() {} virtual BOOL isItemRenameable() const; virtual BOOL renameItem(const std::string& new_name); - virtual void descriptionChanged(void) const; virtual BOOL isItemMovable() const; virtual BOOL isItemRemovable() const; virtual BOOL removeItem(); @@ -431,11 +430,6 @@ BOOL LLTaskInvFVBridge::renameItem(const std::string& new_name) return TRUE; } -void LLTaskInvFVBridge::descriptionChanged(void) const -{ - // Nothing to do. -} - BOOL LLTaskInvFVBridge::isItemMovable() const { //LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); @@ -855,7 +849,6 @@ public: virtual BOOL isItemRenameable() const; // virtual BOOL isItemCopyable() const { return FALSE; } virtual BOOL renameItem(const std::string& new_name); - virtual void descriptionChanged(void) const; virtual BOOL isItemRemovable() const; virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual BOOL hasChildren() const; @@ -896,12 +889,6 @@ BOOL LLTaskCategoryBridge::renameItem(const std::string& new_name) return FALSE; } -void LLTaskCategoryBridge::descriptionChanged(void) const -{ - // A category has no description. - llerrs << "Calling LLTaskCategoryBridge::descriptionChanged" << llendl; -} - BOOL LLTaskCategoryBridge::isItemRemovable() const { return FALSE; @@ -1217,7 +1204,6 @@ public: virtual BOOL isItemRenameable() const; virtual BOOL renameItem(const std::string& new_name); - virtual void descriptionChanged(void) const; }; BOOL LLTaskCallingCardBridge::isItemRenameable() const @@ -1230,11 +1216,6 @@ BOOL LLTaskCallingCardBridge::renameItem(const std::string& new_name) return FALSE; } -void LLTaskCallingCardBridge::descriptionChanged(void) const -{ - // Nothing to do. -} - ///---------------------------------------------------------------------------- /// Class LLTaskScriptBridge ///----------------------------------------------------------------------------