diff options
author | callum <none@none> | 2010-12-08 14:38:20 -0800 |
---|---|---|
committer | callum <none@none> | 2010-12-08 14:38:20 -0800 |
commit | 61b675e0afb96d1d46b1f36a8d54bb8146ef27d6 (patch) | |
tree | aa9484ac0b7253f106ef7a3227f07638f1c3d305 /indra/newview/llfloaterwebcontent.cpp | |
parent | 52ff7420fdd6c41211174720e4c07b35f61d81c2 (diff) |
SOCIAL-358 FIX Add button to Web Content floater to open current URL in system browser
Diffstat (limited to 'indra/newview/llfloaterwebcontent.cpp')
-rw-r--r-- | indra/newview/llfloaterwebcontent.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index ed66be165e..d9748b2235 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -33,6 +33,7 @@ #include "llprogressbar.h"
#include "lltextbox.h"
#include "llviewercontrol.h"
+#include "llweb.h"
#include "llwindow.h"
#include "llfloaterwebcontent.h"
@@ -43,8 +44,8 @@ LLFloaterWebContent::LLFloaterWebContent( const LLSD& key ) mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this ));
mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this ));
mCommitCallbackRegistrar.add( "WebContent.Reload", boost::bind( &LLFloaterWebContent::onClickReload, this ));
-
mCommitCallbackRegistrar.add( "WebContent.EnterAddress", boost::bind( &LLFloaterWebContent::onEnterAddress, this ));
+ mCommitCallbackRegistrar.add( "WebContent.PopExternal", boost::bind( &LLFloaterWebContent::onPopExternal, this ));
}
BOOL LLFloaterWebContent::postBuild()
@@ -58,8 +59,9 @@ BOOL LLFloaterWebContent::postBuild() // observe browser events
mWebBrowser->addObserver( this );
- // these button are always enabled
+ // these buttons are always enabled
getChildView("reload")->setEnabled( true );
+ getChildView("popexternal")->setEnabled( true );
return TRUE;
}
@@ -323,8 +325,20 @@ void LLFloaterWebContent::onEnterAddress() {
// make sure there is at least something there.
// (perhaps this test should be for minimum length of a URL)
- if ( mAddressCombo->getValue().asString().length() > 0 )
+ std::string url = mAddressCombo->getValue().asString();
+ if ( url.length() > 0 )
+ {
+ mWebBrowser->navigateTo( url, "text/html");
+ };
+}
+
+void LLFloaterWebContent::onPopExternal()
+{
+ // make sure there is at least something there.
+ // (perhaps this test should be for minimum length of a URL)
+ std::string url = mAddressCombo->getValue().asString();
+ if ( url.length() > 0 )
{
- mWebBrowser->navigateTo( mAddressCombo->getValue().asString(), "text/html");
+ LLWeb::loadURLExternal( url );
};
}
|