summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepaneliteminfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llsidepaneliteminfo.cpp')
-rwxr-xr-xindra/newview/llsidepaneliteminfo.cpp42
1 files changed, 18 insertions, 24 deletions
diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp
index d75d4ae951..a7cfc173af 100755
--- a/indra/newview/llsidepaneliteminfo.cpp
+++ b/indra/newview/llsidepaneliteminfo.cpp
@@ -32,6 +32,7 @@
#include "llagent.h"
#include "llavataractions.h"
#include "llbutton.h"
+#include "llcombobox.h"
#include "llfloaterreg.h"
#include "llgroupactions.h"
#include "llinventorydefines.h"
@@ -176,6 +177,8 @@ BOOL LLSidepanelItemInfo::postBuild()
getChild<LLUICtrl>("CheckNextOwnerTransfer")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitPermissions, this));
// Mark for sale or not, and sale info
getChild<LLUICtrl>("CheckPurchase")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitSaleInfo, this));
+ // Change sale type, and sale info
+ getChild<LLUICtrl>("ComboBoxSaleType")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitSaleInfo, this));
// "Price" label for edit
getChild<LLUICtrl>("Edit Cost")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitSaleInfo, this));
refresh();
@@ -447,7 +450,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
"CheckNextOwnerTransfer",
"CheckPurchase",
"SaleLabel",
- "combobox sale copy",
+ "ComboBoxSaleType",
"Edit Cost",
"TextPrice"
};
@@ -629,6 +632,9 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* 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))
@@ -642,7 +648,8 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
getChildView("CheckNextOwnerTransfer")->setEnabled((next_owner_mask & PERM_COPY) && !cannot_restrict_permissions);
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
{
@@ -655,13 +662,12 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
getChildView("CheckNextOwnerTransfer")->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)));
@@ -670,11 +676,13 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
{
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
{
- getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",0));
+ edit_cost->setValue(llformat("%d",0));
+ combo_sale_type->setValue(LLSaleInfo::FS_COPY);
}
}
@@ -953,24 +961,10 @@ void LLSidepanelItemInfo::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