static void onClickF1HelpLoadURL(S32 option, void* userdata) { if (option == 0) { // choose HELP url based on selected language - default to english language support page LLString lang = LLUI::sConfigGroup->getString("Language"); // *TODO:Translate // this sucks but there isn't a way to grab an arbitrary string from an XML file // (using llcontroldef strings causes problems if string don't exist) LLString help_url( "http://secondlife.com/support" ); if ( lang == "ja" ) help_url = "http://help.secondlife.com/jp"; else if ( lang == "ko" ) help_url = "http://help.secondlife.com/kr"; else if ( lang == "pt" ) help_url = "http://help.secondlife.com/pt"; else if ( lang == "de" ) help_url = "http://de.secondlife.com/support"; LLWeb::loadURL( help_url ); } }
/** * Show the help page for a particular algorithm. The page is picked * using matching naming conventions. * * @param name The name of the algorithm to show. If this is empty show * the algorithm index. * @param version The version of the algorithm to jump do. The default * value (-1) will show the top of the page. */ void MantidHelpWindow::showAlgorithm(const string &name, const int version) { auto versionStr("-v" + boost::lexical_cast<string>(version)); if (version <= 0) { versionStr = ""; // let the redirect do its thing } QString help_url(""); if (!name.empty()) { auto alg = Mantid::API::AlgorithmManager::Instance().createUnmanaged(name); help_url = QString::fromStdString(alg->helpURL()); } if (bool(g_helpWindow)) { if (help_url.isEmpty()) { QString url(BASE_URL); url += "algorithms/"; if (name.empty()) { url += "index.html"; } else { url += QString(name.c_str()) + QString(versionStr.c_str()) + ".html"; } this->showHelp(url); } else { this->showHelp(help_url); } } else { // qt-assistant disabled if (help_url.isEmpty()) { if (name.empty()) { this->showWikiPage(std::string("Category:Algorithms")); } else { this->showWikiPage(name); } } else { this->openWebpage(help_url); } } }