From ec23ec68ea8835e4155e083ec5570245b0aef1ec Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 10 Oct 2011 19:17:38 -0700 Subject: EXP-1310 FIX Profile button should open Web Profile floater removed unused LLWeb functions for opening non-web media moved logic inside floaters and away from auxiliary functions --- indra/newview/llfloaterwebcontent.cpp | 39 ++++++++++++++--------------------- 1 file changed, 16 insertions(+), 23 deletions(-) (limited to 'indra/newview/llfloaterwebcontent.cpp') diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 2c9a736aff..c76aeb0498 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -88,20 +88,6 @@ BOOL LLFloaterWebContent::postBuild() return TRUE; } -bool LLFloaterWebContent::matchesKey(const LLSD& key) -{ - LLUUID id = key["id"]; - if (id.notNull()) - { - return id == mKey["id"].asUUID(); - } - else - { - return key["target"].asString() == mKey["target"].asString(); - } -} - - void LLFloaterWebContent::initializeURLHistory() { // start with an empty list @@ -123,6 +109,20 @@ void LLFloaterWebContent::initializeURLHistory() } } +bool LLFloaterWebContent::matchesKey(const LLSD& key) +{ + Params p(mKey); + Params other_p(key); + if (!other_p.target().empty() && other_p.target() != "_blank") + { + return other_p.target() == p.target(); + } + else + { + return other_p.id() == p.id(); + } +} + //static LLFloater* LLFloaterWebContent::create( Params p) { @@ -139,14 +139,7 @@ LLFloater* LLFloaterWebContent::create( Params p) } S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit"); - - LLSD sd; - sd["target"] = p.target; - if(LLFloaterReg::findInstance(p.window_class, sd) != NULL) - { - // There's already a web browser for this tag, so we won't be opening a new window. - } - else if(browser_window_limit != 0) + 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. @@ -166,7 +159,7 @@ LLFloater* LLFloaterWebContent::create( Params p) } } - return LLFloaterReg::showInstance(p.window_class, p); + return new LLFloaterWebContent(p); } //static -- cgit v1.2.3 From 172662ce2a456b76d5c748ea9c5f3f2b4c6f3b2b Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 14 Oct 2011 13:49:48 -0700 Subject: EXP-1272 FIX Move "How To" to a separate web floater fixed title of how to window to always say "How To" instead of showing url --- indra/newview/llfloaterwebcontent.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterwebcontent.cpp') diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index c76aeb0498..f410c31f44 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -48,13 +48,15 @@ LLFloaterWebContent::_Params::_Params() show_chrome("show_chrome", true), allow_address_entry("allow_address_entry", true), preferred_media_size("preferred_media_size"), - trusted_content("trusted_content", false) + trusted_content("trusted_content", false), + show_page_title("show_page_title", true) {} LLFloaterWebContent::LLFloaterWebContent( const Params& params ) : LLFloater( params ), LLInstanceTracker(params.id()), - mUUID(params.id()) + mUUID(params.id()), + mShowPageTitle(params.show_page_title) { mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this )); mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this )); @@ -359,10 +361,13 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent { std::string page_title = self->getMediaName(); // simulate browser behavior - title is empty, use the current URL - if ( page_title.length() > 0 ) - setTitle( page_title ); - else - setTitle( mCurrentURL ); + if (mShowPageTitle) + { + if ( page_title.length() > 0 ) + setTitle( page_title ); + else + setTitle( mCurrentURL ); + } } else if(event == MEDIA_EVENT_LINK_HOVERED ) { -- cgit v1.2.3