Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer

This commit is contained in:
Latif Khalifa
2013-07-20 18:36:40 +02:00
10 changed files with 33 additions and 63 deletions

View File

@@ -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) if (curr_item_id == item_id)
{ {
LLViewerWearable* wearable = getViewerWearable((LLWearableType::EType)i,j); LLViewerWearable* wearable = getViewerWearable(type, j);
llassert(wearable); llassert(wearable);
if (!wearable) continue; if (!wearable) continue;
wearable->refreshNameAndDescription(); wearable->refreshNameAndDescription();
break;
// Update the name in the appearance editor.
if (LLFloaterCustomize::instanceExists())
{
LLFloaterCustomize::getInstance()->wearablesChanged(type);
}
return;
} }
} }
} }

View File

@@ -116,7 +116,7 @@ public:
// void setWearableItem(LLInventoryItem* new_item, LLViewerWearable* wearable, bool do_append = false); // 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 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 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 ? // *TODO: Move this into llappearance/LLWearableData ?
void addLocalTextureObject(const LLWearableType::EType wearable_type, const LLAvatarAppearanceDefines::ETextureIndex texture_type, U32 wearable_index); void addLocalTextureObject(const LLWearableType::EType wearable_type, const LLAvatarAppearanceDefines::ETextureIndex texture_type, U32 wearable_index);

View File

@@ -67,7 +67,7 @@ public:
virtual void showProperties(void) = 0; virtual void showProperties(void) = 0;
virtual BOOL isItemRenameable() const = 0; virtual BOOL isItemRenameable() const = 0;
virtual BOOL renameItem(const std::string& new_name) = 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 isItemMovable( void ) const = 0; // Can be moved to another folder
virtual BOOL isItemRemovable( void ) const = 0; // Can be destroyed virtual BOOL isItemRemovable( void ) const = 0; // Can be destroyed
virtual BOOL isItemInTrash( void) const { return FALSE; } // TODO: make into pure virtual. virtual BOOL isItemInTrash( void) const { return FALSE; } // TODO: make into pure virtual.

View File

@@ -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 ) if( mListener )
{ {
mListener->descriptionChanged(); mListener->nameOrDescriptionChanged();
} }
} }

View File

@@ -277,8 +277,8 @@ public:
// just rename the object. // just rename the object.
void rename(const std::string& new_name); void rename(const std::string& new_name);
// Alert mListener that the description of this item changed. // Alert mListener that the name or description of this item changed.
void descriptionChanged(void) const; void nameOrDescriptionChanged(void) const;
// open // open
virtual void openItem( void ); virtual void openItem( void );

View File

@@ -1724,11 +1724,6 @@ BOOL LLItemBridge::renameItem(const std::string& new_name)
return FALSE; return FALSE;
} }
void LLItemBridge::descriptionChanged(void) const
{
// Nothing to do.
}
BOOL LLItemBridge::removeItem() BOOL LLItemBridge::removeItem()
{ {
if(!isItemRemovable()) if(!isItemRemovable())
@@ -2970,12 +2965,6 @@ BOOL LLFolderBridge::renameItem(const std::string& new_name)
return FALSE; return FALSE;
} }
void LLFolderBridge::descriptionChanged(void) const
{
// A folder has no description.
llerrs << "Calling LLFolderBridge::descriptionChanged" << llendl;
}
BOOL LLFolderBridge::removeItem() BOOL LLFolderBridge::removeItem()
{ {
if(!isItemRemovable()) if(!isItemRemovable())
@@ -5479,11 +5468,6 @@ BOOL LLObjectBridge::renameItem(const std::string& new_name)
return FALSE; return FALSE;
} }
void LLObjectBridge::descriptionChanged(void) const
{
// Nothing to do.
}
// +=================================================+ // +=================================================+
// | LLLSLTextBridge | // | LLLSLTextBridge |
// +=================================================+ // +=================================================+
@@ -5642,11 +5626,11 @@ BOOL LLWearableBridge::renameItem(const std::string& new_name)
return LLItemBridge::renameItem(new_name); return LLItemBridge::renameItem(new_name);
} }
void LLWearableBridge::descriptionChanged(void) const void LLWearableBridge::nameOrDescriptionChanged(void) const
{ {
if (get_is_item_worn(mUUID)) if (get_is_item_worn(mUUID))
{ {
gAgentWearables.descriptionChanged(mUUID); gAgentWearables.nameOrDescriptionChanged(mUUID);
} }
} }

View File

@@ -211,7 +211,6 @@ public:
virtual time_t getCreationDate() const; virtual time_t getCreationDate() const;
virtual BOOL isItemRenameable() const; virtual BOOL isItemRenameable() const;
virtual BOOL renameItem(const std::string& new_name); virtual BOOL renameItem(const std::string& new_name);
virtual void descriptionChanged(void) const;
virtual BOOL removeItem(); virtual BOOL removeItem();
virtual BOOL isItemCopyable() const; virtual BOOL isItemCopyable() const;
virtual BOOL hasChildren() const { return FALSE; } virtual BOOL hasChildren() const { return FALSE; }
@@ -258,7 +257,6 @@ public:
static LLUIImagePtr getIcon(LLFolderType::EType preferred_type); static LLUIImagePtr getIcon(LLFolderType::EType preferred_type);
virtual BOOL renameItem(const std::string& new_name); virtual BOOL renameItem(const std::string& new_name);
virtual void descriptionChanged(void) const;
virtual BOOL removeItem(); virtual BOOL removeItem();
BOOL removeSystemFolder(); BOOL removeSystemFolder();
@@ -468,7 +466,6 @@ public:
virtual std::string getLabelSuffix() const; virtual std::string getLabelSuffix() const;
virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
virtual BOOL renameItem(const std::string& new_name); virtual BOOL renameItem(const std::string& new_name);
virtual void descriptionChanged(void) const;
LLInventoryObject* getObject() const; LLInventoryObject* getObject() const;
protected: protected:
static LLUUID sContextMenuItemID; // Only valid while the context menu is open. static LLUUID sContextMenuItemID; // Only valid while the context menu is open.
@@ -502,7 +499,7 @@ public:
virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
virtual std::string getLabelSuffix() const; virtual std::string getLabelSuffix() const;
virtual BOOL renameItem(const std::string& new_name); 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; } virtual LLWearableType::EType getWearableType() const { return mWearableType; }
static void onWearOnAvatar( void* userdata ); // Access to wearOnAvatar() from menu static void onWearOnAvatar( void* userdata ); // Access to wearOnAvatar() from menu

