diff options
author | Jacek Antonelli | 2009-04-30 13:04:20 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-04-30 13:07:16 -0500 |
commit | ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch) | |
tree | 8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/llfloaterhtmlhelp.cpp | |
parent | Second Life viewer sources 1.22.11 (diff) | |
download | meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2 meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz |
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/newview/llfloaterhtmlhelp.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterhtmlhelp.cpp | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/linden/indra/newview/llfloaterhtmlhelp.cpp b/linden/indra/newview/llfloaterhtmlhelp.cpp index c9bf1cd..5337c07 100644 --- a/linden/indra/newview/llfloaterhtmlhelp.cpp +++ b/linden/indra/newview/llfloaterhtmlhelp.cpp | |||
@@ -17,7 +17,8 @@ | |||
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://secondlifegrid.net/programs/open_source/licensing/flossexception | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | 22 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
@@ -270,7 +271,7 @@ public: | |||
270 | // used for some stats logging - will be removed at some point | 271 | // used for some stats logging - will be removed at some point |
271 | static BOOL sFloaterOpened; | 272 | static BOOL sFloaterOpened; |
272 | 273 | ||
273 | static void onClickF1HelpLoadURL(S32 option, void* userdata); | 274 | static bool onClickF1HelpLoadURL(const LLSD& notification, const LLSD& response); |
274 | 275 | ||
275 | protected: | 276 | protected: |
276 | LLWebBrowserCtrl* mWebBrowser; | 277 | LLWebBrowserCtrl* mWebBrowser; |
@@ -376,26 +377,35 @@ void LLFloaterHtmlHelp::show(std::string url, std::string title) | |||
376 | { | 377 | { |
377 | LLFloaterHtml* floater_html = LLFloaterHtml::getInstance(); | 378 | LLFloaterHtml* floater_html = LLFloaterHtml::getInstance(); |
378 | floater_html->setVisible(FALSE); | 379 | floater_html->setVisible(FALSE); |
379 | 380 | ||
380 | if(url.empty()) | 381 | if (url.empty()) |
381 | { | 382 | { |
382 | url = floater_html->getSupportUrl(); | 383 | url = floater_html->getSupportUrl(); |
383 | } | 384 | } |
384 | std::string* url_copy = new std::string(url); | ||
385 | |||
386 | gViewerWindow->alertXml("ClickOpenF1Help", onClickF1HelpLoadURL, url_copy); | ||
387 | 385 | ||
386 | if (gSavedSettings.getBOOL("UseExternalBrowser")) | ||
387 | { | ||
388 | LLSD payload; | ||
389 | payload["url"] = url; | ||
390 | |||
391 | LLNotifications::instance().add("ClickOpenF1Help", LLSD(), payload, onClickF1HelpLoadURL); | ||
392 | } | ||
393 | else | ||
394 | { | ||
395 | // don't wait, just do it | ||
396 | LLWeb::loadURL(url); | ||
397 | } | ||
388 | } | 398 | } |
389 | 399 | ||
390 | // static | 400 | // static |
391 | void LLFloaterHtmlHelp::onClickF1HelpLoadURL(S32 option, void* userdata) | 401 | bool LLFloaterHtmlHelp::onClickF1HelpLoadURL(const LLSD& notification, const LLSD& response) |
392 | { | 402 | { |
393 | std::string* urlp = (std::string*)userdata; | 403 | S32 option = LLNotification::getSelectedOption(notification, response); |
394 | if (0 == option) | 404 | if (option == 0) |
395 | { | 405 | { |
396 | LLWeb::loadURL(urlp->c_str()); | 406 | LLWeb::loadURL(notification["payload"]["url"].asString()); |
397 | } | 407 | } |
398 | delete urlp; | 408 | return false; |
399 | } | 409 | } |
400 | 410 | ||
401 | //////////////////////////////////////////////////////////////////////////////// | 411 | //////////////////////////////////////////////////////////////////////////////// |