From 0c9d8d917a4281e2dea7fa2044e86735caca2aa9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 10 Nov 2011 16:02:57 -0800 Subject: fixed build fixed handle downcast not initiating handle --- indra/newview/llfloaterwebcontent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterwebcontent.cpp') diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index f410c31f44..d6db7aa6ad 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -167,7 +167,7 @@ LLFloater* LLFloaterWebContent::create( Params p) //static void LLFloaterWebContent::closeRequest(const std::string &uuid) { - LLFloaterWebContent* floaterp = getInstance(uuid); + LLFloaterWebContent* floaterp = instance_tracker_t::getInstance(uuid); if (floaterp) { floaterp->closeFloater(false); @@ -177,7 +177,7 @@ void LLFloaterWebContent::closeRequest(const std::string &uuid) //static void LLFloaterWebContent::geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height) { - LLFloaterWebContent* floaterp = getInstance(uuid); + LLFloaterWebContent* floaterp = instance_tracker_t::getInstance(uuid); if (floaterp) { floaterp->geometryChanged(x, y, width, height); -- cgit v1.2.3 From 943789b53ac3f2750cb71dca6facc0de7fa39539 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 23 Nov 2011 12:11:53 -0800 Subject: SH-2710 FIX -- Removed calls to getChild happening every frame and during idle calls. Reviewed by davep. --- indra/newview/llfloaterwebcontent.cpp | 40 +++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 13 deletions(-) (limited to 'indra/newview/llfloaterwebcontent.cpp') diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index f410c31f44..02f1899e6e 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -55,6 +55,15 @@ LLFloaterWebContent::_Params::_Params() LLFloaterWebContent::LLFloaterWebContent( const Params& params ) : LLFloater( params ), LLInstanceTracker(params.id()), + mWebBrowser(NULL), + mAddressCombo(NULL), + mSecureLockIcon(NULL), + mStatusBarText(NULL), + mStatusBarProgress(NULL), + mBtnBack(NULL), + mBtnForward(NULL), + mBtnReload(NULL), + mBtnStop(NULL), mUUID(params.id()), mShowPageTitle(params.show_page_title) { @@ -74,11 +83,16 @@ BOOL LLFloaterWebContent::postBuild() mStatusBarText = getChild< LLTextBox >( "statusbartext" ); mStatusBarProgress = getChild("statusbarprogress" ); + mBtnBack = getChildView( "back" ); + mBtnForward = getChildView( "forward" ); + mBtnReload = getChildView( "reload" ); + mBtnStop = getChildView( "stop" ); + // observe browser events mWebBrowser->addObserver( this ); // these buttons are always enabled - getChildView("reload")->setEnabled( true ); + mBtnReload->setEnabled( true ); getChildView("popexternal")->setEnabled( true ); // cache image for secure browsing @@ -276,8 +290,8 @@ void LLFloaterWebContent::onClose(bool app_quitting) void LLFloaterWebContent::draw() { // this is asynchronous so we need to keep checking - getChildView( "back" )->setEnabled( mWebBrowser->canNavigateBack() ); - getChildView( "forward" )->setEnabled( mWebBrowser->canNavigateForward() ); + mBtnBack->setEnabled( mWebBrowser->canNavigateBack() ); + mBtnForward->setEnabled( mWebBrowser->canNavigateForward() ); LLFloater::draw(); } @@ -297,12 +311,12 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent else if(event == MEDIA_EVENT_NAVIGATE_BEGIN) { // flags are sent with this event - getChildView("back")->setEnabled( self->getHistoryBackAvailable() ); - getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() ); + mBtnBack->setEnabled( self->getHistoryBackAvailable() ); + mBtnForward->setEnabled( self->getHistoryForwardAvailable() ); // toggle visibility of these buttons based on browser state - getChildView("reload")->setVisible( false ); - getChildView("stop")->setVisible( true ); + mBtnReload->setVisible( false ); + mBtnStop->setVisible( true ); // turn "on" progress bar now we're about to start loading mStatusBarProgress->setVisible( true ); @@ -310,12 +324,12 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE) { // flags are sent with this event - getChildView("back")->setEnabled( self->getHistoryBackAvailable() ); - getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() ); + mBtnBack->setEnabled( self->getHistoryBackAvailable() ); + mBtnForward->setEnabled( self->getHistoryForwardAvailable() ); // toggle visibility of these buttons based on browser state - getChildView("reload")->setVisible( true ); - getChildView("stop")->setVisible( false ); + mBtnReload->setVisible( true ); + mBtnStop->setVisible( false ); // turn "off" progress bar now we're loaded mStatusBarProgress->setVisible( false ); @@ -421,8 +435,8 @@ void LLFloaterWebContent::onClickStop() // still should happen when we catch the navigate complete event // but sometimes (don't know why) that event isn't sent from Qt // and we ghetto a point where the stop button stays active. - getChildView("reload")->setVisible( true ); - getChildView("stop")->setVisible( false ); + mBtnReload->setVisible( true ); + mBtnStop->setVisible( false ); } void LLFloaterWebContent::onEnterAddress() -- cgit v1.2.3 From 2be10e866056d19f01568fe6f569af7ab9ad7686 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 6 Dec 2011 20:06:44 +0200 Subject: EXP-1577 FOLLOWUP Implemented new requirements on size of profile floaters. Implemented new requirements from XD: "Profile window should keep last size, regardless of whether it was own profile or another users'. If multiple windows open, last one touched is the size we store." --- indra/newview/llfloaterwebcontent.cpp | 71 +++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 33 deletions(-) (limited to 'indra/newview/llfloaterwebcontent.cpp') diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index d6db7aa6ad..f3beacea4f 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -128,39 +128,7 @@ bool LLFloaterWebContent::matchesKey(const LLSD& key) //static LLFloater* LLFloaterWebContent::create( Params p) { - lldebugs << "url = " << p.url() << ", target = " << p.target() << ", uuid = " << p.id() << llendl; - - if (!p.id.isProvided()) - { - p.id = LLUUID::generateNewID().asString(); - } - - if(p.target().empty() || p.target() == "_blank") - { - p.target = p.id(); - } - - S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit"); - if(browser_window_limit != 0) - { - // showInstance will open a new window. Figure out how many web browsers are already open, - // and close the least recently opened one if this will put us over the limit. - - LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class); - lldebugs << "total instance count is " << instances.size() << llendl; - - for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++) - { - lldebugs << " " << (*iter)->getKey()["target"] << llendl; - } - - if(instances.size() >= (size_t)browser_window_limit) - { - // Destroy the least recently opened instance - (*instances.begin())->closeFloater(); - } - } - + preCreate(p); return new LLFloaterWebContent(p); } @@ -211,6 +179,43 @@ void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height) setShape(new_rect); } +// static +void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p) +{ + lldebugs << "url = " << p.url() << ", target = " << p.target() << ", uuid = " << p.id() << llendl; + + if (!p.id.isProvided()) + { + p.id = LLUUID::generateNewID().asString(); + } + + if(p.target().empty() || p.target() == "_blank") + { + p.target = p.id(); + } + + S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit"); + if(browser_window_limit != 0) + { + // showInstance will open a new window. Figure out how many web browsers are already open, + // and close the least recently opened one if this will put us over the limit. + + LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class); + lldebugs << "total instance count is " << instances.size() << llendl; + + for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++) + { + lldebugs << " " << (*iter)->getKey()["target"] << llendl; + } + + if(instances.size() >= (size_t)browser_window_limit) + { + // Destroy the least recently opened instance + (*instances.begin())->closeFloater(); + } + } +} + void LLFloaterWebContent::open_media(const Params& p) { // Specifying a mime type of text/html here causes the plugin system to skip the MIME type probe and just open a browser plugin. -- cgit v1.2.3 From 93aa231a18b9b5c9b3ab2ff162fa4928ac60d62b Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 6 Mar 2012 16:49:58 -0800 Subject: EXP-1767 WIP Received Items panel state does not persist between sessions ensure that layout stack has updated its layout before manually resizing one of its elements (which was causing the manual resize to be stomped on by the newly triggered layout update) made layout stack animation occur even when layout stack not visible (inventory will appear in proper open/closed state) LLView::setShape() now only calls handleReshape() when dimensions change removed extraneous calls to LLLayoutStack::updateClass() so that it should be called only once per frame now, allowing it to limit animation updates to layout stacks to one per frame. fixed rendering glitches arising from reshaping LLFolderView while in the middle of its draw() method --- indra/newview/llfloaterwebcontent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterwebcontent.cpp') diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 3b5c3663fb..3fe2518de6 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -169,7 +169,7 @@ void LLFloaterWebContent::geometryChanged(const std::string &uuid, S32 x, S32 y, void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height) { // Make sure the layout of the browser control is updated, so this calculation is correct. - LLLayoutStack::updateClass(); + getChild("stack1")->updateLayout(); // TODO: need to adjust size and constrain position to make sure floaters aren't moved outside the window view, etc. LLCoordWindow window_size; @@ -258,7 +258,7 @@ void LLFloaterWebContent::open_media(const Params& p) if (!p.preferred_media_size().isEmpty()) { - LLLayoutStack::updateClass(); + getChild("stack1")->updateLayout(); LLRect browser_rect = mWebBrowser->calcScreenRect(); LLCoordWindow window_size; getWindow()->getSize(&window_size); -- cgit v1.2.3