summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterproperties.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterproperties.cpp')
-rw-r--r--indra/newview/llfloaterproperties.cpp310
1 files changed, 134 insertions, 176 deletions
diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp
index 406d940cf0..091debe95e 100644
--- a/indra/newview/llfloaterproperties.cpp
+++ b/indra/newview/llfloaterproperties.cpp
@@ -37,25 +37,29 @@
#include <functional>
#include "llcachename.h"
#include "lldbstrings.h"
+#include "llfloaterreg.h"
#include "llinventory.h"
#include "llagent.h"
#include "llbutton.h"
#include "llcheckboxctrl.h"
-#include "llfloateravatarinfo.h"
-#include "llfloatergroupinfo.h"
+#include "llavataractions.h"
#include "llinventorymodel.h"
#include "lllineeditor.h"
+//#include "llspinctrl.h"
#include "llradiogroup.h"
#include "llresmgr.h"
#include "roles_constants.h"
#include "llselectmgr.h"
#include "lltextbox.h"
+#include "lltrans.h"
#include "lluiconstants.h"
#include "llviewerinventory.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"
#include "llviewercontrol.h"
+#include "llviewerwindow.h"
+#include "llgroupactions.h"
#include "lluictrlfactory.h"
@@ -73,7 +77,8 @@
class LLPropertiesObserver : public LLInventoryObserver
{
public:
- LLPropertiesObserver()
+ LLPropertiesObserver(LLFloaterProperties* floater)
+ : mFloater(floater)
{
gInventory.addObserver(this);
}
@@ -82,6 +87,8 @@ public:
gInventory.removeObserver(this);
}
virtual void changed(U32 mask);
+private:
+ LLFloaterProperties* mFloater;
};
void LLPropertiesObserver::changed(U32 mask)
@@ -89,7 +96,7 @@ void LLPropertiesObserver::changed(U32 mask)
// if there's a change we're interested in.
if((mask & (LLInventoryObserver::LABEL | LLInventoryObserver::INTERNAL | LLInventoryObserver::REMOVE)) != 0)
{
- LLFloaterProperties::dirtyAll();
+ mFloater->dirty();
}
}
@@ -99,120 +106,63 @@ void LLPropertiesObserver::changed(U32 mask)
/// Class LLFloaterProperties
///----------------------------------------------------------------------------
-// static
-LLFloaterProperties::instance_map LLFloaterProperties::sInstances;
-LLPropertiesObserver* LLFloaterProperties::sPropertiesObserver = NULL;
-S32 LLFloaterProperties::sPropertiesObserverCount = 0;
-
-// static
-LLFloaterProperties* LLFloaterProperties::find(const LLUUID& item_id,
- const LLUUID& object_id)
-{
- // for simplicity's sake, we key the properties window with a
- // single uuid. However, the items are keyed by item and object
- // (obj == null -> agent inventory). So, we xor the two ids, and
- // use that as a lookup key
- instance_map::iterator it = sInstances.find(item_id ^ object_id);
- if(it != sInstances.end())
- {
- return (*it).second;
- }
- return NULL;
-}
-
-// static
-LLFloaterProperties* LLFloaterProperties::show(const LLUUID& item_id,
- const LLUUID& object_id)
+// Default constructor
+LLFloaterProperties::LLFloaterProperties(const LLUUID& item_id)
+ : LLFloater(mItemID),
+ mItemID(item_id),
+ mDirty(TRUE)
{
- LLFloaterProperties* instance = find(item_id, object_id);
- if(instance)
- {
- if (LLFloater::getFloaterHost() && LLFloater::getFloaterHost() != instance->getHost())
- {
- // this properties window is being opened in a new context
- // needs to be rehosted
- LLFloater::getFloaterHost()->addFloater(instance, TRUE);
- }
-
- instance->refresh();
- instance->open(); /* Flawfinder: ignore */
- }
- return instance;
+ mPropertiesObserver = new LLPropertiesObserver(this);
+
+ //LLUICtrlFactory::getInstance()->buildFloater(this,"floater_inventory_item_properties.xml");
}
-void LLFloaterProperties::dirtyAll()
+// Destroys the object
+LLFloaterProperties::~LLFloaterProperties()
{
- // ...this is more clear. Possibly more correct, because the
- // refresh method may delete the object.
- for(instance_map::iterator it = sInstances.begin(); it!=sInstances.end(); )
- {
- (*it++).second->dirty();
- }
+ delete mPropertiesObserver;
+ mPropertiesObserver = NULL;
}
-// Default constructor
-LLFloaterProperties::LLFloaterProperties(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_id, const LLUUID& object_id) :
- LLFloater(name, rect, title),
- mItemID(item_id),
- mObjectID(object_id),
- mDirty(TRUE)
+// virtual
+BOOL LLFloaterProperties::postBuild()
{
- LLUICtrlFactory::getInstance()->buildFloater(this,"floater_inventory_item_properties.xml");
-
- if (!sPropertiesObserver)
- {
- sPropertiesObserver = new LLPropertiesObserver;
- }
- sPropertiesObserverCount++;
-
- // add the object to the static structure
- LLUUID key = mItemID ^ mObjectID;
- sInstances.insert(instance_map::value_type(key, this));
// build the UI
// item name & description
childSetPrevalidate("LabelItemName",&LLLineEditor::prevalidatePrintableNotPipe);
- childSetCommitCallback("LabelItemName",onCommitName,this);
+ getChild<LLUICtrl>("LabelItemName")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitName,this));
childSetPrevalidate("LabelItemDesc",&LLLineEditor::prevalidatePrintableNotPipe);
- childSetCommitCallback("LabelItemDesc", onCommitDescription, this);
+ getChild<LLUICtrl>("LabelItemDesc")->setCommitCallback(boost::bind(&LLFloaterProperties:: onCommitDescription, this));
// Creator information
- childSetAction("BtnCreator",onClickCreator,this);
+ getChild<LLUICtrl>("BtnCreator")->setCommitCallback(boost::bind(&LLFloaterProperties::onClickCreator,this));
// owner information
- childSetAction("BtnOwner",onClickOwner,this);
+ getChild<LLUICtrl>("BtnOwner")->setCommitCallback(boost::bind(&LLFloaterProperties::onClickOwner,this));
// acquired date
// owner permissions
// Permissions debug text
// group permissions
- childSetCommitCallback("CheckShareWithGroup",&onCommitPermissions, this);
+ getChild<LLUICtrl>("CheckShareWithGroup")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this));
// everyone permissions
- childSetCommitCallback("CheckEveryoneCopy",&onCommitPermissions, this);
+ getChild<LLUICtrl>("CheckEveryoneCopy")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this));
// next owner permissions
- childSetCommitCallback("CheckNextOwnerModify",&onCommitPermissions, this);
- childSetCommitCallback("CheckNextOwnerCopy",&onCommitPermissions, this);
- childSetCommitCallback("CheckNextOwnerTransfer",&onCommitPermissions, this);
+ getChild<LLUICtrl>("CheckNextOwnerModify")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this));
+ getChild<LLUICtrl>("CheckNextOwnerCopy")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this));
+ getChild<LLUICtrl>("CheckNextOwnerTransfer")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this));
// Mark for sale or not, and sale info
- childSetCommitCallback("CheckPurchase",&onCommitSaleInfo, this);
- childSetCommitCallback("RadioSaleType",&onCommitSaleType, this);
+ getChild<LLUICtrl>("CheckPurchase")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this));
+ getChild<LLUICtrl>("RadioSaleType")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleType, this));
// "Price" label for edit
- childSetCommitCallback("EditPrice",&onCommitSaleInfo, this);
+ getChild<LLUICtrl>("Edit Cost")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this));
// The UI has been built, now fill in all the values
refresh();
+
+ return TRUE;
}
-// Destroys the object
-LLFloaterProperties::~LLFloaterProperties()
+// virtual
+void LLFloaterProperties::onOpen(const LLSD& key)
{
- // clean up the static data.
- instance_map::iterator it = sInstances.find(mItemID ^ mObjectID);
- if(it != sInstances.end())
- {
- sInstances.erase(it);
- }
- sPropertiesObserverCount--;
- if (!sPropertiesObserverCount)
- {
- delete sPropertiesObserver;
- sPropertiesObserver = NULL;
- }
+ refresh();
}
void LLFloaterProperties::refresh()
@@ -246,7 +196,7 @@ void LLFloaterProperties::refresh()
"CheckNextOwnerTransfer",
"CheckPurchase",
"RadioSaleType",
- "EditPrice"
+ "Edit Cost"
};
for(size_t t=0; t<LL_ARRAY_SIZE(enableNames); ++t)
{
@@ -287,12 +237,15 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
// do not enable the UI for incomplete items.
LLViewerInventoryItem* i = (LLViewerInventoryItem*)item;
BOOL is_complete = i->isComplete();
-
+ const BOOL cannot_restrict_permissions = LLInventoryType::cannotRestrictPermissions(i->getInventoryType());
+ const BOOL is_calling_card = (i->getInventoryType() == LLInventoryType::IT_CALLINGCARD);
const LLPermissions& perm = item->getPermissions();
- BOOL can_agent_manipulate = gAgent.allowOperation(PERM_OWNER, perm,
- GP_OBJECT_MANIPULATE);
- BOOL can_agent_sell = gAgent.allowOperation(PERM_OWNER, perm,
- GP_OBJECT_SET_SALE);
+ const BOOL can_agent_manipulate = gAgent.allowOperation(PERM_OWNER, perm,
+ GP_OBJECT_MANIPULATE);
+ const BOOL can_agent_sell = gAgent.allowOperation(PERM_OWNER, perm,
+ GP_OBJECT_SET_SALE) &&
+ !cannot_restrict_permissions;
+ const BOOL is_link = i->getIsLinkType();
// You need permission to modify the object to modify an inventory
// item in it.
@@ -308,11 +261,11 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
// ITEM NAME & DESC //
//////////////////////
BOOL is_modifiable = gAgent.allowOperation(PERM_MODIFY, perm,
- GP_OBJECT_MANIPULATE)
- && is_obj_modify && is_complete;
+ GP_OBJECT_MANIPULATE)
+ && is_obj_modify && is_complete;
childSetEnabled("LabelItemNameTitle",TRUE);
- childSetEnabled("LabelItemName",is_modifiable);
+ childSetEnabled("LabelItemName",is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards
childSetText("LabelItemName",item->getName());
childSetEnabled("LabelItemDescTitle",TRUE);
childSetEnabled("LabelItemDesc",is_modifiable);
@@ -372,8 +325,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
//////////////////
// ACQUIRE DATE //
//////////////////
-
- // *TODO: Localize / translate this
+
time_t time_utc = item->getCreationDate();
if (0 == time_utc)
{
@@ -381,7 +333,11 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
}
else
{
- childSetText("LabelAcquiredDate", std::string(ctime(&time_utc)) );
+ std::string timeStr = getString("acquiredDate");
+ LLSD substitution;
+ substitution["datetime"] = (S32) time_utc;
+ LLStringUtil::format (timeStr, substitution);
+ childSetText ("LabelAcquiredDate", timeStr);
}
///////////////////////
@@ -472,7 +428,12 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
/////////////
// Check for ability to change values.
- if (is_obj_modify && can_agent_manipulate)
+ if (is_link || cannot_restrict_permissions)
+ {
+ childSetEnabled("CheckShareWithGroup",FALSE);
+ childSetEnabled("CheckEveryoneCopy",FALSE);
+ }
+ else if (is_obj_modify && can_agent_manipulate)
{
childSetEnabled("CheckShareWithGroup",TRUE);
childSetEnabled("CheckEveryoneCopy",(owner_mask & PERM_COPY) && (owner_mask & PERM_TRANSFER));
@@ -533,13 +494,13 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
childSetEnabled("CheckPurchase",is_complete);
childSetEnabled("NextOwnerLabel",TRUE);
- childSetEnabled("CheckNextOwnerModify",base_mask & PERM_MODIFY);
- childSetEnabled("CheckNextOwnerCopy",base_mask & PERM_COPY);
- childSetEnabled("CheckNextOwnerTransfer",next_owner_mask & PERM_COPY);
+ childSetEnabled("CheckNextOwnerModify",(base_mask & PERM_MODIFY) && !cannot_restrict_permissions);
+ childSetEnabled("CheckNextOwnerCopy",(base_mask & PERM_COPY) && !cannot_restrict_permissions);
+ childSetEnabled("CheckNextOwnerTransfer",(next_owner_mask & PERM_COPY) && !cannot_restrict_permissions);
childSetEnabled("RadioSaleType",is_complete && is_for_sale);
childSetEnabled("TextPrice",is_complete && is_for_sale);
- childSetEnabled("EditPrice",is_complete && is_for_sale);
+ childSetEnabled("Edit Cost",is_complete && is_for_sale);
}
else
{
@@ -553,11 +514,13 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
childSetEnabled("RadioSaleType",FALSE);
childSetEnabled("TextPrice",FALSE);
- childSetEnabled("EditPrice",FALSE);
+ childSetEnabled("Edit Cost",FALSE);
}
// Set values.
childSetValue("CheckPurchase", is_for_sale);
+ childSetEnabled("combobox sale copy", is_for_sale);
+ childSetEnabled("Edit Cost", is_for_sale);
childSetValue("CheckNextOwnerModify",LLSD(BOOL(next_owner_mask & PERM_MODIFY)));
childSetValue("CheckNextOwnerCopy",LLSD(BOOL(next_owner_mask & PERM_COPY)));
childSetValue("CheckNextOwnerTransfer",LLSD(BOOL(next_owner_mask & PERM_TRANSFER)));
@@ -568,63 +531,50 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1);
S32 numerical_price;
numerical_price = sale_info.getSalePrice();
- childSetText("EditPrice",llformat("%d",numerical_price));
+ childSetText("Edit Cost",llformat("%d",numerical_price));
}
else
{
radioSaleType->setSelectedIndex(-1);
- childSetText("EditPrice",llformat("%d",0));
+ childSetText("Edit Cost",llformat("%d",0));
}
}
-// static
-void LLFloaterProperties::onClickCreator(void* data)
+void LLFloaterProperties::onClickCreator()
{
- LLFloaterProperties* self = (LLFloaterProperties*)data;
- if(!self) return;
- LLInventoryItem* item = self->findItem();
+ LLInventoryItem* item = findItem();
if(!item) return;
if(!item->getCreatorUUID().isNull())
{
- LLFloaterAvatarInfo::showFromObject(item->getCreatorUUID());
+ LLAvatarActions::showProfile(item->getCreatorUUID());
}
}
// static
-void LLFloaterProperties::onClickOwner(void* data)
+void LLFloaterProperties::onClickOwner()
{
- LLFloaterProperties* self = (LLFloaterProperties*)data;
- if(!self) return;
- LLInventoryItem* item = self->findItem();
+ LLInventoryItem* item = findItem();
if(!item) return;
if(item->getPermissions().isGroupOwned())
{
- LLFloaterGroupInfo::showFromUUID(item->getPermissions().getGroup());
+ LLGroupActions::show(item->getPermissions().getGroup());
}
else
{
- if(!item->getPermissions().getOwner().isNull())
- {
- LLFloaterAvatarInfo::showFromObject(item->getPermissions().getOwner());
- }
+ LLAvatarActions::showProfile(item->getPermissions().getOwner());
}
}
// static
-void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data)
+void LLFloaterProperties::onCommitName()
{
//llinfos << "LLFloaterProperties::onCommitName()" << llendl;
- LLFloaterProperties* self = (LLFloaterProperties*)data;
- if(!self)
- {
- return;
- }
- LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem();
+ LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem();
if(!item)
{
return;
}
- LLLineEditor* labelItemName = self->getChild<LLLineEditor>("LabelItemName");
+ LLLineEditor* labelItemName = getChild<LLLineEditor>("LabelItemName");
if(labelItemName&&
(item->getName() != labelItemName->getText()) &&
@@ -632,15 +582,16 @@ void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data)
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->rename(labelItemName->getText());
- if(self->mObjectID.isNull())
+ if(mObjectID.isNull())
{
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
+ gInventory.updateLinkedObjects(new_item->getUUID());
gInventory.notifyObservers();
}
else
{
- LLViewerObject* object = gObjectList.findObject(self->mObjectID);
+ LLViewerObject* object = gObjectList.findObject(mObjectID);
if(object)
{
object->updateInventory(
@@ -652,16 +603,13 @@ void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data)
}
}
-// static
-void LLFloaterProperties::onCommitDescription(LLUICtrl* ctrl, void* data)
+void LLFloaterProperties::onCommitDescription()
{
//llinfos << "LLFloaterProperties::onCommitDescription()" << llendl;
- LLFloaterProperties* self = (LLFloaterProperties*)data;
- if(!self) return;
- LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem();
+ LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem();
if(!item) return;
- LLLineEditor* labelItemDesc = self->getChild<LLLineEditor>("LabelItemDesc");
+ LLLineEditor* labelItemDesc = getChild<LLLineEditor>("LabelItemDesc");
if(!labelItemDesc)
{
return;
@@ -672,7 +620,7 @@ void LLFloaterProperties::onCommitDescription(LLUICtrl* ctrl, void* data)
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->setDescription(labelItemDesc->getText());
- if(self->mObjectID.isNull())
+ if(mObjectID.isNull())
{
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
@@ -680,7 +628,7 @@ void LLFloaterProperties::onCommitDescription(LLUICtrl* ctrl, void* data)
}
else
{
- LLViewerObject* object = gObjectList.findObject(self->mObjectID);
+ LLViewerObject* object = gObjectList.findObject(mObjectID);
if(object)
{
object->updateInventory(
@@ -693,17 +641,15 @@ void LLFloaterProperties::onCommitDescription(LLUICtrl* ctrl, void* data)
}
// static
-void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data)
+void LLFloaterProperties::onCommitPermissions()
{
//llinfos << "LLFloaterProperties::onCommitPermissions()" << llendl;
- LLFloaterProperties* self = (LLFloaterProperties*)data;
- if(!self) return;
- LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem();
+ LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem();
if(!item) return;
LLPermissions perm(item->getPermissions());
- LLCheckBoxCtrl* CheckShareWithGroup = self->getChild<LLCheckBoxCtrl>("CheckShareWithGroup");
+ LLCheckBoxCtrl* CheckShareWithGroup = getChild<LLCheckBoxCtrl>("CheckShareWithGroup");
if(CheckShareWithGroup)
{
@@ -711,26 +657,26 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data)
CheckShareWithGroup->get(),
PERM_MODIFY | PERM_MOVE | PERM_COPY);
}
- LLCheckBoxCtrl* CheckEveryoneCopy = self->getChild<LLCheckBoxCtrl>("CheckEveryoneCopy");
+ LLCheckBoxCtrl* CheckEveryoneCopy = getChild<LLCheckBoxCtrl>("CheckEveryoneCopy");
if(CheckEveryoneCopy)
{
perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(),
CheckEveryoneCopy->get(), PERM_COPY);
}
- LLCheckBoxCtrl* CheckNextOwnerModify = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerModify");
+ LLCheckBoxCtrl* CheckNextOwnerModify = getChild<LLCheckBoxCtrl>("CheckNextOwnerModify");
if(CheckNextOwnerModify)
{
perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
CheckNextOwnerModify->get(), PERM_MODIFY);
}
- LLCheckBoxCtrl* CheckNextOwnerCopy = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerCopy");
+ LLCheckBoxCtrl* CheckNextOwnerCopy = getChild<LLCheckBoxCtrl>("CheckNextOwnerCopy");
if(CheckNextOwnerCopy)
{
perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
CheckNextOwnerCopy->get(), PERM_COPY);
}
- LLCheckBoxCtrl* CheckNextOwnerTransfer = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerTransfer");
+ LLCheckBoxCtrl* CheckNextOwnerTransfer = getChild<LLCheckBoxCtrl>("CheckNextOwnerTransfer");
if(CheckNextOwnerTransfer)
{
perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
@@ -766,7 +712,7 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data)
flags |= LLInventoryItem::II_FLAGS_OBJECT_PERM_OVERWRITE_GROUP;
}
new_item->setFlags(flags);
- if(self->mObjectID.isNull())
+ if(mObjectID.isNull())
{
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
@@ -774,7 +720,7 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data)
}
else
{
- LLViewerObject* object = gObjectList.findObject(self->mObjectID);
+ LLViewerObject* object = gObjectList.findObject(mObjectID);
if(object)
{
object->updateInventory(
@@ -787,26 +733,22 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data)
else
{
// need to make sure we don't just follow the click
- self->refresh();
+ refresh();
}
}
// static
-void LLFloaterProperties::onCommitSaleInfo(LLUICtrl* ctrl, void* data)
+void LLFloaterProperties::onCommitSaleInfo()
{
//llinfos << "LLFloaterProperties::onCommitSaleInfo()" << llendl;
- LLFloaterProperties* self = (LLFloaterProperties*)data;
- if(!self) return;
- self->updateSaleInfo();
+ updateSaleInfo();
}
// static
-void LLFloaterProperties::onCommitSaleType(LLUICtrl* ctrl, void* data)
+void LLFloaterProperties::onCommitSaleType()
{
//llinfos << "LLFloaterProperties::onCommitSaleType()" << llendl;
- LLFloaterProperties* self = (LLFloaterProperties*)data;
- if(!self) return;
- self->updateSaleInfo();
+ updateSaleInfo();
}
void LLFloaterProperties::updateSaleInfo()
@@ -851,13 +793,11 @@ void LLFloaterProperties::updateSaleInfo()
sale_type = LLSaleInfo::FS_ORIGINAL;
}
- LLLineEditor* EditPrice = getChild<LLLineEditor>("EditPrice");
+
S32 price = -1;
- if(EditPrice)
- {
- price = atoi(EditPrice->getText().c_str());
- }
+ price = getChild<LLUICtrl>("Edit Cost")->getValue().asInteger();;
+
// Invalid data - turn off the sale
if (price < 0)
{
@@ -932,13 +872,15 @@ LLInventoryItem* LLFloaterProperties::findItem() const
return item;
}
-void LLFloaterProperties::closeByID(const LLUUID& item_id, const LLUUID &object_id)
+//static
+void LLFloaterProperties::dirtyAll()
{
- LLFloaterProperties* floaterp = find(item_id, object_id);
-
- if (floaterp)
+ LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("properties");
+ for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin();
+ iter != inst_list.end(); ++iter)
{
- floaterp->close();
+ LLFloaterProperties* floater = dynamic_cast<LLFloaterProperties*>(*iter);
+ floater->dirty();
}
}
@@ -946,8 +888,24 @@ void LLFloaterProperties::closeByID(const LLUUID& item_id, const LLUUID &object_
/// LLMultiProperties
///----------------------------------------------------------------------------
-LLMultiProperties::LLMultiProperties(const LLRect &rect) : LLMultiFloater(std::string("Properties"), rect)
+LLMultiProperties::LLMultiProperties()
+ : LLMultiFloater(LLSD())
{
+ // *TODO: There should be a .xml file for this
+ const LLRect& nextrect = LLFloaterReg::getFloaterRect("properties"); // place where the next properties should show up
+ if (nextrect.getWidth() > 0)
+ {
+ setRect(nextrect);
+ }
+ else
+ {
+ // start with a small rect in the top-left corner ; will get resized
+ LLRect rect;
+ rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeight(), 20, 20);
+ setRect(rect);
+ }
+ setTitle(LLTrans::getString("MultiPropertiesTitle"));
+ buildTabContainer();
}
///----------------------------------------------------------------------------