summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llfloaterproperties.cpp49
-rwxr-xr-xindra/newview/llsidepaneliteminfo.cpp42
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_inventory_item_properties.xml46
-rwxr-xr-xindra/newview/skins/default/xui/en/sidepanel_item_info.xml22
4 files changed, 60 insertions, 99 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
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
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 adef066aef..6667238232 100755
--- a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml
+++ b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml
@@ -304,16 +304,20 @@
left_pad="5"
layout="topleft"
follows="left|top"
- name="combobox sale copy"
+ name="ComboBoxSaleType"
width="110">
- <combo_box.item
- label="Copy"
+ <combo_box.item
name="Copy"
- value="Copy" />
- <combo_box.item
- label="Original"
+ label="Copy"
+ value="2" />
+ <combo_box.item
+ name="Contents"
+ label="Contents"
+ value="3" />
+ <combo_box.item
name="Original"
- value="Original" />
+ label="Original"
+ value="1" />
</combo_box>
<spinner
follows="left|top"
@@ -427,34 +431,6 @@
Mark Item:
</text-->
-
- <!--radio_group
- draw_border="false"
- follows="left|top|right"
- height="16"
- layout="topleft"
- left_delta="78"
- name="RadioSaleType"
- top_delta="0"
- width="252">
- <radio_item
- height="16"
- label="Original"
- layout="topleft"
- left="0"
- name="radio"
- top="0"
- width="70" />
- <radio_item
- height="16"
- label="Copy"
- layout="topleft"
- left_delta="60"
- name="radio2"
- top_delta="0"
- width="70" />
- </radio_group-->
-
<!--text
type="string"
length="1"
diff --git a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml
index c5dfb703e5..9be01c5d4f 100755
--- a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml
@@ -395,16 +395,20 @@
left_pad="0"
layout="topleft"
follows="left|top"
- name="combobox sale copy"
+ name="ComboBoxSaleType"
width="170">
- <combo_box.item
- label="Copy"
- name="Copy"
- value="Copy" />
- <combo_box.item
- label="Original"
- name="Original"
- value="Original" />
+ <combo_box.item
+ name="Copy"
+ label="Copy"
+ value="2" />
+ <combo_box.item
+ name="Contents"
+ label="Contents"
+ value="3" />
+ <combo_box.item
+ name="Original"
+ label="Original"
+ value="1" />
</combo_box>
<spinner
follows="left|top"