diff options
author | Kelly Washington <kelly@lindenlab.com> | 2012-12-03 13:18:46 -0800 |
---|---|---|
committer | Kelly Washington <kelly@lindenlab.com> | 2012-12-03 13:18:46 -0800 |
commit | 28d8aade82627c2034b5f9e6b0972b250bd34cad (patch) | |
tree | 76f95fc67cd7c20199e1dd682883d635f15e23e8 /indra/newview/llfloaterbuycontents.cpp | |
parent | 06a5cc52852d2e5b8920206a3f56bfe86ba0bae3 (diff) |
MAINT-1748 Users have an ability to sell non existing objects from content of other object
* Keep the buy-contents floater subscribed to inventory changes on the object.
reviewed with Simon
Diffstat (limited to 'indra/newview/llfloaterbuycontents.cpp')
-rw-r--r-- | indra/newview/llfloaterbuycontents.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index bca4b5e447..fffd724b22 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -80,6 +80,7 @@ BOOL LLFloaterBuyContents::postBuild() LLFloaterBuyContents::~LLFloaterBuyContents() { + removeVOInventoryListener(); } @@ -147,23 +148,26 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, return; } - if (!inv) + LLScrollListCtrl* item_list = getChild<LLScrollListCtrl>("item_list"); + if (!item_list) { - llwarns << "No inventory in LLFloaterBuyContents::inventoryChanged" - << llendl; removeVOInventoryListener(); return; } - LLCtrlListInterface *item_list = childGetListInterface("item_list"); - if (!item_list) + item_list->deleteAllItems(); + + if (!inv) { - removeVOInventoryListener(); + llwarns << "No inventory in LLFloaterBuyContents::inventoryChanged" + << llendl; + return; } // default to turning off the buy button. - getChildView("buy_btn")->setEnabled(FALSE); + LLView* buy_btn = getChildView("buy_btn"); + buy_btn->setEnabled(FALSE); LLUUID owner_id; BOOL is_group_owned; @@ -204,7 +208,7 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, // There will be at least one item shown in the display, so go // ahead and enable the buy button. - getChildView("buy_btn")->setEnabled(TRUE); + buy_btn->setEnabled(TRUE); // Create the line in the list LLSD row; @@ -255,8 +259,6 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, getChildView("wear_check")->setEnabled(TRUE); getChild<LLUICtrl>("wear_check")->setValue(LLSD(false) ); } - - removeVOInventoryListener(); } |