summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterproperties.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterproperties.cpp')
-rwxr-xr-xindra/newview/llfloaterproperties.cpp49
1 files changed, 18 insertions, 31 deletions
diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp
index a3bf99f054..6bfc780722 100755
--- 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"
@@ -143,7 +144,7 @@ BOOL LLFloaterProperties::postBuild()
getChild<LLUICtrl>("CheckNextOwnerTransfer")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this));
// Mark for sale or not, and sale info
getChild<LLUICtrl>("CheckPurchase")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this));
- getChild<LLUICtrl>("RadioSaleType")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleType, this));
+ getChild<LLUICtrl>("ComboBoxSaleType")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleType, this));
// "Price" label for edit
getChild<LLUICtrl>("Edit Cost")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this));
// The UI has been built, now fill in all the values
@@ -188,7 +189,7 @@ void LLFloaterProperties::refresh()
"CheckNextOwnerCopy",
"CheckNextOwnerTransfer",
"CheckPurchase",
- "RadioSaleType",
+ "ComboBoxSaleType",
"Edit Cost"
};
for(size_t t=0; t<LL_ARRAY_SIZE(enableNames); ++t)
@@ -479,6 +480,9 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
const LLSaleInfo& sale_info = item->getSaleInfo();
BOOL is_for_sale = sale_info.isForSale();
+ LLComboBox* combo_sale_type = getChild<LLComboBox>("ComboBoxSaleType");
+ LLUICtrl* edit_cost = getChild<LLUICtrl>("Edit Cost");
+
// Check for ability to change values.
if (is_obj_modify && can_agent_sell
&& gAgent.allowOperation(PERM_TRANSFER, perm, GP_OBJECT_MANIPULATE))
@@ -491,9 +495,9 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
getChildView("CheckNextOwnerCopy")->setEnabled((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("Edit Cost")->setEnabled(is_complete && is_for_sale);
+ combo_sale_type->setEnabled(is_complete && is_for_sale);
+ edit_cost->setEnabled(is_complete && is_for_sale);
}
else
{
@@ -505,31 +509,28 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
getChildView("CheckNextOwnerCopy")->setEnabled(FALSE);
getChildView("CheckNextOwnerTransfer")->setEnabled(FALSE);
- getChildView("RadioSaleType")->setEnabled(FALSE);
getChildView("TextPrice")->setEnabled(FALSE);
- getChildView("Edit Cost")->setEnabled(FALSE);
+ combo_sale_type->setEnabled(FALSE);
+ edit_cost->setEnabled(FALSE);
}
// Set values.
getChild<LLUICtrl>("CheckPurchase")->setValue(is_for_sale);
- getChildView("combobox sale copy")->setEnabled(is_for_sale);
- getChildView("Edit Cost")->setEnabled(is_for_sale);
getChild<LLUICtrl>("CheckNextOwnerModify")->setValue(LLSD(BOOL(next_owner_mask & PERM_MODIFY)));
getChild<LLUICtrl>("CheckNextOwnerCopy")->setValue(LLSD(BOOL(next_owner_mask & PERM_COPY)));
getChild<LLUICtrl>("CheckNextOwnerTransfer")->setValue(LLSD(BOOL(next_owner_mask & PERM_TRANSFER)));
- LLRadioGroup* radioSaleType = getChild<LLRadioGroup>("RadioSaleType");
if (is_for_sale)
{
- radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1);
S32 numerical_price;
numerical_price = sale_info.getSalePrice();
- getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",numerical_price));
+ edit_cost->setValue(llformat("%d",numerical_price));
+ combo_sale_type->setValue(sale_info.getSaleType());
}
else
{
- radioSaleType->setSelectedIndex(-1);
- getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",0));
+ edit_cost->setValue(llformat("%d",0));
+ combo_sale_type->setValue(LLSaleInfo::FS_COPY);
}
}
@@ -757,25 +758,11 @@ void LLFloaterProperties::updateSaleInfo()
{
// turn on sale info
LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY;
-
- LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("RadioSaleType");
- if(RadioSaleType)
+
+ LLComboBox* combo_sale_type = getChild<LLComboBox>("ComboBoxSaleType");
+ if (combo_sale_type)
{
- switch (RadioSaleType->getSelectedIndex())
- {
- case 0:
- sale_type = LLSaleInfo::FS_ORIGINAL;
- break;
- case 1:
- sale_type = LLSaleInfo::FS_COPY;
- break;
- case 2:
- sale_type = LLSaleInfo::FS_CONTENTS;
- break;
- default:
- sale_type = LLSaleInfo::FS_COPY;
- break;
- }
+ sale_type = static_cast<LLSaleInfo::EForSale>(combo_sale_type->getValue().asInteger());
}
if (sale_type == LLSaleInfo::FS_COPY