diff options
| author | Richard Nelson <richard@lindenlab.com> | 2009-08-04 01:12:59 +0000 |
|---|---|---|
| committer | Richard Nelson <richard@lindenlab.com> | 2009-08-04 01:12:59 +0000 |
| commit | eb853f55c07ae4a3c3f2aa05fbabcf2e4b4dc115 (patch) | |
| tree | 7707fccb8d0946b6257d5ed7c5dfd3941c53eec0 /indra/newview/llfloaterpostcard.cpp | |
| parent | db5cda26676f376f18816013c0c5e3fbad5b20d0 (diff) | |
svn merge -r 128442:129343 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-18 into svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3
Diffstat (limited to 'indra/newview/llfloaterpostcard.cpp')
| -rw-r--r-- | indra/newview/llfloaterpostcard.cpp | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index 696531c208..aa68a1b229 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -45,6 +45,7 @@ #include "lllineeditor.h" #include "llviewertexteditor.h" #include "llbutton.h" +#include "llfloaterreg.h" #include "llviewercontrol.h" #include "llviewernetwork.h" #include "lluictrlfactory.h" @@ -70,40 +71,30 @@ /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- -//static -LLFloaterPostcard::instance_list_t LLFloaterPostcard::sInstances; - ///---------------------------------------------------------------------------- /// Class LLFloaterPostcard ///---------------------------------------------------------------------------- -LLFloaterPostcard::LLFloaterPostcard(LLImageJPEG* jpeg, LLViewerTexture *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global) -: LLFloater(), - mJPEGImage(jpeg), - mViewerImage(img), - mImageScale(img_scale), - mPosTakenGlobal(pos_taken_global), +LLFloaterPostcard::LLFloaterPostcard(const LLSD& key) +: LLFloater(key), + mJPEGImage(NULL), + mViewerImage(NULL), mHasFirstMsgFocus(false) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_postcard.xml"); - - sInstances.insert(this); - - // pick up the user's up-to-date email address - gAgent.sendAgentUserInfoRequest(); - - openFloater(); + //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_postcard.xml"); } // Destroys the object LLFloaterPostcard::~LLFloaterPostcard() { - sInstances.erase(this); mJPEGImage = NULL; // deletes image } BOOL LLFloaterPostcard::postBuild() { + // pick up the user's up-to-date email address + gAgent.sendAgentUserInfoRequest(); + childSetAction("cancel_btn", onClickCancel, this); childSetAction("send_btn", onClickSend, this); @@ -127,15 +118,18 @@ BOOL LLFloaterPostcard::postBuild() return TRUE; } - - // static LLFloaterPostcard* LLFloaterPostcard::showFromSnapshot(LLImageJPEG *jpeg, LLViewerTexture *img, const LLVector2 &image_scale, const LLVector3d& pos_taken_global) { // Take the images from the caller // It's now our job to clean them up - LLFloaterPostcard *instance = new LLFloaterPostcard(jpeg, img, image_scale, pos_taken_global); - + LLFloaterPostcard* instance = LLFloaterReg::showTypedInstance<LLFloaterPostcard>("postcard", LLSD(img->getID())); + + instance->mJPEGImage = jpeg; + instance->mViewerImage = img; + instance->mImageScale = image_scale; + instance->mPosTakenGlobal = pos_taken_global; + return instance; } @@ -302,10 +296,11 @@ void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data, // static void LLFloaterPostcard::updateUserInfo(const std::string& email) { - for (instance_list_t::iterator iter = sInstances.begin(); - iter != sInstances.end(); ++iter) + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); + iter != inst_list.end(); ++iter) { - LLFloaterPostcard *instance = *iter; + LLFloater* instance = *iter; const std::string& text = instance->childGetValue("from_form").asString(); if (text.empty()) { |
