From 9e2f60ea8cca0dc44fc3e116e55939421e697dc3 Mon Sep 17 00:00:00 2001 From: Kadah Date: Sun, 26 Jun 2011 12:10:07 -0700 Subject: [PATCH] Build Improvements: Don't clear pending sale info changes on idle refresh --- indra/newview/llpanelpermissions.cpp | 18 ++++++++++++++++++ indra/newview/llpanelpermissions.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 12665e103f..50b4eed044 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -307,6 +307,7 @@ void LLPanelPermissions::refresh() { // ...nothing selected disableAll(); + mLastSelectedObejct = NULL; return; } @@ -493,6 +494,15 @@ void LLPanelPermissions::refresh() getChildView("Object Description")->setEnabled(FALSE); } + //KC: Check if the selection has chnaged and that there are pending sale changes + BOOL selection_changed = FALSE; + if (mLastSelectedObejct != objectp) + { + mLastSelectedObejct = objectp; + selection_changed = TRUE; + } + BOOL update_sale_info = selection_changed || !getChild("btnMarkForSale")->getEnabled(); + S32 total_sale_price = 0; S32 individual_sale_price = 0; BOOL is_for_sale_mixed = FALSE; @@ -519,6 +529,9 @@ void LLPanelPermissions::refresh() // You own these objects. else if (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) { + //KC: dont update and clear sale info if changes are pending + if (update_sale_info) + { // If there are multiple items for sale then set text to PRICE PER UNIT. if (num_for_sale > 1) { @@ -552,6 +565,7 @@ void LLPanelPermissions::refresh() BOOL enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : FALSE; getChildView("Cost")->setEnabled(enable_edit); getChildView("Edit Cost")->setEnabled(enable_edit); + } } // Someone, not you, owns these objects. else if (!public_owned) @@ -688,6 +702,9 @@ void LLPanelPermissions::refresh() getChildView("checkbox allow everyone copy")->setEnabled(FALSE); } + //KC: dont update and clear sale info if changes are pending + if (update_sale_info) + { if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER)) { getChildView("checkbox for sale")->setEnabled(can_transfer || (!can_transfer && num_for_sale)); @@ -711,6 +728,7 @@ void LLPanelPermissions::refresh() getChildView("checkbox next owner can copy")->setEnabled(FALSE); getChildView("checkbox next owner can transfer")->setEnabled(FALSE); } + } if (valid_group_perms) { diff --git a/indra/newview/llpanelpermissions.h b/indra/newview/llpanelpermissions.h index 261c83d707..c5ba8f680c 100644 --- a/indra/newview/llpanelpermissions.h +++ b/indra/newview/llpanelpermissions.h @@ -37,6 +37,7 @@ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLNameBox; +class LLViewerObject; class LLPanelPermissions : public LLPanel { @@ -86,6 +87,8 @@ private: LLUUID mCreatorID; LLUUID mOwnerID; LLUUID mLastOwnerID; + + LLPointer mLastSelectedObejct; };