diff options
author | Bryan O'Sullivan <bos@lindenlab.com> | 2009-08-31 13:47:47 -0700 |
---|---|---|
committer | Bryan O'Sullivan <bos@lindenlab.com> | 2009-08-31 13:47:47 -0700 |
commit | 30ff6cabd61f2f083df5df1e6e70cc94742af477 (patch) | |
tree | 631935f1cf59d19a91cdad65e9a75fe825afda7d /indra/newview/llfloaterparcel.cpp | |
parent | ff11d74820c89822cd067b51727d9df1dc87d0d0 (diff) | |
parent | 3ac3a4b206c08ed06b889bdaa24074b6aa0e020a (diff) |
Merge with trunk
Diffstat (limited to 'indra/newview/llfloaterparcel.cpp')
-rw-r--r-- | indra/newview/llfloaterparcel.cpp | 60 |
1 files changed, 19 insertions, 41 deletions
diff --git a/indra/newview/llfloaterparcel.cpp b/indra/newview/llfloaterparcel.cpp index 4213150553..44270683a0 100644 --- a/indra/newview/llfloaterparcel.cpp +++ b/indra/newview/llfloaterparcel.cpp @@ -35,6 +35,8 @@ #include "llfloaterparcel.h" +#include "llfloaterreg.h" + // viewer project includes #include "llcommandhandler.h" #include "llpanelplace.h" @@ -47,15 +49,13 @@ // Globals //----------------------------------------------------------------------------- -LLMap< const LLUUID, LLFloaterParcelInfo* > gPlaceInfoInstances; - class LLParcelHandler : public LLCommandHandler { public: // requires trusted browser to trigger LLParcelHandler() : LLCommandHandler("parcel", true) { } bool handle(const LLSD& params, const LLSD& query_map, - LLWebBrowserCtrl* web) + LLMediaCtrl* web) { if (params.size() < 2) { @@ -68,8 +68,11 @@ public: } if (params[1].asString() == "about") { - LLFloaterParcelInfo::show(parcel_id); - return true; + if (parcel_id.notNull()) + { + LLFloaterReg::showInstance("parcel_info", LLSD(parcel_id)); + return true; + } } return false; } @@ -82,7 +85,7 @@ LLParcelHandler gParcelHandler; //---------------------------------------------------------------------------- -void* LLFloaterParcelInfo::createPanelPlace(void* data) +void* LLFloaterParcelInfo::createPanelPlace(void* data) { LLFloaterParcelInfo* self = (LLFloaterParcelInfo*)data; self->mPanelParcelp = new LLPanelPlace(); // allow edit self @@ -93,54 +96,29 @@ void* LLFloaterParcelInfo::createPanelPlace(void* data) //---------------------------------------------------------------------------- -LLFloaterParcelInfo::LLFloaterParcelInfo(const std::string& name, const LLUUID &parcel_id) -: LLFloater(name), - mParcelID( parcel_id ) +LLFloaterParcelInfo::LLFloaterParcelInfo(const LLSD& parcel_id) +: LLFloater(parcel_id), + mParcelID( parcel_id.asUUID() ), + mPanelParcelp(NULL) { mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterParcelInfo::createPanelPlace, this); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml", &getFactoryMap()); - gPlaceInfoInstances.addData(parcel_id, this); +// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml"); } // virtual LLFloaterParcelInfo::~LLFloaterParcelInfo() { - // child views automatically deleted - gPlaceInfoInstances.removeData(mParcelID); - -} -void LLFloaterParcelInfo::displayParcelInfo(const LLUUID& parcel_id) -{ - mPanelParcelp->setParcelID(parcel_id); } -// static -LLFloaterParcelInfo* LLFloaterParcelInfo::show(const LLUUID &parcel_id) +BOOL LLFloaterParcelInfo::postBuild() { - if (parcel_id.isNull()) + if (mPanelParcelp) { - return NULL; + mPanelParcelp->setParcelID(mParcelID); } - - LLFloaterParcelInfo *floater; - if (gPlaceInfoInstances.checkData(parcel_id)) - { - // ...bring that window to front - floater = gPlaceInfoInstances.getData(parcel_id); - floater->open(); /*Flawfinder: ignore*/ - floater->setFrontmost(true); - } - else - { - floater = new LLFloaterParcelInfo("parcelinfo", parcel_id ); - floater->center(); - floater->open(); /*Flawfinder: ignore*/ - floater->displayParcelInfo(parcel_id); - floater->setFrontmost(true); - } - - return floater; + center(); + return LLFloater::postBuild(); } |