summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepaneliteminfo.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2015-04-14 13:46:01 -0700
committerMerov Linden <merov@lindenlab.com>2015-04-14 13:46:01 -0700
commitd631f2fd4daed5e3b10fc6dc290aa16f3d0591f0 (patch)
treeafc5139a2d530bdca9233308d2b6d6d4532bc6c4 /indra/newview/llsidepaneliteminfo.cpp
parent5411f349e5ed8835d5c99dbfb19a0934a6e5e28f (diff)
parenta49e11efd9e249cc6d3cf5bcffaafe1e831f2fa9 (diff)
Pull merge from lindenlab/viewer-tools-update (includes viewer-release)
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 1d20b7bed5..126f1fb9de 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"
@@ -173,6 +174,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();
@@ -435,7 +438,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
"CheckNextOwnerTransfer",
"CheckPurchase",
"SaleLabel",
- "combobox sale copy",
+ "ComboBoxSaleType",
"Edit Cost",
"TextPrice"
};
@@ -617,6 +620,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))
@@ -630,7 +636,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
{
@@ -643,13 +650,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)));
@@ -658,11 +664,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);
}
}
@@ -918,24 +926,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