diff options
author | William Todd Stinson <stinson@lindenlab.com> | 2012-10-09 18:45:33 -0700 |
---|---|---|
committer | William Todd Stinson <stinson@lindenlab.com> | 2012-10-09 18:45:33 -0700 |
commit | aed6a3c7336ff143829a420cce5cddcaf7d35cbc (patch) | |
tree | e0a124ba98339df289c6dd659a7b4517f860e848 /indra | |
parent | f84f821df7a0edf472420995ae3e5140bbf05996 (diff) |
Adding a behavior to the multi-tables for the get response to sync up the selected material across all tables.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterdebugmaterials.cpp | 53 | ||||
-rw-r--r-- | indra/newview/llfloaterdebugmaterials.h | 1 |
2 files changed, 51 insertions, 3 deletions
diff --git a/indra/newview/llfloaterdebugmaterials.cpp b/indra/newview/llfloaterdebugmaterials.cpp index da1068d879..cab2ab6372 100644 --- a/indra/newview/llfloaterdebugmaterials.cpp +++ b/indra/newview/llfloaterdebugmaterials.cpp @@ -123,12 +123,15 @@ BOOL LLFloaterDebugMaterials::postBuild() mGetNormalMapScrollList = findChild<LLScrollListCtrl>("get_normal_map_scroll_list"); llassert(mGetNormalMapScrollList != NULL); + mGetNormalMapScrollList->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onGetScrollListSelectionChange, this, _1)); mGetSpecularMapScrollList = findChild<LLScrollListCtrl>("get_specular_map_scroll_list"); llassert(mGetSpecularMapScrollList != NULL); + mGetSpecularMapScrollList->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onGetScrollListSelectionChange, this, _1)); mGetOtherDataScrollList = findChild<LLScrollListCtrl>("get_other_data_scroll_list"); llassert(mGetOtherDataScrollList != NULL); + mGetOtherDataScrollList->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onGetScrollListSelectionChange, this, _1)); mNormalMap = findChild<LLTextureCtrl>("normal_map"); llassert(mNormalMap != NULL); @@ -425,6 +428,50 @@ void LLFloaterDebugMaterials::onInWorldSelectionChange() updateControls(); } +void LLFloaterDebugMaterials::onGetScrollListSelectionChange(LLUICtrl* pUICtrl) +{ + LLScrollListCtrl* scrollListCtrl = dynamic_cast<LLScrollListCtrl*>(pUICtrl); + llassert(scrollListCtrl != NULL); + + if (scrollListCtrl != mGetNormalMapScrollList) + { + mGetNormalMapScrollList->deselectAllItems(TRUE); + } + if (scrollListCtrl != mGetSpecularMapScrollList) + { + mGetSpecularMapScrollList->deselectAllItems(TRUE); + } + if (scrollListCtrl != mGetOtherDataScrollList) + { + mGetOtherDataScrollList->deselectAllItems(TRUE); + } + + std::vector<LLScrollListItem*> selectedItems = scrollListCtrl->getAllSelected(); + if (!selectedItems.empty()) + { + llassert(selectedItems.size() == 1); + LLScrollListItem* selectedItem = selectedItems.front(); + + llassert(selectedItem != NULL); + const LLSD& selectedIdValue = selectedItem->getValue(); + + llinfos << "attempting to select by value '" << selectedIdValue << "'" << llendl; + + if (scrollListCtrl != mGetNormalMapScrollList) + { + mGetNormalMapScrollList->selectByValue(selectedIdValue); + } + if (scrollListCtrl != mGetSpecularMapScrollList) + { + mGetSpecularMapScrollList->selectByValue(selectedIdValue); + } + if (scrollListCtrl != mGetOtherDataScrollList) + { + mGetOtherDataScrollList->selectByValue(selectedIdValue); + } + } +} + void LLFloaterDebugMaterials::onDeferredCheckRegionMaterialStatus(LLUUID regionId) { checkRegionMaterialStatus(regionId); @@ -997,9 +1044,9 @@ void LLFloaterDebugMaterials::parseGetResponse(const LLSD& pContent) cellParams.value = llformat("%d", diffuseAlphaMode); otherDataRowParams.columns.add(cellParams); - normalMapRowParams.value = materialID; - specularMapRowParams.value = materialID; - otherDataRowParams.value = materialID; + normalMapRowParams.value = materialIDString; + specularMapRowParams.value = materialIDString; + otherDataRowParams.value = materialIDString; mGetNormalMapScrollList->addRow(normalMapRowParams); mGetSpecularMapScrollList->addRow(specularMapRowParams); diff --git a/indra/newview/llfloaterdebugmaterials.h b/indra/newview/llfloaterdebugmaterials.h index 732b6a9349..65f3cbd6ca 100644 --- a/indra/newview/llfloaterdebugmaterials.h +++ b/indra/newview/llfloaterdebugmaterials.h @@ -81,6 +81,7 @@ private: void onBadPostClicked(); void onRegionCross(); void onInWorldSelectionChange(); + void onGetScrollListSelectionChange(LLUICtrl* pUICtrl); void onDeferredCheckRegionMaterialStatus(LLUUID regionId); void onDeferredRequestGetMaterials(LLUUID regionId); void onDeferredRequestPutMaterials(LLUUID regionId, bool pIsDoSet); |