aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterhtmlhelp.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloaterhtmlhelp.cpp58
1 files changed, 40 insertions, 18 deletions
diff --git a/linden/indra/newview/llfloaterhtmlhelp.cpp b/linden/indra/newview/llfloaterhtmlhelp.cpp
index 50dd14c..4612674 100644
--- a/linden/indra/newview/llfloaterhtmlhelp.cpp
+++ b/linden/indra/newview/llfloaterhtmlhelp.cpp
@@ -4,6 +4,7 @@
4 * 4 *
5 * Copyright (c) 2006-2007, Linden Research, Inc. 5 * Copyright (c) 2006-2007, Linden Research, Inc.
6 * 6 *
7 * Second Life Viewer Source Code
7 * The source code in this file ("Source Code") is provided by Linden Lab 8 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 9 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement 10 * ("GPL"), unless you have obtained a separate licensing agreement
@@ -36,18 +37,21 @@
36 37
37#if LL_LIBXUL_ENABLED 38#if LL_LIBXUL_ENABLED
38 39
40LLViewerHtmlHelp gViewerHtmlHelp;
41
39class LLFloaterHtmlHelp : 42class LLFloaterHtmlHelp :
40 public LLFloater, 43 public LLFloater,
41 public LLWebBrowserCtrlObserver 44 public LLWebBrowserCtrlObserver
42{ 45{
43public: 46public:
44 LLFloaterHtmlHelp(); 47 LLFloaterHtmlHelp(std::string start_url = "");
45 virtual ~LLFloaterHtmlHelp(); 48 virtual ~LLFloaterHtmlHelp();
46 49
47 virtual void onClose( bool app_quitting ); 50 virtual void onClose( bool app_quitting );
48 virtual void draw(); 51 virtual void draw();
49 52
50 static void show( void* url_string = NULL ); 53 static void show();
54 static void show(std::string url);
51 static void onClickBack( void* data ); 55 static void onClickBack( void* data );
52 static void onClickHome( void* data ); 56 static void onClickHome( void* data );
53 static void onClickForward( void* data ); 57 static void onClickForward( void* data );
@@ -77,7 +81,7 @@ BOOL LLFloaterHtmlHelp::sFloaterOpened = FALSE;
77 81
78//////////////////////////////////////////////////////////////////////////////// 82////////////////////////////////////////////////////////////////////////////////
79// 83//
80LLFloaterHtmlHelp::LLFloaterHtmlHelp() 84LLFloaterHtmlHelp::LLFloaterHtmlHelp(std::string start_url)
81: LLFloater( "HTML Help" ), 85: LLFloater( "HTML Help" ),
82 mWebBrowser( 0 ), 86 mWebBrowser( 0 ),
83 mStatusTextContents( "" ), 87 mStatusTextContents( "" ),
@@ -100,16 +104,22 @@ LLFloaterHtmlHelp::LLFloaterHtmlHelp()
100 { 104 {
101 // observe browser control events 105 // observe browser control events
102 mWebBrowser->addObserver( this ); 106 mWebBrowser->addObserver( this );
103
104 // if the last page we were at before the client was closed is valid, go there and
105 // override what is in the XML file
106 // (not when the window was closed - it's only ever hidden - not closed)
107 107
108 LLString lastPageUrl = gSavedSettings.getString( "HtmlHelpLastPage" ); 108 if (start_url != "")
109 if ( lastPageUrl != "" )
110 { 109 {
111 mWebBrowser->navigateTo( lastPageUrl ); 110 mWebBrowser->navigateTo( start_url );
112 }; 111 }
112 else
113 {
114 // if the last page we were at before the client was closed is valid, go there and
115 // override what is in the XML file
116 // (not when the window was closed - it's only ever hidden - not closed)
117 LLString lastPageUrl = gSavedSettings.getString( "HtmlHelpLastPage" );
118 if ( lastPageUrl != "" )
119 {
120 mWebBrowser->navigateTo( lastPageUrl );
121 };
122 }
113 }; 123 };
114} 124}
115 125
@@ -151,17 +161,21 @@ void LLFloaterHtmlHelp::draw()
151 161
152//////////////////////////////////////////////////////////////////////////////// 162////////////////////////////////////////////////////////////////////////////////
153// 163//
154void LLFloaterHtmlHelp::show( void* url_string ) 164void LLFloaterHtmlHelp::show(std::string url)
155{ 165{
156 sFloaterOpened = true; 166 sFloaterOpened = true;
157 167
158 if ( sInstance ) 168 if ( sInstance )
159 { 169 {
170 if (sInstance->mWebBrowser)
171 {
172 sInstance->mWebBrowser->navigateTo(url);
173 }
160 sInstance->setVisibleAndFrontmost(); 174 sInstance->setVisibleAndFrontmost();
161 return; 175 return;
162 } 176 }
163 177
164 LLFloaterHtmlHelp* self = new LLFloaterHtmlHelp; 178 LLFloaterHtmlHelp* self = new LLFloaterHtmlHelp(url);
165 179
166 // reposition floater from saved settings 180 // reposition floater from saved settings
167 LLRect rect = gSavedSettings.getRect( "HtmlHelpRect" ); 181 LLRect rect = gSavedSettings.getRect( "HtmlHelpRect" );
@@ -248,14 +262,22 @@ void LLFloaterHtmlHelp::onLocationChange( const EventType& eventIn )
248 262
249//////////////////////////////////////////////////////////////////////////////// 263////////////////////////////////////////////////////////////////////////////////
250// 264//
251// static 265LLViewerHtmlHelp::LLViewerHtmlHelp()
252void LLHtmlHelp::show(void* url_string) 266{
267 LLUI::setHtmlHelp(this);
268}
269
270LLViewerHtmlHelp::~LLViewerHtmlHelp()
271{
272 LLUI::setHtmlHelp(NULL);
273}
274
275void LLViewerHtmlHelp::show(std::string url)
253{ 276{
254 LLFloaterHtmlHelp::show(url_string); 277 LLFloaterHtmlHelp::show(url);
255} 278}
256 279
257// static 280BOOL LLViewerHtmlHelp::getFloaterOpened()
258BOOL LLHtmlHelp::getFloaterOpened()
259{ 281{
260 return LLFloaterHtmlHelp::sFloaterOpened; 282 return LLFloaterHtmlHelp::sFloaterOpened;
261} 283}