summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerhelp.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-12-14 10:39:59 -0500
committerLoren Shih <seraph@lindenlab.com>2009-12-14 10:39:59 -0500
commitaad8d99af2b4a29d055dccb1c3fbea7a46fcb843 (patch)
tree96b398bd405344f42753e58afbb02092882715cb /indra/newview/llviewerhelp.cpp
parent3e75137f26c099185677e1160570860e07a56595 (diff)
parenta763409647a5a8d82f2f1c54223b998877c3b72d (diff)
automated merge viewer2.0->viewer2.0
Diffstat (limited to 'indra/newview/llviewerhelp.cpp')
-rw-r--r--indra/newview/llviewerhelp.cpp30
1 files changed, 25 insertions, 5 deletions
diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp
index 297c0cc111..b8f91697e5 100644
--- a/indra/newview/llviewerhelp.cpp
+++ b/indra/newview/llviewerhelp.cpp
@@ -49,24 +49,38 @@
void LLViewerHelp::showTopic(const std::string &topic)
{
- showHelp();
-
// allow overriding the help server with a local help file
if( gSavedSettings.getBOOL("HelpUseLocal") )
{
+ showHelp();
LLFloaterHelpBrowser* helpbrowser = dynamic_cast<LLFloaterHelpBrowser*>(LLFloaterReg::getInstance("help_browser"));
helpbrowser->navigateToLocalPage( "help-offline" , "index.html" );
return;
}
- // use a special login topic before the user logs in
+ // if the help topic is empty, use the default topic
std::string help_topic = topic;
- if (! LLLoginInstance::getInstance()->authSuccess())
+ if (help_topic.empty())
{
- help_topic = preLoginTopic();
+ help_topic = defaultTopic();
+ }
+
+ // f1 help topic means: if user not logged in yet, show the
+ // pre-login topic, otherwise show help for the focused item
+ if (help_topic == f1HelpTopic())
+ {
+ if (! LLLoginInstance::getInstance()->authSuccess())
+ {
+ help_topic = preLoginTopic();
+ }
+ else
+ {
+ help_topic = getTopicFromFocus();
+ }
}
// work out the URL for this topic and display it
+ showHelp();
const LLOSInfo& osinfo = LLAppViewer::instance()->getOSInfo();
std::string helpURL = LLViewerHelpUtil::buildHelpURL( help_topic, gSavedSettings, osinfo );
setRawURL( helpURL );
@@ -84,6 +98,12 @@ std::string LLViewerHelp::preLoginTopic()
return "pre_login_help";
}
+std::string LLViewerHelp::f1HelpTopic()
+{
+ // *hack: to be done properly
+ return "f1_help";
+}
+
//////////////////////////////
// our own interfaces