View File

@@ -479,8 +479,8 @@ void LLInventoryPanel::modelChanged(U32 mask)
view_item->refresh(); view_item->refresh();
} }
// Singu note: let listeners know it was renamed. // Singu note: Needed to propagate name change to wearables.
view_item->rename(view_item->getLabel()); view_item->nameOrDescriptionChanged();
} }
} }
@@ -491,7 +491,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
{ {
if (view_item) if (view_item)
{ {
view_item->descriptionChanged(); view_item->nameOrDescriptionChanged();
} }
} }

View File

@@ -933,12 +933,7 @@ void LLPanelEditWearable::setWearableIndex(S32 index)
LLViewerWearable* wearable = gAgentWearables.getViewerWearable(mType,mCurrentIndex); LLViewerWearable* wearable = gAgentWearables.getViewerWearable(mType,mCurrentIndex);
if(wearable == getWearable()) // Singu note: Set title even if the wearable didn't change: the name might have changed (when renamed).
return;
mCurrentWearable = wearable;
if(wearable) if(wearable)
{ {
childSetTextArg("title", "[DESC]", wearable->getName() ); childSetTextArg("title", "[DESC]", wearable->getName() );
@@ -950,6 +945,11 @@ void LLPanelEditWearable::setWearableIndex(S32 index)
childSetTextArg("title_no_modify", "[DESC]", std::string(LLWearableType::getTypeLabel( mType ))); childSetTextArg("title_no_modify", "[DESC]", std::string(LLWearableType::getTypeLabel( mType )));
} }
if(wearable == getWearable())
return;
mCurrentWearable = wearable;
if(mActiveModal) if(mActiveModal)
mActiveModal->close(); mActiveModal->close();

View File

@@ -123,7 +123,6 @@ public:
virtual void selectItem() {} virtual void selectItem() {}
virtual BOOL isItemRenameable() const; virtual BOOL isItemRenameable() const;
virtual BOOL renameItem(const std::string& new_name); virtual BOOL renameItem(const std::string& new_name);
virtual void descriptionChanged(void) const;
virtual BOOL isItemMovable() const; virtual BOOL isItemMovable() const;
virtual BOOL isItemRemovable() const; virtual BOOL isItemRemovable() const;
virtual BOOL removeItem(); virtual BOOL removeItem();
@@ -431,11 +430,6 @@ BOOL LLTaskInvFVBridge::renameItem(const std::string& new_name)
return TRUE; return TRUE;
} }
void LLTaskInvFVBridge::descriptionChanged(void) const
{
// Nothing to do.
}
BOOL LLTaskInvFVBridge::isItemMovable() const BOOL LLTaskInvFVBridge::isItemMovable() const
{ {
//LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); //LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
@@ -855,7 +849,6 @@ public:
virtual BOOL isItemRenameable() const; virtual BOOL isItemRenameable() const;
// virtual BOOL isItemCopyable() const { return FALSE; } // virtual BOOL isItemCopyable() const { return FALSE; }
virtual BOOL renameItem(const std::string& new_name); virtual BOOL renameItem(const std::string& new_name);
virtual void descriptionChanged(void) const;
virtual BOOL isItemRemovable() const; virtual BOOL isItemRemovable() const;
virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
virtual BOOL hasChildren() const; virtual BOOL hasChildren() const;
@@ -896,12 +889,6 @@ BOOL LLTaskCategoryBridge::renameItem(const std::string& new_name)
return FALSE; return FALSE;
} }
void LLTaskCategoryBridge::descriptionChanged(void) const
{
// A category has no description.
llerrs << "Calling LLTaskCategoryBridge::descriptionChanged" << llendl;
}
BOOL LLTaskCategoryBridge::isItemRemovable() const BOOL LLTaskCategoryBridge::isItemRemovable() const
{ {
return FALSE; return FALSE;
@@ -1217,7 +1204,6 @@ public:
virtual BOOL isItemRenameable() const; virtual BOOL isItemRenameable() const;
virtual BOOL renameItem(const std::string& new_name); virtual BOOL renameItem(const std::string& new_name);
virtual void descriptionChanged(void) const;
}; };
BOOL LLTaskCallingCardBridge::isItemRenameable() const BOOL LLTaskCallingCardBridge::isItemRenameable() const
@@ -1230,11 +1216,6 @@ BOOL LLTaskCallingCardBridge::renameItem(const std::string& new_name)
return FALSE; return FALSE;
} }
void LLTaskCallingCardBridge::descriptionChanged(void) const
{
// Nothing to do.
}
///---------------------------------------------------------------------------- ///----------------------------------------------------------------------------
/// Class LLTaskScriptBridge /// Class LLTaskScriptBridge
///---------------------------------------------------------------------------- ///----------------------------------------------------------------------------