diff options
author | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
commit | b2afb8800bb033a04bb3ecdf0363068d56648ef1 (patch) | |
tree | 3568129b5bbddb47cd39d622b4137a8fbff4abaf /linden/indra/newview/llfloaterhtmlhelp.cpp | |
parent | Second Life viewer sources 1.14.0.1 (diff) | |
download | meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.zip meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.gz meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.bz2 meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.xz |
Second Life viewer sources 1.15.0.2
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloaterhtmlhelp.cpp | 58 |
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 | ||
40 | LLViewerHtmlHelp gViewerHtmlHelp; | ||
41 | |||
39 | class LLFloaterHtmlHelp : | 42 | class LLFloaterHtmlHelp : |
40 | public LLFloater, | 43 | public LLFloater, |
41 | public LLWebBrowserCtrlObserver | 44 | public LLWebBrowserCtrlObserver |
42 | { | 45 | { |
43 | public: | 46 | public: |
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 | // |
80 | LLFloaterHtmlHelp::LLFloaterHtmlHelp() | 84 | LLFloaterHtmlHelp::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 | // |
154 | void LLFloaterHtmlHelp::show( void* url_string ) | 164 | void 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 | 265 | LLViewerHtmlHelp::LLViewerHtmlHelp() |
252 | void LLHtmlHelp::show(void* url_string) | 266 | { |
267 | LLUI::setHtmlHelp(this); | ||
268 | } | ||
269 | |||
270 | LLViewerHtmlHelp::~LLViewerHtmlHelp() | ||
271 | { | ||
272 | LLUI::setHtmlHelp(NULL); | ||
273 | } | ||
274 | |||
275 | void LLViewerHtmlHelp::show(std::string url) | ||
253 | { | 276 | { |
254 | LLFloaterHtmlHelp::show(url_string); | 277 | LLFloaterHtmlHelp::show(url); |
255 | } | 278 | } |
256 | 279 | ||
257 | // static | 280 | BOOL LLViewerHtmlHelp::getFloaterOpened() |
258 | BOOL LLHtmlHelp::getFloaterOpened() | ||
259 | { | 281 | { |
260 | return LLFloaterHtmlHelp::sFloaterOpened; | 282 | return LLFloaterHtmlHelp::sFloaterOpened; |
261 | } | 283 | } |