diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llsidepanelinventory.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llsidepanelinventory.h | 1 | ||||
-rw-r--r-- | indra/newview/llsidepanelinventorysubpanel.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llsidepanelinventorysubpanel.h | 1 | ||||
-rw-r--r-- | indra/newview/llsidepaneliteminfo.cpp | 32 | ||||
-rw-r--r-- | indra/newview/llsidepaneliteminfo.h | 1 | ||||
-rw-r--r-- | indra/newview/llsidepaneltaskinfo.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/sidepanel_item_info.xml | 9 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/sidepanel_task_info.xml | 11 |
10 files changed, 31 insertions, 53 deletions
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index ca7a3b663a..5383158cd3 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -235,8 +235,10 @@ void LLSidepanelInventory::updateVerbs() if (!item) return; - mInfoBtn->setEnabled(TRUE); - mShareBtn->setEnabled(TRUE); + bool is_single_selection = getSelectedCount() == 1; + + mInfoBtn->setEnabled(is_single_selection); + mShareBtn->setEnabled(is_single_selection); switch(item->getInventoryType()) { @@ -274,6 +276,14 @@ LLInventoryItem *LLSidepanelInventory::getSelectedItem() return item; } +U32 LLSidepanelInventory::getSelectedCount() +{ + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory"); + std::set<LLUUID> selection_list; + panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList(selection_list); + return selection_list.size(); +} + LLInventoryPanel *LLSidepanelInventory::getActivePanel() { if (!getVisible()) diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 231cdac9e1..ee11fb6b54 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -56,6 +56,7 @@ public: protected: // Tracks highlighted (selected) item in inventory panel. LLInventoryItem *getSelectedItem(); + U32 getSelectedCount(); void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action); // "wear", "teleport", etc. void performActionOnSelection(const std::string &action); diff --git a/indra/newview/llsidepanelinventorysubpanel.cpp b/indra/newview/llsidepanelinventorysubpanel.cpp index 23931defdd..793904faa8 100644 --- a/indra/newview/llsidepanelinventorysubpanel.cpp +++ b/indra/newview/llsidepanelinventorysubpanel.cpp @@ -57,7 +57,6 @@ LLSidepanelInventorySubpanel::LLSidepanelInventorySubpanel() : LLPanel(), mIsDirty(TRUE), mIsEditing(FALSE), - mEditBtn(NULL), mCancelBtn(NULL), mSaveBtn(NULL) { @@ -71,9 +70,6 @@ LLSidepanelInventorySubpanel::~LLSidepanelInventorySubpanel() // virtual BOOL LLSidepanelInventorySubpanel::postBuild() { - mEditBtn = getChild<LLButton>("edit_btn"); - mEditBtn->setClickedCallback(boost::bind(&LLSidepanelInventorySubpanel::onEditButtonClicked, this)); - mSaveBtn = getChild<LLButton>("save_btn"); mSaveBtn->setClickedCallback(boost::bind(&LLSidepanelInventorySubpanel::onSaveButtonClicked, this)); @@ -111,9 +107,9 @@ void LLSidepanelInventorySubpanel::draw() { if (mIsDirty) { - mIsDirty = FALSE; refresh(); updateVerbs(); + mIsDirty = FALSE; } LLPanel::draw(); @@ -127,7 +123,6 @@ void LLSidepanelInventorySubpanel::dirty() void LLSidepanelInventorySubpanel::updateVerbs() { - mEditBtn->setVisible(!mIsEditing); mSaveBtn->setVisible(mIsEditing); mCancelBtn->setVisible(mIsEditing); } diff --git a/indra/newview/llsidepanelinventorysubpanel.h b/indra/newview/llsidepanelinventorysubpanel.h index a74f4fdee6..b7bee6809f 100644 --- a/indra/newview/llsidepanelinventorysubpanel.h +++ b/indra/newview/llsidepanelinventorysubpanel.h @@ -70,7 +70,6 @@ protected: void onEditButtonClicked(); void onSaveButtonClicked(); void onCancelButtonClicked(); - LLButton* mEditBtn; LLButton* mSaveBtn; LLButton* mCancelBtn; diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index ad6428e515..449bdefb8f 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -159,7 +159,6 @@ void LLSidepanelItemInfo::refresh() setIsEditing(FALSE); return; } - mEditBtn->setEnabled(FALSE); } if (!getIsEditing()) @@ -251,6 +250,18 @@ void LLSidepanelItemInfo::refreshFromItem(LLInventoryItem* item) GP_OBJECT_MANIPULATE) && is_obj_modify && is_complete; + const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + bool item_in_trash = item->getUUID() == trash_id || gInventory.isObjectDescendentOf(item->getUUID(), trash_id); + + if (is_modifiable && !item_in_trash) + { + setIsEditing(TRUE); + } + else + { + setIsEditing(FALSE); + } + childSetEnabled("LabelItemNameTitle",TRUE); childSetEnabled("LabelItemName",is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards childSetText("LabelItemName",item->getName()); @@ -859,25 +870,6 @@ LLInventoryItem* LLSidepanelItemInfo::findItem() const } // virtual -void LLSidepanelItemInfo::updateVerbs() -{ - LLSidepanelInventorySubpanel::updateVerbs(); - - const LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem(); - if (item) - { - const LLPermissions& perm = item->getPermissions(); - BOOL is_modifiable = gAgent.allowOperation(PERM_MODIFY, perm, - GP_OBJECT_MANIPULATE); - - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - bool item_in_trash = item->getUUID() == trash_id || gInventory.isObjectDescendentOf(item->getUUID(), trash_id); - mEditBtn->setEnabled(is_modifiable && !item_in_trash); - - } -} - -// virtual void LLSidepanelItemInfo::save() { onCommitName(); diff --git a/indra/newview/llsidepaneliteminfo.h b/indra/newview/llsidepaneliteminfo.h index 4bfbd56ea7..21002327bc 100644 --- a/indra/newview/llsidepaneliteminfo.h +++ b/indra/newview/llsidepaneliteminfo.h @@ -62,7 +62,6 @@ public: protected: /*virtual*/ void refresh(); /*virtual*/ void save(); - /*virtual*/ void updateVerbs(); LLInventoryItem* findItem() const; LLViewerObject* findObject() const; diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 464546cc77..2c40e948de 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -1047,8 +1047,8 @@ void LLSidepanelTaskInfo::updateVerbs() mBuyBtn->setVisible(!getIsEditing()); mOpenBtn->setEnabled(enable_object_open()); - const LLViewerObject *obj = getFirstSelectedObject(); - mEditBtn->setEnabled(obj && obj->permModify()); + //const LLViewerObject *obj = getFirstSelectedObject(); + //mEditBtn->setEnabled(obj && obj->permModify()); } void LLSidepanelTaskInfo::onOpenButtonClicked() diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 93b0ad4a5b..03910b0534 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5994,7 +5994,7 @@ void LLVOAvatar::updateMeshTextures() else { mBakedTextureDatas[i].mIsLoaded = FALSE; - if ( (i == BAKED_HEAD) || (i == BAKED_UPPER) || (i == BAKED_LOWER) ) + if ( (baked_img->getID() != IMG_INVISIBLE) && ((i == BAKED_HEAD) || (i == BAKED_UPPER) || (i == BAKED_LOWER)) ) { baked_img->setLoadedCallback(onBakedTextureMasksLoaded, MORPH_MASK_REQUESTED_DISCARD, TRUE, TRUE, new LLTextureMaskData( mID )); } @@ -6464,7 +6464,7 @@ void LLVOAvatar::onFirstTEMessageReceived() LLViewerFetchedTexture* image = LLViewerTextureManager::staticCastToFetchedTexture(getImage( mBakedTextureDatas[i].mTextureIndex, 0 ), TRUE) ; mBakedTextureDatas[i].mLastTextureIndex = image->getID(); // If we have more than one texture for the other baked layers, we'll want to call this for them too. - if ( (i == BAKED_HEAD) || (i == BAKED_UPPER) || (i == BAKED_LOWER) ) + if ( (image->getID() != IMG_INVISIBLE) && ((i == BAKED_HEAD) || (i == BAKED_UPPER) || (i == BAKED_LOWER)) ) { image->setLoadedCallback( onBakedTextureMasksLoaded, MORPH_MASK_REQUESTED_DISCARD, TRUE, TRUE, new LLTextureMaskData( mID )); } diff --git a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml index db8a844eb0..d006fd0700 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml @@ -489,15 +489,6 @@ bottom="5" width="313"> <button - follows="bottom|left" - height="25" - label="Edit" - layout="topleft" - left="0" - name="edit_btn" - top="0" - width="50" /> - <button follows="bottom|right" height="25" label="Cancel" diff --git a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml index 348f0dfc09..eff2ca1fcd 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml @@ -482,16 +482,7 @@ left="5" bottom="5" width="313"> - <button - follows="bottom|left" - height="25" - label="Edit" - layout="topleft" - left="0" - name="edit_btn" - top="0" - width="50" /> - <button + <button follows="bottom|left" height="25" label="Open" |