diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-12-09 20:26:20 -0500 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-12-09 20:26:20 -0500 |
commit | 152010b8c6f0c5e6aec1cf56176d767f70205411 (patch) | |
tree | 23a5c8c426de87aee88c8cc9e2c8a7eb437a0588 /indra/newview | |
parent | 4a7c31ee1d63db068eeef3bd2f5fc0cf61247f69 (diff) |
EXT-3063 cleanup of inventory item properties sidepanel
step 1: kill the edit button
step 2: disable info button on main inventory panel if more than one item is
selected.
other steps to be done will be filed as separate jiras
code reviewed by seraph
--HG--
branch : avatar-pipeline
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/skins/default/xui/en/sidepanel_item_info.xml | 9 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/sidepanel_task_info.xml | 11 |
9 files changed, 29 insertions, 51 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/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" |