From 4bcd2d95629d8a77c066117eea658587905db8f6 Mon Sep 17 00:00:00 2001 From: Tonya Souther Date: Tue, 26 Apr 2011 10:35:14 -0500 Subject: [PATCH] Complete conversion of object profile sale type to combo box. Fixes FIRE-856 and FIRE-765. --- indra/newview/llfloaterproperties.cpp | 25 ++++++------ .../en/floater_inventory_item_properties.xml | 39 ++++--------------- 2 files changed, 19 insertions(+), 45 deletions(-) diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index 4a8eb86d89..0c9d8f2b86 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -36,6 +36,7 @@ #include "llagent.h" #include "llbutton.h" #include "llcheckboxctrl.h" +#include "llcombobox.h" #include "llavataractions.h" #include "llinventorydefines.h" #include "llinventoryobserver.h" @@ -146,7 +147,7 @@ BOOL LLFloaterProperties::postBuild() getChild("CheckNextOwnerTransfer")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this)); // Mark for sale or not, and sale info getChild("CheckPurchase")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this)); - getChild("RadioSaleType")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleType, this)); + getChild("ComboSaleType")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleType, this)); // "Price" label for edit getChild("Edit Cost")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this)); // The UI has been built, now fill in all the values @@ -191,7 +192,7 @@ void LLFloaterProperties::refresh() "CheckNextOwnerCopy", "CheckNextOwnerTransfer", "CheckPurchase", - "RadioSaleType", + "ComboSaleType", "Edit Cost" }; for(size_t t=0; tsetEnabled((base_mask & PERM_COPY) && !cannot_restrict_permissions); getChildView("CheckNextOwnerTransfer")->setEnabled((next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); - getChildView("RadioSaleType")->setEnabled(is_complete && is_for_sale); -// getChildView("TextPrice")->setEnabled(is_complete && is_for_sale); + getChildView("ComboSaleType")->setEnabled(is_complete && is_for_sale); getChildView("Edit Cost")->setEnabled(is_complete && is_for_sale); } else @@ -525,30 +525,27 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) getChildView("CheckNextOwnerCopy")->setEnabled(FALSE); getChildView("CheckNextOwnerTransfer")->setEnabled(FALSE); - getChildView("RadioSaleType")->setEnabled(FALSE); -// getChildView("TextPrice")->setEnabled(FALSE); + getChildView("ComboSaleType")->setEnabled(FALSE); getChildView("Edit Cost")->setEnabled(FALSE); } // Set values. getChild("CheckPurchase")->setValue(is_for_sale); - getChildView("combobox sale copy")->setEnabled(is_for_sale); - getChildView("Edit Cost")->setEnabled(is_for_sale); getChild("CheckNextOwnerModify")->setValue(LLSD(BOOL(next_owner_mask & PERM_MODIFY))); getChild("CheckNextOwnerCopy")->setValue(LLSD(BOOL(next_owner_mask & PERM_COPY))); getChild("CheckNextOwnerTransfer")->setValue(LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); - LLRadioGroup* radioSaleType = getChild("RadioSaleType"); + LLComboBox* comboSaleType = getChild("ComboSaleType"); if (is_for_sale) { - radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1); + comboSaleType->setCurrentByIndex((S32)sale_info.getSaleType() - 1); S32 numerical_price; numerical_price = sale_info.getSalePrice(); getChild("Edit Cost")->setValue(llformat("%d",numerical_price)); } else { - radioSaleType->setSelectedIndex(-1); + comboSaleType->setCurrentByIndex(-1); getChild("Edit Cost")->setValue(llformat("%d",0)); } } @@ -793,10 +790,10 @@ void LLFloaterProperties::updateSaleInfo() // turn on sale info LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY; - LLRadioGroup* RadioSaleType = getChild("RadioSaleType"); - if(RadioSaleType) + LLComboBox* ComboSaleType = getChild("ComboSaleType"); + if(ComboSaleType) { - switch (RadioSaleType->getSelectedIndex()) + switch (ComboSaleType->getCurrentIndex()) { case 0: sale_type = LLSaleInfo::FS_ORIGINAL; diff --git a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml index 42a8b389ef..1e895b3c1d 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml @@ -305,16 +305,20 @@ left_pad="5" layout="topleft" follows="left|top" - name="combobox sale copy" + name="ComboSaleType" width="110"> + + label="Contents" + name="Contents" + value="Contents" /> - - - - -