aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llwebbrowserctrl.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:11 -0500
committerJacek Antonelli2008-08-15 23:45:11 -0500
commit215f423cbe18fe9ca14a26caef918d303bad28ff (patch)
tree0743442b286216cc8e19aa487c26f4e9345ffd64 /linden/indra/newview/llwebbrowserctrl.cpp
parentSecond Life viewer sources 1.18.3.5-RC (diff)
downloadmeta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.zip
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.gz
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.bz2
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.xz
Second Life viewer sources 1.18.4.0-RC
Diffstat (limited to 'linden/indra/newview/llwebbrowserctrl.cpp')
-rw-r--r--linden/indra/newview/llwebbrowserctrl.cpp56
1 files changed, 9 insertions, 47 deletions
diff --git a/linden/indra/newview/llwebbrowserctrl.cpp b/linden/indra/newview/llwebbrowserctrl.cpp
index 26e5076..5de0d43 100644
--- a/linden/indra/newview/llwebbrowserctrl.cpp
+++ b/linden/indra/newview/llwebbrowserctrl.cpp
@@ -2,6 +2,8 @@
2 * @file llwebbrowserctrl.cpp 2 * @file llwebbrowserctrl.cpp
3 * @brief Web browser UI control 3 * @brief Web browser UI control
4 * 4 *
5 * $LicenseInfo:firstyear=2006&license=viewergpl$
6 *
5 * Copyright (c) 2006-2007, Linden Research, Inc. 7 * Copyright (c) 2006-2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
@@ -24,6 +26,7 @@
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
27 */ 30 */
28 31
29#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
@@ -34,6 +37,7 @@
34#include "llviewborder.h" 37#include "llviewborder.h"
35#include "llviewerwindow.h" 38#include "llviewerwindow.h"
36#include "llfloaterworldmap.h" 39#include "llfloaterworldmap.h"
40#include "llurldispatcher.h"
37#include "llfocusmgr.h" 41#include "llfocusmgr.h"
38#include "llweb.h" 42#include "llweb.h"
39#include "viewer.h" 43#include "viewer.h"
@@ -521,54 +525,12 @@ void LLWebBrowserCtrl::onClickLinkHref( const EventType& eventIn )
521// virtual 525// virtual
522void LLWebBrowserCtrl::onClickLinkSecondLife( const EventType& eventIn ) 526void LLWebBrowserCtrl::onClickLinkSecondLife( const EventType& eventIn )
523{ 527{
524 const std::string protocol( "secondlife://" ); 528 std::string url = eventIn.getStringValue();
525 529 LLURLDispatcher::dispatch(url);
526 if ( eventIn.getStringValue().length() )
527 {
528 if ( LLString::compareInsensitive( eventIn.getStringValue().substr( 0, protocol.length() ).c_str(), protocol.c_str() ) == 0 )
529 {
530 if ( mOpenSecondLifeLinksInMap )
531 {
532 openMapAtlocation( eventIn.getStringValue() );
533 };
534
535 // chain this event on to observers of an instance of LLWebBrowserCtrl
536 LLWebBrowserCtrlEvent event( eventIn.getStringValue() );
537 mEventEmitter.update( &LLWebBrowserCtrlObserver::onClickLinkSecondLife, event );
538 };
539 };
540}
541
542////////////////////////////////////////////////////////////////////////////////
543// virtual
544void LLWebBrowserCtrl::openMapAtlocation( std::string second_life_url )
545{
546 // parse out sim name and coordinates
547 LLURLSimString::setString( second_life_url );
548 LLURLSimString::parse();
549
550 // if there is a world map
551 if ( gFloaterWorldMap )
552 {
553 #if ! LL_RELEASE_FOR_DOWNLOAD
554 llinfos << "MOZ> opening map to " << LLURLSimString::sInstance.mSimName.c_str() << " at " << LLURLSimString::sInstance.mX << "," << LLURLSimString::sInstance.mY << "," << LLURLSimString::sInstance.mZ << llendl;
555 #endif
556
557 // mark where the destination is
558 gFloaterWorldMap->trackURL( LLURLSimString::sInstance.mSimName.c_str(),
559 LLURLSimString::sInstance.mX,
560 LLURLSimString::sInstance.mY,
561 LLURLSimString::sInstance.mZ );
562 530
563 // display map 531 // chain this event on to observers of an instance of LLWebBrowserCtrl
564 LLFloaterWorldMap::show( NULL, TRUE ); 532 LLWebBrowserCtrlEvent event( eventIn.getStringValue() );
565 } 533 mEventEmitter.update( &LLWebBrowserCtrlObserver::onClickLinkSecondLife, event );
566 else
567 // if there is no world map, assume we're on the login page.. (this might be bad but I don't see a way to tell if you're at login or not)
568 {
569 // refresh the login page and force the location combo box to be visible
570 LLPanelLogin::refreshLocation( true );
571 };
572} 534}
573 535
574//////////////////////////////////////////////////////////////////////////////// 536////////////////////////////////////////////////////////////////////////////////