summaryrefslogtreecommitdiff
path: root/indra/newview/llfloateropenobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloateropenobject.cpp')
-rw-r--r--indra/newview/llfloateropenobject.cpp34
1 files changed, 15 insertions, 19 deletions
diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp
index f4984df6d9..4d782a1814 100644
--- a/indra/newview/llfloateropenobject.cpp
+++ b/indra/newview/llfloateropenobject.cpp
@@ -45,6 +45,7 @@
#include "llagent.h" // for agent id
#include "llalertdialog.h"
+#include "llinventorybridge.h"
#include "llinventoryview.h"
#include "llinventorymodel.h"
#include "llpanelinventory.h"
@@ -58,24 +59,26 @@
LLFloaterOpenObject* LLFloaterOpenObject::sInstance = NULL;
LLFloaterOpenObject::LLFloaterOpenObject()
-: LLFloater(std::string("object_contents")),
+: LLFloater(),
mPanelInventory(NULL),
mDirty(TRUE)
{
- LLCallbackMap::map_t factory_map;
- factory_map["object_contents"] = LLCallbackMap(createPanelInventory, this);
- LLUICtrlFactory::getInstance()->buildFloater(this,"floater_openobject.xml",&factory_map);
-
- childSetAction("copy_to_inventory_button", onClickMoveToInventory, this);
- childSetAction("copy_and_wear_button", onClickMoveAndWear, this);
- childSetTextArg("object_name", "[DESC]", std::string("Object") ); // *Note: probably do not want to translate this
+ LLUICtrlFactory::getInstance()->buildFloater(this,"floater_openobject.xml");
}
LLFloaterOpenObject::~LLFloaterOpenObject()
{
sInstance = NULL;
}
-
+// virtual
+BOOL LLFloaterOpenObject::postBuild()
+{
+ childSetAction("copy_to_inventory_button", onClickMoveToInventory, this);
+ childSetAction("copy_and_wear_button", onClickMoveAndWear, this);
+ childSetTextArg("object_name", "[DESC]", std::string("Object") ); // *Note: probably do not want to translate this
+ mPanelInventory = getChild<LLPanelInventory>("object_contents");
+ return TRUE;
+}
void LLFloaterOpenObject::refresh()
{
mPanelInventory->refresh();
@@ -135,7 +138,7 @@ void LLFloaterOpenObject::show()
sInstance->center();
}
- sInstance->open(); /* Flawfinder: ignore */
+ sInstance->openFloater();
sInstance->setFocus(TRUE);
sInstance->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
@@ -215,7 +218,7 @@ void LLFloaterOpenObject::onClickMoveToInventory(void* data)
{
LLFloaterOpenObject* self = (LLFloaterOpenObject*)data;
self->moveToInventory(false);
- self->close();
+ self->closeFloater();
}
// static
@@ -223,13 +226,6 @@ void LLFloaterOpenObject::onClickMoveAndWear(void* data)
{
LLFloaterOpenObject* self = (LLFloaterOpenObject*)data;
self->moveToInventory(true);
- self->close();
+ self->closeFloater();
}
-//static
-void* LLFloaterOpenObject::createPanelInventory(void* data)
-{
- LLFloaterOpenObject* floater = (LLFloaterOpenObject*)data;
- floater->mPanelInventory = new LLPanelInventory(std::string("Object Contents"), LLRect());
- return floater->mPanelInventory;
-}