diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2024-04-25 20:33:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-25 20:33:10 +0300 |
commit | 0cceb13b5a5283078c31c88d864d700b49eeff7f (patch) | |
tree | 31775ec6b2414e4d5952aa6e2865c7527b78726c /indra | |
parent | 0d4f52b7783706d988ec2c022be24ef9880f318a (diff) |
viewer#1321 allow to set price before clicking the "For Sale" box
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelpermissions.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llpanelpermissions.h | 1 |
2 files changed, 15 insertions, 2 deletions
diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 67f913a067..f11136da6d 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -176,7 +176,7 @@ BOOL LLPanelPermissions::postBuild() childSetCommitCallback("sale type",LLPanelPermissions::onCommitSaleType,this); - childSetCommitCallback("Edit Cost", LLPanelPermissions::onCommitSaleInfo, this); + childSetCommitCallback("Edit Cost", LLPanelPermissions::onCommitSalePrice, this); childSetCommitCallback("checkbox next owner can modify",LLPanelPermissions::onCommitNextOwnerModify,this); childSetCommitCallback("checkbox next owner can copy",LLPanelPermissions::onCommitNextOwnerCopy,this); @@ -781,7 +781,9 @@ void LLPanelPermissions::refresh() if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER)) { - getChildView("checkbox for sale")->setEnabled(can_transfer || (!can_transfer && num_for_sale)); + bool change_sale_allowed = can_transfer || (!can_transfer && num_for_sale); + getChildView("checkbox for sale")->setEnabled(change_sale_allowed); + getChildView("Edit Cost")->setEnabled(change_sale_allowed && !is_for_sale_mixed); // Set the checkbox to tentative if the prices of each object selected // are not the same. getChild<LLUICtrl>("checkbox for sale")->setTentative( is_for_sale_mixed); @@ -1223,6 +1225,16 @@ void LLPanelPermissions::onCommitSaleType(LLUICtrl*, void* data) self->setAllSaleInfo(); } +void LLPanelPermissions::onCommitSalePrice(LLUICtrl *, void *data) +{ + LLPanelPermissions *self = (LLPanelPermissions *) data; + LLCheckBoxCtrl *checkPurchase = self->getChild<LLCheckBoxCtrl>("checkbox for sale"); + if (checkPurchase && checkPurchase->get()) + { + self->setAllSaleInfo(); + } +} + void LLPanelPermissions::setAllSaleInfo() { LL_INFOS() << "LLPanelPermissions::setAllSaleInfo()" << LL_ENDL; diff --git a/indra/newview/llpanelpermissions.h b/indra/newview/llpanelpermissions.h index e657f8f8b7..4ae916d41a 100644 --- a/indra/newview/llpanelpermissions.h +++ b/indra/newview/llpanelpermissions.h @@ -77,6 +77,7 @@ protected: static void onCommitSaleInfo(LLUICtrl* ctrl, void* data); static void onCommitSaleType(LLUICtrl* ctrl, void* data); + static void onCommitSalePrice(LLUICtrl *ctrl, void *data); void setAllSaleInfo(); static void onCommitClickAction(LLUICtrl* ctrl, void*); |