From 454be02eab38bb7d4139d3f5c87843d7686f14f2 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Thu, 19 Feb 2015 14:28:50 -0500 Subject: [PATCH] Feature Request: Allow bulk edit for objects' descriptions and names Translators need to translate the multiple_objects_selected string in floater_tools.xml --- indra/newview/llpanelpermissions.cpp | 33 +++++++++++-------- indra/newview/llselectmgr.cpp | 8 ++--- .../skins/default/xui/en-us/floater_tools.xml | 1 + 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index f9ad87f55..b7e82865d 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -202,14 +202,18 @@ void LLPanelPermissions::disableAll() getChildView("button set group")->setEnabled(FALSE); getChildView("button open group")->setEnabled(FALSE); - getChild("Object Name")->setValue(LLStringUtil::null); - getChildView("Object Name")->setEnabled(FALSE); + LLLineEditor* ed = getChild("Object Name"); + ed->setValue(LLStringUtil::null); + ed->setEnabled(FALSE); + ed->setLabel(LLStringUtil::null); getChildView("Name:")->setEnabled(FALSE); //getChild("Group Name")->setValue(LLStringUtil::null); //getChildView("Group Name")->setEnabled(FALSE); getChildView("Description:")->setEnabled(FALSE); - getChild("Object Description")->setValue(LLStringUtil::null); - getChildView("Object Description")->setEnabled(FALSE); + ed = getChild("Object Description"); + ed->setEnabled(FALSE); + ed->setValue(LLStringUtil::null); + ed->setLabel(LLStringUtil::null); getChildView("Permissions:")->setEnabled(FALSE); @@ -510,7 +514,7 @@ void LLPanelPermissions::refresh() { if(keyboard_focus_view != LineEditorObjectName) { - getChild("Object Name")->setValue(nodep->mName); + LineEditorObjectName->setValue(nodep->mName); } if(LineEditorObjectDesc) @@ -523,25 +527,26 @@ void LLPanelPermissions::refresh() } else { - getChild("Object Name")->setValue(LLStringUtil::null); + LineEditorObjectName->setText(LLStringUtil::null); LineEditorObjectDesc->setText(LLStringUtil::null); } // figure out the contents of the name, description, & category - BOOL edit_name_desc = FALSE; - if(is_one_object && objectp->permModify() && !objectp->isPermanentEnforced()) + // Singu Note: It was requested that the user be able to bulk change description { - edit_name_desc = TRUE; + const std::string& str(object_count > 1 ? getString("multiple_objects_selected") : LLStringUtil::null); + LineEditorObjectName->setLabel(str); + LineEditorObjectDesc->setLabel(str); } - if(edit_name_desc) + if (/*is_one_object &&*/ objectp->permModify() && !objectp->isPermanentEnforced()) { - getChildView("Object Name")->setEnabled(TRUE); - getChildView("Object Description")->setEnabled(TRUE); + LineEditorObjectName->setEnabled(TRUE); + LineEditorObjectDesc->setEnabled(TRUE); } else { - getChildView("Object Name")->setEnabled(FALSE); - getChildView("Object Description")->setEnabled(FALSE); + LineEditorObjectName->setEnabled(FALSE); + LineEditorObjectDesc->setEnabled(FALSE); } S32 total_sale_price = 0; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index fa4ba2ff7..16471ba9f 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -4290,7 +4290,7 @@ void LLSelectMgr::selectionSetObjectName(const std::string& name) std::string name_copy(name); // we only work correctly if 1 object is selected. - if(mSelectedObjects->getRootObjectCount() == 1) + if(mSelectedObjects->getRootObjectCount() /*== 1*/) // Singu Note: It was requested that the user be able to bulk rename { sendListToRegions("ObjectName", packAgentAndSessionID, @@ -4298,7 +4298,7 @@ void LLSelectMgr::selectionSetObjectName(const std::string& name) (void*)(&name_copy), SEND_ONLY_ROOTS); } - else if(mSelectedObjects->getObjectCount() == 1) + else if(mSelectedObjects->getObjectCount() /*== 1*/) { sendListToRegions("ObjectName", packAgentAndSessionID, @@ -4313,7 +4313,7 @@ void LLSelectMgr::selectionSetObjectDescription(const std::string& desc) std::string desc_copy(desc); // we only work correctly if 1 object is selected. - if(mSelectedObjects->getRootObjectCount() == 1) + if (mSelectedObjects->getRootObjectCount() /*== 1*/) // Singu Note: It was requested that the user be able to bulk change description { sendListToRegions("ObjectDescription", packAgentAndSessionID, @@ -4321,7 +4321,7 @@ void LLSelectMgr::selectionSetObjectDescription(const std::string& desc) (void*)(&desc_copy), SEND_ONLY_ROOTS); } - else if(mSelectedObjects->getObjectCount() == 1) + else if (mSelectedObjects->getObjectCount() /*== 1*/) { sendListToRegions("ObjectDescription", packAgentAndSessionID, diff --git a/indra/newview/skins/default/xui/en-us/floater_tools.xml b/indra/newview/skins/default/xui/en-us/floater_tools.xml index 4afe0d4a9..a4141e4c2 100644 --- a/indra/newview/skins/default/xui/en-us/floater_tools.xml +++ b/indra/newview/skins/default/xui/en-us/floater_tools.xml @@ -443,6 +443,7 @@ follows="left|top|right" font="SansSerifSmall" height="16" left="88" max_length="127" mouse_opaque="true" name="Object Description" select_all_on_focus_received="true" width="172" /> +