Skip to content
Snippets Groups Projects
Commit 434407ef authored by Lynx Linden's avatar Lynx Linden
Browse files

DEV-40001: Add support for a pre-login help topic.

Asking for help (e.g., pressing F1) before logging in will now display
a specific pre-login help topic, "pre_login_help". This behavior was
agreed upon with Rand to allow us to display a custom page to help the
user log on successfully.
parent 02943eca
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,8 @@ class LLHelp ...@@ -40,6 +40,8 @@ class LLHelp
virtual void showTopic(const std::string &topic) = 0; virtual void showTopic(const std::string &topic) = 0;
// return default (fallback) topic name suitable for showTopic() // return default (fallback) topic name suitable for showTopic()
virtual std::string defaultTopic() = 0; virtual std::string defaultTopic() = 0;
// return topic to use before the user logs in
virtual std::string preLoginTopic() = 0;
}; };
#endif // headerguard #endif // headerguard
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "llviewercontrol.h" #include "llviewercontrol.h"
#include "llversionviewer.h" #include "llversionviewer.h"
#include "llappviewer.h" #include "llappviewer.h"
#include "lllogininstance.h"
#include "llviewerhelputil.h" #include "llviewerhelputil.h"
#include "llviewerhelp.h" #include "llviewerhelp.h"
...@@ -51,17 +52,25 @@ void LLViewerHelp::showTopic(const std::string &topic) ...@@ -51,17 +52,25 @@ void LLViewerHelp::showTopic(const std::string &topic)
{ {
showHelp(); showHelp();
// allow overriding the help server with a local help file
if( gSavedSettings.getBOOL("HelpUseLocal") ) if( gSavedSettings.getBOOL("HelpUseLocal") )
{ {
LLFloaterHelpBrowser* helpbrowser = dynamic_cast<LLFloaterHelpBrowser*>(LLFloaterReg::getInstance("help_browser")); LLFloaterHelpBrowser* helpbrowser = dynamic_cast<LLFloaterHelpBrowser*>(LLFloaterReg::getInstance("help_browser"));
helpbrowser->navigateToLocalPage( "help-offline" , "index.html" ); helpbrowser->navigateToLocalPage( "help-offline" , "index.html" );
return;
} }
else
// use a special login topic before the user logs in
std::string help_topic = topic;
if (! LLLoginInstance::getInstance()->authSuccess())
{ {
const LLOSInfo& osinfo = LLAppViewer::instance()->getOSInfo(); help_topic = preLoginTopic();
std::string helpURL = LLViewerHelpUtil::buildHelpURL( topic, gSavedSettings, osinfo );
setRawURL( helpURL );
} }
// work out the URL for this topic and display it
const LLOSInfo& osinfo = LLAppViewer::instance()->getOSInfo();
std::string helpURL = LLViewerHelpUtil::buildHelpURL( help_topic, gSavedSettings, osinfo );
setRawURL( helpURL );
} }
std::string LLViewerHelp::defaultTopic() std::string LLViewerHelp::defaultTopic()
...@@ -70,6 +79,12 @@ std::string LLViewerHelp::defaultTopic() ...@@ -70,6 +79,12 @@ std::string LLViewerHelp::defaultTopic()
return "this_is_fallbacktopic"; return "this_is_fallbacktopic";
} }
std::string LLViewerHelp::preLoginTopic()
{
// *hack: to be done properly
return "pre_login_help";
}
////////////////////////////// //////////////////////////////
// our own interfaces // our own interfaces
......
...@@ -57,6 +57,9 @@ class LLViewerHelp : public LLHelp, public LLSingleton<LLViewerHelp> ...@@ -57,6 +57,9 @@ class LLViewerHelp : public LLHelp, public LLSingleton<LLViewerHelp>
// return topic derived from viewer UI focus, else default topic // return topic derived from viewer UI focus, else default topic
std::string getTopicFromFocus(); std::string getTopicFromFocus();
// return topic to use before the user logs in
std::string preLoginTopic();
private: private:
static void showHelp(); // make sure help UI is visible & raised static void showHelp(); // make sure help UI is visible & raised
static void setRawURL(std::string url); // send URL to help UI static void setRawURL(std::string url); // send URL to help UI
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment