aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterhtmlhelp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloaterhtmlhelp.cpp')
-rw-r--r--linden/indra/newview/llfloaterhtmlhelp.cpp61
1 files changed, 48 insertions, 13 deletions
diff --git a/linden/indra/newview/llfloaterhtmlhelp.cpp b/linden/indra/newview/llfloaterhtmlhelp.cpp
index 4612674..9cae4cc 100644
--- a/linden/indra/newview/llfloaterhtmlhelp.cpp
+++ b/linden/indra/newview/llfloaterhtmlhelp.cpp
@@ -34,6 +34,8 @@
34#include "llwebbrowserctrl.h" 34#include "llwebbrowserctrl.h"
35#include "llviewerwindow.h" 35#include "llviewerwindow.h"
36#include "llviewercontrol.h" 36#include "llviewercontrol.h"
37#include "llweb.h"
38#include "llui.h"
37 39
38#if LL_LIBXUL_ENABLED 40#if LL_LIBXUL_ENABLED
39 41
@@ -63,7 +65,9 @@ public:
63 65
64 // used for some stats logging - will be removed at some point 66 // used for some stats logging - will be removed at some point
65 static BOOL sFloaterOpened; 67 static BOOL sFloaterOpened;
66 68
69 static void onClickF1HelpLoadURL(S32 option, void* userdata);
70
67protected: 71protected:
68 LLWebBrowserCtrl* mWebBrowser; 72 LLWebBrowserCtrl* mWebBrowser;
69 static LLFloaterHtmlHelp* sInstance; 73 static LLFloaterHtmlHelp* sInstance;
@@ -163,24 +167,55 @@ void LLFloaterHtmlHelp::draw()
163// 167//
164void LLFloaterHtmlHelp::show(std::string url) 168void LLFloaterHtmlHelp::show(std::string url)
165{ 169{
166 sFloaterOpened = true; 170 gViewerWindow->alertXml("ClickOpenF1Help", onClickF1HelpLoadURL, (void*) NULL);
167 171
168 if ( sInstance ) 172 // switching this out for the moment - will come back later
173 // want it still to be compiled so not using comments of #if 0
174 if ( false )
169 { 175 {
170 if (sInstance->mWebBrowser) 176 sFloaterOpened = true;
177
178 if ( sInstance )
171 { 179 {
172 sInstance->mWebBrowser->navigateTo(url); 180 if (sInstance->mWebBrowser)
181 {
182 sInstance->mWebBrowser->navigateTo(url);
183 }
184 sInstance->setVisibleAndFrontmost();
185 return;
173 } 186 }
174 sInstance->setVisibleAndFrontmost();
175 return;
176 }
177 187
178 LLFloaterHtmlHelp* self = new LLFloaterHtmlHelp(url); 188 LLFloaterHtmlHelp* self = new LLFloaterHtmlHelp(url);
189
190 // reposition floater from saved settings
191 LLRect rect = gSavedSettings.getRect( "HtmlHelpRect" );
192 self->reshape( rect.getWidth(), rect.getHeight(), FALSE );
193 self->setRect( rect );
194 };
195}
196
197// static
198void LLFloaterHtmlHelp::onClickF1HelpLoadURL(S32 option, void* userdata)
199{
200 if (option == 0)
201 {
202 // choose HELP url based on selected language - default to english language support page
203 LLString lang = LLUI::sConfigGroup->getString("Language");
204
205 // this sucks but there isn't a way to grab an arbitrary string from an XML file
206 // (using llcontroldef strings causes problems if string don't exist)
207 LLString help_url( "https://support.secondlife.com/" );
208 if ( lang == "ja" )
209 help_url = "http://help.secondlife.com/jp";
210 else
211 if ( lang == "ko" )
212 help_url = "http://help.secondlife.com/kr";
213 else
214 if ( lang == "pt" )
215 help_url = "http://help.secondlife.com/pt";
179 216
180 // reposition floater from saved settings 217 LLWeb::loadURL( help_url );
181 LLRect rect = gSavedSettings.getRect( "HtmlHelpRect" ); 218 };
182 self->reshape( rect.getWidth(), rect.getHeight(), FALSE );
183 self->setRect( rect );
184} 219}
185 220
186//////////////////////////////////////////////////////////////////////////////// 221////////////////////////////////////////////////////////////////////////////////