diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-08-24 18:44:39 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-08-24 18:44:39 +0100 |
commit | 98cc2365034a93c69704daa69efb389799cc9627 (patch) | |
tree | 4c3ec75b78a26a736f18a2153af025040ae05a4b /indra/newview/llsidepaneliteminfo.cpp | |
parent | 6ba23344c95157793af9e4154933ae8df61630e8 (diff) |
Backed out changeset a62bf7c0af21
Backing out this merge that I pushed (prematurely) to the wrong place.
Diffstat (limited to 'indra/newview/llsidepaneliteminfo.cpp')
-rw-r--r-- | indra/newview/llsidepaneliteminfo.cpp | 188 |
1 files changed, 94 insertions, 94 deletions
diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 731079fb5d..d98398c484 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -104,9 +104,9 @@ BOOL LLSidepanelItemInfo::postBuild() { LLSidepanelInventorySubpanel::postBuild(); - getChild<LLLineEditor>("LabelItemName")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("LabelItemName",&LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLUICtrl>("LabelItemName")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitName,this)); - getChild<LLLineEditor>("LabelItemDesc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + childSetPrevalidate("LabelItemDesc",&LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLUICtrl>("LabelItemDesc")->setCommitCallback(boost::bind(&LLSidepanelItemInfo:: onCommitDescription, this)); // Creator information getChild<LLUICtrl>("BtnCreator")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onClickCreator,this)); @@ -187,7 +187,7 @@ void LLSidepanelItemInfo::refresh() for(size_t t=0; t<LL_ARRAY_SIZE(no_item_names); ++t) { - getChildView(no_item_names[t])->setEnabled(false); + childSetEnabled(no_item_names[t],false); } const std::string hide_names[]={ @@ -199,7 +199,7 @@ void LLSidepanelItemInfo::refresh() }; for(size_t t=0; t<LL_ARRAY_SIZE(hide_names); ++t) { - getChildView(hide_names[t])->setVisible(false); + childSetVisible(hide_names[t],false); } } @@ -211,7 +211,7 @@ void LLSidepanelItemInfo::refresh() }; for(size_t t=0; t<LL_ARRAY_SIZE(no_edit_mode_names); ++t) { - getChildView(no_edit_mode_names[t])->setEnabled(false); + childSetEnabled(no_edit_mode_names[t],false); } } @@ -259,13 +259,13 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) GP_OBJECT_MANIPULATE) && is_obj_modify && is_complete && not_in_trash; - getChildView("LabelItemNameTitle")->setEnabled(TRUE); - getChildView("LabelItemName")->setEnabled(is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards - getChild<LLUICtrl>("LabelItemName")->setValue(item->getName()); - getChildView("LabelItemDescTitle")->setEnabled(TRUE); - getChildView("LabelItemDesc")->setEnabled(is_modifiable); - getChildView("IconLocked")->setVisible(!is_modifiable); - getChild<LLUICtrl>("LabelItemDesc")->setValue(item->getDescription()); + childSetEnabled("LabelItemNameTitle",TRUE); + childSetEnabled("LabelItemName",is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards + childSetText("LabelItemName",item->getName()); + childSetEnabled("LabelItemDescTitle",TRUE); + childSetEnabled("LabelItemDesc",is_modifiable); + childSetVisible("IconLocked",!is_modifiable); + childSetText("LabelItemDesc",item->getDescription()); ////////////////// // CREATOR NAME // @@ -277,17 +277,17 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) { std::string name; gCacheName->getFullName(item->getCreatorUUID(), name); - getChildView("BtnCreator")->setEnabled(TRUE); - getChildView("LabelCreatorTitle")->setEnabled(TRUE); - getChildView("LabelCreatorName")->setEnabled(TRUE); - getChild<LLUICtrl>("LabelCreatorName")->setValue(name); + childSetEnabled("BtnCreator",TRUE); + childSetEnabled("LabelCreatorTitle",TRUE); + childSetEnabled("LabelCreatorName",TRUE); + childSetText("LabelCreatorName",name); } else { - getChildView("BtnCreator")->setEnabled(FALSE); - getChildView("LabelCreatorTitle")->setEnabled(FALSE); - getChildView("LabelCreatorName")->setEnabled(FALSE); - getChild<LLUICtrl>("LabelCreatorName")->setValue(getString("unknown")); + childSetEnabled("BtnCreator",FALSE); + childSetEnabled("LabelCreatorTitle",FALSE); + childSetEnabled("LabelCreatorName",FALSE); + childSetText("LabelCreatorName",getString("unknown")); } //////////////// @@ -304,17 +304,17 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) { gCacheName->getFullName(perm.getOwner(), name); } - getChildView("BtnOwner")->setEnabled(TRUE); - getChildView("LabelOwnerTitle")->setEnabled(TRUE); - getChildView("LabelOwnerName")->setEnabled(TRUE); - getChild<LLUICtrl>("LabelOwnerName")->setValue(name); + childSetEnabled("BtnOwner",TRUE); + childSetEnabled("LabelOwnerTitle",TRUE); + childSetEnabled("LabelOwnerName",TRUE); + childSetText("LabelOwnerName",name); } else { - getChildView("BtnOwner")->setEnabled(FALSE); - getChildView("LabelOwnerTitle")->setEnabled(FALSE); - getChildView("LabelOwnerName")->setEnabled(FALSE); - getChild<LLUICtrl>("LabelOwnerName")->setValue(getString("public")); + childSetEnabled("BtnOwner",FALSE); + childSetEnabled("LabelOwnerTitle",FALSE); + childSetEnabled("LabelOwnerName",FALSE); + childSetText("LabelOwnerName",getString("public")); } //////////// @@ -323,11 +323,11 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) if (object) { - getChild<LLUICtrl>("origin")->setValue(getString("origin_inworld")); + childSetText("origin",getString("origin_inworld")); } else { - getChild<LLUICtrl>("origin")->setValue(getString("origin_inventory")); + childSetText("origin",getString("origin_inventory")); } ////////////////// @@ -337,7 +337,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) time_t time_utc = item->getCreationDate(); if (0 == time_utc) { - getChild<LLUICtrl>("LabelAcquiredDate")->setValue(getString("unknown")); + childSetText("LabelAcquiredDate",getString("unknown")); } else { @@ -345,7 +345,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) LLSD substitution; substitution["datetime"] = (S32) time_utc; LLStringUtil::format (timeStr, substitution); - getChild<LLUICtrl>("LabelAcquiredDate")->setValue(timeStr); + childSetText ("LabelAcquiredDate", timeStr); } ////////////////////////////////////// @@ -388,12 +388,12 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) { for(size_t t=0; t<LL_ARRAY_SIZE(perm_and_sale_items); ++t) { - getChildView(perm_and_sale_items[t])->setVisible(false); + childSetVisible(perm_and_sale_items[t],false); } for(size_t t=0; t<LL_ARRAY_SIZE(debug_items); ++t) { - getChildView(debug_items[t])->setVisible(false); + childSetVisible(debug_items[t],false); } return; } @@ -401,7 +401,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) { for(size_t t=0; t<LL_ARRAY_SIZE(perm_and_sale_items); ++t) { - getChildView(perm_and_sale_items[t])->setVisible(true); + childSetVisible(perm_and_sale_items[t],true); } } @@ -410,11 +410,11 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) /////////////////////// if(can_agent_manipulate) { - getChild<LLUICtrl>("OwnerLabel")->setValue(getString("you_can")); + childSetText("OwnerLabel",getString("you_can")); } else { - getChild<LLUICtrl>("OwnerLabel")->setValue(getString("owner_can")); + childSetText("OwnerLabel",getString("owner_can")); } U32 base_mask = perm.getMaskBase(); @@ -423,13 +423,13 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) U32 everyone_mask = perm.getMaskEveryone(); U32 next_owner_mask = perm.getMaskNextOwner(); - getChildView("OwnerLabel")->setEnabled(TRUE); - getChildView("CheckOwnerModify")->setEnabled(FALSE); - getChild<LLUICtrl>("CheckOwnerModify")->setValue(LLSD((BOOL)(owner_mask & PERM_MODIFY))); - getChildView("CheckOwnerCopy")->setEnabled(FALSE); - getChild<LLUICtrl>("CheckOwnerCopy")->setValue(LLSD((BOOL)(owner_mask & PERM_COPY))); - getChildView("CheckOwnerTransfer")->setEnabled(FALSE); - getChild<LLUICtrl>("CheckOwnerTransfer")->setValue(LLSD((BOOL)(owner_mask & PERM_TRANSFER))); + childSetEnabled("OwnerLabel",TRUE); + childSetEnabled("CheckOwnerModify",FALSE); + childSetValue("CheckOwnerModify",LLSD((BOOL)(owner_mask & PERM_MODIFY))); + childSetEnabled("CheckOwnerCopy",FALSE); + childSetValue("CheckOwnerCopy",LLSD((BOOL)(owner_mask & PERM_COPY))); + childSetEnabled("CheckOwnerTransfer",FALSE); + childSetValue("CheckOwnerTransfer",LLSD((BOOL)(owner_mask & PERM_TRANSFER))); /////////////////////// // DEBUG PERMISSIONS // @@ -453,39 +453,39 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) perm_string = "B: "; perm_string += mask_to_string(base_mask); - getChild<LLUICtrl>("BaseMaskDebug")->setValue(perm_string); - getChildView("BaseMaskDebug")->setVisible(TRUE); + childSetText("BaseMaskDebug",perm_string); + childSetVisible("BaseMaskDebug",TRUE); perm_string = "O: "; perm_string += mask_to_string(owner_mask); - getChild<LLUICtrl>("OwnerMaskDebug")->setValue(perm_string); - getChildView("OwnerMaskDebug")->setVisible(TRUE); + childSetText("OwnerMaskDebug",perm_string); + childSetVisible("OwnerMaskDebug",TRUE); perm_string = "G"; perm_string += overwrite_group ? "*: " : ": "; perm_string += mask_to_string(group_mask); - getChild<LLUICtrl>("GroupMaskDebug")->setValue(perm_string); - getChildView("GroupMaskDebug")->setVisible(TRUE); + childSetText("GroupMaskDebug",perm_string); + childSetVisible("GroupMaskDebug",TRUE); perm_string = "E"; perm_string += overwrite_everyone ? "*: " : ": "; perm_string += mask_to_string(everyone_mask); - getChild<LLUICtrl>("EveryoneMaskDebug")->setValue(perm_string); - getChildView("EveryoneMaskDebug")->setVisible(TRUE); + childSetText("EveryoneMaskDebug",perm_string); + childSetVisible("EveryoneMaskDebug",TRUE); perm_string = "N"; perm_string += slam_perm ? "*: " : ": "; perm_string += mask_to_string(next_owner_mask); - getChild<LLUICtrl>("NextMaskDebug")->setValue(perm_string); - getChildView("NextMaskDebug")->setVisible(TRUE); + childSetText("NextMaskDebug",perm_string); + childSetVisible("NextMaskDebug",TRUE); } else { - getChildView("BaseMaskDebug")->setVisible(FALSE); - getChildView("OwnerMaskDebug")->setVisible(FALSE); - getChildView("GroupMaskDebug")->setVisible(FALSE); - getChildView("EveryoneMaskDebug")->setVisible(FALSE); - getChildView("NextMaskDebug")->setVisible(FALSE); + childSetVisible("BaseMaskDebug",FALSE); + childSetVisible("OwnerMaskDebug",FALSE); + childSetVisible("GroupMaskDebug",FALSE); + childSetVisible("EveryoneMaskDebug",FALSE); + childSetVisible("NextMaskDebug",FALSE); } ///////////// @@ -495,18 +495,18 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) // Check for ability to change values. if (is_link || cannot_restrict_permissions) { - getChildView("CheckShareWithGroup")->setEnabled(FALSE); - getChildView("CheckEveryoneCopy")->setEnabled(FALSE); + childSetEnabled("CheckShareWithGroup",FALSE); + childSetEnabled("CheckEveryoneCopy",FALSE); } else if (is_obj_modify && can_agent_manipulate) { - getChildView("CheckShareWithGroup")->setEnabled(TRUE); - getChildView("CheckEveryoneCopy")->setEnabled((owner_mask & PERM_COPY) && (owner_mask & PERM_TRANSFER)); + childSetEnabled("CheckShareWithGroup",TRUE); + childSetEnabled("CheckEveryoneCopy",(owner_mask & PERM_COPY) && (owner_mask & PERM_TRANSFER)); } else { - getChildView("CheckShareWithGroup")->setEnabled(FALSE); - getChildView("CheckEveryoneCopy")->setEnabled(FALSE); + childSetEnabled("CheckShareWithGroup",FALSE); + childSetEnabled("CheckEveryoneCopy",FALSE); } // Set values. @@ -516,7 +516,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) if (is_group_copy && is_group_modify && is_group_move) { - getChild<LLUICtrl>("CheckShareWithGroup")->setValue(LLSD((BOOL)TRUE)); + childSetValue("CheckShareWithGroup",LLSD((BOOL)TRUE)); LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup"); if(ctl) @@ -526,7 +526,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) } else if (!is_group_copy && !is_group_modify && !is_group_move) { - getChild<LLUICtrl>("CheckShareWithGroup")->setValue(LLSD((BOOL)FALSE)); + childSetValue("CheckShareWithGroup",LLSD((BOOL)FALSE)); LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup"); if(ctl) { @@ -543,7 +543,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) } } - getChild<LLUICtrl>("CheckEveryoneCopy")->setValue(LLSD((BOOL)(everyone_mask & PERM_COPY))); + childSetValue("CheckEveryoneCopy",LLSD((BOOL)(everyone_mask & PERM_COPY))); /////////////// // SALE INFO // @@ -555,48 +555,48 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) if (is_obj_modify && can_agent_sell && gAgent.allowOperation(PERM_TRANSFER, perm, GP_OBJECT_MANIPULATE)) { - getChildView("SaleLabel")->setEnabled(is_complete); - getChildView("CheckPurchase")->setEnabled(is_complete); + childSetEnabled("SaleLabel",is_complete); + childSetEnabled("CheckPurchase",is_complete); - getChildView("NextOwnerLabel")->setEnabled(TRUE); - getChildView("CheckNextOwnerModify")->setEnabled((base_mask & PERM_MODIFY) && !cannot_restrict_permissions); - getChildView("CheckNextOwnerCopy")->setEnabled((base_mask & PERM_COPY) && !cannot_restrict_permissions); - getChildView("CheckNextOwnerTransfer")->setEnabled((next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); + childSetEnabled("NextOwnerLabel",TRUE); + childSetEnabled("CheckNextOwnerModify",(base_mask & PERM_MODIFY) && !cannot_restrict_permissions); + childSetEnabled("CheckNextOwnerCopy",(base_mask & PERM_COPY) && !cannot_restrict_permissions); + childSetEnabled("CheckNextOwnerTransfer",(next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); - getChildView("TextPrice")->setEnabled(is_complete && is_for_sale); - getChildView("Edit Cost")->setEnabled(is_complete && is_for_sale); + childSetEnabled("TextPrice",is_complete && is_for_sale); + childSetEnabled("Edit Cost",is_complete && is_for_sale); } else { - getChildView("SaleLabel")->setEnabled(FALSE); - getChildView("CheckPurchase")->setEnabled(FALSE); + childSetEnabled("SaleLabel",FALSE); + childSetEnabled("CheckPurchase",FALSE); - getChildView("NextOwnerLabel")->setEnabled(FALSE); - getChildView("CheckNextOwnerModify")->setEnabled(FALSE); - getChildView("CheckNextOwnerCopy")->setEnabled(FALSE); - getChildView("CheckNextOwnerTransfer")->setEnabled(FALSE); + childSetEnabled("NextOwnerLabel",FALSE); + childSetEnabled("CheckNextOwnerModify",FALSE); + childSetEnabled("CheckNextOwnerCopy",FALSE); + childSetEnabled("CheckNextOwnerTransfer",FALSE); - getChildView("TextPrice")->setEnabled(FALSE); - getChildView("Edit Cost")->setEnabled(FALSE); + childSetEnabled("TextPrice",FALSE); + childSetEnabled("Edit Cost",FALSE); } // Set values. - getChild<LLUICtrl>("CheckPurchase")->setValue(is_for_sale); - getChildView("combobox sale copy")->setEnabled(is_for_sale); - getChildView("Edit Cost")->setEnabled(is_for_sale); - getChild<LLUICtrl>("CheckNextOwnerModify")->setValue(LLSD(BOOL(next_owner_mask & PERM_MODIFY))); - getChild<LLUICtrl>("CheckNextOwnerCopy")->setValue(LLSD(BOOL(next_owner_mask & PERM_COPY))); - getChild<LLUICtrl>("CheckNextOwnerTransfer")->setValue(LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); + childSetValue("CheckPurchase", is_for_sale); + childSetEnabled("combobox sale copy", is_for_sale); + childSetEnabled("Edit Cost", is_for_sale); + childSetValue("CheckNextOwnerModify",LLSD(BOOL(next_owner_mask & PERM_MODIFY))); + childSetValue("CheckNextOwnerCopy",LLSD(BOOL(next_owner_mask & PERM_COPY))); + childSetValue("CheckNextOwnerTransfer",LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); if (is_for_sale) { S32 numerical_price; numerical_price = sale_info.getSalePrice(); - getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",numerical_price)); + childSetText("Edit Cost",llformat("%d",numerical_price)); } else { - getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",0)); + childSetText("Edit Cost",llformat("%d",0)); } } @@ -817,10 +817,10 @@ void LLSidepanelItemInfo::updateSaleInfo() LLSaleInfo sale_info(item->getSaleInfo()); if(!gAgent.allowOperation(PERM_TRANSFER, item->getPermissions(), GP_OBJECT_SET_SALE)) { - getChild<LLUICtrl>("CheckPurchase")->setValue(LLSD((BOOL)FALSE)); + childSetValue("CheckPurchase",LLSD((BOOL)FALSE)); } - if((BOOL)getChild<LLUICtrl>("CheckPurchase")->getValue()) + if((BOOL)childGetValue("CheckPurchase")) { // turn on sale info LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY; |