コード例 #1
0
ファイル: IssuesDockWidget.cpp プロジェクト: ricortiz/DREAM3D
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void IssuesDockWidget::showFilterHelp(const QString &urlString)
{
  QUrl helpURL(urlString);

  DocRequestManager* docRequester = DocRequestManager::Instance();
  docRequester->requestFilterDocUrl(helpURL);
}
コード例 #2
0
ファイル: MantidHelpWindow.cpp プロジェクト: DanNixon/mantid
/**
 * 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);
    }
  }
}