DEV-43977: Changed pre-login help browser behavior.
The special pre_login_help topic is now only displayed when the user clicks on the "Need help logging in?" link on the login screen, or selects the top-level Help > Second Life Help (F1) menu.master
parent
d575af6a65
commit
b3f8cec38c
|
|
@ -42,6 +42,8 @@ class LLHelp
|
|||
virtual std::string defaultTopic() = 0;
|
||||
// return topic to use before the user logs in
|
||||
virtual std::string preLoginTopic() = 0;
|
||||
// return topic to use for the top-level help, invoked by F1
|
||||
virtual std::string f1HelpTopic() = 0;
|
||||
};
|
||||
|
||||
#endif // headerguard
|
||||
|
|
|
|||
|
|
@ -452,7 +452,7 @@ BOOL LLPanelLogin::handleKeyHere(KEY key, MASK mask)
|
|||
if ( KEY_F1 == key )
|
||||
{
|
||||
LLViewerHelp* vhelp = LLViewerHelp::getInstance();
|
||||
vhelp->showTopic(vhelp->getTopicFromFocus());
|
||||
vhelp->showTopic(vhelp->f1HelpTopic());
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -972,7 +972,7 @@ void LLPanelLogin::onClickHelp(void*)
|
|||
if (sInstance)
|
||||
{
|
||||
LLViewerHelp* vhelp = LLViewerHelp::getInstance();
|
||||
vhelp->showTopic(vhelp->getTopicFromFocus());
|
||||
vhelp->showTopic(vhelp->preLoginTopic());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -51,14 +51,17 @@ class LLViewerHelp : public LLHelp, public LLSingleton<LLViewerHelp>
|
|||
/// display the specified help topic in the help viewer
|
||||
/*virtual*/ void showTopic(const std::string &topic);
|
||||
|
||||
/// return default (fallback) topic name suitable for showTopic()
|
||||
/*virtual*/ std::string defaultTopic();
|
||||
|
||||
// return topic derived from viewer UI focus, else default topic
|
||||
std::string getTopicFromFocus();
|
||||
|
||||
/// return default (fallback) topic name suitable for showTopic()
|
||||
/*virtual*/ std::string defaultTopic();
|
||||
|
||||
// return topic to use before the user logs in
|
||||
std::string preLoginTopic();
|
||||
/*virtual*/ std::string preLoginTopic();
|
||||
|
||||
// return topic to use for the top-level help, invoked by F1
|
||||
/*virtual*/ std::string f1HelpTopic();
|
||||
|
||||
private:
|
||||
static void showHelp(); // make sure help UI is visible & raised
|
||||
|
|
|
|||
|
|
@ -5575,17 +5575,8 @@ class LLShowHelp : public view_listener_t
|
|||
bool handleEvent(const LLSD& userdata)
|
||||
{
|
||||
std::string help_topic = userdata.asString();
|
||||
|
||||
LLViewerHelp* vhelp = LLViewerHelp::getInstance();
|
||||
if (help_topic.empty())
|
||||
{
|
||||
vhelp->showTopic(vhelp->getTopicFromFocus());
|
||||
}
|
||||
else
|
||||
{
|
||||
vhelp->showTopic(help_topic);
|
||||
}
|
||||
|
||||
vhelp->showTopic(help_topic);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@
|
|||
name="Second Life Help"
|
||||
shortcut="F1">
|
||||
<menu_item_call.on_click
|
||||
function="ShowHelp" />
|
||||
function="ShowHelp"
|
||||
parameter="f1_help" />
|
||||
</menu_item_call>
|
||||
<menu_item_separator />
|
||||
<menu_item_call
|
||||
|
|
|
|||
|
|
@ -1064,7 +1064,8 @@
|
|||
name="Second Life Help"
|
||||
shortcut="F1">
|
||||
<menu_item_call.on_click
|
||||
function="ShowHelp" />
|
||||
function="ShowHelp"
|
||||
parameter="f1_help" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Tutorial"
|
||||
|
|
|
|||
Loading…
Reference in New Issue