aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterhtml.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloaterhtml.cpp66
1 files changed, 56 insertions, 10 deletions
diff --git a/linden/indra/newview/llfloaterhtml.cpp b/linden/indra/newview/llfloaterhtml.cpp
index 0853514..2f7bc14 100644
--- a/linden/indra/newview/llfloaterhtml.cpp
+++ b/linden/indra/newview/llfloaterhtml.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -37,10 +37,13 @@
37#include "llvieweruictrlfactory.h" 37#include "llvieweruictrlfactory.h"
38#include "llviewercontrol.h" 38#include "llviewercontrol.h"
39#include "lllineeditor.h" 39#include "lllineeditor.h"
40#include "llviewerwindow.h"
41#include "llweb.h"
40 42
41#include "llwebbrowserctrl.h" 43#include "llwebbrowserctrl.h"
42 44
43LLFloaterHtml* LLFloaterHtml::sInstance = 0; 45LLFloaterHtml* LLFloaterHtml::sInstance = 0;
46LLViewerHtmlHelp gViewerHtmlHelp;
44 47
45//////////////////////////////////////////////////////////////////////////////// 48////////////////////////////////////////////////////////////////////////////////
46// 49//
@@ -83,10 +86,6 @@ LLFloaterHtml::LLFloaterHtml()
83 { 86 {
84 // open links in internal browser 87 // open links in internal browser
85 mWebBrowser->setOpenInExternalBrowser( false ); 88 mWebBrowser->setOpenInExternalBrowser( false );
86
87 // don't automatically open secondlife links since we want to catch
88 // special ones that do other stuff (like open F1 Help)
89 mWebBrowser->setOpenSLURLsInMap( false );
90 } 89 }
91#endif // LL_LIBXUL_ENABLED 90#endif // LL_LIBXUL_ENABLED
92} 91}
@@ -122,7 +121,7 @@ void LLFloaterHtml::draw()
122 121
123//////////////////////////////////////////////////////////////////////////////// 122////////////////////////////////////////////////////////////////////////////////
124// 123//
125void LLFloaterHtml::show( LLString content_id ) 124void LLFloaterHtml::show( LLString content_id, bool open_app_slurls )
126{ 125{
127 // calculate the XML labels we'll need (if only XML folders worked) 126 // calculate the XML labels we'll need (if only XML folders worked)
128 LLString title_str = content_id + "_title"; 127 LLString title_str = content_id + "_title";
@@ -130,12 +129,12 @@ void LLFloaterHtml::show( LLString content_id )
130 129
131 std::string title = childGetValue( title_str ).asString(); 130 std::string title = childGetValue( title_str ).asString();
132 std::string url = childGetValue( url_str ).asString(); 131 std::string url = childGetValue( url_str ).asString();
133 show( url, title ); 132 show( url, title, open_app_slurls );
134} 133}
135 134
136//////////////////////////////////////////////////////////////////////////////// 135////////////////////////////////////////////////////////////////////////////////
137// 136//
138void LLFloaterHtml::show( std::string start_url, std::string title ) 137void LLFloaterHtml::show( std::string start_url, std::string title, bool open_app_slurls )
139{ 138{
140 // set the title 139 // set the title
141 setTitle( title ); 140 setTitle( title );
@@ -143,7 +142,10 @@ void LLFloaterHtml::show( std::string start_url, std::string title )
143#if LL_LIBXUL_ENABLED 142#if LL_LIBXUL_ENABLED
144 // navigate to the URL 143 // navigate to the URL
145 if ( mWebBrowser ) 144 if ( mWebBrowser )
145 {
146 mWebBrowser->setOpenAppSLURLs( open_app_slurls );
146 mWebBrowser->navigateTo( start_url ); 147 mWebBrowser->navigateTo( start_url );
148 }
147#endif // LL_LIBXUL_ENABLED 149#endif // LL_LIBXUL_ENABLED
148 150
149 // make floater appear 151 // make floater appear
@@ -200,7 +202,7 @@ void LLFloaterHtml::onClickHome( void* data )
200 else 202 else
201 { 203 {
202 llwarns << "Invalid home page specified for HTML floater - navigating to default" << llendl; 204 llwarns << "Invalid home page specified for HTML floater - navigating to default" << llendl;
203 self->mWebBrowser->navigateTo( "http://google.com" ); 205 self->mWebBrowser->navigateTo( "http://secondlife.com" );
204 } 206 }
205 }; 207 };
206#endif // LL_LIBXUL_ENABLED 208#endif // LL_LIBXUL_ENABLED
@@ -259,3 +261,47 @@ void LLFloaterHtml::onClickGo( void* data )
259 }; 261 };
260 }; 262 };
261} 263}
264
265////////////////////////////////////////////////////////////////////////////////
266//
267static void onClickF1HelpLoadURL(S32 option, void* userdata)
268{
269 if (option == 0)
270 {
271 // choose HELP url based on selected language - default to english language support page
272 LLString lang = LLUI::sConfigGroup->getString("Language");
273
274 // *TODO:Translate
275 // this sucks but there isn't a way to grab an arbitrary string from an XML file
276 // (using llcontroldef strings causes problems if string don't exist)
277 LLString help_url( "http://secondlife.com/support" );
278 if ( lang == "ja" )
279 help_url = "http://help.secondlife.com/jp";
280 else
281 if ( lang == "ko" )
282 help_url = "http://help.secondlife.com/kr";
283 else
284 if ( lang == "pt" )
285 help_url = "http://help.secondlife.com/pt";
286 else
287 if ( lang == "de" )
288 help_url = "http://de.secondlife.com/support";
289
290 LLWeb::loadURL( help_url );
291 }
292}
293
294LLViewerHtmlHelp::LLViewerHtmlHelp()
295{
296 LLUI::setHtmlHelp(this);
297}
298
299LLViewerHtmlHelp::~LLViewerHtmlHelp()
300{
301 LLUI::setHtmlHelp(NULL);
302}
303
304void LLViewerHtmlHelp::show(std::string url, std::string title)
305{
306 gViewerWindow->alertXml("ClickOpenF1Help", onClickF1HelpLoadURL, (void*) NULL);
307}